Skip to content

Commit

Permalink
MID-4277 Click-through from assignment to object
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Dec 27, 2018
1 parent 6718592 commit ee51784
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
Expand Up @@ -143,6 +143,7 @@ public class GuiStyleConstants {
public static final String CLASS_STOP_MENU_ITEM = "fa fa-stop";
public static final String CLASS_START_MENU_ITEM = "fa fa-play";
public static final String CLASS_IMPORT_MENU_ITEM = "fa fa-download";
public static final String CLASS_NAVIGATE_ARROW = "fa fa-share";

public static final String CLASS_BUTTON_TOGGLE_OFF = "btn-default";
public static final String CLASS_BUTTON_TOGGLE_ON = "btn-info";
Expand Down
Expand Up @@ -23,10 +23,7 @@
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel;
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanelWithDetailsPanel;
import com.evolveum.midpoint.gui.impl.session.ObjectTabStorage;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.PrismContainerDefinition;
import com.evolveum.midpoint.prism.PrismContainerValue;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.*;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.prism.query.*;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
Expand Down Expand Up @@ -85,6 +82,7 @@ public class AssignmentPanel extends BasePanel<ContainerWrapper<AssignmentType>>

private static final String DOT_CLASS = AssignmentPanel.class.getName() + ".";
protected static final String OPERATION_LOAD_ASSIGNMENTS_LIMIT = DOT_CLASS + "loadAssignmentsLimit";
protected static final String OPERATION_LOAD_ASSIGNMENTS_TARGET_OBJ = DOT_CLASS + "loadAssignmentsTargetRefObject";

protected int assignmentsRequestsLimit = -1;
private List<ContainerValueWrapper<AssignmentType>> detailsPanelAssignmentsList = new ArrayList<>();
Expand Down Expand Up @@ -668,6 +666,41 @@ public InlineMenuItemAction initAction() {
return getMultivalueContainerListPanel().createEditColumnAction();
}
});
menuItems.add(new ButtonInlineMenuItem(createStringResource("AssignmentPanel.viewTargetObject")) {
private static final long serialVersionUID = 1L;

@Override
public String getButtonIconCssClass() {
return GuiStyleConstants.CLASS_NAVIGATE_ARROW;
}

@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<ContainerValueWrapper<AssignmentType>>() {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
ContainerValueWrapper<AssignmentType> assignmentContainer = getRowModel().getObject();
PropertyOrReferenceWrapper targetRef = assignmentContainer.findPropertyWrapper(assignmentContainer.getPath()
.append(AssignmentType.F_TARGET_REF));

if (targetRef != null && targetRef.getValues() != null && targetRef.getValues().size() > 0) {
ValueWrapper refWrapper = (ValueWrapper)targetRef.getValues().get(0);
PrismReferenceValue refValue = (PrismReferenceValue)refWrapper.getValue();
ObjectReferenceType ort = new ObjectReferenceType();
ort.setupReferenceValue(refValue);
WebComponentUtil.dispatchToObjectDetailsPage(ort, AssignmentPanel.this, false);
}
}
};
}

@Override
public boolean isHeaderMenuItem(){
return false;
}
});
return menuItems;
}

Expand Down
Expand Up @@ -3495,6 +3495,7 @@ roleMemberPanel.relation=Relation
chooseMemberForOrgPopup.otherTypesLabel=Others
AssignmentPanel.newAssignmentParameters=Parameters
AssignmentPanel.allLabel=All
AssignmentPanel.viewTargetObject=View target object
SearchPanel.more=More...
SearchPanel.add=Add
SearchPanel.close=Close
Expand Down

0 comments on commit ee51784

Please sign in to comment.