Skip to content

Commit

Permalink
SAK-49768 Portal gateway no indicator which page the user is actually…
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaljaykam authored Apr 22, 2024
1 parent 2e18bd7 commit 7ea36d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public class SiteHandler extends WorksiteHandler
private static final boolean SAK_PROP_SHOW_SITE_LABELS_DFLT = true;

private static final long AUTO_FAVORITES_REFRESH_INTERVAL_MS = 30000;
private static final String SELECTED_PAGE_PROP = "selectedPage";

protected ProfileImageLogic imageLogic;
private org.sakaiproject.coursemanagement.api.CourseManagementService cms = (org.sakaiproject.coursemanagement.api.CourseManagementService) ComponentManager.get(org.sakaiproject.coursemanagement.api.CourseManagementService.class);
Expand Down Expand Up @@ -519,7 +518,7 @@ public void doSite(HttpServletRequest req, HttpServletResponse res, Session sess

PreferencesService.commit(prefs);
} catch (Exception any) {
log.warn("Exception caught whilst setting {} property: {}", SELECTED_PAGE_PROP, any.toString());
log.warn("Exception caught whilst setting expanded navigation or theme properties: {}", any.toString());
}
}

Expand Down Expand Up @@ -589,21 +588,12 @@ public void doSite(HttpServletRequest req, HttpServletResponse res, Session sess

rcontext.put("showSiteLabels",ServerConfigurationService.getBoolean(SAK_PROP_SHOW_SITE_LABELS, SAK_PROP_SHOW_SITE_LABELS_DFLT));

rcontext.put("activePageId", page.getId());

addLocale(rcontext, site, session.getUserId());

addTimeInfo(rcontext);

if (userId != null) {
try {
PreferencesEdit prefs = PreferencesService.edit(userId);
ResourcePropertiesEdit props = prefs.getPropertiesEdit(org.sakaiproject.user.api.PreferencesService.SITENAV_PREFS_KEY);
props.addProperty(SELECTED_PAGE_PROP, page.getId());
PreferencesService.commit(prefs);
} catch (Exception any) {
log.warn("Exception caught whilst setting {} property: {}", SELECTED_PAGE_PROP, any.toString());
}
}

includeSiteNav(rcontext, req, session, siteId, toolId);

includeWorksite(rcontext, res, req, session, site, page, toolContextPath,
Expand Down Expand Up @@ -946,7 +936,6 @@ else if (allowroleswap)
boolean sidebarCollapsed = false;
boolean currentExpanded = false;
String expandedSite = siteId;
String selectedPage = "";
boolean toolMaximised = false;

if (loggedIn)
Expand Down Expand Up @@ -980,7 +969,6 @@ else if (allowroleswap)
log.warn("Exception caught whilst getting currentExpanded: {}", any.toString());
}

selectedPage = props.getProperty(SELECTED_PAGE_PROP);

try {
toolMaximised = props.getBooleanProperty("toolMaximised");
Expand All @@ -996,7 +984,6 @@ else if (allowroleswap)
if (expandedSite.equals(siteId)) {
rcontext.put(PortalConstants.PROP_CURRENT_EXPANDED, Boolean.valueOf(currentExpanded));
}
rcontext.put(SELECTED_PAGE_PROP, selectedPage);
rcontext.put("toolMaximised", Boolean.valueOf(toolMaximised));

SiteView siteView = portal.getSiteHelper().getSitesView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#macro( pageListItem $page $url $icon $indentation)

<li class="nav-item" tabindex="1">
<a class="btn btn-nav w-100 ps-${indentation} #if ($selectedPage == $page.id)selected-page#end" data-page-id="${page.id}"
<a class="btn btn-nav w-100 ps-${indentation} #if ($activePageId == $page.id)selected-page#end" data-page-id="${page.id}"
href="$!{url}"
title="${page.title}: ${page.description}">
<div class="d-flex text-start align-items-center">
Expand Down

0 comments on commit 7ea36d3

Please sign in to comment.