Skip to content

Commit

Permalink
some improvements for work item details
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jun 24, 2019
1 parent 05bc5cc commit 85f7bb9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
Expand Up @@ -17,9 +17,9 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="col-md-4">
<div class="col-md-1" wicket:id="icon" />
<div class="col-md-10" wicket:id="name" />
<div>
<div class="pull-left" wicket:id="icon" />
<div style="padding-left: 20px;" wicket:id="name" />
</div>
</wicket:panel>
</html>
Expand Up @@ -23,6 +23,7 @@
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.web.component.data.column.ColumnUtils;
import com.evolveum.midpoint.web.component.data.column.ImagePanel;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand Down Expand Up @@ -84,9 +85,16 @@ private void initLayout(){
setOutputMarkupId(true);

DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType(referencedObjectModel.getObject(), getPageBase());
if (displayType == null){
displayType = new DisplayType();
}
if (displayType.getIcon() == null){
displayType.setIcon(WebComponentUtil.createIconType(WebComponentUtil.createDefaultBlackIcon(
WebComponentUtil.classToQName(getPageBase().getPrismContext(), referencedObjectModel.getObject().getClass()))));
}
ImagePanel imagePanel = new ImagePanel(ID_ICON, displayType);
imagePanel.setOutputMarkupId(true);
imagePanel.add(new VisibleBehaviour(() -> displayType != null && displayType.getIcon() != null && StringUtils.isNotEmpty(displayType.getIcon().getCssClass())));
// imagePanel.add(new VisibleBehaviour(() -> displayType != null && displayType.getIcon() != null && StringUtils.isNotEmpty(displayType.getIcon().getCssClass())));
add(imagePanel);

Label nameLabel = new Label(ID_NAME, Model.of(WebComponentUtil.getEffectiveName(referencedObjectModel.getObject(), AbstractRoleType.F_DISPLAY_NAME)));
Expand Down
Expand Up @@ -35,24 +35,23 @@
<td class="col-md-9"><span wicket:id="requestedFor"/></td>
</tr>
<tr>
<td>
<td class="col-md-3">
<wicket:message key="workItemPanel.target"/>
</td>
<td><span wicket:id="target"/></td>
<td class="col-md-9"><span wicket:id="target"/></td>
</tr>
<tr>
<td>
<td class="col-md-3">
<wicket:message key="workItemPanel.reason"/>
</td>
<td><b><span wicket:id="reason"/></b></td>
<td class="col-md-9"><span wicket:id="reason"/></td>
</tr>
<tr>
<td class="col-md-3">
<wicket:message key="workItemPanel.requesterComment"/>
</td>
<td class="col-md-9" style="max-width: 600px; word-wrap: break-word;"><span wicket:id="requesterCommentMessage"/></td>
</tr>
<!--<tr>-->
<!--<td>-->
<!--<wicket:message key="workItemPanel.requesterComment"/>-->
<!--</td>-->
<!--<td style="max-width: 600px; word-wrap: break-word;"><b><span wicket:id="requesterCommentMessage"/></b>-->
<!--</td>-->
<!--</tr>-->
</table>
</div>
</div>
Expand Down
Expand Up @@ -26,9 +26,13 @@
import com.evolveum.midpoint.web.component.data.IconedObjectNamePanel;
import com.evolveum.midpoint.web.component.prism.show.SceneDto;
import com.evolveum.midpoint.web.component.prism.show.ScenePanel;
import com.evolveum.midpoint.web.page.admin.workflow.dto.WorkItemDto;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

/**
* Created by honchar
Expand Down Expand Up @@ -88,6 +92,8 @@ private void initLayout(){
target.setOutputMarkupId(true);
add(target);

add(new Label(ID_COMMENT, CaseTypeUtil.getRequesterComment(CaseTypeUtil.getCase(getModelObject()))));

CaseType parentCase = CaseTypeUtil.getCase(getModelObject());
EvaluatedTriggerGroupListPanel reasonPanel = new EvaluatedTriggerGroupListPanel(ID_REASON,
Model.ofList(WebComponentUtil.computeTriggers(parentCase != null ? parentCase.getApprovalContext() : null,
Expand All @@ -97,6 +103,5 @@ private void initLayout(){

add(new ScenePanel(ID_DELTAS_TO_APPROVE, sceneModel));


}
}
Expand Up @@ -23,6 +23,7 @@
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationBusinessContextType;
import org.jetbrains.annotations.NotNull;

import javax.xml.datatype.XMLGregorianCalendar;
Expand Down Expand Up @@ -63,4 +64,9 @@ public static boolean isClosed(CaseType aCase) {
public static XMLGregorianCalendar getStartTimestamp(CaseType aCase) {
return aCase != null && aCase.getMetadata() != null ? aCase.getMetadata().getCreateTimestamp() : null;
}

public static String getRequesterComment(CaseType aCase) {
OperationBusinessContextType businessContext = ApprovalContextUtil.getBusinessContext(aCase);
return businessContext != null ? businessContext.getComment() : null;
}
}

0 comments on commit 85f7bb9

Please sign in to comment.