mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
* Rename service-factory folder * Move cryptographic service factories * Move crypto models * Move crypto services * Move domain base class * Platform code owners * Move desktop log services * Move log files * Establish component library ownership * Move background listeners * Move background background * Move localization to Platform * Move browser alarms to Platform * Move browser state to Platform * Move CLI state to Platform * Move Desktop native concerns to Platform * Move flag and misc to Platform * Lint fixes * Move electron state to platform * Move web state to Platform * Move lib state to Platform * Fix broken tests * Rename interface to idiomatic TS * `npm run prettier` 🤖 * Resolve review feedback * Set platform as owners of web core and shared * Expand moved services * Fix test types --------- Co-authored-by: Hinton <hinton@users.noreply.github.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import { Component } from "@angular/core";
|
|
import { ActivatedRoute } from "@angular/router";
|
|
|
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
|
|
|
@Component({
|
|
selector: "app-org-tools",
|
|
templateUrl: "tools.component.html",
|
|
})
|
|
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
|
export class ToolsComponent {
|
|
organization: Organization;
|
|
accessReports = false;
|
|
loading = true;
|
|
|
|
constructor(
|
|
private route: ActivatedRoute,
|
|
private organizationService: OrganizationService,
|
|
private messagingService: MessagingService
|
|
) {}
|
|
|
|
ngOnInit() {
|
|
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
|
|
this.route.parent.params.subscribe(async (params) => {
|
|
this.organization = await this.organizationService.get(params.organizationId);
|
|
// TODO: Maybe we want to just make sure they are not on a free plan? Just compare useTotp for now
|
|
// since all paid plans include useTotp
|
|
this.accessReports = this.organization.useTotp;
|
|
this.loading = false;
|
|
});
|
|
}
|
|
|
|
upgradeOrganization() {
|
|
this.messagingService.send("upgradeOrganization", { organizationId: this.organization.id });
|
|
}
|
|
}
|