From 35d40a88ebed382a09cfa1686b14fe5f725034be Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Mon, 23 Oct 2023 14:31:02 +0300 Subject: [PATCH] UI: Improved show confirm on exit dialog in widget editor --- .../app/core/guards/confirm-on-exit.guard.ts | 11 ++++++- .../dashboard-page.component.ts | 11 +++++++ .../pages/widget/widget-editor.component.ts | 33 +++++++++++++++++-- .../app/shared/models/window-message.model.ts | 3 +- .../assets/locale/locale.constant-en_US.json | 1 + 5 files changed, 54 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts b/ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts index f3a72e7aae..e28578fe61 100644 --- a/ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts +++ b/ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts @@ -28,10 +28,12 @@ import { isDefined } from '../utils'; export interface HasConfirmForm { confirmForm(): UntypedFormGroup; + confirmOnExitMessage?: string; } export interface HasDirtyFlag { isDirty: boolean; + confirmOnExitMessage?: string; } @Injectable({ @@ -66,9 +68,10 @@ export class ConfirmOnExitGuard implements CanDeactivate { if (dialogResult) { @@ -85,4 +88,10 @@ export class ConfirmOnExitGuard implements CanDeactivateAre you sure you want to leave this page?", "widget-type-not-found": "Problem loading widget configuration.
Probably associated\n widget type was removed.", "widget-type-load-error": "Widget wasn't loaded due to the following errors:", "remove": "Remove widget",