Skip to content

Commit 1a9d8e3

Browse files
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 <[email protected]>
1 parent 76f2772 commit 1a9d8e3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Umbraco.Web.UI.Client/src/packages/documents/documents/rollback/entity-action/rollback.action.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export class UmbRollbackDocumentEntityAction extends UmbEntityActionBase<never>
1111
const modalManagerContext = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
1212
const modalContext = modalManagerContext.open(this, UMB_ROLLBACK_MODAL, {});
1313

14-
await modalContext.onSubmit();
14+
const data = await modalContext.onSubmit().catch(() => undefined);
15+
if (!data) return;
16+
1517
const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT);
1618
notificationContext.peek('positive', {
1719
data: { message: this.#localize.term('rollback_documentRolledBack') },

src/Umbraco.Web.UI.Client/src/packages/documents/documents/rollback/modal/rollback-modal.element.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ export class UmbRollbackModalElement extends UmbModalBaseElement<UmbRollbackModa
223223
const entityUpdatedEvent = new UmbEntityUpdatedEvent({ unique, entityType });
224224
actionEventContext.dispatchEvent(entityUpdatedEvent);
225225

226+
this.value = {};
227+
226228
this.modalContext?.submit();
227229
}
228230

@@ -243,7 +245,7 @@ export class UmbRollbackModalElement extends UmbModalBaseElement<UmbRollbackModa
243245
if (!version) return;
244246

245247
version.preventCleanup = preventCleanup;
246-
this.requestUpdate('versions');
248+
this.requestUpdate('_versions');
247249
}
248250

249251
#onChangeCulture(event: UUISelectEvent) {

0 commit comments

Comments
 (0)