mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
various fixes to desktop cipher form (#14576)
This commit is contained in:
@@ -445,6 +445,12 @@
|
||||
"addField": {
|
||||
"message": "Add field"
|
||||
},
|
||||
"editField": {
|
||||
"message": "Edit field"
|
||||
},
|
||||
"permanentlyDeleteAttachmentConfirmation": {
|
||||
"message": "Are you sure you want to permanently delete this attachment?"
|
||||
},
|
||||
"fieldType": {
|
||||
"message": "Field type"
|
||||
},
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
<ng-container *ngIf="!cipher.decryptionFailure">
|
||||
<button
|
||||
#submitBtn
|
||||
bitButton
|
||||
form="cipherForm"
|
||||
type="submit"
|
||||
*ngIf="action !== 'view'"
|
||||
class="primary"
|
||||
appA11yTitle="{{ 'save' | i18n }}"
|
||||
>
|
||||
<i class="bwi bwi-save-changes bwi-lg bwi-fw" [hidden]="isSubmitting" aria-hidden="true"></i>
|
||||
<span [hidden]="isSubmitting">{{ "save" | i18n }}</span>
|
||||
<i
|
||||
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
|
||||
[hidden]="!isSubmitting"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
(onClone)="cloneCipher($event)"
|
||||
(onDelete)="deleteCipher()"
|
||||
(onCancel)="cancelCipher($event)"
|
||||
[isSubmitting]="isSubmitting"
|
||||
></app-vault-item-footer>
|
||||
<div class="content">
|
||||
<div class="inner-content">
|
||||
@@ -31,6 +32,7 @@
|
||||
formId="cipherForm"
|
||||
[config]="config"
|
||||
(cipherSaved)="savedCipher($event)"
|
||||
[beforeSubmit]="onSubmit"
|
||||
[submitBtn]="footer?.submitBtn"
|
||||
>
|
||||
<bit-item slot="attachment-button">
|
||||
|
||||
@@ -141,6 +141,7 @@ export class VaultV2Component implements OnInit, OnDestroy {
|
||||
cipher: CipherView | null = new CipherView();
|
||||
collections: CollectionView[] | null = null;
|
||||
config: CipherFormConfig | null = null;
|
||||
isSubmitting = false;
|
||||
|
||||
protected canAccessAttachments$ = this.accountService.activeAccount$.pipe(
|
||||
filter((account): account is Account => !!account),
|
||||
@@ -560,6 +561,7 @@ export class VaultV2Component implements OnInit, OnDestroy {
|
||||
await this.vaultItemsComponent?.load(this.activeFilter.buildFilter()).catch(() => {});
|
||||
await this.go().catch(() => {});
|
||||
await this.vaultItemsComponent?.refresh().catch(() => {});
|
||||
this.isSubmitting = false;
|
||||
}
|
||||
|
||||
async deleteCipher() {
|
||||
@@ -735,6 +737,11 @@ export class VaultV2Component implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
protected onSubmit = async () => {
|
||||
this.isSubmitting = true;
|
||||
return Promise.resolve(true);
|
||||
};
|
||||
|
||||
private prefillCipherFromFilter() {
|
||||
if (this.activeFilter.selectedCollectionId != null && this.vaultFilterComponent != null) {
|
||||
const collections = this.vaultFilterComponent.collections.fullList.filter(
|
||||
|
||||
Reference in New Issue
Block a user