From 3dc48f0894f2b142b8aca55647bbc97e3c2da75b Mon Sep 17 00:00:00 2001 From: Paul Grey Date: Wed, 30 Nov 2022 17:41:15 -0500 Subject: [PATCH] NIFI-10916 - Controller Service allowable values dropdown list should be sorted Signed-off-by: Nathan Gough This closes #6739. --- .../src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index d28f9d93a2..2039eab5a2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -4225,7 +4225,6 @@ public final class DtoFactory { } else { final List allowableValues = new ArrayList<>(); final List controllerServiceIdentifiers = new ArrayList<>(controllerServiceProvider.getControllerServiceIdentifiers(serviceDefinition, groupId)); - Collections.sort(controllerServiceIdentifiers, Collator.getInstance(Locale.US)); for (final String serviceIdentifier : controllerServiceIdentifiers) { final ControllerServiceNode service = controllerServiceProvider.getControllerServiceNode(serviceIdentifier); final boolean isServiceAuthorized = service.isAuthorized(authorizer, RequestAction.READ, NiFiUserUtils.getNiFiUser()); @@ -4236,6 +4235,7 @@ public final class DtoFactory { allowableValue.setValue(serviceIdentifier); allowableValues.add(entityFactory.createAllowableValueEntity(allowableValue, isServiceAuthorized)); } + allowableValues.sort(Comparator.comparing(e -> e.getAllowableValue().getDisplayName())); dto.setAllowableValues(allowableValues); } } else { @@ -4247,7 +4247,7 @@ public final class DtoFactory { allowableValueDto.setDescription(allowableValue.getDescription()); allowableValues.add(entityFactory.createAllowableValueEntity(allowableValueDto, true)); } - + allowableValues.sort(Comparator.comparing(e -> e.getAllowableValue().getDisplayName())); dto.setAllowableValues(allowableValues); }