bitwarden-estensione-browser/src/app/organizations/tools/tools.component.ts

33 lines
1.1 KiB
TypeScript
Raw Normal View History

2018-07-06 16:21:08 +02:00
import { Component } from '@angular/core';
2018-12-14 19:56:01 +01:00
import { ActivatedRoute } from '@angular/router';
import { Organization } from 'jslib/models/domain/organization';
2018-12-14 20:48:12 +01:00
import { MessagingService } from 'jslib/abstractions/messaging.service';
2018-12-14 19:56:01 +01:00
import { UserService } from 'jslib/abstractions/user.service';
2018-07-05 20:40:53 +02:00
@Component({
selector: 'app-org-tools',
templateUrl: 'tools.component.html',
})
2018-12-14 19:56:01 +01:00
export class ToolsComponent {
organization: Organization;
accessReports = false;
2018-12-14 20:48:12 +01:00
constructor(private route: ActivatedRoute, private userService: UserService,
private messagingService: MessagingService) { }
2018-12-14 19:56:01 +01:00
ngOnInit() {
this.route.parent.params.subscribe(async (params) => {
this.organization = await this.userService.getOrganization(params.organizationId);
2018-12-16 03:54:32 +01:00
// 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;
2018-12-14 19:56:01 +01:00
});
}
2018-12-14 20:48:12 +01:00
upgradeOrganization() {
this.messagingService.send('upgradeOrganization', { organizationId: this.organization.id });
}
2018-12-14 19:56:01 +01:00
}