Skip to content

Commit

Permalink
more bugfixes for attorney ui
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Oct 30, 2017
1 parent a78ccd4 commit 4aa32e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
Expand Up @@ -1406,6 +1406,7 @@ protected List<SideBarMenuItem> createMenuItems() {
}

if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_MY_WORK_ITEMS_URL,
AuthorizationConstants.AUTZ_UI_ATTORNEY_WORK_ITEMS_URL,
AuthorizationConstants.AUTZ_UI_APPROVALS_ALL_URL, AuthorizationConstants.AUTZ_GUI_ALL_URL,
AuthorizationConstants.AUTZ_GUI_ALL_DEPRECATED_URL)) {
if (getWorkflowManager().isEnabled()) {
Expand Down
Expand Up @@ -78,6 +78,11 @@ public class PageAttorneySelection extends PageBase {
private static final String ID_TABLE = "table";

public PageAttorneySelection() {
this(null);
}

public PageAttorneySelection(PageParameters parameters) {
super(parameters);
}

@Override
Expand Down
Expand Up @@ -26,8 +26,6 @@
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.component.wf.WorkItemsPanel;
Expand All @@ -39,7 +37,7 @@
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -69,9 +67,9 @@ public abstract class PageWorkItems extends PageAdminWorkItems {
private static final String ID_APPROVE = "approve";
private static final String ID_REJECT = "reject";

private WorkItemsPageType workItemsType;
private WorkItemsPageType workItemsType;

private IModel<PrismObject<UserType>> donorModel;
private IModel<PrismObject<UserType>> donorModel;

public PageWorkItems(WorkItemsPageType workItemsType) {
this.workItemsType = workItemsType;
Expand Down Expand Up @@ -103,7 +101,7 @@ private void initLayout(IModel<PrismObject<UserType>> donorModel) {
new WorkItemDtoProvider(PageWorkItems.this, workItemsType, donorModel),
UserProfileStorage.TableId.PAGE_WORK_ITEMS,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_WORK_ITEMS),
WorkItemsPanel.View.FULL_LIST);
WorkItemsPanel.View.FULL_LIST);

panel.setOutputMarkupId(true);
mainForm.add(panel);
Expand Down Expand Up @@ -184,7 +182,13 @@ public void onClick(AjaxRequestTarget target) {
}

private void backPerformed(AjaxRequestTarget target) {
setResponsePage(PageAttorneySelection.class);
PageParameters parameters = new PageParameters();

String oid = donorModel.getObject().getOid();
parameters.add(OnePageParameterEncoder.PARAMETER, oid);

PageAttorneySelection back = new PageAttorneySelection(parameters);
setResponsePage(back);
}

private boolean isSomeItemSelected(List<WorkItemDto> items, AjaxRequestTarget target) {
Expand Down Expand Up @@ -229,7 +233,7 @@ private void approveOrRejectWorkItemsPerformed(AjaxRequestTarget target, boolean
showResult(mainResult);

resetWorkItemCountModel();
target.add(this);
target.add(this);
}

private void claimWorkItemsPerformed(AjaxRequestTarget target) {
Expand Down Expand Up @@ -259,8 +263,8 @@ private void claimWorkItemsPerformed(AjaxRequestTarget target) {

showResult(mainResult);

resetWorkItemCountModel();
target.add(this);
resetWorkItemCountModel();
target.add(this);
}

private void releaseWorkItemsPerformed(AjaxRequestTarget target) {
Expand Down Expand Up @@ -290,7 +294,7 @@ private void releaseWorkItemsPerformed(AjaxRequestTarget target) {

showResult(mainResult);

resetWorkItemCountModel();
target.add(this);
resetWorkItemCountModel();
target.add(this);
}
}
Expand Up @@ -226,7 +226,7 @@ public class AuthorizationConstants {
//Approvals (workflows)
public static final String AUTZ_UI_APPROVALS_ALL_URL = NS_AUTHORIZATION_UI + "#approvalsAll";
public static final String AUTZ_UI_MY_WORK_ITEMS_URL = NS_AUTHORIZATION_UI + "#myWorkItems";
public static final String AUTZ_UI_ATTORNEY_WORK_ITEMS_URL = NS_AUTHORIZATION_UI + "#myWorkItems";
public static final String AUTZ_UI_ATTORNEY_WORK_ITEMS_URL = NS_AUTHORIZATION_UI + "#attorneyWorkItems";
public static final String AUTZ_UI_CLAIMABLE_WORK_ITEMS_URL = NS_AUTHORIZATION_UI + "#claimableWorkItems";
public static final String AUTZ_UI_ALL_WORK_ITEMS_URL = NS_AUTHORIZATION_UI + "#allWorkItems";
public static final String AUTZ_UI_WORK_ITEM_URL = NS_AUTHORIZATION_UI + "#workItem";
Expand Down

0 comments on commit 4aa32e9

Please sign in to comment.