Skip to content

Commit

Permalink
MID-6181 After forwarding approval work item it is not clear to whom …
Browse files Browse the repository at this point in the history
…it was forwarded to
  • Loading branch information
KaterynaHonchar committed Apr 15, 2020
1 parent dac53f1 commit e26f820
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Expand Up @@ -46,8 +46,8 @@ protected void initLayout(UserProfileStorage.TableId tableId, int pageSize) {
List<IColumn<DecisionDto, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.user"), DecisionDto.F_USER));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.attorney"), DecisionDto.F_ATTORNEY));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.originalActor"), DecisionDto.F_ORIGINAL_ACTOR));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.originalAssignee"), DecisionDto.F_ORIGINAL_ASSIGNEE));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.assigneeChange"), DecisionDto.F_ASSIGNEE_CHANGE));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.stage"), DecisionDto.F_STAGE));
columns.add(createOutcomeColumn());
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.comment"), DecisionDto.F_COMMENT));
Expand Down Expand Up @@ -84,7 +84,7 @@ public String getCssClass() {

private String choose(IModel<DecisionDto> rowModel, String inProgress, String forwarded, String approved, String rejected) {
DecisionDto dto = rowModel.getObject();
if (StringUtils.isNotEmpty(dto.getOriginalAssignee())){
if (StringUtils.isNotEmpty(dto.getAssigneeChange())){
return forwarded;
}
if (dto.getOutcome() == null) {
Expand Down
Expand Up @@ -19,6 +19,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.Date;
import java.util.List;

/**
* @author lazyman
Expand All @@ -27,7 +28,7 @@ public class DecisionDto extends Selectable {

public static final String F_USER = "user";
public static final String F_ATTORNEY = "attorney";
public static final String F_ORIGINAL_ACTOR = "originalActor";
public static final String F_ASSIGNEE_CHANGE = "assigneeChange";
public static final String F_ORIGINAL_ASSIGNEE = "originalAssignee";
public static final String F_STAGE = "stage";
public static final String F_OUTCOME = "outcome";
Expand All @@ -37,8 +38,8 @@ public class DecisionDto extends Selectable {

private String user;
private String attorney;
private String originalActor;
private String originalAssignee;
private String assigneeChange;
private String stage;
private Boolean outcome;
private String comment;
Expand All @@ -57,14 +58,14 @@ public String getAttorney() {
return attorney;
}

public String getOriginalActor() {
return originalActor;
}

public String getOriginalAssignee() {
return originalAssignee;
}

public String getAssigneeChange() {
return assigneeChange;
}

public String getStage() {
return stage;
}
Expand Down Expand Up @@ -115,16 +116,18 @@ public static DecisionDto create(CaseEventType e, @Nullable PageBase pageBase) {
rv.escalationLevelNumber = ApprovalContextUtil.getEscalationLevelNumber(completionEvent);
if (completionEvent.getOriginalAssigneeRef() != null && pageBase != null) {
// TODO optimize repo access
rv.originalActor = WebModelServiceUtils.resolveReferenceName(completionEvent.getOriginalAssigneeRef(), pageBase);
rv.originalAssignee = WebModelServiceUtils.resolveReferenceName(completionEvent.getOriginalAssigneeRef(), pageBase);
}
return rv;
} else if (e instanceof WorkItemDelegationEventType){
WorkItemDelegationEventType event = (WorkItemDelegationEventType) e;
ObjectReferenceType origAssigneeRef = CollectionUtils.isNotEmpty(event.getAssigneeBefore()) ? event.getAssigneeBefore().get(0) : null;
if (event.getComment() != null){
rv.comment = event.getComment();
}
rv.originalAssignee = origAssigneeRef != null ? WebModelServiceUtils.resolveReferenceName(origAssigneeRef, pageBase) : null;

String assigneeBeforeNamesList = WebComponentUtil.getReferencedObjectDisplayNamesAndNames(event.getAssigneeBefore(), false);
String assigneeAfterNamesList = WebComponentUtil.getReferencedObjectDisplayNamesAndNames(event.getDelegatedTo(), false);
rv.assigneeChange = assigneeBeforeNamesList + " -> " + assigneeAfterNamesList;
return rv;
} else if (e instanceof StageCompletionEventType) {
StageCompletionEventType completion = (StageCompletionEventType) e;
Expand Down

0 comments on commit e26f820

Please sign in to comment.