Skip to content

Commit

Permalink
MID-7877 fixed breadcrumbs handling in system config UI
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Apr 8, 2022
1 parent e918445 commit 1125370
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,8 @@ private boolean isObjectCollectionMenuActive(CompiledObjectCollectionView object
return collectionNameParam.toString().equals(objectView.getViewIdentifier());
}


private void createSystemConfigurationMenu(SideBarMenuItem item) {
MainMenuItem system = createMainMenuItem("PageAdmin.menu.top.configuration.basic", "fa fa-cog", com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.PageSystemConfiguration.class);
MainMenuItem system = createMainMenuItem("PageAdmin.menu.top.configuration.basic", GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON, com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.PageSystemConfiguration.class);
PageBase page = getPageBase();
if (page != null && PageBaseSystemConfiguration.class.isAssignableFrom(page.getClass())) {

Expand All @@ -640,57 +639,6 @@ private void createSystemConfigurationMenu(SideBarMenuItem item) {
system.addMenuItem(menuItem);
}
item.addMainMenuItem(system);

// MainMenuItem systemConfigMenu = createMainMenuItem("PageAdmin.menu.top.configuration.basic", "fa fa-cog");
// createSystemConfigurationTabMebu(systemConfigMenu);
// item.addMainMenuItem(systemConfigMenu);
}

private void createSystemConfigurationTabMebu(MainMenuItem systemConfigMenu) {
// MenuItem menu = new MenuItem("System NEW", PageSystemConfigurationNew.class);
// systemConfigMenu.addMenuItem(menu);

addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.basic",
PageSystemConfiguration.CONFIGURATION_TAB_BASIC);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.objectPolicy",
PageSystemConfiguration.CONFIGURATION_TAB_OBJECT_POLICY);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.globalPolicyRule",
PageSystemConfiguration.CONFIGURATION_TAB_GLOBAL_POLICY_RULE);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.globalAccountSynchronization",
PageSystemConfiguration.CONFIGURATION_TAB_GLOBAL_ACCOUNT_SYNCHRONIZATION);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.cleanupPolicy",
PageSystemConfiguration.CONFIGURATION_TAB_CLEANUP_POLICY);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.notifications",
PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.logging",
PageSystemConfiguration.CONFIGURATION_TAB_LOGGING);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.profiling",
PageSystemConfiguration.CONFIGURATION_TAB_PROFILING);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.adminGui",
PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.workflow",
PageSystemConfiguration.CONFIGURATION_TAB_WORKFLOW);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.roleManagement",
PageSystemConfiguration.CONFIGURATION_TAB_ROLE_MANAGEMENT);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.internals",
PageSystemConfiguration.CONFIGURATION_TAB_INTERNALS);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.deploymentInformation",
PageSystemConfiguration.CONFIGURATION_TAB_DEPLOYMENT_INFORMATION);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.accessCertification",
PageSystemConfiguration.CONFIGURATION_TAB_ACCESS_CERTIFICATION);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.infrastructure",
PageSystemConfiguration.CONFIGURATION_TAB_INFRASTRUCTURE);
addSystemMenuItem(systemConfigMenu, "PageAdmin.menu.top.configuration.fullTextSearch",
PageSystemConfiguration.CONFIGURATION_TAB_FULL_TEXT_SEARCH);
}

private void addSystemMenuItem(MainMenuItem mainItem, String key, int tabIndex) {
PageParameters params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, tabIndex);

boolean isTabActive = classMatches(PageSystemConfiguration.class) && tabIndex == getSelectedTabForConfiguration(getPageBase());
MenuItem menu = new MenuItem(key, PageSystemConfiguration.class, params, isTabActive);
mainItem.addMenuItem(menu);
}

private int getSelectedTabForConfiguration(WebPage page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor;
import com.evolveum.midpoint.authentication.api.authorization.Url;
import com.evolveum.midpoint.authentication.api.util.AuthConstants;
import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder;
import com.evolveum.midpoint.gui.impl.component.icon.IconCssStyle;
Expand All @@ -22,6 +23,7 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.CompositedIconButtonDto;
import com.evolveum.midpoint.web.component.MultiCompositedButtonPanel;
import com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb;
import com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

Expand Down Expand Up @@ -119,6 +121,14 @@ public PageSystemConfiguration() {
initLayout();
}

@Override
protected void createBreadcrumb() {
super.createBreadcrumb();

Breadcrumb bc = getLastBreadcrumb();
bc.setIcon(new Model(GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON));
}

private void initLayout() {
List<CompositedIconButtonDto> buttons = Arrays.stream(SubPage.values())
.map(s -> createCompositedButton(s.getIcon(), s.getPage())).collect(Collectors.toUnmodifiableList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.page;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractPageObjectDetails;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails;
import com.evolveum.midpoint.gui.impl.page.admin.component.AssignmentHolderOperationalButtonsPanel;
Expand All @@ -20,13 +20,15 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.ObjectSummaryPanel;
import com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb;
import com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import javax.xml.namespace.QName;
Expand All @@ -51,6 +53,17 @@ public PageBaseSystemConfiguration(final PrismObject<SystemConfigurationType> ob
super(object);
}

@Override
protected void onConfigure() {
super.onConfigure();

clearBreadcrumbs();

IModel<String> model = createStringResource("PageAdmin.menu.top.configuration.basic");
addBreadcrumb(new Breadcrumb(model, new Model(GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON), PageSystemConfiguration.class, null));
createBreadcrumb();
}

@Override
public Class<SystemConfigurationType> getType() {
return SystemConfigurationType.class;
Expand Down

0 comments on commit 1125370

Please sign in to comment.