1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

[PM-12389] Combined web vault item dialog (#11345)

* [PM-12389] Cleanup attachment dialog UI bugs

* [PM-12389] Add formReady event to CipherForm

* [PM-12389] Use ngOnChanges for CipherView component initialization

* [PM-12389] Cleanup web specific services and components

* [PM-12389] Introduce combined Vault Item Dialog component

* [PM-12389] Use the new VaultItemDialog in the Individual Vault

* [PM-12389] Deprecate the AddEditV2 and View dialogs in Web

* [PM-12389] Fix failing test

* [PM-12389] Fix broken imports after move

* [PM-12389] Remove messages.json addition that is taken care of in another PR
This commit is contained in:
Shane Melton
2024-10-02 14:34:46 -07:00
committed by GitHub
parent 4bd2e158c0
commit 0d877c4e77
15 changed files with 616 additions and 125 deletions

View File

@@ -0,0 +1,79 @@
<bit-dialog dialogSize="large" background="alt" [loading]="performingInitialLoad">
<span bitDialogTitle aria-live="polite">
{{ title }}
</span>
<div bitDialogContent #dialogContent>
<app-cipher-view
*ngIf="showCipherView"
[cipher]="cipher"
[collections]="collections"
></app-cipher-view>
<vault-cipher-form
*ngIf="loadForm"
formId="cipherForm"
[config]="formConfig"
[submitBtn]="submitBtn"
(formReady)="onFormReady()"
(cipherSaved)="onCipherSaved($event)"
>
<bit-item slot="attachment-button">
<button bit-item-content type="button" (click)="openAttachmentsDialog()">
<p class="tw-m-0">
{{ "attachments" | i18n }}
<span
*ngIf="!(canAccessAttachments$ | async)"
bitBadge
variant="success"
class="tw-ml-2"
>
{{ "premium" | i18n }}
</span>
</p>
<i slot="end" class="bwi bwi-angle-right" aria-hidden="true"></i>
</button>
</bit-item>
</vault-cipher-form>
</div>
<ng-container bitDialogFooter>
<ng-container *ngIf="showCipherView">
<button
bitButton
[bitAction]="switchToEdit"
buttonType="primary"
type="button"
[disabled]="disableEdit"
>
{{ "edit" | i18n }}
</button>
</ng-container>
<button
bitButton
type="submit"
form="cipherForm"
buttonType="primary"
#submitBtn
[hidden]="showCipherView"
>
{{ "save" | i18n }}
</button>
<button
bitButton
type="button"
buttonType="secondary"
(click)="cancel()"
*ngIf="!showCipherView"
>
{{ "cancel" | i18n }}
</button>
<div class="tw-ml-auto">
<button
bitIconButton="bwi-trash"
type="button"
buttonType="danger"
[appA11yTitle]="'delete' | i18n"
[bitAction]="delete"
[disabled]="!canDelete"
></button>
</div>
</ng-container>
</bit-dialog>