From f781f1914858ac7d0c98d8b2cda430e4e54e2c31 Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Tue, 21 Nov 2023 15:34:13 +0000 Subject: [PATCH 1/5] update account page for one login move --- app/assets/stylesheets/application.scss | 4 ++++ app/views/user/show.html.slim | 10 ++-------- config/locales/en.yml | 1 + spec/lib/seed_snippets_spec.rb | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a87d09295..d1704f7c4 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -194,3 +194,7 @@ ul>li>ul>li { .white-space-pre-wrap { white-space: pre-wrap; } + +.text-secondary { + color: $govuk-secondary-text-colour !important; +} diff --git a/app/views/user/show.html.slim b/app/views/user/show.html.slim index 1cf9f3e03..b0ae1b03e 100644 --- a/app/views/user/show.html.slim +++ b/app/views/user/show.html.slim @@ -14,14 +14,8 @@ - row.with_key { 'Name' } - row.with_value(text: current_user.name, classes: %w[data-hj-suppress]) - 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: '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: 'Change password', href: edit_password_user_path, html_attributes: { id: :edit_password_user }) + p.text-secondary + = t('my_account.name_information') = govuk_summary_list do |other_details| - other_details.with_row do |row| diff --git a/config/locales/en.yml b/config/locales/en.yml index ec06dafcc..a3ad60362 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -296,6 +296,7 @@ en: # /my-account my_account: title: My account + name_information: This is the name that will appear on you end of module certificate. You can use this setting to change how your name appears. Changing your name on this account will not affect your Gov.UK One Login account. setting_details: | ## Your setting details email_preferences: | diff --git a/spec/lib/seed_snippets_spec.rb b/spec/lib/seed_snippets_spec.rb index 5041dca24..bac2ac9a8 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 191 + expect(locales.count).to be 192 end it 'dot separated key -> Page::Resource#name' do From 26e7c5fe243ae918b7de0e240f349db299f9c3fe Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Tue, 21 Nov 2023 15:38:09 +0000 Subject: [PATCH 2/5] css update --- app/assets/stylesheets/application.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d1704f7c4..041d1e8a9 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -196,5 +196,5 @@ ul>li>ul>li { } .text-secondary { - color: $govuk-secondary-text-colour !important; + color: $govuk-secondary-text-colour; } From 7f29b86088cfe740ba28ab04e0ff25070bf26268 Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Wed, 22 Nov 2023 10:03:22 +0000 Subject: [PATCH 3/5] remove change password spec --- .../registered_user/changing_password_spec.rb | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 spec/system/registered_user/changing_password_spec.rb diff --git a/spec/system/registered_user/changing_password_spec.rb b/spec/system/registered_user/changing_password_spec.rb deleted file mode 100644 index 47679ba47..000000000 --- a/spec/system/registered_user/changing_password_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'Registered user changing password', type: :system do - subject(:user) { create :user, :registered, created_at: 1.month.ago } - - let(:password) { 'Str0ngPa$$w0rd' } - - include_context 'with user' - - before do - visit '/my-account/edit-password' - fill_in 'Enter your current password', with: 'Str0ngPa$$w0rd' - fill_in 'Create a new password', with: password - fill_in 'Confirm password', with: password - end - - context 'when cancelled' do - it 'returns to account page' do - click_link 'Cancel' - expect(page).to have_current_path '/my-account' - expect(page).not_to have_text 'Your new password has been saved.' - end - end - - context 'when successful' do - let(:password) { '12!@NewPassword' } - let(:today) { Time.zone.today.to_formatted_s(:rfc822) } # 18 May 2022 - - it 'updates password' do - click_button 'Save' - expect(page).to have_current_path '/my-account' - expect(page).to have_text('Manage your account') # page heading - .and have_text('Your new password has been saved.') # flash message - .and have_text("Password last changed on #{today}") # event - end - end - - context 'when too short' do - let(:password) { 'short' } - - it 'renders an error message' do - click_button 'Save' - expect(page).to have_text 'Password must be at least 10 characters.' - end - end - - context 'when blank' do - let(:password) { '' } - - it 'renders an error message' do - click_button 'Save' - expect(page).to have_text 'Enter a password.' - end - end -end From b81ec3832a89e89cc5d5dba95c64773d598b4af7 Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Wed, 22 Nov 2023 11:58:39 +0000 Subject: [PATCH 4/5] update bot spec --- spec/requests/bot_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/requests/bot_spec.rb b/spec/requests/bot_spec.rb index 7f46679c8..3a7109570 100644 --- a/spec/requests/bot_spec.rb +++ b/spec/requests/bot_spec.rb @@ -2,9 +2,10 @@ RSpec.describe 'Automated bot', type: :request do let(:bot_email) { 'bot_token@example.com' } + let(:bot_name) { 'Bot' } before do - create :user, :registered, email: bot_email + create :user, :registered, email: bot_email, first_name: bot_name end context 'with header' do @@ -14,7 +15,7 @@ it 'is not redirected and can access secure pages' do expect(response).not_to redirect_to new_user_session_path - expect(response.body).to include bot_email + expect(response.body).to include bot_name end end From 4a353bc8a613d1de1fb9e6b9ad26f6be4bf7a54d Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Thu, 23 Nov 2023 13:44:46 +0000 Subject: [PATCH 5/5] minor styling updates --- app/views/user/show.html.slim | 2 +- config/locales/en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/user/show.html.slim b/app/views/user/show.html.slim index b0ae1b03e..39f273dcc 100644 --- a/app/views/user/show.html.slim +++ b/app/views/user/show.html.slim @@ -7,7 +7,7 @@ .govuk-grid-column-full h1.govuk-heading-l Manage your account h2.govuk-heading-m Your details - hr.govuk-section-break.govuk-section-break--l.govuk-section-break--visible + hr.govuk-section-break.govuk-section-break--l.govuk-section-break--visible class="govuk-!-margin-bottom-0" = govuk_summary_list do |your_details| - your_details.with_row do |row| diff --git a/config/locales/en.yml b/config/locales/en.yml index a3ad60362..c4bdb22a8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -296,7 +296,7 @@ en: # /my-account my_account: title: My account - name_information: This is the name that will appear on you end of module certificate. You can use this setting to change how your name appears. Changing your name on this account will not affect your Gov.UK One Login account. + name_information: This is the name that will appear on you end of module certificate. You can use this setting to change how your name appears. Changing your name on this account will not affect your GOV.UK One Login account. setting_details: | ## Your setting details email_preferences: |