diff --git a/force-app/main/default/classes/CON_ContactMerge_CTRL.cls b/force-app/main/default/classes/CON_ContactMerge_CTRL.cls index a1198f982d6..a50fde50472 100644 --- a/force-app/main/default/classes/CON_ContactMerge_CTRL.cls +++ b/force-app/main/default/classes/CON_ContactMerge_CTRL.cls @@ -264,6 +264,11 @@ public with sharing class CON_ContactMerge_CTRL { */ public Map ariaNameMap { get; private set; } + /*********************************************************************************************** + * @description Map to store Contact Duplicate Rule Ids and status + */ + public Map duplicateRuleStatusMap { get; set; } + /*********************************************************************************************** * @description List of readonly fields */ @@ -442,6 +447,11 @@ public with sharing class CON_ContactMerge_CTRL { showDRSButton = true; loadMergePage = false; showDRS = false; + duplicateRuleStatusMap = new Map(); + + for (DuplicateRule duplicateRule : [SELECT Id, isActive FROM DuplicateRule WHERE SObjectType = 'Contact']) { + duplicateRuleStatusMap.put(duplicateRule.Id, duplicateRule.isActive); + } if (!hasContactObjectDeletePermission()) { canContinueWithMerge = false; diff --git a/force-app/main/default/pages/CON_ContactMerge.page b/force-app/main/default/pages/CON_ContactMerge.page index 4f42b6c60db..740ef0292be 100644 --- a/force-app/main/default/pages/CON_ContactMerge.page +++ b/force-app/main/default/pages/CON_ContactMerge.page @@ -73,6 +73,17 @@ causing unwanted spaces to appear in output. this fixes that */ display: inline-flex; } + /* Tooltip hover effect */ + .slds-icon_container:hover .slds-popover_tooltip { + display: block !important; + visibility: visible !important; + opacity: 1 !important; + } + .slds-popover_tooltip { + pointer-events: auto; /* Allow pointer events for the tooltip */ + user-select: text; /* Allow text selection */ + cursor: text; /* Show text cursor */ + } - {!$objectType.DuplicateRecordSet.fields.DuplicateRuleId.label} + {!SUBSTITUTE($objectType.DuplicateRecordSet.fields.DuplicateRuleId.label, ' ID', '')} {!$Label.commonContactCount} @@ -207,9 +218,41 @@ - - - +
+ +
+ + + + + + +
+
+ + + +
@@ -603,5 +646,71 @@ } } } + document.addEventListener("DOMContentLoaded", function () { + const infoIcons = document.querySelectorAll(".slds-icon_container"); + + infoIcons.forEach(icon => { + const tooltip = icon.querySelector(".slds-popover_tooltip"); + + if (tooltip) { + icon.addEventListener("mouseenter", function () { + tooltip.style.display = "block"; + tooltip.style.visibility = "visible"; + tooltip.style.opacity = "1"; + }); + + icon.addEventListener("mouseleave", function () { + setTimeout(() => { + // Hide the tooltip only if the mouse has left both the icon and the tooltip + if (!tooltip.matches(":hover")) { + tooltip.style.opacity = "0"; + tooltip.style.visibility = "hidden"; + tooltip.style.display = "none"; + } + }, 200); + }); + + tooltip.addEventListener("mouseenter", function () { + // Keep the tooltip visible when hovering over the tooltip itself + tooltip.style.opacity = "1"; + tooltip.style.visibility = "visible"; + tooltip.style.display = "block"; + }); + + tooltip.addEventListener("mouseleave", function () { + tooltip.style.opacity = "0"; + tooltip.style.visibility = "hidden"; + setTimeout(() => { + tooltip.style.display = "none"; + }, 200); + }); + + // Keyboard focus event (focus and blur) + icon.addEventListener("focus", function () { + tooltip.style.display = "block"; + tooltip.style.visibility = "visible"; + tooltip.style.opacity = "1"; + }); + + icon.addEventListener("blur", function () { + tooltip.style.opacity = "0"; + tooltip.style.visibility = "hidden"; + setTimeout(() => { + tooltip.style.display = "none"; + }, 200); + }); + // Close tooltip and remove focus when clicking on tooltip text + tooltip.addEventListener("click", function (e) { + tooltip.style.opacity = "0"; + tooltip.style.visibility = "hidden"; + setTimeout(() => { + tooltip.style.display = "none"; + }, 200); + // Remove focus from the icon + icon.blur(); + }); + } + }); + });