Skip to content

Commit

Permalink
avniproject/avni-webapp#1214 - use comma as user group separator. err…
Browse files Browse the repository at this point in the history
…or message change.
  • Loading branch information
petmongrels committed May 23, 2024
1 parent a18b4d9 commit f990b30
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void write(List<? extends Row> rows) throws Exception {
private void strictWriter(Row row, List<String> allErrorMsgs) throws Exception {
Map<String, String> nonEmptyLocations = new LinkedHashMap<>();
for (String header : row.getHeaders()) {
if(this.locationTypeNames.contains(header) && !S.isEmpty(row.get(header))) {
if (this.locationTypeNames.contains(header) && !S.isEmpty(row.get(header))) {
nonEmptyLocations.put(header, row.get(header));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void write(Row row) throws Exception {

AddressLevel location = locationRepository.findByTitleLineageIgnoreCase(fullAddress)
.orElseThrow(() -> new Exception(format(
"Provided Location does not exist. Please check for spelling mistakes '%s'", fullAddress)));
"Provided Location does not exist in Avni. Please add it or check for spelling mistakes '%s'", fullAddress)));

Catchment catchment = catchmentService.createOrUpdate(catchmentName, location);
Organisation organisation = UserContextHolder.getUserContext().getOrganisation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void addToGroups(User user, String groupsSpecified) {
return;
}

String[] groupNames = Strings.split(groupsSpecified, '|');
String[] groupNames = Strings.split(groupsSpecified, ',');
Arrays.stream(groupNames).distinct().forEach(groupName -> {
if (!StringUtils.hasLength(groupName.trim())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ public void isValid() {
public void getInvalidMessage() {
assertEquals("Invalid phone number. CountryCode:91, NationalNumber:11111111", PhoneNumberUtil.getInvalidMessage("+9111111111"));
assertEquals("Invalid phone number. CountryCode:91, NationalNumber:2829", PhoneNumberUtil.getInvalidMessage("+91 2829"));
assertEquals("The string supplied did not seem to be a phone number.", PhoneNumberUtil.getInvalidMessage(""));
}
}

0 comments on commit f990b30

Please sign in to comment.