From 5312e7423b1765002fd42ab7fa2cb76a26ae175b Mon Sep 17 00:00:00 2001 From: Peter David Hamilton Date: Wed, 8 Nov 2023 10:07:39 +0000 Subject: [PATCH 1/2] Change link text instead of adding labels on my account --- app/views/user/show.html.slim | 10 +++++----- config/locales/en.yml | 1 - spec/lib/seed_snippets_spec.rb | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/user/show.html.slim b/app/views/user/show.html.slim index cc7a3ba36..ed8da34ae 100644 --- a/app/views/user/show.html.slim +++ b/app/views/user/show.html.slim @@ -13,21 +13,21 @@ - your_details.with_row do |row| - row.with_key { 'Name' } - row.with_value(text: current_user.name, classes: %w[data-hj-suppress]) - - row.with_action(text: t('links.change'), href: edit_registration_name_path, html_attributes: { id: :edit_name_registration, aria: { label: 'Change name' } }) + - row.with_action(text: 'Change name', href: edit_registration_name_path, html_attributes: { id: :edit_name_registration }) - your_details.with_row do |row| - row.with_key { 'Email' } - row.with_value(text:current_user.email, classes: %w[data-hj-suppress]) - - row.with_action(text: t('links.change'), href: edit_email_user_path, html_attributes: { id: :edit_email_user, aria: { label: 'Change email' } }) + - row.with_action(text: 'Change email', href: edit_email_user_path, html_attributes: { id: :edit_email_user } }) - your_details.with_row do |row| - row.with_key { 'Password' } - row.with_value { t('my_account.password_changed', date: current_user.password_last_changed) } - - row.with_action(text: t('links.change'), href: edit_password_user_path, html_attributes: { id: :edit_password_user, aria: { label: 'Change password' } }) + - row.with_action(text: 'Change password', href: edit_password_user_path, html_attributes: { id: :edit_password_user }) = govuk_summary_list do |other_details| - other_details.with_row do |row| - row.with_key { m('my_account.setting_details') } - row.with_value { nil } - - row.with_action(text: t('links.change'), href: edit_registration_setting_type_path, html_attributes: { id: :edit_setting_type_registration, aria: { label: 'Change setting details' } }) + - row.with_action(text: 'Change setting details', href: edit_registration_setting_type_path, html_attributes: { id: :edit_setting_type_registration }) - other_details.with_row do |row| - row.with_key { 'Setting type' } - row.with_value(text: current_user.setting_name, classes: %w[data-hj-suppress]) @@ -45,7 +45,7 @@ - email_preferences.with_row do |row| - row.with_key { 'Email updates about this training course' } - row.with_value(text: t(current_user.training_emails_recipient?, scope: 'my_account.training_emails'), classes: %w[data-hj-suppress]) - - row.with_action(text: t('links.change'), href: edit_training_emails_user_path, html_attributes: { id: :edit_training_emails_user, aria: { label: 'Change email preferences' } }) + - row.with_action(text: 'Change email preferences', href: edit_training_emails_user_path, html_attributes: { id: :edit_training_emails_user }) = m('my_account.closing.information') = govuk_button_link_to t('my_account.closing.button'), new_user_close_account_path diff --git a/config/locales/en.yml b/config/locales/en.yml index 92d5b2311..612a9ea32 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -105,7 +105,6 @@ en: na: Not applicable links: - change: Change save: Save continue: Continue cancel: Cancel diff --git a/spec/lib/seed_snippets_spec.rb b/spec/lib/seed_snippets_spec.rb index 8add68d26..6091c4788 100644 --- a/spec/lib/seed_snippets_spec.rb +++ b/spec/lib/seed_snippets_spec.rb @@ -5,7 +5,7 @@ subject(:locales) { described_class.new.call } it 'converts all translations' do - expect(locales.count).to be 177 + expect(locales.count).to be 176 end it 'dot separated key -> Page::Resource#name' do From 3c416919ca71d5bc33047f273ea2601854414fca Mon Sep 17 00:00:00 2001 From: Peter David Hamilton Date: Wed, 8 Nov 2023 10:43:17 +0000 Subject: [PATCH 2/2] typo --- app/views/user/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/user/show.html.slim b/app/views/user/show.html.slim index ed8da34ae..e020f14c7 100644 --- a/app/views/user/show.html.slim +++ b/app/views/user/show.html.slim @@ -17,7 +17,7 @@ - your_details.with_row do |row| - row.with_key { 'Email' } - row.with_value(text:current_user.email, classes: %w[data-hj-suppress]) - - row.with_action(text: 'Change email', href: edit_email_user_path, html_attributes: { id: :edit_email_user } }) + - row.with_action(text: 'Change email', href: edit_email_user_path, html_attributes: { id: :edit_email_user }) - your_details.with_row do |row| - row.with_key { 'Password' } - row.with_value { t('my_account.password_changed', date: current_user.password_last_changed) }