Skip to content

Commit

Permalink
fix: Remove old way of portlet height definition - MEED-7550 - Meeds-…
Browse files Browse the repository at this point in the history
…io/meeds#2428 (#983)

Prior to this change, the old height attribute defined in portlets was
applied on the whole block of the portlet. This change will cancel this
style application for portlets retrieved using the new layout management
system so that it still be applied on old pages designed with old system
but not applied on pages applied using the new layout.
  • Loading branch information
boubaker committed Oct 5, 2024
1 parent b2590fd commit ebfcefc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
String windowHeight = uicomponent.getHeight();

String cssStyle = "";
if (windowHeight != null || windowWidth != null) {
if ((windowHeight != null || windowWidth != null) && !rcontext.isMaximizePortlet()) {
if (windowWidth != null) {
cssStyle += "width: "+ windowWidth +";";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,6 @@ public void setShowPortletMode(Boolean b) {
showPortletMode = b;
}

/**
* Used internally by portal to change current state
* if portlet is in portal or in page
*/
public void setPortletInPortal(boolean b) {
portletInPortal_ = b;
}

/**
* Check if portlet is in portal
* @return true if portlet is in portal
*/
public boolean isPortletInPortal() {
return portletInPortal_;
}

/**
* Theme is composed of map between theme name and skin name.
* Theme format: {skinName}:{themeName}::{anotherSkin}:{anotherTheme}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ public static void toUIPage(UIPage uiPage, Page model) throws Exception {

List<UIPortlet> portlets = new ArrayList<>();
uiPage.findComponentOfType(portlets, UIPortlet.class);
for (UIPortlet portlet : portlets) {
portlet.setPortletInPortal(false);
}
}

public static void toUIPortal(UIPortal uiPortal, PortalConfig model) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,11 +1186,11 @@ private boolean isRefreshPage(RequestNavigationData requestNavData) {
}

private boolean isDraftPage() {
return ((PortalRequestContext) RequestContext.getCurrentInstance()).isDraftPage();
return PortalRequestContext.getCurrentInstance().isDraftPage();
}

public boolean isMaximizePortlet() {
return StringUtils.isNotBlank(PortalRequestContext.getCurrentInstance().getMaximizedPortletId());
return PortalRequestContext.getCurrentInstance().isMaximizePortlet();
}

public String getMaximizedPortletId() {
Expand Down

0 comments on commit ebfcefc

Please sign in to comment.