Skip to content

Commit

Permalink
feat: migrate dashboard to API Wrapper, move some asset properties to…
Browse files Browse the repository at this point in the history
… backend
  • Loading branch information
richardtreier committed Oct 6, 2023
1 parent d213418 commit 74cce25
Show file tree
Hide file tree
Showing 44 changed files with 436 additions and 546 deletions.
14 changes: 1 addition & 13 deletions .env.local-dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@
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_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/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/api/dsp

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
EDC_UI_IDS_DESCRIPTION=This is an example sovity EDC UI in local dev.
EDC_UI_CURATOR_URL=https://example.com
EDC_UI_CURATOR_ORGANIZATION_NAME=Example GmbH
EDC_UI_DAPS_OAUTH_TOKEN_URL=https://example-daps.com/token
EDC_UI_DAPS_OAUTH_JWKS_URL=https://example-daps.com/jwks.json
EDC_UI_MAINTAINER_URL=https://example.com
EDC_UI_MAINTAINER_ORGANIZATION_NAME=Example GmbH
29 changes: 17 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,30 @@ the detailed section referring to by linking pull requests or issues.

### Detailed Changes

#### Added
#### Major

- Switched to semantic versioning
- Migrated transfer history page to the api wrapper
- Migrated contract definition page to the api wrapper
- Migrated policy definition page to the api wrapper
- Migrated asset page to the api wrapper
- Migrated dashboard page to the api wrapper

#### Minor

- Added custom 404 pages to connector and broker ui
- New Asset Property "Participant ID"

#### Fixed
#### Patch

- Removed 404-causing login polling from broker UI
- Migrated transfer history page to api wrapper
- Migrated contract definition page to api wrapper
- Migrated policy definition page to api wrapper
- Migrated asset page to api wrapper
- Broker: Fixed popularity not logged when clicking on a data offer.
- Renamed button from cancel to close in json-dialogs
- Broker: Fixed popularity not logged when clicking on a data offer
- Broker: Fixed missing name in legal notice

#### Removed

#### Fixed
#### Deployment Migration Notes

- Renamed button from cancel to close in json-dialogs
Removed Env Vars:

## [v0.0.1-milestone-8-sovity12] 12.07.2023

Expand Down Expand Up @@ -191,7 +196,7 @@ information is now displayed.

#### Changed

