From d0a650873bb9dd913532cfac3212c8d6efdda458 Mon Sep 17 00:00:00 2001 From: Sara Boutej <40363501+SaraBoutej@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:47:45 +0100 Subject: [PATCH] feat: No additional margin when hidden app - MEED-2924-Meeds-io/MIPs#103 (#3195) This change allow to add a new data attribute to check if all steps in the gattingStarted portlet are done so we add hidden class to the app parent. (cherry picked from commit e24b613bbdbf4d810e39c17ecafa62c2b05eda0b) --- .../main/webapp/WEB-INF/jsp/portlet/gettingStarted.jsp | 2 +- .../src/main/webapp/vue-apps/getting-started/main.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/webapp/portlet/src/main/webapp/WEB-INF/jsp/portlet/gettingStarted.jsp b/webapp/portlet/src/main/webapp/WEB-INF/jsp/portlet/gettingStarted.jsp index 9e593180e28..08afb05266f 100644 --- a/webapp/portlet/src/main/webapp/WEB-INF/jsp/portlet/gettingStarted.jsp +++ b/webapp/portlet/src/main/webapp/WEB-INF/jsp/portlet/gettingStarted.jsp @@ -25,7 +25,7 @@ } %>
-
+
diff --git a/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js b/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js index 35f9625b4d4..645bc9e5b6c 100644 --- a/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js +++ b/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js @@ -17,9 +17,8 @@ if (parentAppElement) { hideGettingStarted().then(() => parentElementToHide.classList.add('hidden')); }); }; -} else { - const parentElementToHide = document.querySelector('#GettingStartedPortlet'); - if (parentElementToHide) { - parentElementToHide.closest('.PORTLET-FRAGMENT').classList.add('hidden'); - } +} +const parentElementToHide = document.querySelector('#GettingStartedPortlet'); +if (parentElementToHide && parentElementToHide.dataset.canClose === 'true') { + parentElementToHide.closest('.PORTLET-FRAGMENT').classList.add('hidden'); }