2018-07-16 18:42:49 +02:00
|
|
|
import { Component } from "@angular/core";
|
2018-07-18 23:10:26 +02:00
|
|
|
import { ActivatedRoute } from "@angular/router";
|
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { OrganizationService } from "@bitwarden/common/abstractions/organization.service";
|
|
|
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
2018-07-16 18:42:49 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-org-settings",
|
|
|
|
templateUrl: "settings.component.html",
|
|
|
|
})
|
2022-08-26 18:09:28 +02:00
|
|
|
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
2018-07-18 23:10:26 +02:00
|
|
|
export class SettingsComponent {
|
|
|
|
access2fa = false;
|
2022-05-10 09:41:52 +02:00
|
|
|
showBilling: boolean;
|
2018-07-18 23:10:26 +02:00
|
|
|
|
2021-12-14 17:10:26 +01:00
|
|
|
constructor(
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private organizationService: OrganizationService,
|
2019-02-18 22:10:32 +01:00
|
|
|
private platformUtilsService: PlatformUtilsService
|
|
|
|
) {}
|
2018-07-18 23:10:26 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
2022-08-26 18:09:28 +02:00
|
|
|
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
|
2021-02-03 18:41:33 +01:00
|
|
|
this.route.parent.params.subscribe(async (params) => {
|
2021-12-14 17:10:26 +01:00
|
|
|
const organization = await this.organizationService.get(params.organizationId);
|
2022-05-10 09:41:52 +02:00
|
|
|
this.showBilling = !this.platformUtilsService.isSelfHost() && organization.canManageBilling;
|
2018-07-18 23:10:26 +02:00
|
|
|
this.access2fa = organization.use2fa;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|