- Marked `EDC_UI_DATA_MANAGEMENT_API_URL` as deprecated in favor of
- Marked `EDC_UI_MANAGEMENT_API_URL` as deprecated in favor of
`EDC_UI_MANAGEMENT_API_URL`.
- Marked `EDC_UI_DATA_MANAGEMENT_API_KEY` as deprecated in favor of
`EDC_UI_MANAGEMENT_API_KEY`.
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.20230926.151824-main-fdf8eb66",
"@sovity.de/edc-client": "0.20231006.85703-main-5ece112d",
"clean-deep": "^3.4.0",
"date-fns": "^2.30.0",
"dotenv": "^16.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class AssetDetailDialogDataService {
),
this.assetPropertyGridGroupBuilder.buildContractPolicyGroup(
contractAgreement.contractPolicy,
asset.name,
asset.title,
),
this.assetPropertyGridGroupBuilder.buildAssetPropertiesGroup(
asset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[dataOffer]="data.dataOffer!"></contract-offer-icon>
<div class="mat-card-header-text">
<div class="mat-card-title">
{{ asset.name }}
{{ asset.title }}
</div>
<div class="mat-card-subtitle">
{{ asset.creatorOrganizationName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class AssetDetailDialogComponent implements OnDestroy {
private confirmDelete(): Observable<boolean> {
const dialogData = ConfirmDialogModel.forDelete(
'asset',
`"${this.asset.name}"`,
`"${this.asset.title}"`,
);
const ref = this.matDialog.open(ConfirmationDialogComponent, {
maxWidth: '20%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export class AssetPropertyGridGroupBuilder {
label: 'Organization',
...this.propertyGridUtils.guessValue(asset.creatorOrganizationName),
},
{
icon: 'category',
label: 'Participant ID',
...this.propertyGridUtils.guessValue(asset.participantId),
},
{
icon: 'category',
label: 'Content Type',
Expand Down Expand Up @@ -162,7 +167,7 @@ export class AssetPropertyGridGroupBuilder {
onclick: () =>
this.jsonDialogService.showJsonDetailDialog({
title: `${groupLabel} Contract Policy)`,
subtitle: asset.name,
subtitle: asset.title,
icon: 'policy',
objectForJson: JSON.parse(
contractOffer.contractPolicy.legacyPolicy ?? 'null',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
[columns]="3"
[props]="contractOffer.properties"></property-grid>

<div *ngIf="contractOffers.length > 1" class="flex flex-row mt-[15px]">
<div
*ngIf="contractOffers.length > 1"
class="flex flex-row justify-end mt-[15px]">
<button
mat-raised-button
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="link"
href="javascript:void(0)"
(click)="dataOfferClick.emit(dataOffer)">
{{ asset.name }}
{{ asset.title }}
</a>
</mat-card-title>
<mat-card-subtitle>{{ asset.creatorOrganizationName }}</mat-card-subtitle>
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/config/app-config-initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let appConfig: AppConfig | null = null;
export async function loadAppConfig(): Promise<AppConfig> {
const merger = new AppConfigMerger();
const builder = new AppConfigBuilder();
const fetcher = new AppConfigFetcher(merger, builder);
const fetcher = new AppConfigFetcher(merger);
return fetcher
.fetchEffectiveConfig('/assets/config/app-config.json', null)
.then((json) => builder.buildAppConfig(json))
Expand Down
93 changes: 0 additions & 93 deletions src/app/core/config/app-config-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,106 +45,13 @@ export const AppConfigProperties = {
*/
logoutUrl: 'EDC_UI_LOGOUT_URL',

/**
* Current Connector Endpoint.
* When creating assets, this is added as asset property.
*/
connectorEndpoint: 'EDC_UI_CONNECTOR_ENDPOINT',

/**
* Pre-configured Other Connector Endpoints to be used in catalog browser, comma separated.
*/
catalogUrls: 'EDC_UI_CATALOG_URLS',

/**
* Connector ID, usually https://hostname of EDC backend.
*
* E.g. contained in DAT Claim "referringConnector".
* And will be used to realize the connector restricted policy.
*/
connectorId: 'EDC_UI_CONNECTOR_ID',

/**
* Connector Name, e.g. used by broker extension
*/
connectorName: 'EDC_UI_CONNECTOR_NAME',

/**
* Connector IDS ID, e.g. urn:connector:sth
*/
connectorIdsId: 'EDC_UI_IDS_ID',

/**
* Connector Title, e.g. "Sovity Test Connector 001"
*/
connectorIdsTitle: 'EDC_UI_IDS_TITLE',

/**
* Connector Description Text
*/
connectorIdsDescription: 'EDC_UI_IDS_DESCRIPTION',

/**
* DAPS OAUTH Token URL
*/
dapsOauthTokenUrl: 'EDC_UI_DAPS_OAUTH_TOKEN_URL',

/**
* DAPS OAUTH JWKS URL
*/
dapsOauthJwksUrl: 'EDC_UI_DAPS_OAUTH_JWKS_URL',

/**
* Curator Organization Homepage
*/
curatorUrl: 'EDC_UI_CURATOR_URL',

/**
* Curator Organization Name.
* When creating assets, this is added as asset property.
*/
curatorOrganizationName: 'EDC_UI_CURATOR_ORGANIZATION_NAME',

/**
* Maintainer Organization Homepage
*/
maintainerUrl: 'EDC_UI_MAINTAINER_URL',

/**
* Maintainer Organization Name.
*/
maintainerOrganizationName: 'EDC_UI_MAINTAINER_ORGANIZATION_NAME',

/**
* Whether to use the fake backend (local development).
*/
useFakeBackend: 'EDC_UI_USE_FAKE_BACKEND',

/**
* Same as {@link connectorEndpoint}.
*
* @deprecated Use {@link connectorEndpoint} instead.
*/
_legacyConnectorEndpoint: 'EDC_UI_ASSET_PROP_ORIGINATOR',

/**
* Same as {@link curatorOrganizationName}.
*
* @deprecated Use {@link curatorOrganizationName} instead.
*/
_legacyCuratorOrganizationName: 'EDC_UI_ASSET_PROP_ORIGINATOR_ORGANIZATION',

/**
* Same as {@link managementApiUrl}.
*
* @deprecated Use {@link managementApiUrl} instead.
*/
_legacyManagementApiUrl: 'EDC_UI_DATA_MANAGEMENT_API_URL',

/**
* Same as {@link managementApiKey}.
*
* @deprecated Use {@link managementApiKey} instead.
*/
_legacyManagementApiKey: 'EDC_UI_DATA_MANAGEMENT_API_KEY',
};
58 changes: 2 additions & 56 deletions src/app/core/config/app-config.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,72 +21,18 @@ export class AppConfigBuilder {
...profileConfig,

// EDC Backend Endpoints
connectorEndpoint:
vars[AppConfigProperties.connectorEndpoint] ??
vars[AppConfigProperties._legacyConnectorEndpoint] ??
'https://no-connector-endpoint-configured',
managementApiKey:
this.getManagementApiKey(vars) ?? 'no-api-key-configured',
vars[AppConfigProperties.managementApiKey] ?? 'no-api-key-configured',
managementApiUrl:
this.getManagementApiUrl(vars) ??
vars[AppConfigProperties.managementApiUrl] ??
'https://no-backend-api-url-configured',
logoutUrl:
vars[AppConfigProperties.logoutUrl] ??
'https://no-logout-url-configured',

// Other EDC Backend Endpoints
catalogUrls: vars[AppConfigProperties.catalogUrls] ?? '',

// Connector Self-Description
connectorId:
vars[AppConfigProperties.connectorId] ??
'https://missing-edc-connector-id',
connectorName:
vars[AppConfigProperties.connectorName] ??
'EDC Connector (No Name Configured)',
connectorIdsId:
vars[AppConfigProperties.connectorIdsId] ??
'no-ids-connector-id-configured',
connectorIdsTitle:
vars[AppConfigProperties.connectorIdsTitle] ??
'EDC Connector (No Title Configured)',
connectorIdsDescription:
vars[AppConfigProperties.connectorIdsDescription] ??
'No Connector Description was configured.',
curatorUrl:
vars[AppConfigProperties.curatorUrl] ??
'http://no-curator-url-configured',
curatorOrganizationName:
vars[AppConfigProperties.curatorOrganizationName] ??
vars[AppConfigProperties._legacyCuratorOrganizationName] ??
'No Curator Organization Name Configured',
dapsOauthTokenUrl:
vars[AppConfigProperties.dapsOauthTokenUrl] ??
'http://no-daps-oauth-token-url-configured',
dapsOauthJwksUrl:
vars[AppConfigProperties.dapsOauthJwksUrl] ??
'http://no-daps-oauth-jwks-url-configured',
maintainerUrl:
vars[AppConfigProperties.maintainerUrl] ??
'http://no-maintainer-url-configured',
maintainerOrganizationName:
vars[AppConfigProperties.maintainerOrganizationName] ??
'No Maintainer Organization Name Configured',
useFakeBackend: vars[AppConfigProperties.useFakeBackend] === 'true',
};
}

getManagementApiKey(vars: Record<string, string | null>): string | null {
return (
vars[AppConfigProperties.managementApiKey] ??
vars[AppConfigProperties._legacyManagementApiKey]
);
}

getManagementApiUrl(vars: Record<string, string | null>): string | null {
return (
vars[AppConfigProperties.managementApiUrl] ??
vars[AppConfigProperties._legacyManagementApiUrl]
);
}
}
Loading

0 comments on commit 74cce25

Please sign in to comment.