mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
show reports with upgrade message
This commit is contained in:
parent
ceca4fbe53
commit
4bb9051136
@ -12,9 +12,14 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" *ngIf="accessReports">
|
||||
<div class="card-header">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex">
|
||||
{{'reports' | i18n}}
|
||||
<div class="ml-auto">
|
||||
<a href="#" appStopClick class="badge badge-primary" *ngIf="!accessReport" (click)="upgradeOrganization()">
|
||||
{{'upgrade' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a routerLink="exposed-passwords-report" class="list-group-item" routerLinkActive="active">
|
||||
|
@ -3,6 +3,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Organization } from 'jslib/models/domain/organization';
|
||||
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
@Component({
|
||||
@ -13,7 +14,8 @@ export class ToolsComponent {
|
||||
organization: Organization;
|
||||
accessReports = false;
|
||||
|
||||
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
||||
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||
private messagingService: MessagingService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.route.parent.params.subscribe(async (params) => {
|
||||
@ -24,4 +26,7 @@ export class ToolsComponent {
|
||||
});
|
||||
}
|
||||
|
||||
upgradeOrganization() {
|
||||
this.messagingService.send('upgradeOrganization', { organizationId: this.organization.id });
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export class ToolsComponent implements OnInit {
|
||||
this.canAccessPremium = await this.userService.canAccessPremium();
|
||||
}
|
||||
|
||||
async premiumRequired() {
|
||||
premiumRequired() {
|
||||
if (!this.canAccessPremium) {
|
||||
this.messagingService.send('premiumRequired');
|
||||
return;
|
||||
|
@ -97,14 +97,14 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
return confirmed;
|
||||
}
|
||||
|
||||
async premiumRequired() {
|
||||
premiumRequired() {
|
||||
if (!this.canAccessPremium) {
|
||||
this.messagingService.send('premiumRequired');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
async upgradeOrganization() {
|
||||
upgradeOrganization() {
|
||||
this.messagingService.send('upgradeOrganization', { organizationId: this.cipher.organizationId });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user