mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[SM-1365] Fix organization ID not updating on overview swaps (#10189)
* fix org id not being updated in new-menu on org swaps * fix org suspended component
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnDestroy, OnInit } from "@angular/core";
|
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import { Subject, takeUntil, concatMap, map } from "rxjs";
|
import { Subject, takeUntil, concatMap } from "rxjs";
|
||||||
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
@@ -36,16 +36,12 @@ export class NewMenuComponent implements OnInit, OnDestroy {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.params
|
this.route.params
|
||||||
.pipe(
|
.pipe(
|
||||||
concatMap((params) =>
|
concatMap(async (params) => await this.organizationService.get(params.organizationId)),
|
||||||
this.organizationService
|
|
||||||
.get$(params.organizationId)
|
|
||||||
.pipe(map((organization) => ({ params, organization }))),
|
|
||||||
),
|
|
||||||
takeUntil(this.destroy$),
|
takeUntil(this.destroy$),
|
||||||
)
|
)
|
||||||
.subscribe((mapResult) => {
|
.subscribe((org) => {
|
||||||
this.organizationId = mapResult?.params?.organizationId;
|
this.organizationId = org.id;
|
||||||
this.organizationEnabled = mapResult?.organization?.enabled;
|
this.organizationEnabled = org.enabled;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class OrgSuspendedComponent {
|
|||||||
|
|
||||||
protected NoAccess: Icon = Icons.NoAccess;
|
protected NoAccess: Icon = Icons.NoAccess;
|
||||||
protected organizationName$ = this.route.params.pipe(
|
protected organizationName$ = this.route.params.pipe(
|
||||||
concatMap((params) => this.organizationService.get$(params.organizationId)),
|
concatMap(async (params) => await this.organizationService.get(params.organizationId)),
|
||||||
map((org) => org?.name),
|
map((org) => org?.name),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user