Skip to content

Commit

Permalink
show user display name in workitem detail and wf preview
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-lizner committed Dec 13, 2019
1 parent b9c2a7b commit 89a631a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -108,8 +108,7 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
nameLink.setOutputMarkupId(true);
add(nameLink);

Label nameLinkText = new Label(ID_NAME_TEXT, Model.of(WebComponentUtil.getEffectiveName(referencedObjectModel.getObject(),
AbstractRoleType.F_DISPLAY_NAME)));
Label nameLinkText = new Label(ID_NAME_TEXT, Model.of(WebComponentUtil.getDisplayName(referencedObjectModel.getObject().asPrismObject())));
nameLinkText.setOutputMarkupId(true);
nameLink.add(nameLinkText);

Expand Down
Expand Up @@ -212,7 +212,7 @@ private String getStageNameLabel(ApprovalStageExecutionInformationDto stage, int

private String getApproverLabel(String labelKey, ObjectReferenceType ref) {
if (ref != null) {
return getString(labelKey) + ": " + WebComponentUtil.getName(ref);
return getString(labelKey) + ": " + WebComponentUtil.getDisplayName(ref);
} else {
return "";
}
Expand Down
Expand Up @@ -547,7 +547,12 @@ public static PolyStringType getDisplayName(ObjectType object) {
if (object instanceof AbstractRoleType) {
return ((AbstractRoleType) object).getDisplayName();
} else if (object instanceof UserType) {
return ((UserType) object).getFullName();
PolyStringType userFullName = ((UserType) object).getFullName();
if (userFullName != null && !userFullName.isEmpty()) {
return userFullName.plus(" (").plus(object.getName()).plus(")");
} else {
return object.getName();
}
} else {
return null;
}
Expand Down

0 comments on commit 89a631a

Please sign in to comment.