NIFI-10916 - Controller Service allowable values dropdown list should be sorted

Signed-off-by: Nathan Gough <thenatog@gmail.com>

This closes #6739.
This commit is contained in:
Paul Grey 2022-11-30 17:41:15 -05:00 committed by Nathan Gough
parent ab7ce58fb1
commit 3dc48f0894
1 changed files with 2 additions and 2 deletions

View File

@ -4225,7 +4225,6 @@ public final class DtoFactory {
} else {
final List<AllowableValueEntity> allowableValues = new ArrayList<>();
final List<String> 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);
}