-
Notifications
You must be signed in to change notification settings - Fork 356
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
Implementing change password view #3294
Conversation
03da09a
to
23e5685
Compare
confirm_password = params[:confirm_password] | ||
|
||
unless new_password.eql?(confirm_password) | ||
add_flash(_("Confirmation password is not equal to new password"), :error) |
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.
@douglasgabriel This looks more like a fronend validation.
Noticed that the form is not in angular.
Please convert the form to angular so that you can address these form-level validations using angular.
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.
Typically flash messages are displayed when you transition to a new screen.
In this particular case, you need to stay right inside the form and report the error to the user. As mentioned above this is a form validation and can be best handled with angular directives. What needs to happen here is - the "Confirmation password is not equal to new password" message needs to be displayed right under the password field in red
23e5685
to
63ec7b3
Compare
just wondering, do we need to show some indication of password strength? (e.g. weak, normal,, strong etc?) |
Well, I think that this is a little bit more difficult to do, cause maybe all providers has its owns passwords rules. In some scenario, the MiQ UI can say that a password is strong, however the provider could reject this password because it break some password rule, what can make the user a bit confused. Don't you think? 🤔 My idea is to try change password in provider and if something goes wrong, catch the error message from provider and show to user |
da76099
to
0ca7329
Compare
0ca7329
to
049d77a
Compare
7a5b1da
to
1260f30
Compare
@miq-bot remove_label pending core |
# This method handle view objects of page | ||
# +/ems_physical_infra/change_password/<id>+ | ||
def change_password | ||
@record = model.find(params[: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.
params[:id]
is exposed here.
Hence can you add an rbac check for this?
Thanks.
"redirect-url" => ems_physical_infra_path(@record),} | ||
|
||
:javascript | ||
miq_bootstrap('change-password-component'); |
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.
Add a new line here
@douglasgabriel Tested this in the UI and this is looking really good. A couple questions -
which actually brings me to my next question - |
@douglasgabriel Can you also take a look at the codeclimate issues? |
2559274
to
02f247a
Compare
Thanks @AparnaKarve for the suggestions here.
Great idea! I've put this validation, as well.
I also agree, this way is much better. Done!
No, at least for the Lenovo Provider.
P.S. The Travis failures doesn't seems to be due this PR modifications 🤔 |
@douglasgabriel You can address the Cognitive Complexity issue by making the functions - In |
b47c85d
to
0ff6ae2
Compare
Checked commit douglasgabriel@3e26ed1 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Done @AparnaKarve :D |
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.
LGTM
Thanks!
This PR is able to:
ems_physical_infra/show_list
ems_physical_infra/change_password/${id}
After click in save button
The user can follow the change password request status in the tasks page
This PR depends on:
Adding feature to change Physical Infra Provider password manageiq#16883- MergedAdding method to change password of a provider on its client manageiq#16895- Merged