mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
AC-1115 Modify AC Vault/Collections (#6789)
* Permissions Column added to Org Vault. Other updates to filter section and Can Manage Permission added and put behind feature flag --------- Co-authored-by: Thomas Rittson <trittson@bitwarden.com> Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
import { Component, EventEmitter, HostBinding, HostListener, Input, Output } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
HostBinding,
|
||||
HostListener,
|
||||
Input,
|
||||
OnInit,
|
||||
Output,
|
||||
} from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view";
|
||||
|
||||
import { GroupView } from "../../../admin-console/organizations/core";
|
||||
import { CollectionAdminView } from "../../core/views/collection-admin.view";
|
||||
|
||||
import {
|
||||
convertToPermission,
|
||||
getPermissionList,
|
||||
Permission,
|
||||
} from "./../../../admin-console/organizations/shared/components/access-selector/access-selector.models";
|
||||
import { VaultItemEvent } from "./vault-item-event";
|
||||
import { RowHeightClass } from "./vault-items.component";
|
||||
|
||||
@@ -14,7 +28,7 @@ import { RowHeightClass } from "./vault-items.component";
|
||||
selector: "tr[appVaultCollectionRow]",
|
||||
templateUrl: "vault-collection-row.component.html",
|
||||
})
|
||||
export class VaultCollectionRowComponent {
|
||||
export class VaultCollectionRowComponent implements OnInit {
|
||||
protected RowHeightClass = RowHeightClass;
|
||||
|
||||
@Input() disabled: boolean;
|
||||
@@ -26,17 +40,25 @@ export class VaultCollectionRowComponent {
|
||||
@Input() canDeleteCollection: boolean;
|
||||
@Input() organizations: Organization[];
|
||||
@Input() groups: GroupView[];
|
||||
@Input() showPermissionsColumn: boolean;
|
||||
@Input() flexibleCollectionsEnabled: boolean;
|
||||
|
||||
@Output() onEvent = new EventEmitter<VaultItemEvent>();
|
||||
|
||||
@Input() checked: boolean;
|
||||
@Output() checkedToggled = new EventEmitter<void>();
|
||||
|
||||
private permissionList: Permission[];
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private i18nService: I18nService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.permissionList = getPermissionList(this.flexibleCollectionsEnabled);
|
||||
}
|
||||
|
||||
@HostBinding("class")
|
||||
get classes() {
|
||||
return [].concat(this.disabled ? [] : ["tw-cursor-pointer"]);
|
||||
@@ -54,6 +76,16 @@ export class VaultCollectionRowComponent {
|
||||
return this.organizations.find((o) => o.id === this.collection.organizationId);
|
||||
}
|
||||
|
||||
get permissionText() {
|
||||
if (!(this.collection as CollectionAdminView).assigned) {
|
||||
return "-";
|
||||
} else {
|
||||
return this.i18nService.t(
|
||||
this.permissionList.find((p) => p.perm === convertToPermission(this.collection))?.labelId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener("click")
|
||||
protected click() {
|
||||
this.router.navigate([], {
|
||||
|
||||
Reference in New Issue
Block a user