diff --git a/.env.local-dev b/.env.local-dev index 68360b73a..131d53dd2 100644 --- a/.env.local-dev +++ b/.env.local-dev @@ -5,11 +5,11 @@ EDC_UI_ACTIVE_PROFILE=sovity-open-source EDC_UI_USE_FAKE_BACKEND=true EDC_UI_DATA_MANAGEMENT_API_URL=http://edc.fake-backend EDC_UI_DATA_MANAGEMENT_API_KEY=no-api-key-required-in-local-dev -EDC_UI_CATALOG_URLS=http://existing-other-connector/v1/ids/data,http://does-not-exist-but-is-super-long-so-we-can-test/v1/ids/data, http://how-wrapping-works-in-subtext-of-catalog-url-select/v1/ids/data +EDC_UI_CATALOG_URLS=http://existing-other-connector/api/dsp,http://does-not-exist-but-is-super-long-so-we-can-test/api/dsp, http://how-wrapping-works-in-subtext-of-catalog-url-select/api/dsp EDC_UI_LOGOUT_URL=https://example.com/logout -EDC_UI_CONNECTOR_ENDPOINT=http://localhost:3000/v1/ids/data +EDC_UI_CONNECTOR_ENDPOINT=http://localhost:3000/api/dsp -EDC_UI_CONNECTOR_ID=https://example-connector-id/ +EDC_UI_CONNECTOR_ID=https://localhost:3000 EDC_UI_CONNECTOR_NAME=example-connector-name EDC_UI_IDS_ID=urn:connector:example EDC_UI_IDS_TITLE=Example Connector Title diff --git a/README.md b/README.md index d3fb5a1f5..faea5d4cc 100644 --- a/README.md +++ b/README.md @@ -86,21 +86,8 @@ for a list of extensions used. ## Getting Started -The fastest way to get started is to run our -[docker-compose.yaml](docs/getting-started/docker-compose.yaml). - -```shell -cd docs/getting-started - -# Pull latest images -docker compose pull - -# On ARM64, e.g. MAC with M1, you need to cross compile your own UI image -# (cd ../../ && docker buildx build -f "docker/Dockerfile" --platform linux/arm64 -t "ghcr.io/sovity/edc-ui:latest" .) - -# Runs EDC and EDC UI at localhost:11000 -docker compose up -``` +The fastest way to get started is using our Getting Started Guide in +[sovity EDC CE Getting Started Guide](https://github.com/sovity/edc-extensions#getting-started).

(back to top)

