-
Notifications
You must be signed in to change notification settings - Fork 507
Add account renaming functionality #4088
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: main
Are you sure you want to change the base?
Conversation
|
Because of the first commit, authentication tests are failing with the following exception. @jeremyevans, how can I fix this issue? Architecturally, is the first commit incorrect? |
For catch use of untype-checked parameters in our templates, we undefine To workaround this issue, you can change |
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 don't object to the combining of the change login and change login pages, but I don't think it makes things simpler. Changing login and changing password are generally done for different reasons, so putting them on the same page doesn't result in a simpler user experience to me. It also seems unrelated to account renaming. However, it doesn't cause harm.
clover.rb
Outdated
| ].each { path(it, class_name: true, &under_project_path) } | ||
|
|
||
| path("Project", class_name: true, &:path) | ||
| path("Account", class_name: true, &:path) |
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.
Considering this is static and not dynamic, I would not recommend a model method. Maybe:
| path("Account", class_name: true, &:path) | |
| path("Account", class_name: true) { |_| '/account' } |
model/account.rb
Outdated
| def path | ||
| "/account" | ||
| end | ||
|
|
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.
| def path | |
| "/account" | |
| end |
We don't need to check authorization for all cases such as renaming accounts.
Some actions, such as renaming accounts, call the audit_log helper without a project context. In these cases, there's no relevant project information to log, so we now skip storing audit logs when the project context is missing.
We only use template_prefix in a single place, and the show_object helper already accepts a template. This change makes them consistent and also allows using the helper for resources without a show view.
It allows to use the rename route helper other than in settings page.
We allow spaces in account names and not allow leading spaces. We should not allow trailing spaces too.
Thanks to @jeremyevans's renaming helpers, it was straightforward to implement.
d789fe8 to
412a921
Compare
!! It doesn't have tests yet !!
Combine account password change and login pages
Previously, we had separate pages for changing passwords and logging in,
which was unnecessary. This change combines them into a single unified
page for a simpler user experience.
I plan to add account renaming functionality to this page in a future
commit.
Add path helper to account model
Do not check authorization for renaming if it's passed as nil explicitly
We don't need to check authorization for all cases such as renaming
accounts.
Skip storing audit logs when no project context is available
Some actions, such as renaming accounts, call the audit_log helper
without a project context. In these cases, there's no relevant project
information to log, so we now skip storing audit logs when the project
context is missing.
Add account renaming functionality
Thanks to @jeremyevans's renaming helpers, it was straightforward to
implement.