Skip to content

Commit

Permalink
my requests dashboard widget fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 18, 2022
1 parent 1eaeecb commit 605bd75
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (C) 2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.web.page.admin.cases;

import com.evolveum.midpoint.authentication.api.util.AuthUtil;
import com.evolveum.midpoint.cases.api.util.QueryUtils;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.prism.query.ObjectFilter;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.page.admin.server.CasesTablePanel;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;


@PanelType(name = "myRequests")
public class MyCasesPanel extends CasesTablePanel {

private static final long serialVersionUID = 1L;

public MyCasesPanel(String id, AssignmentHolderDetailsModel model, ContainerPanelConfigurationType configurationType) {
super(id, configurationType);
}

protected ObjectFilter getCasesFilter(){
return QueryUtils.filterForMyRequests(getPrismContext().queryFor(CaseType.class),
AuthUtil.getPrincipalUser().getOid())
.desc(ItemPath.create(CaseType.F_METADATA, MetadataType.F_CREATE_TIMESTAMP))
.buildFilter();
}

@Override
protected UserProfileStorage.TableId getTableId() {
return null;
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Collection;
import java.util.List;

import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;

import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
Expand All @@ -31,7 +30,6 @@
/**
* @author lskublik
*/
@PanelType(name = "myRequests")
public abstract class CasesTablePanel extends MainObjectListPanel<CaseType> {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@
</icon>
</display>
<target>
<targetUrl>/self/profile/user</targetUrl>
<panelIdentifier>focusCases</panelIdentifier>
<targetUrl>/admin/casesAll</targetUrl>
<collectionIdentifier>my-cases</collectionIdentifier>
</target>
</action>
<panelType>focusCases</panelType>
<panelType>myRequests</panelType>
<previewSize>5</previewSize>
</widget>
<widget>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@
<identifier>listResourcesWidget</identifier>
<visibility>hidden</visibility>
</widget>
<widget>
<identifier>myRequests</identifier>
<action>
<identifier>viewAll</identifier>
<visibility>hidden</visibility>
</action>
</widget>
</homePage>
<selfProfilePage>
<type>UserType</type>
Expand Down

0 comments on commit 605bd75

Please sign in to comment.