Skip to content

Commit

Permalink
Sort org root tabs by displayOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Fedonin committed Jul 3, 2017
1 parent 2f2d526 commit d634ff0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ private List<PrismObject<OrgType>> loadOrgRoots() {
try {
ObjectQuery query = ObjectQueryUtil.createRootOrgQuery(getPageBase().getPrismContext());
list = getPageBase().getModelService().searchObjects(OrgType.class, query, null, task, result);
// Sort org roots by displayOrder, if not set push the org to the end
list.sort((o1, o2) -> (o1.getRealValue().getDisplayOrder() == null ? Integer.MAX_VALUE : o1.getRealValue().getDisplayOrder())
- (o2.getRealValue().getDisplayOrder() == null ? Integer.MAX_VALUE : o2.getRealValue().getDisplayOrder()));

if (list.isEmpty()) {
warn(getString("PageOrgTree.message.noOrgStructDefined"));
Expand Down

0 comments on commit d634ff0

Please sign in to comment.