mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-15047] Updating admin console 3 dots menu to use th enewer attachments modal (#12402)
* Updating admin console 3 dots menu to use th enewer attachments modal * Update apps/web/src/app/vault/org-vault/vault.component.ts Co-authored-by: Shane Melton <smelton@bitwarden.com> * lint fix --------- Co-authored-by: --global <> Co-authored-by: Shane Melton <smelton@bitwarden.com>
This commit is contained in:
@@ -104,6 +104,10 @@ import {
|
|||||||
} from "../components/vault-item-dialog/vault-item-dialog.component";
|
} from "../components/vault-item-dialog/vault-item-dialog.component";
|
||||||
import { VaultItemEvent } from "../components/vault-items/vault-item-event";
|
import { VaultItemEvent } from "../components/vault-items/vault-item-event";
|
||||||
import { VaultItemsModule } from "../components/vault-items/vault-items.module";
|
import { VaultItemsModule } from "../components/vault-items/vault-items.module";
|
||||||
|
import {
|
||||||
|
AttachmentDialogResult,
|
||||||
|
AttachmentsV2Component,
|
||||||
|
} from "../individual-vault/attachments-v2.component";
|
||||||
import {
|
import {
|
||||||
BulkDeleteDialogResult,
|
BulkDeleteDialogResult,
|
||||||
openBulkDeleteDialog,
|
openBulkDeleteDialog,
|
||||||
@@ -119,7 +123,6 @@ import { VaultHeaderComponent } from "../org-vault/vault-header/vault-header.com
|
|||||||
import { getNestedCollectionTree } from "../utils/collection-utils";
|
import { getNestedCollectionTree } from "../utils/collection-utils";
|
||||||
|
|
||||||
import { AddEditComponent } from "./add-edit.component";
|
import { AddEditComponent } from "./add-edit.component";
|
||||||
import { AttachmentsComponent } from "./attachments.component";
|
|
||||||
import {
|
import {
|
||||||
BulkCollectionsDialogComponent,
|
BulkCollectionsDialogComponent,
|
||||||
BulkCollectionsDialogResult,
|
BulkCollectionsDialogResult,
|
||||||
@@ -761,29 +764,18 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let madeAttachmentChanges = false;
|
const dialogRef = AttachmentsV2Component.open(this.dialogService, {
|
||||||
|
cipherId: cipher.id as CipherId,
|
||||||
|
});
|
||||||
|
|
||||||
const [modal] = await this.modalService.openViewRef(
|
const result = await firstValueFrom(dialogRef.closed);
|
||||||
AttachmentsComponent,
|
|
||||||
this.attachmentsModalRef,
|
|
||||||
(comp) => {
|
|
||||||
comp.organization = this.organization;
|
|
||||||
comp.cipherId = cipher.id;
|
|
||||||
comp.onUploadedAttachment
|
|
||||||
.pipe(takeUntil(this.destroy$))
|
|
||||||
.subscribe(() => (madeAttachmentChanges = true));
|
|
||||||
comp.onDeletedAttachment
|
|
||||||
.pipe(takeUntil(this.destroy$))
|
|
||||||
.subscribe(() => (madeAttachmentChanges = true));
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
modal.onClosed.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
if (
|
||||||
if (madeAttachmentChanges) {
|
result.action === AttachmentDialogResult.Removed ||
|
||||||
|
result.action === AttachmentDialogResult.Uploaded
|
||||||
|
) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
madeAttachmentChanges = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async addCipher(cipherType?: CipherType) {
|
async addCipher(cipherType?: CipherType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user