1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-24935] - [Desktop] Fix loading state in cipher form save button (#16368)

* use bitButton for handling loading state

* remove unecessary code
This commit is contained in:
Jordan Aasen
2025-09-09 16:23:27 -07:00
committed by GitHub
parent e35dbba279
commit 8aa9f986f5
4 changed files with 3 additions and 17 deletions

View File

@@ -4,16 +4,12 @@
#submitBtn
form="cipherForm"
type="submit"
*ngIf="action !== 'view'"
[hidden]="action === 'view'"
bitButton
class="primary"
appA11yTitle="{{ 'save' | i18n }}"
>
<span [hidden]="isSubmitting">{{ "save" | i18n }}</span>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!isSubmitting"
aria-hidden="true"
></i>
{{ "save" | i18n }}
</button>
<button
type="button"

View File

@@ -24,7 +24,6 @@ export class ItemFooterComponent implements OnInit {
@Input({ required: true }) cipher: CipherView = new CipherView();
@Input() collectionId: string | null = null;
@Input({ required: true }) action: string = "view";
@Input() isSubmitting: boolean = false;
@Input() masterPasswordAlreadyPrompted: boolean = false;
@Output() onEdit = new EventEmitter<CipherView>();
@Output() onClone = new EventEmitter<CipherView>();

View File

@@ -19,7 +19,6 @@
(onClone)="cloneCipher($event)"
(onDelete)="deleteCipher()"
(onCancel)="cancelCipher($event)"
[isSubmitting]="isSubmitting"
[masterPasswordAlreadyPrompted]="cipherRepromptId === cipherId"
></app-vault-item-footer>
<div class="content">
@@ -33,7 +32,6 @@
formId="cipherForm"
[config]="config"
(cipherSaved)="savedCipher($event)"
[beforeSubmit]="onSubmit"
[submitBtn]="footer?.submitBtn"
(formStatusChange$)="formStatusChanged($event)"
>

View File

@@ -161,7 +161,6 @@ export class VaultV2Component<C extends CipherViewLike>
cipher: CipherView | null = new CipherView();
collections: CollectionView[] | null = null;
config: CipherFormConfig | null = null;
isSubmitting = false;
/** Tracks the disabled status of the edit cipher form */
protected formDisabled: boolean = false;
@@ -741,7 +740,6 @@ export class VaultV2Component<C extends CipherViewLike>
await this.vaultItemsComponent?.load(this.activeFilter.buildFilter()).catch(() => {});
await this.go().catch(() => {});
await this.vaultItemsComponent?.refresh().catch(() => {});
this.isSubmitting = false;
}
async deleteCipher() {
@@ -917,11 +915,6 @@ export class VaultV2Component<C extends CipherViewLike>
});
}
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(