Skip to content

Commit

Permalink
CEGEP modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
JayanthyChengan committed Apr 16, 2024
1 parent e311ccc commit 2b9f1bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,10 @@ public boolean isDisabled(Type t) {
public List<String> getAffiliationList() {
affiliationList.clear();
ResourceBundle bundle = BundleUtil.getResourceBundle("affiliation");
affiliationList = affiliationServiceBean.getValues(bundle);

affiliationList.stream().filter(str -> !str.equals("true")); // Skip "true"
affiliationList = affiliationServiceBean.getValues(bundle).stream()
.filter(str -> !str.equals("true")) // Skip "true"
.collect(Collectors.toList()); // Collect into a new list

affiliationList.sort((String o1, String o2) -> {
o1 = Normalizer.normalize(o1, Normalizer.Form.NFD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,23 @@ public void setAffiliationGroups(List<AffiliationGroup> affiliationGroups) {
public List<String> getAffiliationList() {
ResourceBundle bundle = BundleUtil.getResourceBundle("affiliation", new Locale("en"));
List<String> values = affiliationServiceBean.getValues(bundle);

List<String> filteredList = values.stream()
.filter(str -> !str.equals("true")) // Skip "true"
.collect(Collectors.toList()); // Collect into a new list


if (affiliationGroups.isEmpty()) {
affiliationGroups = affGroupProvider.getAffiliationGroups();
}
List<String> existing = affiliationGroups.stream().map(a -> a.getDisplayName()).collect(Collectors.toList());
values.stream().filter(str -> !str.equals("true")); // Skip "true"
values.removeAll(existing);
values.sort((String o1, String o2) -> {
filteredList.removeAll(existing);
filteredList.sort((String o1, String o2) -> {
o1 = Normalizer.normalize(o1, Normalizer.Form.NFD);
o2 = Normalizer.normalize(o2, Normalizer.Form.NFD);
return o1.compareTo(o2);
});
return values;
return filteredList;
}
/**
* Pager for when user list exceeds the number of display rows
Expand Down

0 comments on commit 2b9f1bb

Please sign in to comment.