From 5faaf87b22b021041d68eb59c1af0f7315fa984c Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Mon, 26 Aug 2024 10:07:23 +0200 Subject: [PATCH] fix(console): change external links dynamically (#8423) This PR fixes a problem, where the external links were not replaced dynamically on an org change. --- .../app/modules/header/header.component.html | 8 ++++--- .../app/modules/header/header.component.ts | 23 +------------------ 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/console/src/app/modules/header/header.component.html b/console/src/app/modules/header/header.component.html index a8c438ae4d..2a167731ec 100644 --- a/console/src/app/modules/header/header.component.html +++ b/console/src/app/modules/header/header.component.html @@ -168,9 +168,11 @@ - - {{ customLinkText }} - + + + {{ pP.customLinkText }} + + {{ 'MENU.DOCUMENTATION' | translate }} diff --git a/console/src/app/modules/header/header.component.ts b/console/src/app/modules/header/header.component.ts index 720d40cb98..457e2bbe51 100644 --- a/console/src/app/modules/header/header.component.ts +++ b/console/src/app/modules/header/header.component.ts @@ -9,7 +9,6 @@ import { BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.s import { GrpcAuthService } from 'src/app/services/grpc-auth.service'; import { ManagementService } from 'src/app/services/mgmt.service'; import { ActionKeysType } from '../action-keys/action-keys.component'; -import { GetPrivacyPolicyResponse } from 'src/app/proto/generated/zitadel/management_pb'; @Component({ selector: 'cnsl-header', @@ -32,8 +31,6 @@ export class HeaderComponent implements OnDestroy { public BreadcrumbType: any = BreadcrumbType; public ActionKeysType: any = ActionKeysType; public docsLink = 'https://zitadel.com/docs'; - public customLink = ''; - public customLinkText = ''; public positions: ConnectedPosition[] = [ new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }, 0, 10), @@ -50,25 +47,7 @@ export class HeaderComponent implements OnDestroy { public mgmtService: ManagementService, public breadcrumbService: BreadcrumbService, public router: Router, - ) { - this.loadData(); - } - - public async loadData(): Promise { - const getData = (): Promise => { - return this.mgmtService.getPrivacyPolicy(); - }; - - getData() - .then((resp) => { - if (resp.policy) { - this.docsLink = resp.policy.docsLink; - this.customLink = resp.policy.customLink; - this.customLinkText = resp.policy.customLinkText; - } - }) - .catch(() => {}); - } + ) {} public ngOnDestroy() { this.destroy$.next();