Skip to content

Commit

Permalink
FKS-676 #comment removed deployment to api in CD.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Erling Jahr committed Feb 29, 2024
1 parent 7d14e5e commit 967c6fd
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 57 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ jobs:
include:
- org: fintlabs-no
cluster: aks-beta-fint-2021-11-23
- org: ofk-no
cluster: aks-api-fint-2022-02-08
- org: afk-no
cluster: aks-api-fint-2022-02-08
- org: bfk-no
cluster: aks-api-fint-2022-02-08
# - org: ofk-no
# cluster: aks-api-fint-2022-02-08
# - org: afk-no
# cluster: aks-api-fint-2022-02-08
# - org: bfk-no
# cluster: aks-api-fint-2022-02-08

steps:
- name: Checkout repository
Expand Down
97 changes: 46 additions & 51 deletions src/main/java/no/fintlabs/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ private Runnable onSaveNewUser(User user) {
private Consumer<User> onSaveExistingUser(User user) {
return existingUser -> {
user.setId(existingUser.getId());
//log.info("Update user: " + user.getId());
log.debug("Update user: " + user.getId());
memberService.process(memberService.create(user));
User savedUser = userRepository.save(user);
//log.info("update kontrollUser: " + savedUser.getIdentityProviderUserObjectId());
log.debug("update kontrollUser: " + savedUser.getIdentityProviderUserObjectId());
userEntityProducerService.publish(savedUser);
};
}
Expand Down Expand Up @@ -85,50 +85,50 @@ public Optional<User> getUserById(Long id) {
}


public List<SimpleUser> getSimpleUsers(
FintJwtEndUserPrincipal principal,
String search,
List<String> orgUnits,
String userType) {

List<User> users;


if ((orgUnits == null) && !(userType.equals("ALLTYPES"))) {
users = userRepository.findUsersByNameType(search, userType);
return users
.stream()
.filter(user -> user.getStatus().equals("ACTIV"))
.map(User::toSimpleUser)
.toList();
}

if ((orgUnits != null) && (userType.equals("ALLTYPES"))) {
users = userRepository.findUsersByNameOrg(search, orgUnits);
return users
.stream()
.filter(user -> user.getStatus().equals("ACTIV"))
.map(User::toSimpleUser)
.toList();
}

if ((orgUnits == null) && (userType.equals("ALLTYPES"))) {
users = userRepository.findUsersByName(search);
return users
.stream()
.filter(user -> user.getStatus().equals("ACTIV"))
.map(User::toSimpleUser)
.toList();
}


users = userRepository.findUsersByNameOrgType(search, orgUnits, userType);
return users
.stream()
.filter(user -> user.getStatus().equals("ACTIV"))
.map(User::toSimpleUser)
.toList();
}
// public List<SimpleUser> getSimpleUsers(
// FintJwtEndUserPrincipal principal,
// String search,
// List<String> orgUnits,
// String userType) {
//
// List<User> users;
//
//
// if ((orgUnits == null) && !(userType.equals("ALLTYPES"))) {
// users = userRepository.findUsersByNameType(search, userType);
// return users
// .stream()
// .filter(user -> user.getStatus().equals("ACTIV"))
// .map(User::toSimpleUser)
// .toList();
// }
//
// if ((orgUnits != null) && (userType.equals("ALLTYPES"))) {
// users = userRepository.findUsersByNameOrg(search, orgUnits);
// return users
// .stream()
// .filter(user -> user.getStatus().equals("ACTIV"))
// .map(User::toSimpleUser)
// .toList();
// }
//
// if ((orgUnits == null) && (userType.equals("ALLTYPES"))) {
// users = userRepository.findUsersByName(search);
// return users
// .stream()
// .filter(user -> user.getStatus().equals("ACTIV"))
// .map(User::toSimpleUser)
// .toList();
// }
//
//
// users = userRepository.findUsersByNameOrgType(search, orgUnits, userType);
// return users
// .stream()
// .filter(user -> user.getStatus().equals("ACTIV"))
// .map(User::toSimpleUser)
// .toList();
// }


public List<SimpleUser> getSimpleUsersUsingSpec(
Expand All @@ -137,12 +137,7 @@ public List<SimpleUser> getSimpleUsersUsingSpec(
String userType
){
UserSpesificationBuilder userSpesification = new UserSpesificationBuilder(search,orgUnits,userType);

List<User> userList = userRepository.findAll(userSpesification.build());
// .stream()
// .filter(user -> user.getStatus().equals("ACTIV"))
// .map(User::toSimpleUser)
// .toList();

return userList.stream()
.filter(user -> user.getStatus().equals("ACTIV"))
Expand Down

0 comments on commit 967c6fd

Please sign in to comment.