From 6f4e79ae4f59a4e80c2cfd08c40aabdc1c44dd12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?=
Date: Mon, 2 Sep 2024 16:48:57 +0200
Subject: [PATCH] Admin / Source / Improve dirty state (#8222)
* Admin / Source / Improve dirty state
Due to wrong `form` tag placement, dirty state was only set when changing portal id and filter - not UI config, service or logo.
Reorganize the form to improve this, so that save action is enabled when changing the form. Also keep the logo form upload not nested (because it would not work)
* Update SourcesController.js
* Admin / Source / Hide logo if not available.
---
.../catalog/js/admin/SourcesController.js | 2 +-
.../templates/admin/settings/sources.html | 221 +++++++++---------
2 files changed, 112 insertions(+), 111 deletions(-)
diff --git a/web-ui/src/main/resources/catalog/js/admin/SourcesController.js b/web-ui/src/main/resources/catalog/js/admin/SourcesController.js
index 2a6c5e86e62..c83ff220c7c 100644
--- a/web-ui/src/main/resources/catalog/js/admin/SourcesController.js
+++ b/web-ui/src/main/resources/catalog/js/admin/SourcesController.js
@@ -211,7 +211,7 @@
$scope.deleteSourceLogo = function () {
$scope.source.logo = null;
- // $scope.updateSource();
+ $scope.gnSourceForm.$setDirty();
};
// upload directive options
diff --git a/web-ui/src/main/resources/catalog/templates/admin/settings/sources.html b/web-ui/src/main/resources/catalog/templates/admin/settings/sources.html
index a0315d50b0f..56edf2a2bb6 100644
--- a/web-ui/src/main/resources/catalog/templates/admin/settings/sources.html
+++ b/web-ui/src/main/resources/catalog/templates/admin/settings/sources.html
@@ -50,6 +50,7 @@
{{::s.name}}
@@ -169,6 +170,20 @@