-
Notifications
You must be signed in to change notification settings - Fork 262
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
#616 added modal on icon click #747
Conversation
@@ -93,6 +93,7 @@ export interface MakeBucketRequest { | |||
} | |||
|
|||
export interface ChangePasswordRequest { | |||
//selected_user: object; |
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.
if this line is not needed, remove it
restapi/user_account.go
Outdated
// changeUserPassword validate current current user password and if it's correct set the new password | ||
// WHAT SHOULD IT DO? just set the new password, assuming this is for locked out users, current password may be unknown, only Admin users can use this function, should it use 2factor/email? | ||
func changeUserPassword(ctx context.Context, client MinioAdmin, session *models.Principal, currentSecretKey, newSecretKey string) error { | ||
if session.AccountSecretKey != currentSecretKey { |
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.
we probably don't have the user's current password, so we shouldn't require this field
bindata.go
Outdated
@@ -0,0 +1,10 @@ | |||
|
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.
please remove this file
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.
any bindata file mnust be removed from this PR
183d23c
to
0511abf
Compare
interface IChangePasswordProps { | ||
classes: any; | ||
open: boolean; | ||
// selectedUser: User | null; |
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.
We can remove this line
const ChangePassword = ({ | ||
classes, | ||
open, | ||
//selectedUser, |
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.
We can remove this line if not needed
setLoading(true); | ||
|
||
let request: ChangeUserPasswordRequest = { | ||
//selected_user: selectedUser, |
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.
We can remove this line
.invoke("POST", "/api/v1/account/change-user-password", request) | ||
.then((res) => { | ||
setLoading(false); | ||
// setSelectedUser(""); |
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.
We can remove this line
loading || | ||
!( | ||
newPassword.length > 0 && | ||
reNewPassword.length > 0 |
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.
we can add another condition to disable the button if passwords don't match
reNewPassword.length > 0 | |
reNewPassword.length > 0 && newPassword !== reNewPassword |
@@ -189,7 +189,7 @@ const Groups = ({ classes, setErrorSnackMessage }: IGroupsProps) => { | |||
<Grid item xs={12} className={classes.container}> | |||
<Grid item xs={12} className={classes.actionsTray}> | |||
<TextField | |||
placeholder="Search Groups" | |||
placeholder="Search " |
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 think this label should not be removed
Please review:
|
430c00b
to
5957b75
Compare
restapi/admin_users.go
Outdated
} | ||
// user credentials are updated at this point, we need to generate a new admin client and authenticate using | ||
// the new credentials | ||
//credentials, err := getConsoleCredentials(ctx, accessKey, newSecretKey) |
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.
remove commented code if not needed
add icon to Users page to change password commit work to date to github for ongoing use add modal with fields for current and new password on icon click missing swagger files remove unneeded files move changeUserPassword to admin_api, remove field for current password, include selected user Please enter the commit message for your changes. Lines starting added missing js files asset and function signature formatting changes
selectedUser to modal text
…emoved commented out code
add icon to Users page to change password commit work to date to github for ongoing use add modal with fields for current and new password on icon click missing swagger files remove unneeded files move changeUserPassword to admin_api, remove field for current password, include selected user Please enter the commit message for your changes. Lines starting added missing js files asset and function signature formatting changes
selectedUser to modal text
5c7108a
to
a158acb
Compare
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.
Tested Works
Upon clicking the pencil icon, a modal opens with fields for current password, new password, and to reenter the new password. The modal is largely a copy of the ChangePassword modal, and requires further modification to pass the selected user, and change the selected users password.
fixes https://github.com/miniohq/engineering/issues/3