Skip to content

Commit

Permalink
cases/workitems summary panel cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 7, 2019
1 parent 1baaee6 commit fea7efe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
Expand Up @@ -128,22 +128,6 @@ public String getObject() {
};
}

@Override
protected ObjectReferenceType getReferencedObjectToNavigate(){
if (getModelObject() == null || CaseTypeUtil.getCase(getModelObject()) == null){
return null;
}
ObjectReferenceType caseReference = new ObjectReferenceType();
caseReference.setOid(CaseTypeUtil.getCase(getModelObject()).getOid());
caseReference.setType(CaseType.COMPLEX_TYPE);
return caseReference;
}

@Override
protected IModel<String> getReferenceObjectTitleModel(){
return createStringResource("CaseWorkItemSummaryPanel.viewParentCaseButton");
}

@Override
protected IModel<String> getTitle2Model() {
return new IModel<String>() {
Expand Down
Expand Up @@ -45,7 +45,7 @@
</td>
<td class="col-md-9"><span wicket:id="approver"/></td>
</tr>
<tr>
<tr wicket:id="parentCaseContainer">
<td class="col-md-3">
<wicket:message key="workItemPanel.parentCase"/>
</td>
Expand Down
Expand Up @@ -70,6 +70,7 @@ public class WorkItemDetailsPanel extends BasePanel<CaseWorkItemType>{
private static final String ID_REQUESTED_BY = "requestedBy";
private static final String ID_REQUESTED_FOR = "requestedFor";
private static final String ID_APPROVER = "approver";
private static final String ID_PARENT_CASE_CONTAINER = "parentCaseContainer";
private static final String ID_PARENT_CASE = "parentCase";
private static final String ID_TARGET = "target";
private static final String ID_REASON = "reason";
Expand Down Expand Up @@ -140,12 +141,16 @@ public AssignmentHolderType getObject() {
approver.setOutputMarkupId(true);
add(approver);

WebMarkupContainer parentCaseContainer = new WebMarkupContainer(ID_PARENT_CASE_CONTAINER);
parentCaseContainer.add(new VisibleBehaviour(() -> getPageBase() instanceof PageCaseWorkItem));
parentCaseContainer.setOutputMarkupId(true);
add(parentCaseContainer);

IconedObjectNamePanel parentCaseLink = new IconedObjectNamePanel(ID_PARENT_CASE,
getModelObject() != null && CaseTypeUtil.getCase(getModelObject()) != null ?
Model.of(CaseTypeUtil.getCase(getModelObject())) : Model.of());
parentCaseLink.add(new VisibleBehaviour(() -> getPageBase() instanceof PageCaseWorkItem));
parentCaseLink.setOutputMarkupId(true);
add(parentCaseLink);
parentCaseContainer.add(parentCaseLink);

IconedObjectNamePanel target = new IconedObjectNamePanel(ID_TARGET,
WorkItemTypeUtil.getTargetReference(getModelObject()));
Expand Down

0 comments on commit fea7efe

Please sign in to comment.