From 482865f04f268f0bc81f4e52455c06319a73be03 Mon Sep 17 00:00:00 2001 From: kulgg <75735874+kulgg@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:54:18 +0200 Subject: [PATCH 1/6] fix fake backend --- .../contract-agreement-fake-service.ts | 11 +++++++++-- .../services/api/fake-backend/edc-fake-backend.ts | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/core/services/api/fake-backend/connector-fake-impl/contract-agreement-fake-service.ts b/src/app/core/services/api/fake-backend/connector-fake-impl/contract-agreement-fake-service.ts index 639578fd8..df82289d7 100644 --- a/src/app/core/services/api/fake-backend/connector-fake-impl/contract-agreement-fake-service.ts +++ b/src/app/core/services/api/fake-backend/connector-fake-impl/contract-agreement-fake-service.ts @@ -2,6 +2,7 @@ import { ContractAgreementCard, ContractAgreementPage, ContractAgreementTransferProcess, + ContractTerminationStatus, IdResponseDto, InitiateTransferRequest, } from '@sovity.de/edc-client'; @@ -127,9 +128,15 @@ let contractAgreements: ContractAgreementCard[] = [ ], }, ]; -export const contractAgreementPage = (): ContractAgreementPage => { +export const contractAgreementPage = ( + terminationStatus?: ContractTerminationStatus, +): ContractAgreementPage => { return { - contractAgreements, + contractAgreements: terminationStatus + ? contractAgreements.filter( + (x) => x.terminationStatus === terminationStatus, + ) + : contractAgreements, }; }; diff --git a/src/app/core/services/api/fake-backend/edc-fake-backend.ts b/src/app/core/services/api/fake-backend/edc-fake-backend.ts index 526b83115..b0222a5b7 100644 --- a/src/app/core/services/api/fake-backend/edc-fake-backend.ts +++ b/src/app/core/services/api/fake-backend/edc-fake-backend.ts @@ -1,5 +1,6 @@ import { AssetPageToJSON, + ContractAgreementPageQueryFromJSON, ContractAgreementPageToJSON, ContractDefinitionPageToJSON, ContractDefinitionRequestFromJSON, @@ -167,8 +168,9 @@ export const EDC_FAKE_BACKEND: FetchAPI = async ( }) .url('pages/contract-agreement-page') - .on('GET', () => { - const page = contractAgreementPage(); + .on('POST', () => { + const pageQuery = body ? ContractAgreementPageQueryFromJSON(body) : null; + const page = contractAgreementPage(pageQuery?.terminationStatus); return ok(ContractAgreementPageToJSON(page)); }) From 40db3106ba32562acbbdd6e90b02a80a661ac48b Mon Sep 17 00:00:00 2001 From: kulgg <75735874+kulgg@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:46:33 +0200 Subject: [PATCH 2/6] on request asset icon in data offer cards --- .../contract-offer-icon.component.ts | 20 ++++++++++++++++--- .../catalog-fake-service.ts | 11 ++++++++++ .../connector-fake-impl/data/test-assets.ts | 13 ++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts b/src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts index 96b79484f..02e9fb503 100644 --- a/src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts +++ b/src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts @@ -5,7 +5,7 @@ import {DataOffer} from '../../../core/services/models/data-offer'; @Component({ selector: 'contract-offer-icon', template: ` - +
- - sim_card + + sim_card + + + contact_page `, }) export class ContractOfferIconComponent { @@ -34,4 +44,8 @@ export class ContractOfferIconComponent { this.contractNegotiationService.isNegotiated(it), ); } + + isOnRequestAsset(): boolean { + return this.dataOffer.asset.dataSourceAvailability === 'ON_REQUEST'; + } } diff --git a/src/app/core/services/api/fake-backend/connector-fake-impl/catalog-fake-service.ts b/src/app/core/services/api/fake-backend/connector-fake-impl/catalog-fake-service.ts index 8acfd8398..98b400e22 100644 --- a/src/app/core/services/api/fake-backend/connector-fake-impl/catalog-fake-service.ts +++ b/src/app/core/services/api/fake-backend/connector-fake-impl/catalog-fake-service.ts @@ -42,6 +42,17 @@ let dataOffers: UiDataOffer[] = [ }, ], }, + { + endpoint: 'http://existing-other-connector/api/dsp', + participantId: 'MDSL1234XX.C1234XX', + asset: TestAssets.onRequestAsset, + contractOffers: [ + { + contractOfferId: 'on-request-contract-offer', + policy: TestPolicies.failedMapping, + }, + ], + }, ]; export const getCatalogPageDataOffers = ( diff --git a/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-assets.ts b/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-assets.ts index 8cefb2c27..2137fc2ab 100644 --- a/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-assets.ts +++ b/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-assets.ts @@ -73,6 +73,19 @@ export namespace TestAssets { This is a short description text that should be fully rendered without being **collapsed**. No *show more* button should be visible. `; + export const onRequestAsset: UiAsset = { + dataSourceAvailability: 'ON_REQUEST', + assetId: 'on-request-asset', + title: 'On Request Asset', + description: '', + descriptionShortText: '', + connectorEndpoint: 'https://my-other-connector/api/dsp', + participantId: 'MDSL1234XX.C1234XX', + creatorOrganizationName: 'my-org', + temporalCoverageFrom: new Date('2024-01-01'), + isOwnConnector: false, + }; + export const boring: UiAsset = { dataSourceAvailability: 'LIVE', assetId: 'data-sample-ckd-skd-demands-2023-Jan', From b0eed854dd638592c5adaf869829c43bdb9b1629 Mon Sep 17 00:00:00 2001 From: kulgg <75735874+kulgg@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:54:42 +0200 Subject: [PATCH 3/6] differentiate on request offers on detail dialog --- .../asset-detail-dialog.component.html | 29 +++++++++++++---- .../asset-detail-dialog.component.ts | 29 ++++++++++++++++- .../connector-fake-impl/data/test-assets.ts | 6 ++-- .../core/services/mailto-link-builder.spec.ts | 24 ++++++++++++++ src/app/core/services/mailto-link-builder.ts | 31 +++++++++++++++++++ src/app/core/utils/record-utils.ts | 12 +++++++ 6 files changed, 122 insertions(+), 9 deletions(-) create mode 100644 src/app/core/services/mailto-link-builder.spec.ts create mode 100644 src/app/core/services/mailto-link-builder.ts 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 680348c62..2f57f9414 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 @@ -51,7 +51,7 @@
@@ -88,10 +88,22 @@ + +
+
On Request Data Offer
+
+ This data offer is not available for immediate consumption. However, the + creator left an email address to contact him if interested. +
+
+ Click Contact to email the data offer + provider. +
+
@@ -102,10 +114,7 @@ + *ngIf="isLiveDataOffer && data.dataOffer!.contractOffers.length === 1">