diff --git a/docs/getting-started/docker-compose.yaml b/docs/getting-started/docker-compose.yaml deleted file mode 100644 index 34305a563..000000000 --- a/docs/getting-started/docker-compose.yaml +++ /dev/null @@ -1,59 +0,0 @@ -version: '3.8' -services: - edc-ui: - image: ghcr.io/sovity/edc-ui:latest - ports: - - '11000:80' - environment: - - EDC_UI_ACTIVE_PROFILE=sovity-open-source - - EDC_UI_CONFIG_URL=edc-ui-config - - EDC_UI_DATA_MANAGEMENT_API_URL=http://localhost:11002/api/v1/management - - EDC_UI_DATA_MANAGEMENT_API_KEY=ApiKeyDefaultValue - - EDC_UI_CATALOG_URLS=http://edc:11003/api/v1/ids/data - edc: - image: ghcr.io/sovity/edc-dev:latest - depends_on: - - postgresql - environment: - MY_EDC_NAME_KEBAB_CASE: 'example-connector' - MY_EDC_TITLE: 'EDC Connector' - MY_EDC_DESCRIPTION: 'sovity Community Edition EDC Connector' - MY_EDC_CURATOR_URL: 'https://example.com' - MY_EDC_CURATOR_NAME: 'Example GmbH' - MY_EDC_MAINTAINER_URL: 'https://sovity.de' - MY_EDC_MAINTAINER_NAME: 'sovity GmbH' - - # Data Management API Key - EDC_API_AUTH_KEY: ApiKeyDefaultValue - - MY_EDC_FQDN: 'edc' - MY_EDC_PROTOCOL: 'http://' - MY_EDC_IDS_BASE_URL: 'http://edc:11003' # adds missing port - - MY_EDC_JDBC_URL: jdbc:postgresql://postgresql:5432/edc - MY_EDC_JDBC_USER: edc - MY_EDC_JDBC_PASSWORD: edc - EDC_WEB_REST_CORS_ENABLED: 'true' - EDC_WEB_REST_CORS_HEADERS: 'origin,content-type,accept,authorization,x-api-key' - EDC_WEB_REST_CORS_ORIGINS: '*' - ports: - - '11001:11001' - - '11002:11002' - - '11003:11003' - - '11004:11004' - - '11005:5005' - postgresql: - image: docker.io/bitnami/postgresql:11 - restart: always - environment: - POSTGRESQL_USERNAME: edc - POSTGRESQL_PASSWORD: edc - POSTGRESQL_DATABASE: edc - ports: - - '54321:5432' - volumes: - - 'postgresql:/bitnami/postgresql' - -volumes: - postgresql: - driver: local diff --git a/package-lock.json b/package-lock.json index b24ec3946..fe10f78a1 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.20230712.71619-main-a4860cff", - "@sovity.de/edc-client": "0.20230921.115850-main-5e87f14f", + "@sovity.de/edc-client": "0.20230926.105529-main-44861eac", "clean-deep": "^3.4.0", "date-fns": "^2.30.0", "dotenv": "^16.3.1", @@ -59,9 +59,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.2.0.tgz", - "integrity": "sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", "dev": true }, "node_modules/@alloc/quick-lru": { @@ -3607,9 +3607,9 @@ "integrity": "sha512-305vHJj38Ma9x9YADM3SJh3sdqePeLcrUB1hHlYsuPdx7wYe9vwgb503KYStJ+5iN/ojP2xu8k6Unt+y+Bu5iQ==" }, "node_modules/@sovity.de/edc-client": { - "version": "0.20230921.115850-main-5e87f14f", - "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20230921.115850-main-5e87f14f.tgz", - "integrity": "sha512-G875A/e88tKgsqcZCq6NS4bHb8FLMcxjjpixJ7qnnG9BNety3cG76IM+Iesii8Ino4+T/J2+9MG9lGquV+Au2g==" + "version": "0.20230926.105529-main-44861eac", + "resolved": "https://registry.npmjs.org/@sovity.de/edc-client/-/edc-client-0.20230926.105529-main-44861eac.tgz", + "integrity": "sha512-mhvZvwcN7ZNLKgg9ApbDVmGhyA5BAAYmpUeEmG//uTGU9abfmepRxHozv59anN3SpixhnU2MDCQJSlADmEfZsQ==" }, "node_modules/@tootallnate/once": { "version": "2.0.0", diff --git a/package.json b/package.json index 78d738497..c3edb3894 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.20230712.71619-main-a4860cff", - "@sovity.de/edc-client": "0.20230921.115850-main-5e87f14f", + "@sovity.de/edc-client": "0.20230926.105529-main-44861eac", "clean-deep": "^3.4.0", "date-fns": "^2.30.0", "dotenv": "^16.3.1", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index bd24b9e0f..452cff27c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,12 +1,7 @@ import {NgModule} from '@angular/core'; -import { - ROUTES, - RouterModule, - Routes, -} from '@angular/router'; +import {ROUTES, RouterModule, Routes} from '@angular/router'; +import {PageNotFoundComponent} from './component-library/error-404-component/page-not-found.component'; import {APP_CONFIG, AppConfig} from './core/config/app-config'; -import {PageNotFoundComponent} from "./component-library/error-404-component/page-not-found.component"; - @NgModule({ imports: [RouterModule.forRoot([], {paramsInheritanceStrategy: 'always'})], @@ -22,24 +17,26 @@ import {PageNotFoundComponent} from "./component-library/error-404-component/pag switch (config.routes) { case 'broker-ui': routes.push({ - path: '', loadChildren: () => + path: '', + loadChildren: () => import('./routes/broker-ui/broker-ui.module').then( (m) => m.BrokerUiModule, - ) + ), }); break; case 'connector-ui': routes.push({ - path: '', loadChildren: () => + path: '', + loadChildren: () => import('./routes/connector-ui/connector-ui.module').then( (m) => m.ConnectorUiModule, - ) + ), }); break; default: throw new Error(`Unhandled PageSet: ${config.routes}`); } - routes.push({path: '**', component: PageNotFoundComponent}) + routes.push({path: '**', component: PageNotFoundComponent}); return routes; }, }, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0729036c4..97215ff6c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,7 +7,6 @@ import {FaviconService} from './core/services/favicon.service'; templateUrl: './app.component.html', }) export class AppComponent implements OnInit { - constructor( @Inject(APP_CONFIG) private config: AppConfig, private faviconService: FaviconService, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cd65d149f..c0da7ce11 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -22,12 +22,7 @@ import {AppRoutingModule} from './app-routing.module'; import {AppComponent} from './app.component'; import {PageNotFoundComponent} from './component-library/error-404-component/page-not-found.component'; import {provideAppConfig} from './core/config/app-config-initializer'; -import {provideAppConfigProperty} from './core/config/app-config-injection-utils'; import {ApiKeyInterceptor} from './core/services/api/api-key.interceptor'; -import { - API_KEY, - CONNECTOR_DATAMANAGEMENT_API, -} from './core/services/api/legacy-managent-api-client'; @NgModule({ imports: [ @@ -61,10 +56,6 @@ import { providers: [ provideAppConfig(), - // Provide individual properties of config for better Angular Component APIs - provideAppConfigProperty(CONNECTOR_DATAMANAGEMENT_API, 'managementApiUrl'), - provideAppConfigProperty(API_KEY, 'managementApiKey'), - {provide: HTTP_INTERCEPTORS, multi: true, useClass: ApiKeyInterceptor}, {provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, 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 a670c4a52..2b2d45096 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 @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {Asset} from '../../../core/services/models/asset'; -import {ContractOffer} from '../../../core/services/models/contract-offer'; +import {DataOffer} from '../../../core/services/models/data-offer'; import {BrokerDataOffer} from '../../../routes/broker-ui/catalog-page/catalog-page/mapping/broker-data-offer'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; import {AssetDetailDialogData} from './asset-detail-dialog-data'; @@ -26,9 +26,9 @@ export class AssetDetailDialogDataService { }; } - contractOfferDetails(contractOffer: ContractOffer): AssetDetailDialogData { - let asset = contractOffer.asset; - let contractPolicy = contractOffer.policy; + dataOfferDetails(dataOffer: DataOffer): AssetDetailDialogData { + let asset = dataOffer.asset; + let contractPolicy = dataOffer.contractOffers[0].policy; const propertyGridGroups = [ this.assetPropertyGridGroupBuilder.buildAssetPropertiesGroup(asset, null), @@ -40,9 +40,9 @@ export class AssetDetailDialogDataService { ].filter((it) => it.properties.length); return { - type: 'contract-offer', - asset: contractOffer.asset, - contractOffer, + type: 'data-offer', + asset: dataOffer.asset, + dataOffer, propertyGridGroups, }; } @@ -51,9 +51,6 @@ export class AssetDetailDialogDataService { contractAgreement: ContractAgreementCardMapped, ): AssetDetailDialogData { let asset = contractAgreement.asset; - let contractPolicy = JSON.parse( - contractAgreement.contractPolicy.policyJsonLd, - ); const propertyGridGroups = [ this.assetPropertyGridGroupBuilder.buildContractAgreementGroup( @@ -61,7 +58,7 @@ export class AssetDetailDialogDataService { ), this.assetPropertyGridGroupBuilder.buildPolicyGroup( asset, - contractPolicy, + contractAgreement.contractPolicy, ), this.assetPropertyGridGroupBuilder.buildAssetPropertiesGroup( asset, @@ -89,7 +86,7 @@ export class AssetDetailDialogDataService { ), this.assetPropertyGridGroupBuilder.buildAdditionalPropertiesGroup(asset), ...dataOffer.contractOffers.map((contractOffer, i) => - this.assetPropertyGridGroupBuilder.buildContractOfferGroup( + this.assetPropertyGridGroupBuilder.buildBrokerContractOfferGroup( asset, contractOffer, i, 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 c896e769f..2677414e3 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 @@ -1,5 +1,5 @@ import {Asset} from 'src/app/core/services/models/asset'; -import {ContractOffer} from '../../../core/services/models/contract-offer'; +import {DataOffer} from '../../../core/services/models/data-offer'; import {BrokerDataOffer} from '../../../routes/broker-ui/catalog-page/catalog-page/mapping/broker-data-offer'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; import {PropertyGridGroup} from '../../property-grid/property-grid-group/property-grid-group'; @@ -7,12 +7,12 @@ import {PropertyGridGroup} from '../../property-grid/property-grid-group/propert export interface AssetDetailDialogData { type: | 'asset-details' - | 'contract-offer' + | 'data-offer' | 'contract-agreement' | 'broker-data-offer'; propertyGridGroups: PropertyGridGroup[]; asset: Asset; - contractOffer?: ContractOffer; + dataOffer?: DataOffer; contractAgreement?: ContractAgreementCardMapped; brokerDataOffer?: BrokerDataOffer; showDeleteButton?: boolean; 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 af0ebcb10..3cacbe1ee 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,5 +1,5 @@
- + upload - + {{ data.contractAgreement!!.direction === 'PROVIDING' ? 'upload' : 'download' }} + *ngIf="data.type === 'data-offer'" + [dataOffer]="data.dataOffer!">
{{ asset.name }} @@ -29,8 +31,8 @@
- -
-
- Validity -
-
- - - - -
-
-
@@ -97,7 +85,7 @@
-
+
{{ card.asset.version diff --git a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-result.ts b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-result.ts index 7215c6061..db4068420 100644 --- a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-result.ts +++ b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-result.ts @@ -1,6 +1,4 @@ -import {TransferId} from '../../../../core/services/api/legacy-managent-api-client'; - export interface ContractAgreementTransferDialogResult { - transferProcessId: TransferId; + transferProcessId: string; contractId: string; } diff --git a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts index 5f5e0a530..fa2789504 100644 --- a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts +++ b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts @@ -92,9 +92,9 @@ export class ContractAgreementTransferDialogComponent implements OnDestroy { }), ) .subscribe({ - next: (transferProcessId) => + next: (response) => this.close({ - transferProcessId, + transferProcessId: response.id!, contractId: this.data.contractId, }), error: (err) => { diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-card-builder.ts b/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-card-builder.ts index 4ea383009..822c57c53 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-card-builder.ts +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-card-builder.ts @@ -5,9 +5,9 @@ import { PolicyDefinitionDto, UiCriterion, } from '@sovity.de/edc-client'; -import {CRITERION_OPERATOR_SYMBOLS} from '../../../../core/services/api/criterion-type-ext'; -import {AssetProperties} from '../../../../core/services/asset-properties'; +import {CRITERION_OPERATOR_SYMBOLS} from '../../../../core/services/api/model/criterion-type-ext'; import {Asset} from '../../../../core/services/models/asset'; +import {AssetProperty} from '../../../../core/services/models/asset-properties'; import {associateBy} from '../../../../core/utils/map-utils'; import {assetSearchTargets} from '../../../../core/utils/search-utils'; import { @@ -76,7 +76,7 @@ export class ContractDefinitionCardBuilder { private extractCriterionOperation(criterion: UiCriterion): string { const {operandLeft, operator} = criterion; if ( - operandLeft.toLowerCase() === AssetProperties.id.toLowerCase() && + operandLeft === AssetProperty.id && (operator === 'EQ' || operator === 'IN') ) { return 'Assets'; @@ -107,7 +107,7 @@ export class ContractDefinitionCardBuilder { }; // Try to find asset - if (operandLeft === AssetProperties.id) { + if (operandLeft === AssetProperty.id) { let asset = assetsById.get(it); if (asset) { return { diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.ts b/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.ts index a77938604..51d4e730a 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.ts +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.ts @@ -4,7 +4,7 @@ import {Subject} from 'rxjs'; import {finalize, takeUntil} from 'rxjs/operators'; import {PolicyDefinitionDto} from '@sovity.de/edc-client'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; -import {AssetServiceMapped} from '../../../../core/services/asset-service-mapped'; +import {AssetService} from '../../../../core/services/asset.service'; import {ContractDefinitionBuilder} from '../../../../core/services/contract-definition-builder'; import {Asset} from '../../../../core/services/models/asset'; import {NotificationService} from '../../../../core/services/notification.service'; @@ -23,7 +23,7 @@ export class ContractDefinitionEditorDialog implements OnInit, OnDestroy { loading = false; constructor( - private assetServiceMapped: AssetServiceMapped, + private assetServiceMapped: AssetService, public form: ContractDefinitionEditorDialogForm, private notificationService: NotificationService, private edcApiService: EdcApiService, diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.service.ts b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.service.ts index 09658b41d..e867c2daf 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.service.ts +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.service.ts @@ -2,7 +2,7 @@ import {Injectable} from '@angular/core'; import {Observable, combineLatest, of} from 'rxjs'; import {catchError, map, switchMap} from 'rxjs/operators'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; -import {AssetServiceMapped} from '../../../../core/services/asset-service-mapped'; +import {AssetService} from '../../../../core/services/asset.service'; import {Fetched} from '../../../../core/services/models/fetched'; import {search} from '../../../../core/utils/search-utils'; import {ContractDefinitionCard} from '../contract-definition-cards/contract-definition-card'; @@ -17,7 +17,7 @@ export interface ContractDefinitionList { export class ContractDefinitionPageService { constructor( private edcApiService: EdcApiService, - private assetServiceMapped: AssetServiceMapped, + private assetServiceMapped: AssetService, private contractDefinitionCardBuilder: ContractDefinitionCardBuilder, ) {} diff --git a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.service.ts b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.service.ts index fb82a9f09..77e7366c3 100644 --- a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.service.ts +++ b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.service.ts @@ -1,17 +1,12 @@ import {Injectable} from '@angular/core'; -import {Observable, combineLatest, merge, of, scan} from 'rxjs'; -import {map} from 'rxjs/operators'; -import {TransferHistoryEntry} from '@sovity.de/edc-client'; -import {CatalogApiUrlService} from '../../../../core/services/api/catalog-api-url.service'; -import {ContractOfferService} from '../../../../core/services/api/contract-offer.service'; +import {Observable, combineLatest, merge, of, sampleTime, scan} from 'rxjs'; +import {catchError, map} from 'rxjs/operators'; +import {TransferHistoryEntry, UiDataOffer} from '@sovity.de/edc-client'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; -import { - ContractAgreementService, - ContractDefinitionService, -} from '../../../../core/services/api/legacy-managent-api-client'; +import {LastCommitInfoService} from '../../../../core/services/api/last-commit-info.service'; import {ConnectorInfoPropertyGridGroupBuilder} from '../../../../core/services/connector-info-property-grid-group-builder'; -import {LastCommitInfoService} from '../../../../core/services/last-commit-info.service'; import {Fetched} from '../../../../core/services/models/fetched'; +import {CatalogApiUrlService} from '../../catalog-browser-page/catalog-browser-page/catalog-api-url.service'; import {DonutChartData} from '../dashboard-donut-chart/donut-chart-data'; import {DashboardPageData, defaultDashboardData} from './dashboard-page-data'; @@ -19,9 +14,6 @@ import {DashboardPageData, defaultDashboardData} from './dashboard-page-data'; export class DashboardPageDataService { constructor( private edcApiService: EdcApiService, - private catalogBrowserService: ContractOfferService, - private contractDefinitionService: ContractDefinitionService, - private contractAgreementService: ContractAgreementService, private catalogApiUrlService: CatalogApiUrlService, private lastCommitInfoService: LastCommitInfoService, private connectorInfoPropertyGridGroupBuilder: ConnectorInfoPropertyGridGroupBuilder, @@ -61,20 +53,18 @@ export class DashboardPageDataService { } private contractDefinitionKpis(): Observable> { - return this.contractDefinitionService - .getAllContractDefinitions(0, 10_000_000) - .pipe( - map((contractDefinitions) => contractDefinitions.length), - Fetched.wrap({ - failureMessage: 'Failed fetching number of contract definitions.', - }), - map((numContractDefinitions) => ({numContractDefinitions})), - ); + return this.edcApiService.getContractDefinitionPage().pipe( + map((page) => page.contractDefinitions.length), + Fetched.wrap({ + failureMessage: 'Failed fetching number of contract definitions.', + }), + map((numContractDefinitions) => ({numContractDefinitions})), + ); } private contractAgreementKpis(): Observable> { - return this.contractAgreementService.getAllAgreements(0, 10_000_000).pipe( - map((contractAgreements) => contractAgreements.length), + return this.edcApiService.getContractAgreementPage().pipe( + map((page) => page.contractAgreements.length), Fetched.wrap({ failureMessage: 'Failed fetching contract agreements.', }), @@ -83,8 +73,8 @@ export class DashboardPageDataService { } private catalogBrowserKpis(): Observable> { - return this.catalogBrowserService.getAllContractOffers().pipe( - map((contractDefinitions) => contractDefinitions.length), + return this.getAllDataOffers().pipe( + map((dataOffers) => dataOffers.length), Fetched.wrap({ failureMessage: 'Failed fetching data offers.', }), @@ -92,6 +82,21 @@ export class DashboardPageDataService { ); } + private getAllDataOffers(): Observable { + const catalogUrls = this.catalogApiUrlService.getAllProviders(); + + const dataOffers = catalogUrls.map((it) => + this.edcApiService + .getCatalogPageDataOffers(it) + .pipe(catchError(() => of([]))), + ); + + return merge(...dataOffers).pipe( + sampleTime(50), + map((results) => results.flat()), + ); + } + private assetKpis(): Observable> { return this.edcApiService.getAssetPage().pipe( map((assetPage) => assetPage.assets.length), diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts index aedd62d23..6bbd4f927 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts +++ b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts @@ -4,7 +4,7 @@ import { PolicyDefinitionPage, UiPolicyLiteral, } from '@sovity.de/edc-client'; -import {OPERATOR_SYMBOLS} from '../../../../core/services/api/policy-type-ext'; +import {OPERATOR_SYMBOLS} from '../../../../core/services/api/model/policy-type-ext'; import {PolicyCard, PolicyCardConstraint} from './policy-card'; @Injectable({providedIn: 'root'}) diff --git a/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts b/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts index b696a95dc..3492d9b30 100644 --- a/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts +++ b/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts @@ -18,7 +18,7 @@ import {AssetDetailDialogDataService} from '../../../../component-library/catalo import {AssetDetailDialogService} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog.service'; import {JsonDialogService} from '../../../../component-library/json-dialog/json-dialog/json-dialog.service'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; -import {AssetPropertyMapper} from '../../../../core/services/asset-property-mapper'; +import {AssetBuilder} from '../../../../core/services/asset-builder'; import {Asset} from '../../../../core/services/models/asset'; import {Fetched} from '../../../../core/services/models/fetched'; import {NotificationService} from '../../../../core/services/notification.service'; @@ -45,7 +45,7 @@ export class TransferHistoryPageComponent implements OnInit, OnDestroy { private edcApiService: EdcApiService, private assetDetailDialogDataService: AssetDetailDialogDataService, private assetDetailDialogService: AssetDetailDialogService, - private assetPropertyMapper: AssetPropertyMapper, + private assetBuilder: AssetBuilder, private notificationService: NotificationService, private jsonDialogService: JsonDialogService, ) {} @@ -66,11 +66,11 @@ export class TransferHistoryPageComponent implements OnInit, OnDestroy { return this.edcApiService .getTransferProcessAsset(item.transferProcessId) .pipe( - map((uiAsset: UiAsset) => { - return this.assetPropertyMapper.buildAsset({ - uiAsset, - connectorEndpoint: item.counterPartyConnectorEndpoint, - }); + map((asset: UiAsset) => { + return this.assetBuilder.buildAsset( + asset, + item.counterPartyConnectorEndpoint, + ); }), ); } diff --git a/src/theme.scss b/src/theme.scss index c15940f0a..94b642835 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -35,11 +35,15 @@ mat-paginator { } // Fix Icon sizes used in card avatars -mat-icon[mat-card-avatar] { - font-size: 40px; - width: 40px; - height: 40px; - line-height: 40px; +mat-icon[mat-card-avatar], +.mat-card-avatar-icon { + font-size: 40px !important; + width: 40px !important; + height: 40px !important; + line-height: 40px !important; + margin-top: 1px; + margin-right: -3px; + margin-left: 2px; } // Fix mat-chips exploding out and/or having multiline exploding strings