From 59cb62025701191f55e4feeac8898070fcd576c5 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 3 Sep 2024 11:28:57 +0100 Subject: [PATCH] fix: Fix displaying inaccessible application - MEED-7411 - Meeds-io/MIPs#156 (#205) Prior to this change, when adding a not accessible application inside a page using a dynamic container (with access permissions that the user is not member of), then a 'null' string is displayed instead of displaying an empty content. This change, ensures to not display the application at all and even hide the parent element to not have an additional padding. --- .../src/main/webapp/vue-app/common/js/ApplicationUtils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layout-webapp/src/main/webapp/vue-app/common/js/ApplicationUtils.js b/layout-webapp/src/main/webapp/vue-app/common/js/ApplicationUtils.js index 4054fa12e..eb630e675 100644 --- a/layout-webapp/src/main/webapp/vue-app/common/js/ApplicationUtils.js +++ b/layout-webapp/src/main/webapp/vue-app/common/js/ApplicationUtils.js @@ -201,6 +201,10 @@ export function handleApplicationContent(applicationContent, applicationElement) const newHtmlDocument = document.createElement('div'); newHtmlDocument.innerHTML = newBodyContent; const portletContent = newHtmlDocument.querySelector('.UIWorkingWorkspace .PORTLET-FRAGMENT'); + if (!portletContent) { + applicationElement.classList.add('hidden'); + return; + } const oldPortletContent = applicationElement.querySelector('.PORTLET-FRAGMENT'); if (oldPortletContent) { oldPortletContent.remove();