Skip to content

Commit

Permalink
fix: parameterization hints not showing in catalog browser
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Oct 10, 2023
1 parent bb6a350 commit 949b914
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
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

0 comments on commit 949b914

Please sign in to comment.