mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
# Which Problems Are Solved The new breadcrumbs were causing problems with some more advanced Zitadel setups. This pr removes the new breadcrumbs to revert to the old navigation behaviour. # How the Problems Are Solved Most of the changes could be kept but those specific to the navigation where mostly reverted. # Additional Changes Updated some dependencies. # Additional Context - Closes #10863
74 lines
2.6 KiB
TypeScript
74 lines
2.6 KiB
TypeScript
import { ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
import { Component, EventEmitter, input, Input, Output } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { User } from 'src/app/proto/generated/zitadel/user_pb';
|
|
import { BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
|
|
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 { Organization } from '@zitadel/proto/zitadel/org/v2/org_pb';
|
|
import { Org } from '@zitadel/proto/zitadel/org_pb';
|
|
|
|
@Component({
|
|
selector: 'cnsl-header',
|
|
templateUrl: './header.component.html',
|
|
styleUrls: ['./header.component.scss'],
|
|
standalone: false,
|
|
})
|
|
export class HeaderComponent {
|
|
@Input() public isDarkTheme: boolean = true;
|
|
@Input({ required: true }) public user!: User.AsObject;
|
|
public showOrgContext: boolean = false;
|
|
|
|
public org = input<Organization | Org | null>();
|
|
|
|
@Output() public changedActiveOrg = new EventEmitter<void>();
|
|
public showAccount: boolean = false;
|
|
public BreadcrumbType = BreadcrumbType;
|
|
public ActionKeysType = ActionKeysType;
|
|
|
|
public positions: ConnectedPosition[] = [
|
|
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }, 0, 10),
|
|
new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }, 0, 10),
|
|
];
|
|
|
|
public accountCardPositions: ConnectedPosition[] = [
|
|
new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }, 0, 10),
|
|
new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }, 0, 10),
|
|
];
|
|
constructor(
|
|
public authService: GrpcAuthService,
|
|
public mgmtService: ManagementService,
|
|
public breadcrumbService: BreadcrumbService,
|
|
public router: Router,
|
|
) {}
|
|
|
|
public async setActiveOrg(orgId: string): Promise<void> {
|
|
await this.authService.getActiveOrg(orgId);
|
|
this.changedActiveOrg.emit();
|
|
}
|
|
|
|
public get isOnMe(): boolean {
|
|
return this.router.url === '/users/me';
|
|
}
|
|
|
|
public errorHandler(event: any, fallbackSrc: string) {
|
|
(event.target as HTMLImageElement).src = fallbackSrc;
|
|
}
|
|
|
|
public get isOnInstance(): boolean {
|
|
const pages: string[] = [
|
|
'/instance',
|
|
'/settings',
|
|
'/views',
|
|
'/events',
|
|
'/orgs',
|
|
'/settings',
|
|
'/failed-events',
|
|
'/instance/members',
|
|
];
|
|
|
|
return pages.findIndex((p) => this.router.url.includes(p)) > -1;
|
|
}
|
|
}
|