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

[#285] Allow user to edit their name #7736

Merged
merged 6 commits into from
Jul 17, 2023
Merged

[#285] Allow user to edit their name #7736

merged 6 commits into from
Jul 17, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented May 9, 2023

Relevant issue(s)

Requires #7735
Connected to #285

What does this do?

  • Allows users to edit their own user name
  • Displays previously used user names on their profile.

Why was this needed?

Often requested feature which will reduce admin burden.

Screenshots

Screenshot 2023-05-09 at 10 00 22
Screenshot 2023-05-09 at 10 12 46

gbp added a commit to mysociety/whatdotheyknow-theme that referenced this pull request May 9, 2023
@gbp gbp force-pushed the 285-user-name-edits branch 2 times, most recently from 5b24069 to ed983f1 Compare May 9, 2023 09:24
Copy link
Member

@garethrees garethrees left a comment

Choose a reason for hiding this comment

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

Think all this looks good; couple of phrasing suggestions

app/controllers/users/names_controller.rb Outdated Show resolved Hide resolved
app/views/users/names/edit.html.erb Outdated Show resolved Hide resolved
app/controllers/users/names_controller.rb Outdated Show resolved Hide resolved
app/models/user.rb Outdated Show resolved Hide resolved
spec/models/user_spec.rb Outdated Show resolved Hide resolved
@gbp gbp linked an issue May 30, 2023 that may be closed by this pull request
@gbp gbp force-pushed the 285-user-name-edits branch from ed983f1 to 4171add Compare June 30, 2023 13:03
@gbp
Copy link
Member Author

gbp commented Jun 30, 2023

Marked ready for review as the PRs which this depends on has been merged. Will address the feedback already left next week.

@gbp gbp marked this pull request as ready for review June 30, 2023 13:07
@gbp gbp force-pushed the 285-user-name-edits branch 2 times, most recently from b825077 to 70d6986 Compare July 7, 2023 12:47
@gbp
Copy link
Member Author

gbp commented Jul 12, 2023

Updated the edit form to make it clearer who should (currently) use this form:

image

We can look at allowing the user to erase/redact their previous names in a separate PR.

@HelenWDTK
Copy link
Contributor

How about:

When you send a request, we use the name you gave us. This makes it hard to stop your old and new names from being connected. If you change your name, your old requests won't change. Your old name will still show up on requests that you've already sent and on your public profile page. If you don't want your new name to be linked to your old one, it's a good idea to make a new account instead.

That has a Gunning Fog score of 7.1 vs 14 for the previous version (anything over 12 is hard for most people to read and understand), and a Flesch Reading Ease score of 94.6/100 vs 50.4/100 for the other one (a higher number is better here).

@garethrees
Copy link
Member

Yeah, this looks good.

I wonder whether we should also include a line along the lines of "If you are trying to remove your name, please contact us"? (which we can later replace with #5052)

@gbp
Copy link
Member Author

gbp commented Jul 13, 2023

image

gbp added 6 commits July 14, 2023 14:50
This new column is nil by default and populating would mean easier DB
queries and wouldn't need to handle falling back to calling `User#name`.
Allowing users to change their own name from their profile.
Adds `User#previous_name` and `User#safe_previous_names`. Only the
latter is used at present. The former might be used in the admin UI.
Erase previous slugs and censor previous names.
These are now tested as part of the calls to `User#close!`,
`User#anonymise!` and `User#erase!` so lets just check these methods are
called.
This could be confusing so worth warning the user they might have issues
if not explained to the authority.
@gbp gbp force-pushed the 285-user-name-edits branch from abf27d7 to 69c3d4d Compare July 14, 2023 13:52
@gbp gbp merged commit ad97977 into develop Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Username change without changing history
3 participants