fix all differents only for all elements

This commit is contained in:
Michele Artini 2020-10-30 11:51:52 +01:00
parent 8f5eacb409
commit 502f28dfd3
2 changed files with 3 additions and 3 deletions

View File

@ -200,14 +200,14 @@ public class DatabaseUtils {
@Cacheable("vocs")
public List<VocabularyTerm> listValuesOfVocabularyTable(final VocabularyTable table) {
final String sql = "select val as value, name as name from " + table;
final String sql = "select val as value, name as name from " + table + " order by name";
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VocabularyTerm.class));
}
@Cacheable("countries_for_user")
public List<VocabularyTerm> listCountriesForUser(final String name) {
final String sql =
"select uc.country as value, c.name as name from user_countries uc left outer join countries c on (c.val = uc.country) where uc.email = ?";
"select uc.country as value, c.name as name from user_countries uc left outer join countries c on (c.val = uc.country) where uc.email = ? order by c.name";
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VocabularyTerm.class), name);
}

View File

@ -38,7 +38,7 @@
<div class="card-footer" ng-show="selectedOrgs.length > 0">
<button type="button" class="btn btn-sm btn-secondary" ng-click="reset()" ng-show="selectedOrgs.length > 0">reset</button>
<div class="btn-group float-right" ng-show="selectedOrgs.length > 1">
<button type="button" class="btn btn-sm btn-danger" ng-click="invalidateGroup()">all differents</button>
<button type="button" class="btn btn-sm btn-danger" ng-click="invalidateGroup()" ng-show="selectedOrgs.length == orgs.length">all differents</button>
<button type="button" class="btn btn-sm btn-primary" ng-click="mergeGroup()">merge</button>
</div>
</div>