-
Notifications
You must be signed in to change notification settings - Fork 363
chore: convert user to userdetails refactoring #21441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
…om:dhis2/dhis2-core into chore/use-userdetails-in-bundles # Conflicts: # dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/user/UserServiceTest.java
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
…serdetails-in-user-query-params
Signed-off-by: Morten Svanaes <[email protected]>
…om:dhis2/dhis2-core into chore/use-userdetails-in-bundles
…his2-core into chore/more-usercredentials-refactor
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
Fixed
Show fixed
Hide fixed
Signed-off-by: Morten Svanaes <[email protected]>
Signed-off-by: Morten Svanaes <[email protected]>
…usercredentials-refactor
…usercredentials-refactor
…2/dhis2-core into chore/more-usercredentials-refactor
Signed-off-by: Morten Svanaes <[email protected]>
…usercredentials-refactor
@@ -550,6 +550,9 @@ Map<String, Optional<Locale>> findNotifiableUsersWithPasswordLastUpdatedBetween( | |||
*/ | |||
UserDetails createUserDetails(String userUid) throws NotFoundException; | |||
|
|||
@CheckForNull | |||
UserDetails createUserDetailsSafe(@Nonnull String userUid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to use the UID
type, especially for new methods, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, would be great to do a big refactor just for that. Feels right to do that after UserDetails are mostly done.
|
@@ -495,6 +502,8 @@ public WebMessage replicateUser(@PathVariable String uid, HttpServletRequest req | |||
return conflict(result.getErrorMessage()); | |||
} | |||
|
|||
Session session = entityManager.unwrap(Session.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the entity manager and session at the controller layer feels a bit wrong. It kind of hints that this should be done at the service level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, totally. We should refactor this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple of small comments left
Summary:
Refactoring the use of User to UserDetails, this PR focuses to eliminate the use of UserDetails.fromUser() method, which usually means UserDetails can be used of properly refactored from the top, typically the controller.