Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Aug 31, 2021
2 parents a232910 + 2c2ae08 commit 10d5510
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,6 @@ private void initCartButton(WebMarkupContainer mainHeader) {
AjaxButton cartButton = new AjaxButton(ID_CART_BUTTON) {
private static final long serialVersionUID = 1L;

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}

@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
navigateToNext(new PageAssignmentsList(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ private SideBarMenuItem createSelfServiceMenu(boolean experimentalFeaturesEnable
SideBarMenuItem menu = new SideBarMenuItem("PageAdmin.menu.selfService", experimentalFeaturesEnabled);
menu.addMainMenuItem(createMainMenuItem("PageAdmin.menu.selfDashboard", GuiStyleConstants.CLASS_ICON_DASHBOARD,
PageSelfDashboard.class));
PageParameters pageParameters = new PageParameters();
pageParameters.add(OnePageParameterEncoder.PARAMETER, WebModelServiceUtils.getLoggedInFocusOid());
menu.addMainMenuItem(createMainMenuItem("PageAdmin.menu.profile", GuiStyleConstants.CLASS_ICON_PROFILE,
WebComponentUtil.resolveSelfPage()));
WebComponentUtil.resolveSelfPage(), pageParameters));
menu.addMainMenuItem(createMainMenuItem("PageAdmin.menu.credentials", GuiStyleConstants.CLASS_ICON_CREDENTIALS,
PageSelfCredentials.class));
if (WebModelServiceUtils.getLoggedInFocus() instanceof UserType) {
Expand Down Expand Up @@ -683,6 +685,10 @@ private MainMenuItem createMainMenuItem(String key, String icon, Class<? extends
return new MainMenuItem(key, icon, page);
}

private MainMenuItem createMainMenuItem(String key, String icon, Class<? extends PageBase> page, PageParameters params) {
return new MainMenuItem(key, icon, page, params);
}

public List<SideBarMenuItem> getItems() {
SideBarMenuPanel sideBarMenuPanel = (SideBarMenuPanel) get(ID_MENU);
return sideBarMenuPanel.getModelObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ protected PrismObjectWrapper<O> load() {
WrapperContext ctx = new WrapperContext(task, result);
ctx.setCreateIfEmpty(true);
ctx.setContainerPanelConfigurationType(detailsPageConfigurationModel.getObject().getPanel());
if (isReadonly()) {
ctx.setReadOnly(isReadonly());
}
try {
return factory.createObjectWrapper(prismObject, isEditUser(prismObject) ? ItemStatus.NOT_CHANGED : ItemStatus.ADDED, ctx);
} catch (SchemaException e) {
Expand Down Expand Up @@ -266,4 +269,8 @@ public LoadableModel<GuiObjectDetailsPageType> getObjectDetailsPageConfiguration
public O getObjectType() {
return getPrismObject().asObjectable();
}

protected boolean isReadonly() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.evolveum.midpoint.gui.impl.page.admin.cases;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType;


public class CaseDetailsModels extends AssignmentHolderDetailsModel<CaseType> {

private static final Trace LOGGER = TraceManager.getTrace(FocusDetailsModels.class);
private static final String DOT_CLASS = FocusDetailsModels.class.getName() + ".";

public CaseDetailsModels(LoadableModel<PrismObject<CaseType>> prismObjectModel, PageBase serviceLocator) {
super(prismObjectModel, serviceLocator);
}

@Override
protected boolean isReadonly() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ protected Class<CaseType> getType() {
protected Panel createSummaryPanel(String id, LoadableModel<CaseType> summaryModel) {
return new CaseSummaryPanel(id, summaryModel, this);
}

@Override
protected AssignmentHolderDetailsModel<CaseType> createObjectDetailsModels() {
return new CaseDetailsModels(createPrismObejctModel(), this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ public void onClick(AjaxRequestTarget target) {
addExpressionPerformed(target, expressionType);
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.BUBBLE);
}
};
add(select);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
package com.evolveum.midpoint.web.component;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.ajax.AjaxChannel;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
Expand Down Expand Up @@ -45,4 +47,12 @@ protected void onComponentTag(ComponentTag tag) {
tag.setType(XmlTag.TagType.OPEN);
}
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.BUBBLE);
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.evolveum.midpoint.util.annotation.Experimental;
import com.evolveum.midpoint.web.security.util.SecurityUtils;

import org.apache.wicket.request.mapper.parameter.PageParameters;

/**
* @author Viliam Repan (lazyman)
*/
Expand All @@ -35,8 +37,11 @@ public MainMenuItem(String name, String iconClass) {
}

public MainMenuItem(String name, String iconClass, Class<? extends PageBase> page) {
super(name, iconClass, page, null);
this(name, iconClass, page, null);
}

public MainMenuItem(String name, String iconClass, Class<? extends PageBase> page, PageParameters params) {
super(name, iconClass, page, params);
}

private List<MenuItem> getItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ public boolean isVisible() {
.createStringResource("PageAssignmentDetails.addToCartButton")) {
private static final long serialVersionUID = 1L;

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}

@Override
public void onClick(AjaxRequestTarget target) {
AssignmentEditorDto dto = AssignmentEditorDto.createDtoFromObject(getObject().asObjectable(), UserDtoStatus.ADD, parentPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,6 @@ private void initButtonsPanel(WebMarkupContainer parametersPanel) {
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
AbstractShoppingCartTabPanel.this.addAllAssignmentsPerformed(ajaxRequestTarget);
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.BUBBLE);
}
};
addAllButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
Expand All @@ -327,11 +321,6 @@ public boolean isEnabled() {
AjaxButton goToShoppingCartButton = new AjaxButton(ID_GO_TO_SHOPPING_CART_BUTTON, createStringResource("AbstractShoppingCartTabPanel.goToShoppingCartButton")) {
private static final long serialVersionUID = 1L;

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}

@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
AbstractShoppingCartTabPanel.this.getPageBase().navigateToNext(new PageAssignmentsList(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ public void onClick(AjaxRequestTarget target) {
}
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.BUBBLE);
}

};
requestAssignments.add(new VisibleEnableBehaviour() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public PageUserSelfProfile() {

}

//TODO is this even used??
public PageUserSelfProfile(PageParameters parameters) {
super(parameters);
}
Expand Down

0 comments on commit 10d5510

Please sign in to comment.