diff --git a/CHANGELOG.md b/CHANGELOG.md index c207819f2..80f5417a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ the detailed section referring to by linking pull requests or issues. - Implemented markdown for asset descriptions - Implemented list view for Broker UI +- Asset Metadata is now editable - Now displaying organization information on BrokerUI's `/connectors` page #### Patch diff --git a/package-lock.json b/package-lock.json index b7fba442e..29ec17bd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@ng-apimock/core": "^3.11.0", "@ngxs/store": "^3.8.1", "@sovity.de/broker-server-client": "0.20240116.140046-main-787cf146", - "@sovity.de/edc-client": "0.20240109.103441-main-c8323d18", + "@sovity.de/edc-client": "0.20240109.181620-main-78f67a69", "clean-deep": "^3.4.0", "date-fns": "^2.30.0", "dotenv": "^16.3.1", @@ -3579,9 +3579,9 @@ "integrity": "sha512-2DOelDSvMA/6qQLPdlPUtTaL0l2TJo1tAKyqUvIXYsR8iTfp6Uze+SDU6qOBeAZv8yW73RN38Xak+PK1YPHOCQ==" }, "node_modules/@sovity.de/edc-client": { - "version": "0.20240109.103441-main-c8323d18", - "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20240109.103441-main-c8323d18.tgz", - "integrity": "sha512-g8cAV1uvt0g07Tm11XxmlB0B6v43Qo2LAyB8lx1U9vekYd5hPUPVsNbuXGOUxfURCdi4eOgZwX5wAzpxmO4odQ==" + "version": "0.20240109.181620-main-78f67a69", + "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20240109.181620-main-78f67a69.tgz", + "integrity": "sha512-fWL2TXXZg05RS54Z+gEXaBUYgMOWRWOVen0lWC+7WIjkGNxtb/ybc/bd34IktHV0e0mxMvRFdMbe8cRxGF4Mqg==" }, "node_modules/@tailwindcss/typography": { "version": "0.5.10", @@ -16671,9 +16671,9 @@ "integrity": "sha512-2DOelDSvMA/6qQLPdlPUtTaL0l2TJo1tAKyqUvIXYsR8iTfp6Uze+SDU6qOBeAZv8yW73RN38Xak+PK1YPHOCQ==" }, "@sovity.de/edc-client": { - "version": "0.20240109.103441-main-c8323d18", - "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20240109.103441-main-c8323d18.tgz", - "integrity": "sha512-g8cAV1uvt0g07Tm11XxmlB0B6v43Qo2LAyB8lx1U9vekYd5hPUPVsNbuXGOUxfURCdi4eOgZwX5wAzpxmO4odQ==" + "version": "0.20240109.181620-main-78f67a69", + "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20240109.181620-main-78f67a69.tgz", + "integrity": "sha512-fWL2TXXZg05RS54Z+gEXaBUYgMOWRWOVen0lWC+7WIjkGNxtb/ybc/bd34IktHV0e0mxMvRFdMbe8cRxGF4Mqg==" }, "@tailwindcss/typography": { "version": "0.5.10", diff --git a/package.json b/package.json index 195ebdb35..428ced59c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@ng-apimock/core": "^3.11.0", "@ngxs/store": "^3.8.1", "@sovity.de/broker-server-client": "0.20240116.140046-main-787cf146", - "@sovity.de/edc-client": "0.20240109.103441-main-c8323d18", + "@sovity.de/edc-client": "0.20240109.181620-main-78f67a69", "clean-deep": "^3.4.0", "date-fns": "^2.30.0", "dotenv": "^16.3.1", diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts index 2ef52f944..f6ac077c1 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts +++ b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts @@ -3,7 +3,10 @@ import {DataOffer} from '../../../core/services/models/data-offer'; import {UiAssetMapped} from '../../../core/services/models/ui-asset-mapped'; import {CatalogDataOfferMapped} from '../../../routes/broker-ui/catalog-page/catalog-page/mapping/catalog-page-result-mapped'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; -import {AssetDetailDialogData} from './asset-detail-dialog-data'; +import { + AssetDetailDialogData, + OnAssetEditClickFn, +} from './asset-detail-dialog-data'; import {AssetPropertyGridGroupBuilder} from './asset-property-grid-group-builder'; @Injectable() @@ -12,10 +15,7 @@ export class AssetDetailDialogDataService { private assetPropertyGridGroupBuilder: AssetPropertyGridGroupBuilder, ) {} - assetDetails( - asset: UiAssetMapped, - allowDelete: boolean, - ): AssetDetailDialogData { + assetDetailsReadonly(asset: UiAssetMapped): AssetDetailDialogData { const propertyGridGroups = [ this.assetPropertyGridGroupBuilder.buildAssetPropertiesGroup(asset, null), this.assetPropertyGridGroupBuilder.buildAdditionalPropertiesGroup(asset), @@ -24,11 +24,22 @@ export class AssetDetailDialogDataService { return { type: 'asset-details', asset, - showDeleteButton: allowDelete, propertyGridGroups, }; } + assetDetailsEditable( + asset: UiAssetMapped, + opts: {onAssetEditClick: OnAssetEditClickFn}, + ): AssetDetailDialogData { + return { + ...this.assetDetailsReadonly(asset), + showDeleteButton: true, + showEditButton: true, + onAssetEditClick: opts.onAssetEditClick, + }; + } + dataOfferDetails(dataOffer: DataOffer): AssetDetailDialogData { const asset = dataOffer.asset; const propertyGridGroups = [ diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts index a6c3c9fe3..66f8863b6 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts +++ b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts @@ -16,4 +16,14 @@ export interface AssetDetailDialogData { contractAgreement?: ContractAgreementCardMapped; brokerDataOffer?: CatalogDataOfferMapped; showDeleteButton?: boolean; + showEditButton?: boolean; + onAssetEditClick?: OnAssetEditClickFn; } + +export type OnAssetEditClickFn = ( + asset: UiAssetMapped, + /** + * Required so that after the editing the detail dialog can be updated again + */ + afterEditCb: (updatedDialogData: AssetDetailDialogData) => void, +) => void; diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html index 9055a1610..2c98ebac9 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html +++ b/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html @@ -1,30 +1,56 @@ -