Skip to content

Commit

Permalink
feat: show Management API URL in Dashboard (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilczaja authored Mar 25, 2024
1 parent 8785eea commit 53e1627
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.local-dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ EDC_UI_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_MANAGEMENT_API_URL_SHOWN_IN_DASHBOARD=http://localhost:3000/api/control/management
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ the detailed section referring to by linking pull requests or issues.

#### Minor

- Now displaying the Management API URL on the dashboard. The displayed URL is also overridable.

#### Patch

#### Deployment Migration Notes

- New **optional** environment variable:
- `EDC_UI_MANAGEMENT_API_URL_SHOWN_IN_DASHBOARD` as override for shown Management API URL on the dashboard

## [v3.0.0] - 2024-03-22

### Overview
Expand Down
5 changes: 5 additions & 0 deletions src/app/core/config/app-config-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export const AppConfigProperties = {
*/
managementApiKey: 'EDC_UI_MANAGEMENT_API_KEY',

/**
* Overridden management API URL to be displayed for the user
*/
shownManagementApiUrl: 'EDC_UI_MANAGEMENT_API_URL_SHOWN_IN_DASHBOARD',

/**
* Logout URL.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/app/core/config/app-config.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class AppConfigBuilder {
logoutUrl:
vars[AppConfigProperties.logoutUrl] ??
'https://no-logout-url-configured',
shownManagementApiUrl:
vars[AppConfigProperties.shownManagementApiUrl] ??
vars[AppConfigProperties.managementApiUrl] ??
'https://no-backend-api-url-configured',

// Other EDC Backend Endpoints
catalogUrls: vars[AppConfigProperties.catalogUrls] ?? '',
Expand Down
1 change: 1 addition & 0 deletions src/app/core/config/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface AppConfig {
managementApiUrl: string;
managementApiKey: string;
logoutUrl: string; // requires feature flag logout-button
shownManagementApiUrl: string;

// Other EDC Backend Endpoints
catalogUrls: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@
<mat-icon>content_copy</mat-icon>
</button>
</mat-form-field>
<mat-form-field class="w-full" style="margin-bottom: -10px">
<mat-label>Management API URL</mat-label>
<input
#endpointInput
matInput
ngDefaultControl
readonly
[ngModel]="config.shownManagementApiUrl"
(focus)="endpointInput.select()" />
<mat-icon matPrefix>link</mat-icon>
<button
mat-icon-button
matSuffix
matTooltip="Copy to clipboard"
[cdkCopyToClipboard]="config.shownManagementApiUrl">
<mat-icon>content_copy</mat-icon>
</button>
</mat-form-field>
</mat-card>

<mat-card
Expand Down

0 comments on commit 53e1627

Please sign in to comment.