- Notifications
You must be signed in to change notification settings - Fork928
Add reset user password action#1320
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
… bq/update-user-password
codecovbot commentedMay 6, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## main #1320 +/- ##==========================================+ Coverage 58.09% 66.48% +8.39%========================================== Files 282 284 +2 Lines 18521 18569 +48 Branches 231 235 +4 ==========================================+ Hits 10759 12345 +1586+ Misses 6601 4959 -1642- Partials 1161 1265 +104
Continue to review full report at Codecov.
|
export const Language = { | ||
createUserSuccess: "Successfully created user.", | ||
suspendUserSuccess: "Successfully suspended the user.", | ||
suspendUserError: "Error on suspend the user", | ||
suspendUserError: "Error on suspend the user.", |
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.
nice catch
| { type: "SUSPEND_USER"; userId: TypesGen.User["id"] } | ||
| { type: "CONFIRM_USER_SUSPENSION" } | ||
| { type: "CANCEL_USER_SUSPENSION" } | ||
// Reset password events | ||
| { type: "RESET_USER_PASSWORD"; userId: TypesGen.User["id"] } |
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.
I like how you useTypesGen.User["id"]
, we should do that more
const navigate = useNavigate() | ||
const userToBeSuspended = users?.find((u) => u.id === userIdToSuspend) | ||
const userToResetPassword = users?.find((u) => u.id === userIdToResetPassword) |
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.
In the future we may want to find a way to make the XService give the component the user instead of the user id, but this is fine for now.
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, I've been wondering about that, instead of passing a userId, we could just send the full user object to make things easier but it makes it hard to sync, if we need it, in case the same user is updated by any other action. Using the ID we keep the reference to the user in the list which is always updated since it is the source of the truth. Makes sense?
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.
Looks great!
Closes#733