Skip to content

Commit

Permalink
fix: Fix displaying inaccessible application - MEED-7411 - Meeds-io/M…
Browse files Browse the repository at this point in the history
…IPs#156

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.
  • Loading branch information
boubaker committed Sep 3, 2024
1 parent 917998e commit 128c13e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 128c13e

Please sign in to comment.