Skip to content

Commit

Permalink
little improvement of My assignments items description
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed May 31, 2017
1 parent 21cd420 commit dff7b6f
Showing 1 changed file with 12 additions and 7 deletions.
Expand Up @@ -592,16 +592,21 @@ private AssignmentItemDto createAssignmentItem(PrismObject<UserType> user,
String name = WebComponentUtil.getDisplayNameOrName(value);
AssignmentEditorDtoType type = AssignmentEditorDtoType.getType(value.getCompileTimeClass());
String relation = refValue.getRelation() != null ? refValue.getRelation().getLocalPart() : null;
String description = "";
if (OrgType.class.isAssignableFrom(value.getCompileTimeClass())) {
description = (String) value.getPropertyRealValue(OrgType.F_IDENTIFIER, String.class);
}
description = (description != null && !description.equals("null") ? description + " " : "") + (value.getValue().asObjectable() instanceof ObjectType ?
((ObjectType) value.getValue().asObjectable()).getDescription() : "");

return new AssignmentItemDto(type, name, description, relation);
return new AssignmentItemDto(type, name, getAssignmentDescription(value), relation);
}

private String getAssignmentDescription(PrismObject value){
Object orgIdentifier = null;
if (OrgType.class.isAssignableFrom(value.getCompileTimeClass())) {
orgIdentifier = value.getPropertyRealValue(OrgType.F_IDENTIFIER, String.class);
}
String description = (orgIdentifier != null ? orgIdentifier + " " : "") +
(value.asObjectable() instanceof ObjectType && value.asObjectable().getDescription() != null ?
value.asObjectable().getDescription() : "");
return description;
}

private UserInterfaceElementVisibilityType getComponentVisibility(PredefinedDashboardWidgetId componentId){
if (adminGuiConfig == null || adminGuiConfig.getUserDashboard() == null) {
return UserInterfaceElementVisibilityType.AUTOMATIC;
Expand Down

0 comments on commit dff7b6f

Please sign in to comment.