Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parameterization hints not showing in catalog browser #511

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ EDC 0 compatible version (Connector UI only).

#### Patch

- Fixed HTTP Parameterization Hints not showing in Asset Details.
- Removed 404-causing login polling from broker UI
- Renamed button from cancel to close in json-dialogs
- Broker: Fixed popularity not logged when clicking on a data offer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ export class AssetPropertyGridGroupBuilder {
label: 'Participant ID',
...this.propertyGridUtils.guessValue(asset.participantId),
},
{
icon: 'category',
label: 'Content Type',
...this.propertyGridUtils.guessValue(asset.mediaType),
},
...this.buildHttpDatasourceFields(asset),
];

if (this.activeFeatureSet.hasMdsFields()) {
Expand All @@ -88,6 +84,42 @@ export class AssetPropertyGridGroupBuilder {
};
}

private buildHttpDatasourceFields(asset: Asset): PropertyGridField[] {
const fields: PropertyGridField[] = [];

const hints: {label: string; value: boolean | undefined}[] = [
{label: 'Method', value: asset.httpDatasourceHintsProxyMethod},
{label: 'Path', value: asset.httpDatasourceHintsProxyPath},
{label: 'Query Params', value: asset.httpDatasourceHintsProxyQueryParams},
{label: 'Body', value: asset.httpDatasourceHintsProxyBody},
];

if (hints.some((hint) => hint.value != null)) {
const text = hints.some((hint) => hint.value)
? hints
.filter((hint) => hint.value)
.map((hint) => hint.label)
.join(', ')
: 'Disabled';

fields.push({
icon: 'api',
label: 'HTTP Data Source Parameterization',
text,
});
}

if (asset.mediaType) {
fields.push({
icon: 'category',
label: 'Content Type',
...this.propertyGridUtils.guessValue(asset.mediaType),
});
}

return fields;
}

buildAdditionalPropertiesGroup(asset: Asset): PropertyGridGroup {
const fields: PropertyGridField[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export namespace TestAssets {
geoReferenceMethod: 'Lat/Lon',
transportMode: 'Rail',
httpDatasourceHintsProxyQueryParams: true,
httpDatasourceHintsProxyPath: false,
httpDatasourceHintsProxyMethod: false,
httpDatasourceHintsProxyBody: false,
httpDatasourceHintsProxyPath: true,
httpDatasourceHintsProxyMethod: true,
httpDatasourceHintsProxyBody: true,
additionalProperties: {
'http://unknown/usecase': 'my-use-case',
},
Expand Down
Loading