1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

Use correct report label/layout by product type

This commit is contained in:
Shane Melton 2022-07-12 17:05:51 -07:00
parent 4dc9fe178e
commit 9c7d7fe703
4 changed files with 10 additions and 5 deletions

View File

@ -15,7 +15,7 @@
"groups" | i18n
}}</bit-tab-item>
<bit-tab-item *ngIf="showReportsTab" [route]="['reporting']">{{
"reporting" | i18n
reportTabLabel | i18n
}}</bit-tab-item>
<bit-tab-item *ngIf="showBillingTab" [route]="['billing']">{{
"billing" | i18n

View File

@ -67,7 +67,7 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
}
get showGroupsTab(): boolean {
return this.organization.canManageGroups;
return this.organization.useGroups && this.organization.canManageGroups;
}
get showReportsTab(): boolean {
@ -78,6 +78,10 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
return this.organization.canManageBilling;
}
get reportTabLabel(): string {
return this.organization.useEvents ? "reporting" : "reports";
}
get toolsRoute(): string {
return this.organization.canAccessImportExport
? "tools/import"

View File

@ -1,6 +1,6 @@
<div class="container page-content">
<div class="row">
<div class="col-3">
<div class="col-3" *ngIf="showLeftNav">
<div class="card" *ngIf="organization">
<div class="card-header">{{ "reporting" | i18n }}</div>
<div class="list-group list-group-flush">
@ -23,7 +23,7 @@
</div>
</div>
</div>
<div class="col-9">
<div class="col-9" [ngClass]="showLeftNav ? 'col-9' : 'col-12'">
<router-outlet></router-outlet>
</div>
</div>

View File

@ -11,13 +11,14 @@ import { Organization } from "@bitwarden/common/models/domain/organization";
export class ReportingComponent implements OnInit {
organization: Organization;
accessEvents = false;
showLeftNav = true;
constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {}
ngOnInit() {
this.route.parent.params.subscribe(async (params) => {
this.organization = await this.organizationService.get(params.organizationId);
this.accessEvents = this.organization.useEvents;
this.accessEvents = this.showLeftNav = this.organization.useEvents;
});
}
}