Skip to content

Commit

Permalink
feat: added configurable management api url
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilczaja committed Mar 25, 2024
1 parent 8785eea commit 2a3339a
Show file tree
Hide file tree
Showing 6 changed files with 33 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_SHOWN_MANAGEMENT_API_URL_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

- Added support for displaying a configurable management API URL for the user

#### Patch

#### Deployment Migration Notes

- New environment variables:
- `EDC_UI_SHOWN_MANAGEMENT_API_URL_IN_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_SHOWN_MANAGEMENT_API_URL_IN_DASHBOARD',

/**
* Logout URL.
*/
Expand Down
3 changes: 3 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,9 @@ export class AppConfigBuilder {
logoutUrl:
vars[AppConfigProperties.logoutUrl] ??
'https://no-logout-url-configured',
shownManagementApiUrl:
vars[AppConfigProperties.shownManagementApiUrl] ??
'https://no-shown-management-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; // override for displayed management api url, defaults to internal managementApiUrl

// 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>Connector Management Endpoint</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 2a3339a

Please sign in to comment.