From 088ded3b371dd7b55b7eb220285a4703ca32b0e3 Mon Sep 17 00:00:00 2001
From: SakthivelG <sakthivel.govindan@tarento.com>
Date: Tue, 12 Apr 2022 11:37:05 +0530
Subject: [PATCH] refactor: Defect #57131

---
 public/css/main.css            |  2 +-
 src/components/form/AddForm.js | 13 ++++++++++---
 src/constants/LangConstants.ts |  2 ++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/public/css/main.css b/public/css/main.css
index 2080702..6e99cb5 100644
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -2935,7 +2935,7 @@ button.active {
 } */
 
 .react-confirm-alert-body {
-  color: var(--white-90) !important;
+  color: var(--main-black60) !important;
   background: var(--input-background) !important;
   border-radius: unset !important;
 }
diff --git a/src/components/form/AddForm.js b/src/components/form/AddForm.js
index b1ca4c6..0acb7a0 100644
--- a/src/components/form/AddForm.js
+++ b/src/components/form/AddForm.js
@@ -146,10 +146,17 @@ class AddForm extends Component {
   };
 
   removeElement = (index) => {
-    // console.log(this.state.formElements)
+    // console.log(this.state.formElements);
+
     confirmAlert({
-      title: LANG.CONFIRM_TO_REMOVE,
-      message: LANG.ARE_YOU_SURE_YOU_WANT_TO_DO_THIS,
+      title:
+        this.state.formElements[index] === "heading"
+          ? LANG.HEADING_REMOVAL_WARNING
+          : LANG.CONFIRM_TO_REMOVE,
+      message:
+        this.state.formElements[index] === "heading"
+          ? LANG.CONFIRM_TO_REMOVE_2
+          : LANG.ARE_YOU_SURE_YOU_WANT_TO_DO_THIS,
       buttons: [
         {
           label: LANG.REMOVE,
diff --git a/src/constants/LangConstants.ts b/src/constants/LangConstants.ts
index 5d3a4c3..42189d3 100644
--- a/src/constants/LangConstants.ts
+++ b/src/constants/LangConstants.ts
@@ -52,4 +52,6 @@ export const LANG = {
   CANCEL: "Cancel",
   REMOVE: "Remove",
   CONFIRM_TO_REMOVE: "Confirm to remove",
+  HEADING_REMOVAL_WARNING: "Are you sure deleting the header?",
+  CONFIRM_TO_REMOVE_2: "This action will move the question section to the general header category.",
 };
-- 
GitLab