mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
[PM-2170] Update collections component (#6794)
* PM-2170 Updated Collections to use Component Library * PM-2170 Removed some extra space * PM-2170 Fix typo * PM-2170 Refresh vault when saving * PM-2170 Fix PR comments * PM-2170 Refactor to use CollectionsDialogResult to fix lint error * PM-2170 Refactor subtitle * PM-4788 Fix dismiss of modal * PM-2170 Fix PR comments
This commit is contained in:
@@ -75,6 +75,7 @@ import {
|
||||
BulkDeleteDialogResult,
|
||||
openBulkDeleteDialog,
|
||||
} from "../individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component";
|
||||
import { CollectionsDialogResult } from "../individual-vault/collections.component";
|
||||
import { RoutedVaultFilterBridgeService } from "../individual-vault/vault-filter/services/routed-vault-filter-bridge.service";
|
||||
import { RoutedVaultFilterService } from "../individual-vault/vault-filter/services/routed-vault-filter.service";
|
||||
import { createFilterFunction } from "../individual-vault/vault-filter/shared/models/filter-function";
|
||||
@@ -95,7 +96,7 @@ import {
|
||||
BulkCollectionsDialogComponent,
|
||||
BulkCollectionsDialogResult,
|
||||
} from "./bulk-collections-dialog";
|
||||
import { CollectionsComponent } from "./collections.component";
|
||||
import { openOrgVaultCollectionsDialog } from "./collections.component";
|
||||
import { VaultFilterComponent } from "./vault-filter/vault-filter.component";
|
||||
|
||||
const BroadcasterSubscriptionId = "OrgVaultComponent";
|
||||
@@ -711,21 +712,37 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
collections = await firstValueFrom(this.allCollectionsWithoutUnassigned$);
|
||||
}
|
||||
const [modal] = await this.modalService.openViewRef(
|
||||
CollectionsComponent,
|
||||
this.collectionsModalRef,
|
||||
(comp) => {
|
||||
comp.flexibleCollectionsV1Enabled = this.flexibleCollectionsV1Enabled;
|
||||
comp.collectionIds = cipher.collectionIds;
|
||||
comp.collections = collections;
|
||||
comp.organization = this.organization;
|
||||
comp.cipherId = cipher.id;
|
||||
comp.onSavedCollections.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
||||
modal.close();
|
||||
this.refresh();
|
||||
});
|
||||
const dialog = openOrgVaultCollectionsDialog(this.dialogService, {
|
||||
data: {
|
||||
collectionIds: cipher.collectionIds,
|
||||
collections: collections.filter((c) => !c.readOnly && c.id != Unassigned),
|
||||
organization: this.organization,
|
||||
cipherId: cipher.id,
|
||||
},
|
||||
);
|
||||
});
|
||||
/**
|
||||
|
||||
const [modal] = await this.modalService.openViewRef(
|
||||
CollectionsComponent,
|
||||
this.collectionsModalRef,
|
||||
(comp) => {
|
||||
comp.flexibleCollectionsV1Enabled = this.flexibleCollectionsV1Enabled;
|
||||
comp.collectionIds = cipher.collectionIds;
|
||||
comp.collections = collections;
|
||||
comp.organization = this.organization;
|
||||
comp.cipherId = cipher.id;
|
||||
comp.onSavedCollections.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
||||
modal.close();
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
*/
|
||||
|
||||
if ((await lastValueFrom(dialog.closed)) == CollectionsDialogResult.Saved) {
|
||||
await this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
async addCipher() {
|
||||
|
||||
Reference in New Issue
Block a user