Skip to content
Snippets Groups Projects
Commit 52df13f4 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #611 - "all accounts" should be on top of account select

parent fbccec62
Branches
Tags
No related merge requests found
......@@ -46,26 +46,26 @@ public class AccountService implements Resettable, AccessAllEntities<Account>
@Override
public List<Account> getAllEntitiesAsc()
{
List<Account> accounts = accountRepository.findAllByType(AccountType.ALL);
accounts.addAll(accountRepository.findAllByTypeOrderByNameAsc(AccountType.CUSTOM));
final List<Account> accounts = accountRepository.findAllByTypeOrderByNameAsc(AccountType.CUSTOM);
accounts.sort((a1, a2) -> new NaturalOrderComparator().compare(a1.getName(), a2.getName()));
accounts.addAll(0, accountRepository.findAllByType(AccountType.ALL));
return accounts;
}
public List<Account> getAllActivatedAccountsAsc()
{
List<Account> accounts = accountRepository.findAllByType(AccountType.ALL);
accounts.addAll(accountRepository.findAllByTypeAndAccountStateOrderByNameAsc(AccountType.CUSTOM, AccountState.FULL_ACCESS));
List<Account> accounts = accountRepository.findAllByTypeAndAccountStateOrderByNameAsc(AccountType.CUSTOM, AccountState.FULL_ACCESS);
accounts.sort((a1, a2) -> new NaturalOrderComparator().compare(a1.getName(), a2.getName()));
accounts.addAll(0, accountRepository.findAllByType(AccountType.ALL));
return accounts;
}
public List<Account> getAllReadableAccounts()
{
List<Account> accounts = accountRepository.findAllByType(AccountType.ALL);
accounts.addAll(accountRepository.findAllByTypeAndAccountStateOrderByNameAsc(AccountType.CUSTOM, AccountState.FULL_ACCESS));
List<Account> accounts = accountRepository.findAllByTypeAndAccountStateOrderByNameAsc(AccountType.CUSTOM, AccountState.FULL_ACCESS);
accounts.addAll(accountRepository.findAllByTypeAndAccountStateOrderByNameAsc(AccountType.CUSTOM, AccountState.READ_ONLY));
accounts.sort((a1, a2) -> new NaturalOrderComparator().compare(a1.getName(), a2.getName()));
accounts.addAll(0, accountRepository.findAllByType(AccountType.ALL));
return accounts;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment