fix(console): routing on org change (#4369)

fix: console routing on org change

Co-authored-by: Silvan <[email protected]>
Co-authored-by: Fabi <[email protected]>
This commit is contained in:
Max Peintner
2022-09-19 11:50:34 +02:00
committed by GitHub
co-authored by Silvan Fabi
parent ef87a53dfc
commit 49396c4678
4 changed files with 7 additions and 43 deletions
@@ -23,18 +23,9 @@
matSort
(matSortChange)="sortChange($event)"
>
<ng-container matColumnDef="select">
<th class="selection" mat-header-cell *matHeaderCellDef>
{{ 'ORG.PAGES.ACTIVE' | translate }}
</th>
<td class="selection" mat-cell *matCellDef="let org">
<mat-radio-button (change)="selectOrg(org)" color="primary" [checked]="org.id === activeOrg.id"> </mat-radio-button>
</td>
</ng-container>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>{{ 'ORG.PAGES.ID' | translate }}</th>
<td mat-cell *matCellDef="let org" (change)="selectOrg(org)">{{ org.id }}</td>
<td mat-cell *matCellDef="let org" (click)="setAndNavigateToOrg(org)">{{ org.id }}</td>
</ng-container>
<ng-container matColumnDef="primaryDomain">
@@ -58,7 +49,6 @@
</ng-container>
<ng-container matColumnDef="name">
<!-- mat-sort-header -->
<th mat-header-cell *matHeaderCellDef>
{{ 'ORG.PAGES.NAME' | translate }}
</th>
@@ -94,14 +94,6 @@ export class OrgTableComponent {
);
}
public selectOrg(item: Org.AsObject, event?: any): void {
this.authService.setActiveOrg(item);
this.themeService.loadPrivateLabelling();
this.authService.zitadelPermissions$.pipe(take(1)).subscribe(() => {
this.router.navigate(['/org'], { fragment: item.id });
});
}
public refresh(): void {
this.requestOrgs$.next({
limit: this.paginator.length,
@@ -146,9 +138,7 @@ export class OrgTableComponent {
public setAndNavigateToOrg(org: Org.AsObject): void {
this.authService.setActiveOrg(org);
this.themeService.loadPrivateLabelling();
this.authService.zitadelPermissions$.pipe(take(1)).subscribe(() => {
this.router.navigate(['/org'], { fragment: org.id });
});
this.router.navigate(['/org']);
}
public changePage(): void {