Fixes label of enable/prevent clean up button after update (#18946)

* Update enable cleanup button text on toggle.

* Handle console error visible on cancel of rollback dialog.

* Return value from `umb-rollback-modal`

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
This commit is contained in:
Andy Butland
2025-04-09 10:15:00 +02:00
committed by GitHub
parent 76f27726c5
commit 1a9d8e3a5d
2 changed files with 6 additions and 2 deletions

View File

@@ -11,7 +11,9 @@ export class UmbRollbackDocumentEntityAction extends UmbEntityActionBase<never>
const modalManagerContext = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
const modalContext = modalManagerContext.open(this, UMB_ROLLBACK_MODAL, {});
await modalContext.onSubmit();
const data = await modalContext.onSubmit().catch(() => undefined);
if (!data) return;
const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT);
notificationContext.peek('positive', {
data: { message: this.#localize.term('rollback_documentRolledBack') },

View File

@@ -223,6 +223,8 @@ export class UmbRollbackModalElement extends UmbModalBaseElement<UmbRollbackModa
const entityUpdatedEvent = new UmbEntityUpdatedEvent({ unique, entityType });
actionEventContext.dispatchEvent(entityUpdatedEvent);
this.value = {};
this.modalContext?.submit();
}
@@ -243,7 +245,7 @@ export class UmbRollbackModalElement extends UmbModalBaseElement<UmbRollbackModa
if (!version) return;
version.preventCleanup = preventCleanup;
this.requestUpdate('versions');
this.requestUpdate('_versions');
}
#onChangeCulture(event: UUISelectEvent) {