Skip to content
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

Merged
merged 7 commits into from
Jun 3, 2021
Merged

Conversation

jinapurapu
Copy link
Contributor

@jinapurapu jinapurapu commented May 15, 2021

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.

Screenshot from 2021-05-14 18-48-48
Screenshot from 2021-05-14 18-49-26

fixes https://github.com/miniohq/engineering/issues/3

@@ -93,6 +93,7 @@ export interface MakeBucketRequest {
}

export interface ChangePasswordRequest {
//selected_user: object;
Copy link
Collaborator

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

// 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 {
Copy link
Collaborator

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 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this file

Copy link
Collaborator

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

restapi/user_account.go Outdated Show resolved Hide resolved
@jinapurapu jinapurapu force-pushed the change_PW_icon branch 2 times, most recently from 183d23c to 0511abf Compare May 18, 2021 21:36
interface IChangePasswordProps {
classes: any;
open: boolean;
// selectedUser: User | null;
Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

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("");
Copy link
Collaborator

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
Copy link
Collaborator

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

Suggested change
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 "
Copy link
Collaborator

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

swagger.yml Show resolved Hide resolved
@bexsoft
Copy link
Collaborator

bexsoft commented May 19, 2021

Please review:

restapi/admin_users.go:109:2: missing ',' before newline in argument list
restapi/admin_users.go:111:6: expected '(', found listUsers

@jinapurapu jinapurapu force-pushed the change_PW_icon branch 3 times, most recently from 430c00b to 5957b75 Compare May 28, 2021 18:46
}
// 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)
Copy link
Collaborator

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

@dvaldivia
Copy link
Collaborator

Uploading Screen Shot 2021-06-02 at 11.31.02 AM.png…

jinapurapu and others added 7 commits June 3, 2021 14:42
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
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
Copy link
Collaborator

@dvaldivia dvaldivia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Works

@dvaldivia dvaldivia merged commit a9e82eb into minio:master Jun 3, 2021
@jinapurapu jinapurapu deleted the change_PW_icon branch October 12, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants