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 (#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.
  • Loading branch information
boubaker committed Sep 5, 2024
1 parent bef3d7a commit 59cb620
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 59cb620

Please sign in to comment.