-
Notifications
You must be signed in to change notification settings - Fork 531
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
AO3-6377 Change edit profile page title #4706
AO3-6377 Change edit profile page title #4706
Conversation
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.
Hi, Claire!
I'm glad to see you got your dev environment all set up and were able to make your first pull request! 🎉
I didn't see an account for you in Jira, so I've just updated the Jira issue status to In Review to make sure no one mistakenly submits a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! You can reply here with the account name and we'll set up the permissions for you. (It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (PREFERRED NAME).")
Thanks for contributing!
Thank you, I saw your comment and will be making changes tomorrow!
I did setup a Jira account using this email, the name I used is Claire
Carden, and it setup my own project... clairecarden. This may be where I
went wrong. Should I have tried to join ya'lls space from the beginning? I
use Azure Devops at my job, and cant even remember how I got setup there!
I'm not using a profile picture or anything, its just a green CC.
…On Sat, Jan 6, 2024 at 7:47 PM sarken ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Hi, Claire!
I'm glad to see you got your dev environment all set up and were able to
make your first pull request! 🎉
I didn't see an account for you in Jira, so I've just updated the Jira
issue status to In Review to make sure no one mistakenly submits a
duplicate pull request. If you'd like the ability to comment on, assign,
and transition issues in the future, you're welcome to create a Jira
account! You can reply here with the account name and we'll set up the
permissions for you. (It makes things a bit easier for us on the
organizational side if the Full Name on your Jira account either closely
matches the name you'd like us to credit in the release notes or includes
it in parentheses, e.g. "Nickname (PREFERRED NAME).")
Thanks for contributing!
------------------------------
In app/controllers/users_controller.rb
<#4706 (comment)>:
> @@ -35,6 +35,7 @@ def show
# GET /users/1/edit
def edit
+ @page_title = ts("Edit Profile | #{ArchiveConfig.APP_NAME}")
This will definitely produce the desired result, but it's not *quite* the
best way to go about it.
As you noticed, @page_title overwrites the entire title, so you have to
include | #{ArchiveConfig.APP_NAME}.
But we also have @page_subtitle, which just sets the text before the
vertical bar and app name:
https://github.com/otwcode/otwarchive/blob/9ce7f82a0e0eaca675a7899222b805eed421b57c/app/views/layouts/application.html.erb#L21-L32
It would also be a good idea to set this up for eventual interface
translation, like we've done with this page title:
https://github.com/otwcode/otwarchive/blob/9ce7f82a0e0eaca675a7899222b805eed421b57c/app/controllers/admin/blacklisted_emails_controller.rb#L10
https://github.com/otwcode/otwarchive/blob/9ce7f82a0e0eaca675a7899222b805eed421b57c/config/locales/views/en.yml#L188-L189
What's happening in the controller there is we're taking advantage of Rails
i18n's lazy lookup <https://guides.rubyonrails.org/i18n.html#lazy-lookup>
to tell the app to check our locale files for the value located at:
admin:
blacklisted_emails:
index:
browser_title:
So in this file, you'd write @page_title = t(".browser_title") to tell
Rails to to look up the value located at:
users: # The controller
edit: # The action
browser_title: # The key we've specified
That value doesn't currently exist, of course, so you'd need to add it
under users
<https://github.com/otwcode/otwarchive/blob/9ce7f82a0e0eaca675a7899222b805eed421b57c/config/locales/views/en.yml#L716>,
e.g.:
users:
edit:
browser_title: Edit Profile
change_username:
account_faq: Account FAQ
caution: Please use this feature with caution.
I think you mentioned you were new to Rails, so here's the Rails i18n
documentation <https://guides.rubyonrails.org/i18n.html> as well as our i18n
Standards
<https://github.com/otwcode/otwarchive/wiki/Internationalization-%28i18n%29-Standards>,
which also explains some of the automated tasks we use for i18n. Those
automated tasks will alphabetize and reformat any changes you make to
config/locales/views/en.yml, so it's a good idea to run them before
committing.
Lastly -- and I'm sorry this is so much! -- it would be a good idea to add
an automated test for this in features/other_a/profile_edit.feature
<https://github.com/otwcode/otwarchive/blob/master/features/other_a/profile_edit.feature#L28-L30>
.
That file is set up in a way that makes adding the test a little awkward,
so it's probably best to add Then I should see the page title "Edit
Profile" above the existing the first line (When I fill in the details of
my profile) of the "Add details" scenario
<https://github.com/otwcode/otwarchive/blob/9ce7f82a0e0eaca675a7899222b805eed421b57c/features/other_a/profile_edit.feature#L14C1-L18C37>
.
—
Reply to this email directly, view it on GitHub
<#4706 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW7DDYY7FGPQ4PAUHK2P4U3YNH5BJAVCNFSM6AAAAABBPW72TCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMBXGY2TGMBXGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Best,
Claire Carden
***@***.***
(817) 233-9336 (Cell)
|
Honestly, I'm not sure what went wrong! Sometimes accounts just don't get created right. I've sent you an invitation via email and hopefully that'll straighten things out (it usually does). |
Yup, as soon as I sent the email, your account appeared in the admin section 🎉 I've assigned the issue to you now, and you'll also have the aforementioned permissions going forward. |
@sarken Thanks for the feedback, I've made the changes. This all makes a lot of sense. I saw page_subtitle but did not investigate. Got it working properly now I think. Let me know if other changes need to be made. |
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.
Looks great -- thank you!
Issue
https://otwarchive.atlassian.net/browse/AO3-6377
Purpose
Changed the browser title of the Edit Profile Page from "Edit User" to "Edit Profile"
Testing Instructions
Login > My Dashboard > Profile > Edit Profile > Look at the title in the tab.
References
No.
Credit
Claire Carden she/her
If you have a Jira account, please include the same name in the "Full name"
field on your Jira profile, so we can assign you the issues you're working on.
Please note that if you do not fill in this section, we will use your GitHub account name and
they/them pronouns.