mirror of
https://github.com/zitadel/zitadel.git
synced 2025-05-03 05:50:50 +00:00
fix(console): change external links dynamically (#8423)
This PR fixes a problem, where the external links were not replaced dynamically on an org change.
This commit is contained in:
parent
fd0c15dd4f
commit
5faaf87b22
@ -168,9 +168,11 @@
|
|||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
|
|
||||||
<a class="custom-link" *ngIf="customLink && customLinkText" href="{{ customLink }}" mat-stroked-button target="_blank">
|
<ng-container *ngIf="authService.privacypolicy | async as pP">
|
||||||
{{ customLinkText }}
|
<a class="custom-link" *ngIf="pP.customLink" href="{{ pP.customLink }}" mat-stroked-button target="_blank">
|
||||||
</a>
|
{{ pP.customLinkText }}
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<a class="doc-link" *ngIf="docsLink" href="{{ docsLink }}" mat-stroked-button target="_blank">
|
<a class="doc-link" *ngIf="docsLink" href="{{ docsLink }}" mat-stroked-button target="_blank">
|
||||||
{{ 'MENU.DOCUMENTATION' | translate }}
|
{{ 'MENU.DOCUMENTATION' | translate }}
|
||||||
|
@ -9,7 +9,6 @@ import { BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.s
|
|||||||
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
|
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { ActionKeysType } from '../action-keys/action-keys.component';
|
import { ActionKeysType } from '../action-keys/action-keys.component';
|
||||||
import { GetPrivacyPolicyResponse } from 'src/app/proto/generated/zitadel/management_pb';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cnsl-header',
|
selector: 'cnsl-header',
|
||||||
@ -32,8 +31,6 @@ export class HeaderComponent implements OnDestroy {
|
|||||||
public BreadcrumbType: any = BreadcrumbType;
|
public BreadcrumbType: any = BreadcrumbType;
|
||||||
public ActionKeysType: any = ActionKeysType;
|
public ActionKeysType: any = ActionKeysType;
|
||||||
public docsLink = 'https://zitadel.com/docs';
|
public docsLink = 'https://zitadel.com/docs';
|
||||||
public customLink = '';
|
|
||||||
public customLinkText = '';
|
|
||||||
|
|
||||||
public positions: ConnectedPosition[] = [
|
public positions: ConnectedPosition[] = [
|
||||||
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }, 0, 10),
|
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 mgmtService: ManagementService,
|
||||||
public breadcrumbService: BreadcrumbService,
|
public breadcrumbService: BreadcrumbService,
|
||||||
public router: Router,
|
public router: Router,
|
||||||
) {
|
) {}
|
||||||
this.loadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async loadData(): Promise<any> {
|
|
||||||
const getData = (): Promise<GetPrivacyPolicyResponse.AsObject> => {
|
|
||||||
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() {
|
public ngOnDestroy() {
|
||||||
this.destroy$.next();
|
this.destroy$.next();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user