From d2ed0c55a4dd8bf06c3d5573d44f989c5aba59c7 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Mon, 19 Oct 2026 23:12:09 -0700
Subject: [PATCH] dirtycheck
---
src-ui/src/app/app-routing.module.ts | 2 ++
.../ocr-template-editor.component.html | 2 +-
.../ocr-template-editor.component.spec.ts | 18 +++++++++++
.../ocr-template-editor.component.ts | 32 ++++++++++++++++++-
4 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/src-ui/src/app/app-routing.module.ts b/src-ui/src/app/app-routing.module.ts
index 993ba32d1..28831a424 100644
--- a/src-ui/src/app/app-routing.module.ts
+++ b/src-ui/src/app/app-routing.module.ts
@@ -292,6 +292,7 @@ export const routes: Routes = [
{
path: 'ocr-templates/new',
component: OcrTemplateEditorComponent,
+ canDeactivate: [DirtyFormGuard],
canActivate: [PermissionsGuard],
data: {
requiredPermission: {
@@ -304,6 +305,7 @@ export const routes: Routes = [
{
path: 'ocr-templates/:id',
component: OcrTemplateEditorComponent,
+ canDeactivate: [DirtyFormGuard],
canActivate: [PermissionsGuard],
data: {
requiredPermission: {
diff --git a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html
index 016a41f14..6c6f310d9 100644
--- a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html
+++ b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html
@@ -2,7 +2,7 @@
Close
-