From ec3a13fa1f0f9f00d382b8e3026496840c231c0d Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Thu, 24 Oct 2019 12:29:28 +0200
Subject: [PATCH] warning message improved

---
 CHANGELOG                                              | 2 ++
 frontend-js/src/main/js/gui/admin/EditProjectDialog.js | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 6801e6ec41..3063732750 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 minerva (15.0.0~alpha.0) stable; urgency=medium
   * Small improvement: when downloading a map results in too big file (>1MB)
     the content is compressed and returned as a zip file (#348)
+  * Small improvement: confirmation dialog when removing "general view"
+    overlays contain proper warning  (#809)
   * Bug fix: position of structural state is preserved on upload CellDesigner 
     file (#671)
 
diff --git a/frontend-js/src/main/js/gui/admin/EditProjectDialog.js b/frontend-js/src/main/js/gui/admin/EditProjectDialog.js
index 3097f39e91..0aab8b69b6 100644
--- a/frontend-js/src/main/js/gui/admin/EditProjectDialog.js
+++ b/frontend-js/src/main/js/gui/admin/EditProjectDialog.js
@@ -506,8 +506,14 @@ EditProjectDialog.prototype._createOverlayTable = function () {
     var button = this;
     var overlayId = parseInt($(button).attr("data"));
     var overlay = self._overlayById[overlayId];
+    var confirmationMessage = "Do you want to delete overlay: " + overlay.getName() + "?";
+    if (!overlay.getInputDataAvailable()) {
+      confirmationMessage += "<br/><span style='color:red;font-weight:bold'>Warning: This contains one of the map's " +
+        "diagrams and is required<br/>" +
+        "for map display. Removing it cannot be undone.</span>"
+    }
     return GuiConnector.showConfirmationDialog({
-      message: "Do you want to delete overlay: " + overlay.getName() + "?"
+      message: confirmationMessage
     }).then(function (confirmation) {
       if (confirmation) {
         $(button).attr("disabled", true);
-- 
GitLab