From 98a8d233aa727744b2f7ad4d5096e477795e7dad Mon Sep 17 00:00:00 2001 From: Blake Watt Date: Mon, 31 Jul 2023 20:34:17 -0700 Subject: [PATCH] add warning dialog to internal cache button add warning dialog to internal cache button on the settings published status dashboard --- .../dashboard-published-status.element.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/settings/dashboards/published-status/dashboard-published-status.element.ts b/src/Umbraco.Web.UI.Client/src/packages/settings/dashboards/published-status/dashboard-published-status.element.ts index 2471c4a92f..cd6b732cc1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/settings/dashboards/published-status/dashboard-published-status.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/settings/dashboards/published-status/dashboard-published-status.element.ts @@ -72,7 +72,7 @@ export class UmbDashboardPublishedStatusElement extends UmbLitElement { private async _onReloadCacheHandler() { const modalContext = this._modalContext?.open(UMB_CONFIRM_MODAL, { headline: 'Reload', - content: html` Trigger a in-memory and local file cache reload on all servers. `, + content: html` Trigger a in-memory and local file cache reload on all servers.`, color: 'danger', confirmLabel: 'Continue', }); @@ -106,6 +106,7 @@ export class UmbDashboardPublishedStatusElement extends UmbLitElement { //Collect private async _cacheCollect() { + this._buttonStateCollect = 'waiting'; const { error } = await tryExecuteAndNotify(this, PublishedCacheResource.postPublishedCacheCollect()); if (error) { this._buttonStateCollect = 'failed'; @@ -115,8 +116,15 @@ export class UmbDashboardPublishedStatusElement extends UmbLitElement { } private async _onSnapshotCacheHandler() { - this._buttonStateCollect = 'waiting'; - await this._cacheCollect(); + const modalContex = this._modalContext?.open(UMB_CONFIRM_MODAL, { + headline: 'Snapshot', + content: html` Trigger a NuCache snapshots collection.`, + color: 'danger', + confirmLabel: 'Continue', + }); + modalContex?.onSubmit().then(() => { + this._cacheCollect(); + }); } render() {