Skip to content

Commit

Permalink
composited icon panel title
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 1, 2021
1 parent e0b61bb commit c55aef1
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public static DisplayType getAssignmentObjectRelationDisplayType(PageBase pageBa
}

String typeTitle = "";
String typeValue = "";
if (CollectionUtils.isNotEmpty(assignmentTargetRelation.getArchetypeRefs())) {
OperationResult result = new OperationResult(pageBase.getClass().getSimpleName() + "." + "loadArchetypeObject");
try {
Expand All @@ -108,6 +109,7 @@ public static DisplayType getAssignmentObjectRelationDisplayType(PageBase pageBa
archetypeDisplayType.getLabel().getOrig() :
(archetype.getName() != null && StringUtils.isNotEmpty(archetype.getName().getOrig()) ?
archetype.getName().getOrig() : null);
typeValue = archetypeTooltip;
typeTitle = StringUtils.isNotEmpty(archetypeTooltip) ?
pageBase.createStringResource("abstractRoleMemberPanel.withType", archetypeTooltip).getString() : "";
}
Expand All @@ -117,7 +119,8 @@ public static DisplayType getAssignmentObjectRelationDisplayType(PageBase pageBa
} else if (CollectionUtils.isNotEmpty(assignmentTargetRelation.getObjectTypes())) {
QName type = !CollectionUtils.isEmpty(assignmentTargetRelation.getObjectTypes()) ?
assignmentTargetRelation.getObjectTypes().get(0) : null;
String typeName = type != null ? pageBase.createStringResource("ObjectTypeLowercase." + type.getLocalPart()).getString() : null;
String typeName = type != null ? pageBase.createStringResource("ObjectType." + type.getLocalPart()).getString() : null;
typeValue = typeName;
typeTitle = StringUtils.isNotEmpty(typeName) ?
pageBase.createStringResource("abstractRoleMemberPanel.withType", typeName).getString() : "";
}
Expand All @@ -140,17 +143,17 @@ public static DisplayType getAssignmentObjectRelationDisplayType(PageBase pageBa
displayType.getIcon().setCssClass(def.getDisplay().getIcon().getCssClass());
displayType.getIcon().setColor(def.getDisplay().getIcon().getColor());
}
displayType.setLabel(def.getDisplay().getLabel());
}
if (displayType.getLabel() != null) {
relationValue = WebComponentUtil.getTranslatedPolyString(displayType.getLabel());
if (def.getDisplay().getLabel() != null) {
relationValue = WebComponentUtil.getTranslatedPolyString(def.getDisplay().getLabel());
} else {
String relationKey = "RelationTypes." + RelationTypes.getRelationTypeByRelationValue(relation);
relationValue = pageBase.createStringResource(relationKey).getString();
if (StringUtils.isEmpty(relationValue) || relationKey.equals(relationValue)) {
relationValue = relation.getLocalPart();
}
}
displayType.setLabel(new PolyStringType(typeValue + " " + relationValue));

relationTitle = pageBase.createStringResource("abstractRoleMemberPanel.withRelation", relationValue).getString();

Expand Down

0 comments on commit c55aef1

Please sign in to comment.