From d981422028a8fc52a9c7f783d66dad0cbbc4a8c4 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 3 Oct 2022 19:20:10 -0400 Subject: [PATCH 01/55] LG-7353 First changes - Removed body copy under H1 - Removed H2 "Your personal key" - Updated caption copy to read "Your personal key was generated..." - Removed the previous "Save it. Keep it safe." block from this section - Added new copy ToDo: - Add "What is a personal key?" accordian - Move and change copy/download/print links - Add checkbox - Stretch Continue button --- app/views/partials/personal_key/_key.html.erb | 3 -- app/views/shared/_personal_key.html.erb | 30 ++++++++++--------- config/locales/instructions/en.yml | 7 +++-- config/locales/users/en.yml | 3 +- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index 3a096babaed..54ac9f76e2b 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -1,7 +1,4 @@
-

- <%= t('users.personal_key.header') %> -

<% code.split('-').each do |word| %> diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 24e0c08288b..f54da4f7534 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -1,10 +1,10 @@ <%= render PageHeadingComponent.new.with_content(t('headings.personal_key')) %> -

- <%= t('instructions.personal_key.info') %> -

<%= render 'partials/personal_key/key', code: code %>
+ +
+ <%= render ButtonComponent.new( action: ->(**tag_options, &block) do link_to( @@ -29,17 +29,19 @@ outline: true, class: 'margin-bottom-2 tablet:margin-bottom-0', ) %> -
- <%= image_tag( - asset_url('alert/icon-lock-alert-important.svg'), - alt: '', - size: '80', - class: 'float-left margin-right-2', - ) %> -

- <%= t('instructions.personal_key.email_title') %> -

-

<%= t('instructions.personal_key.email_body') %>

+ +
+
+ +
+ +
+<%= t('instructions.personal_key.info') %> +
    + <% t('instructions.personal_key.info_bullets').each do |bullet| %> + <%= "
  • #{bullet}
  • ".html_safe %> + <% end %> +
<%= button_to( t('forms.buttons.continue'), diff --git a/config/locales/instructions/en.yml b/config/locales/instructions/en.yml index 9d3eae94ca6..1022a7e9bf9 100644 --- a/config/locales/instructions/en.yml +++ b/config/locales/instructions/en.yml @@ -106,9 +106,10 @@ en: email_body: Don’t lose your personal key or share it with others. We’ll ask for it if you reset your password. email_title: Save it. Keep it safe. - info: You’ll need this personal key if you forget your password. If you reset - your password and don’t have this key, you’ll have to verify your - identity again. + info: "If you reset your password without your personal key:" + info_bullets: + - You'll lose access to your account + - You'll need to verify your identity again sp_handoff_bounced: Your sign in was successful, but %{sp_name} sent you back to %{app_name}. Please contact %{sp_link} for help. sp_handoff_bounced_with_no_sp: your service provider diff --git a/config/locales/users/en.yml b/config/locales/users/en.yml index 378d09f4a02..316a6db802e 100644 --- a/config/locales/users/en.yml +++ b/config/locales/users/en.yml @@ -21,8 +21,7 @@ en: personal_key: close: Close confirmation_error: You’ve entered an incorrect personal key. - generated_on_html: Generated on %{date} - header: Your personal key + generated_on_html: Your personal key was generated on %{date} phones: error_message: You’ve added the maximum number of phone numbers. rules_of_use: From 9ef0c5398c158f7e7ddd64d9fe4019aaa1539110 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 3 Oct 2022 21:51:10 -0400 Subject: [PATCH 02/55] More UI tweaks. - Moved personal key links into _key partial and un-styled them. - Added "What is a personal key?" accordian - Added acknowledgement checkbox and text - Widened continue --- app/views/partials/personal_key/_key.html.erb | 26 +++++++ app/views/shared/_personal_key.html.erb | 70 ++++++++++--------- config/locales/forms/en.yml | 2 +- 3 files changed, 63 insertions(+), 35 deletions(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index 54ac9f76e2b..b7aef323cd5 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -12,4 +12,30 @@ date: content_tag(:strong, I18n.l(Time.zone.today, format: '%B %d, %Y')), ) %>

+ + <%= render ClipboardButtonComponent.new( + clipboard_text: code, + unstyled: true) %> + + <%= render ButtonComponent.new( + action: ->(**tag_options, &block) do + link_to( + "data:text/plain;charset=utf-8,#{CGI.escape(code)}", + download: 'personal_key.txt', + **tag_options, + &block + ) + end, + icon: :file_download, + unstyled: true, + class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', + ).with_content(t('forms.backup_code.download')) %> + + <%= render PrintButtonComponent.new( + icon: :print, + unstyled: true, + type: :button, + class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', + ) %> +
diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index f54da4f7534..29dbe1f288b 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -5,48 +5,50 @@
-<%= render ButtonComponent.new( - action: ->(**tag_options, &block) do - link_to( - "data:text/plain;charset=utf-8,#{CGI.escape(code)}", - download: 'personal_key.txt', - **tag_options, - &block - ) - end, - icon: :file_download, - outline: true, - class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', - ).with_content(t('forms.backup_code.download')) %> -<%= render PrintButtonComponent.new( - icon: :print, - outline: true, - type: :button, - class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', - ) %> -<%= render ClipboardButtonComponent.new( - clipboard_text: code, - outline: true, - class: 'margin-bottom-2 tablet:margin-bottom-0', - ) %> -
-
+ <%= render AccordionComponent.new do |c| %> + <% c.header { "What is a personal key?" } %> +

+ A personal key "locks" your personal information with your account. + It's the only way to unlock your information if you lose or forget + your password. +

-
+

+ When you reset your password, Login.gov will ask for your personal + key to make sure you are you - not someone pretending to be you. +

+ <% end %> +
-<%= t('instructions.personal_key.info') %> -
    - <% t('instructions.personal_key.info_bullets').each do |bullet| %> - <%= "
  • #{bullet}
  • ".html_safe %> - <% end %> -
+ +
+ <%= button_to( t('forms.buttons.continue'), update_path, - class: 'display-block usa-button usa-button--big usa-button--wide personal-key-continue margin-top-5', + class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', 'data-toggle': FeatureManagement.idv_personal_key_confirmation_enabled? ? 'modal' : 'skip', ) %> <%= render 'shared/personal_key_confirmation_modal', code: code, update_path: update_path %> diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index 4478278956a..5e96e699e01 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -13,7 +13,7 @@ en: caution_delete: If you delete your backup codes you will no longer be able to use them to sign in. confirm_delete: Are you sure you want to delete your backup codes? - download: Download + download: Download (text file) generate: Get codes last_code: You used your last backup code. Please print, copy or download the codes below. You can use these new codes the next time you sign in. From 59f326309069e9886252343b04424ad0e1427265 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 4 Oct 2022 17:50:09 -0400 Subject: [PATCH 03/55] Moved strings out to new locale file entries. --- app/views/shared/_personal_key.html.erb | 40 ++++++++++--------------- config/locales/forms/en.yml | 18 +++++++++++ 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 29dbe1f288b..efad762b130 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -1,4 +1,4 @@ -<%= render PageHeadingComponent.new.with_content(t('headings.personal_key')) %> +<%= render PageHeadingComponent.new.with_content(t('forms.personal_key_partial.header')) %>
<%= render 'partials/personal_key/key', code: code %>
@@ -7,43 +7,35 @@
<%= render AccordionComponent.new do |c| %> - <% c.header { "What is a personal key?" } %> -

- A personal key "locks" your personal information with your account. - It's the only way to unlock your information if you lose or forget - your password. -

- -

- When you reset your password, Login.gov will ask for your personal - key to make sure you are you - not someone pretending to be you. -

+ <% c.header { t('forms.personal_key_partial.explanation.header') } %> + <% t('forms.personal_key_partial.explanation.text').each do |paragraph| %> + <%= "

#{paragraph}

".html_safe %> + <% end %> <% end %>
- + <%= tag.input( + type: 'checkbox', + id: 'acknowledgement_checkbox', + class: 'masked-text__toggle usa-checkbox__input usa-checkbox__input--bordered,' + ) %>
+<%= javascript_packs_tag_once 'acknowledgement_checkbox' %> <%= button_to( t('forms.buttons.continue'), diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index 5e96e699e01..d6d1d84911c 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -63,6 +63,24 @@ en: submit: Change password labels: password: New password + personal_key_partial: + header: Save your personal key + explanation: + header: What is a personal key? + text: + - A personal key "locks" your personal information with your account. + It's the only way to unlock your information if you lose or forget + your password. + - When you reset your password, Login.gov will ask for your personal + key to make sure you are you - not someone pretending to be you. + acknowledgement: + header: You need your personal key if you forget your password. + Keep it safe and don't share it with anyone. + text: "If you reset your password without your personal key:" + bullets: + - You'll lose access to your account + - You'll need to verify your identity again + instructions: Check the box above to continue personal_key: alternative: Don’t have your personal key? confirmation_label: Personal key From 206b2dd180ed0dfef83b34d28a669c3369c7a3d4 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 4 Oct 2022 20:27:21 -0400 Subject: [PATCH 04/55] Use ValidatedFieldComponent for acknowledgement checkbox. --- app/views/shared/_personal_key.html.erb | 40 ++++++++++++++----------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index efad762b130..ef8962fc746 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -14,14 +14,11 @@ <% end %>
-
- <%= tag.input( - type: 'checkbox', - id: 'acknowledgement_checkbox', - class: 'masked-text__toggle usa-checkbox__input usa-checkbox__input--bordered,' - ) %> -
-<%= javascript_packs_tag_once 'acknowledgement_checkbox' %> + <% end %> + + <%= render ValidatedFieldComponent.new( + form: f, + name: :terms_accepted, + as: :boolean, + label: @acceptance_prompt, + label_html: { class: 'margin-y-0' }, + required: true + ) %> + + <%= button_to( + t('forms.buttons.continue'), + update_path, + class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', + 'data-toggle': FeatureManagement.idv_personal_key_confirmation_enabled? ? 'modal' : 'skip', + ) %> +<% end %> -<%= button_to( - t('forms.buttons.continue'), - update_path, - class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', - 'data-toggle': FeatureManagement.idv_personal_key_confirmation_enabled? ? 'modal' : 'skip', - ) %> <%= render 'shared/personal_key_confirmation_modal', code: code, update_path: update_path %> <%== javascript_packs_tag_once 'personal-key-page-controller' %> From dbfa7a4ffa246138cbfca700afa8eff689d69d88 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 4 Oct 2022 21:52:23 -0400 Subject: [PATCH 05/55] French and Spanish strings [skip changelog] --- app/views/partials/personal_key/_key.html.erb | 2 ++ app/views/shared/_personal_key.html.erb | 12 +++++----- config/locales/components/es.yml | 2 +- config/locales/components/fr.yml | 2 +- config/locales/forms/es.yml | 21 +++++++++++++++++- config/locales/forms/fr.yml | 22 ++++++++++++++++++- config/locales/instructions/en.yml | 7 +++--- config/locales/users/en.yml | 1 + config/locales/users/es.yml | 2 +- config/locales/users/fr.yml | 2 +- 10 files changed, 58 insertions(+), 15 deletions(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index b7aef323cd5..0dadbddc3ff 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -13,6 +13,8 @@ ) %>

+
+ <%= render ClipboardButtonComponent.new( clipboard_text: code, unstyled: true) %> diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index ef8962fc746..84537b8a56f 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -9,21 +9,23 @@ <%= render AccordionComponent.new do |c| %> <% c.header { t('forms.personal_key_partial.explanation.header') } %> <% t('forms.personal_key_partial.explanation.text').each do |paragraph| %> - <%= "

#{paragraph}

".html_safe %> +

<%= paragraph%>

<% end %> <% end %>
<%= simple_form_for('') do |f| %> <% @acceptance_prompt = capture do %> - - <%= t('forms.personal_key_partial.acknowledgement.header') %> - +

+ + <%= t('forms.personal_key_partial.acknowledgement.header') %> + +

<%= t('forms.personal_key_partial.acknowledgement.text') %>

diff --git a/config/locales/components/es.yml b/config/locales/components/es.yml index 24dcb36389f..014b65732fb 100644 --- a/config/locales/components/es.yml +++ b/config/locales/components/es.yml @@ -35,7 +35,7 @@ es: phone_input: country_code_label: Código del país print_button: - label: Imprima esta página + label: Imprima troubleshooting_options: default_heading: '¿Tiene alguna dificultad? Esto es lo que puede hacer:' new_feature: Nueva función diff --git a/config/locales/components/fr.yml b/config/locales/components/fr.yml index e1be7225778..f0fc3a76998 100644 --- a/config/locales/components/fr.yml +++ b/config/locales/components/fr.yml @@ -35,7 +35,7 @@ fr: phone_input: country_code_label: Code pays print_button: - label: Imprimer cette page + label: Imprimer troubleshooting_options: default_heading: 'Des difficultés? Voici ce que vous pouvez faire:' new_feature: Nouvelle fonction diff --git a/config/locales/forms/es.yml b/config/locales/forms/es.yml index 4d449c235a5..7cd50dd8fbc 100644 --- a/config/locales/forms/es.yml +++ b/config/locales/forms/es.yml @@ -14,7 +14,7 @@ es: caution_delete: Si elimina sus códigos de respaldo, ya no podrá usarlos para iniciar sesión. confirm_delete: '¿Estás seguro de que deseas eliminar tus códigos de respaldo?' - download: Descargar + download: Descargar (archivo de texto) generate: Obtener códigos last_code: Usted utilizó el último código de seguridad. Imprima, copie o descargue los códigos que aparecen a continuación. Puede introducir @@ -68,6 +68,25 @@ es: submit: Cambiar la contraseña labels: password: Nueva contraseña + personal_key_partial: + header: Guarda tu clave personal + explanation: + header: ¿Qué es una clave personal? + text: + - Una clave personal "bloquea" la información personal de tu cuenta. + Es la única manera de desbloquear tu información si pierdes u + olvidas tu contraseña. + - Si restableces tu contraseña, Login.gov te pedirá tu clave personal + para asegurarse de que se trata de ti, y no de alguien que quiere + hacerse pasar por ti. + acknowledgement: + header: Necesitarás tu clave personal si olvidas tu contraseña. + Mantenla en un lugar seguro y no la compartas con nadie. + text: "Si restableces tu contraseña sin tu clave personal:" + bullets: + - Perderás el acceso a tu cuenta + - Tendrás que verificar tu identidad nuevamente + instructions: Marca la casilla de arriba para continuar. personal_key: alternative: '¿No tiene su clave personal?' confirmation_label: Clave personal diff --git a/config/locales/forms/fr.yml b/config/locales/forms/fr.yml index 97cb4bd26ff..4e0fdb09e0d 100644 --- a/config/locales/forms/fr.yml +++ b/config/locales/forms/fr.yml @@ -15,7 +15,7 @@ fr: caution_delete: Si vous supprimez vos codes de sauvegarde, vous ne pourrez plus les utiliser pour vous connecter. confirm_delete: Êtes-vous sûr de vouloir supprimer vos codes de sauvegarde? - download: Télécharger + download: Télécharger (fichier texte) generate: Obtenir des codes last_code: Vous avez utilisé votre dernier code de sauvegarde. Veuillez imprimer, copier ou télécharger les codes ci-dessous. Vous pourrez @@ -69,6 +69,26 @@ fr: submit: Changer le mot de passe labels: password: Nouveau mot de passe + personal_key_partial: + header: Sauvegardez votre clé personnelle + explanation: + header: Qu'est-ce qu'une clé personnelle? + text: + - Une clé personnelle « verrouille » vos informations personnelles + avec votre compte. C'est le seul moyen de déverrouiller vos + informations si vous perdez ou oubliez votre mot de passe. + - Lors de la réinitialisation de votre mot de passe, Login.gov vous + demandera votre clé personnelle pour s'assurer que vous êtes bien + vous, et non quelqu'un qui se fait passer pour vous. + acknowledgement: + header: En cas d'oubli de votre mot de passe, vous aurez besoin de + votre clé personnelle. + Gardez-la en sécurité et ne la partagez avec personne. + text: "Si vous réinitialisez votre mot de passe sans votre clé personnelle:" + bullets: + - Vous perdrez l'accès à votre compte + - Vous allez devoir vérifier à nouveau votre identité 
 + instructions: Cochez la case ci-dessus pour continuer. personal_key: alternative: Vous n’avez pas votre clé personnelle? confirmation_label: Clé personnelle diff --git a/config/locales/instructions/en.yml b/config/locales/instructions/en.yml index 1022a7e9bf9..9d3eae94ca6 100644 --- a/config/locales/instructions/en.yml +++ b/config/locales/instructions/en.yml @@ -106,10 +106,9 @@ en: email_body: Don’t lose your personal key or share it with others. We’ll ask for it if you reset your password. email_title: Save it. Keep it safe. - info: "If you reset your password without your personal key:" - info_bullets: - - You'll lose access to your account - - You'll need to verify your identity again + info: You’ll need this personal key if you forget your password. If you reset + your password and don’t have this key, you’ll have to verify your + identity again. sp_handoff_bounced: Your sign in was successful, but %{sp_name} sent you back to %{app_name}. Please contact %{sp_link} for help. sp_handoff_bounced_with_no_sp: your service provider diff --git a/config/locales/users/en.yml b/config/locales/users/en.yml index 316a6db802e..9e09085beb9 100644 --- a/config/locales/users/en.yml +++ b/config/locales/users/en.yml @@ -22,6 +22,7 @@ en: close: Close confirmation_error: You’ve entered an incorrect personal key. generated_on_html: Your personal key was generated on %{date} + header: Your personal key phones: error_message: You’ve added the maximum number of phone numbers. rules_of_use: diff --git a/config/locales/users/es.yml b/config/locales/users/es.yml index f1e8262854a..10e5fe746a1 100644 --- a/config/locales/users/es.yml +++ b/config/locales/users/es.yml @@ -22,7 +22,7 @@ es: personal_key: close: Cerrar confirmation_error: Ha ingresado una clave personal incorrecta. - generated_on_html: Generado el %{date} + generated_on_html: Tu clave personal fue generada el %{date} header: Su clave personal phones: error_message: Agregó el número máximo de números de teléfono. diff --git a/config/locales/users/fr.yml b/config/locales/users/fr.yml index 1c17d049ae1..90ba89b97c6 100644 --- a/config/locales/users/fr.yml +++ b/config/locales/users/fr.yml @@ -24,7 +24,7 @@ fr: personal_key: close: Fermer confirmation_error: Vous avez entré un clé personnelle erronée. - generated_on_html: Générée le %{date} + generated_on_html: Votre clé personnelle a été générée le %{date} header: Votre clé personnelle phones: error_message: Vous avez ajouté le nombre maximum de numéros de téléphone. From 97b5868d89f6efd7ffd21b4d847432ca43f46ae3 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 5 Oct 2022 00:20:25 -0400 Subject: [PATCH 06/55] Spec and implementation for tracking personal key acknowledgments Pushing for CI run --- app/controllers/frontend_log_controller.rb | 2 ++ .../packs/personal-key-page-controller.js | 9 ++++++ spec/javascripts/packs/personal-key-spec.ts | 32 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 spec/javascripts/packs/personal-key-spec.ts diff --git a/app/controllers/frontend_log_controller.rb b/app/controllers/frontend_log_controller.rb index 3cae4dc8967..3b69e8b128e 100644 --- a/app/controllers/frontend_log_controller.rb +++ b/app/controllers/frontend_log_controller.rb @@ -15,6 +15,8 @@ class FrontendLogController < ApplicationController 'IdV: switch_back submitted' => :idv_in_person_switch_back_submitted, 'IdV: download personal key' => :idv_personal_key_downloaded, 'IdV: Native camera forced after failed attempts' => :idv_native_camera_forced, + 'IdV: personal key acknowledged' => :idv_personal_key_acknowledged, + 'IdV: personal key un-acknowledged' => :idv_personal_key_unacknowledged, 'Multi-Factor Authentication: download backup code' => :multi_factor_auth_backup_code_download, 'Show Password button clicked' => :show_password_button_clicked, }.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 36d052bda10..56a2607a1f6 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -11,6 +11,7 @@ const input = formEl.querySelector('input[type="text"]'); const modalTrigger = document.querySelector('[data-toggle="modal"]'); const modalDismiss = document.querySelector('[data-dismiss="personal-key-confirm"]'); const downloadLink = document.querySelector('a[download]'); +const acknowledgmentCheckbox = document.getElementById('acknowledgment'); function scrapePersonalKey() { const keywords = []; @@ -69,6 +70,13 @@ function downloadForIE(event) { window.navigator.msSaveBlob(blob, filename); } +function trackAcknowledgment(click_event) { + if (click_event.target.checked) + trackEvent('IdV: personal key acknowledged'); + else + trackEvent('IdV: personal key un-acknowledgedj'); +} + function trackDownload() { trackEvent('IdV: download personal key'); } @@ -79,6 +87,7 @@ if (modalTrigger) { modalDismiss.addEventListener('click', hide); input.addEventListener('input', validateInput); downloadLink.addEventListener('click', trackDownload); +acknowledgmentCheckbox.addEventListener('click', trackAcknowledgment); if (window.navigator.msSaveBlob) { downloadLink.addEventListener('click', downloadForIE); diff --git a/spec/javascripts/packs/personal-key-spec.ts b/spec/javascripts/packs/personal-key-spec.ts new file mode 100644 index 00000000000..7f9cea3266c --- /dev/null +++ b/spec/javascripts/packs/personal-key-spec.ts @@ -0,0 +1,32 @@ +import { screen } from '@testing-library/dom'; +import userEvent from '@testing-library/user-event'; +import { useSandbox } from '@18f/identity-test-helpers'; +import * as analytics from '@18f/identity-analytics'; + +describe('personal key', () => { + const sandbox = useSandbox(); + + beforeEach(async () => { + document.body.innerHTML = ` + Download + `; + await import('../../../app/javascript/packs/personal-key-page-controller'); + }); + + afterEach(() => { + sandbox.restore(); + delete require.cache[require.resolve('../../../app/javascript/packs/personal-key-page-controller')]; + }); + + it('adds an event listener to the download button', async () => { + const test = sandbox.spy(analytics, 'trackEvent'); + await userEvent.click(screen.getElementById('acknowledgment')); + await userEvent.click(screen.getElementById('acknowledgment')); + + sandbox.assert.calledTwice(test); + sandbox.assert.calledWith(test, 'IdV: personal key acknowledged'); + sandbox.assert.calledWith(test, 'IdV: personal key un-acknowledged'); + }); +}); From 9a0b129cac0a4f5a9c7f53c0c6221421ac7bfef3 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 10:47:08 -0400 Subject: [PATCH 07/55] Lint nits --- .../packs/personal-key-page-controller.js | 9 +++--- app/views/partials/personal_key/_key.html.erb | 13 ++++---- app/views/shared/_personal_key.html.erb | 4 +-- spec/javascripts/packs/personal-key-spec.ts | 32 ------------------- 4 files changed, 14 insertions(+), 44 deletions(-) delete mode 100644 spec/javascripts/packs/personal-key-spec.ts diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 56a2607a1f6..d51dee5be28 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -70,11 +70,12 @@ function downloadForIE(event) { window.navigator.msSaveBlob(blob, filename); } -function trackAcknowledgment(click_event) { - if (click_event.target.checked) +function trackAcknowledgment(clickEvent) { + if (clickEvent.target.checked) { trackEvent('IdV: personal key acknowledged'); - else - trackEvent('IdV: personal key un-acknowledgedj'); + } else { + trackEvent('IdV: personal key un-acknowledged'); + } } function trackDownload() { diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index 0dadbddc3ff..f00265af6c6 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -16,8 +16,9 @@
<%= render ClipboardButtonComponent.new( - clipboard_text: code, - unstyled: true) %> + clipboard_text: code, + unstyled: true, + ) %> <%= render ButtonComponent.new( action: ->(**tag_options, &block) do @@ -28,10 +29,10 @@ &block ) end, - icon: :file_download, - unstyled: true, - class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', - ).with_content(t('forms.backup_code.download')) %> + icon: :file_download, + unstyled: true, + class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', + ).with_content(t('forms.backup_code.download')) %> <%= render PrintButtonComponent.new( icon: :print, diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 84537b8a56f..c21c69ba17c 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -9,7 +9,7 @@ <%= render AccordionComponent.new do |c| %> <% c.header { t('forms.personal_key_partial.explanation.header') } %> <% t('forms.personal_key_partial.explanation.text').each do |paragraph| %> -

<%= paragraph%>

+

<%= paragraph %>

<% end %> <% end %> @@ -40,7 +40,7 @@ as: :boolean, label: @acceptance_prompt, label_html: { class: 'margin-y-0' }, - required: true + required: true, ) %> <%= button_to( diff --git a/spec/javascripts/packs/personal-key-spec.ts b/spec/javascripts/packs/personal-key-spec.ts deleted file mode 100644 index 7f9cea3266c..00000000000 --- a/spec/javascripts/packs/personal-key-spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { screen } from '@testing-library/dom'; -import userEvent from '@testing-library/user-event'; -import { useSandbox } from '@18f/identity-test-helpers'; -import * as analytics from '@18f/identity-analytics'; - -describe('personal key', () => { - const sandbox = useSandbox(); - - beforeEach(async () => { - document.body.innerHTML = ` - Download - `; - await import('../../../app/javascript/packs/personal-key-page-controller'); - }); - - afterEach(() => { - sandbox.restore(); - delete require.cache[require.resolve('../../../app/javascript/packs/personal-key-page-controller')]; - }); - - it('adds an event listener to the download button', async () => { - const test = sandbox.spy(analytics, 'trackEvent'); - await userEvent.click(screen.getElementById('acknowledgment')); - await userEvent.click(screen.getElementById('acknowledgment')); - - sandbox.assert.calledTwice(test); - sandbox.assert.calledWith(test, 'IdV: personal key acknowledged'); - sandbox.assert.calledWith(test, 'IdV: personal key un-acknowledged'); - }); -}); From 47f7a50b3101e45cbcbcf762baa26b82040c20cd Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 10:49:13 -0400 Subject: [PATCH 08/55] Lint/Yaml complaints --- config/locales/forms/en.yml | 32 +++++++++++++++--------------- config/locales/forms/es.yml | 32 +++++++++++++++--------------- config/locales/forms/fr.yml | 39 ++++++++++++++++++------------------- 3 files changed, 51 insertions(+), 52 deletions(-) diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index d6d1d84911c..edc348e3da7 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -63,29 +63,29 @@ en: submit: Change password labels: password: New password + personal_key: + alternative: Don’t have your personal key? + confirmation_label: Personal key + instructions: Please confirm you have a copy of your personal key by entering it below. + title: Enter your personal key personal_key_partial: - header: Save your personal key + acknowledgement: + bullets: + - You’ll lose access to your account + - You’ll need to verify your identity again + header: You need your personal key if you forget your password. Keep it safe and + don’t share it with anyone. + instructions: Check the box above to continue + text: 'If you reset your password without your personal key:' explanation: header: What is a personal key? text: - - A personal key "locks" your personal information with your account. - It's the only way to unlock your information if you lose or forget + - A personal key “locks” your personal information with your account. + It’s the only way to unlock your information if you lose or forget your password. - When you reset your password, Login.gov will ask for your personal key to make sure you are you - not someone pretending to be you. - acknowledgement: - header: You need your personal key if you forget your password. - Keep it safe and don't share it with anyone. - text: "If you reset your password without your personal key:" - bullets: - - You'll lose access to your account - - You'll need to verify your identity again - instructions: Check the box above to continue - personal_key: - alternative: Don’t have your personal key? - confirmation_label: Personal key - instructions: Please confirm you have a copy of your personal key by entering it below. - title: Enter your personal key + header: Save your personal key phone: buttons: delete: Remove phone diff --git a/config/locales/forms/es.yml b/config/locales/forms/es.yml index 7cd50dd8fbc..f6f67676f36 100644 --- a/config/locales/forms/es.yml +++ b/config/locales/forms/es.yml @@ -68,31 +68,31 @@ es: submit: Cambiar la contraseña labels: password: Nueva contraseña + personal_key: + alternative: '¿No tiene su clave personal?' + confirmation_label: Clave personal + instructions: Confirme que tiene una copia de su clave personal ingresándola a + continuación. + title: Ingrese su clave personal personal_key_partial: - header: Guarda tu clave personal + acknowledgement: + bullets: + - Perderás el acceso a tu cuenta + - Tendrás que verificar tu identidad nuevamente + header: Necesitarás tu clave personal si olvidas tu contraseña. Mantenla en un + lugar seguro y no la compartas con nadie. + instructions: Marca la casilla de arriba para continuar. + text: 'Si restableces tu contraseña sin tu clave personal:' explanation: header: ¿Qué es una clave personal? text: - - Una clave personal "bloquea" la información personal de tu cuenta. + - Una clave personal “bloquea” la información personal de tu cuenta. Es la única manera de desbloquear tu información si pierdes u olvidas tu contraseña. - Si restableces tu contraseña, Login.gov te pedirá tu clave personal para asegurarse de que se trata de ti, y no de alguien que quiere hacerse pasar por ti. - acknowledgement: - header: Necesitarás tu clave personal si olvidas tu contraseña. - Mantenla en un lugar seguro y no la compartas con nadie. - text: "Si restableces tu contraseña sin tu clave personal:" - bullets: - - Perderás el acceso a tu cuenta - - Tendrás que verificar tu identidad nuevamente - instructions: Marca la casilla de arriba para continuar. - personal_key: - alternative: '¿No tiene su clave personal?' - confirmation_label: Clave personal - instructions: Confirme que tiene una copia de su clave personal ingresándola a - continuación. - title: Ingrese su clave personal + header: Guarda tu clave personal phone: buttons: delete: Eliminar el teléfono diff --git a/config/locales/forms/fr.yml b/config/locales/forms/fr.yml index 4e0fdb09e0d..f77061396d3 100644 --- a/config/locales/forms/fr.yml +++ b/config/locales/forms/fr.yml @@ -69,32 +69,31 @@ fr: submit: Changer le mot de passe labels: password: Nouveau mot de passe - personal_key_partial: - header: Sauvegardez votre clé personnelle - explanation: - header: Qu'est-ce qu'une clé personnelle? - text: - - Une clé personnelle « verrouille » vos informations personnelles - avec votre compte. C'est le seul moyen de déverrouiller vos - informations si vous perdez ou oubliez votre mot de passe. - - Lors de la réinitialisation de votre mot de passe, Login.gov vous - demandera votre clé personnelle pour s'assurer que vous êtes bien - vous, et non quelqu'un qui se fait passer pour vous. - acknowledgement: - header: En cas d'oubli de votre mot de passe, vous aurez besoin de - votre clé personnelle. - Gardez-la en sécurité et ne la partagez avec personne. - text: "Si vous réinitialisez votre mot de passe sans votre clé personnelle:" - bullets: - - Vous perdrez l'accès à votre compte - - Vous allez devoir vérifier à nouveau votre identité 
 - instructions: Cochez la case ci-dessus pour continuer. personal_key: alternative: Vous n’avez pas votre clé personnelle? confirmation_label: Clé personnelle instructions: Veuillez confirmer que vous avez une copie de votre clé personnelle en l’entrant ci-dessous. title: Entrez votre clé personnelle + personal_key_partial: + acknowledgement: + bullets: + - Vous perdrez l’accès à votre compte + - Vous allez devoir vérifier à nouveau votre identité + header: En cas d’oubli de votre mot de passe, vous aurez besoin de votre clé + personnelle. Gardez-la en sécurité et ne la partagez avec personne. + instructions: Cochez la case ci-dessus pour continuer. + text: 'Si vous réinitialisez votre mot de passe sans votre clé personnelle:' + explanation: + header: Qu’est-ce qu’une clé personnelle? + text: + - Une clé personnelle « verrouille » vos informations personnelles + avec votre compte. C’est le seul moyen de déverrouiller vos + informations si vous perdez ou oubliez votre mot de passe. + - Lors de la réinitialisation de votre mot de passe, Login.gov vous + demandera votre clé personnelle pour s’assurer que vous êtes bien + vous, et non quelqu’un qui se fait passer pour vous. + header: Sauvegardez votre clé personnelle phone: buttons: delete: Supprimer le numéro de teléfono From 164928b2927086001bdc595f7d8c2b8687d6c860 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 12:11:10 -0400 Subject: [PATCH 09/55] Removed unused log controller map entries --- app/controllers/frontend_log_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/frontend_log_controller.rb b/app/controllers/frontend_log_controller.rb index 3b69e8b128e..3cae4dc8967 100644 --- a/app/controllers/frontend_log_controller.rb +++ b/app/controllers/frontend_log_controller.rb @@ -15,8 +15,6 @@ class FrontendLogController < ApplicationController 'IdV: switch_back submitted' => :idv_in_person_switch_back_submitted, 'IdV: download personal key' => :idv_personal_key_downloaded, 'IdV: Native camera forced after failed attempts' => :idv_native_camera_forced, - 'IdV: personal key acknowledged' => :idv_personal_key_acknowledged, - 'IdV: personal key un-acknowledged' => :idv_personal_key_unacknowledged, 'Multi-Factor Authentication: download backup code' => :multi_factor_auth_backup_code_download, 'Show Password button clicked' => :show_password_button_clicked, }.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze From 5ee50d14a1375971c2eb67e4ad91dfe2fb977ec3 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 12:29:43 -0400 Subject: [PATCH 10/55] Fixed incorrect element id --- app/views/shared/_personal_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index c21c69ba17c..f3432fd5675 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -36,7 +36,7 @@ <%= render ValidatedFieldComponent.new( form: f, - name: :terms_accepted, + name: :acknowledgment as: :boolean, label: @acceptance_prompt, label_html: { class: 'margin-y-0' }, From 2f545fc1c6773325a4d7ee9635d9d8fbe1ce6af7 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 12:40:15 -0400 Subject: [PATCH 11/55] Typo. *sigh* --- app/views/shared/_personal_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index f3432fd5675..1da0b8318d0 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -36,7 +36,7 @@ <%= render ValidatedFieldComponent.new( form: f, - name: :acknowledgment + name: :acknowledgment, as: :boolean, label: @acceptance_prompt, label_html: { class: 'margin-y-0' }, From aa96f3999a3ebfd0bb96bcc02fbe298a8f088d9d Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 7 Oct 2022 14:59:14 -0400 Subject: [PATCH 12/55] Test fix. --- app/views/shared/_personal_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 1da0b8318d0..4e6c61b1da3 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -14,7 +14,7 @@ <% end %> -<%= simple_form_for('') do |f| %> +<%= simple_form_for('', url: '/junk') do |f| %> <% @acceptance_prompt = capture do %>

From 2ab80a5ef9e4b2eac10ad36ba14b6963b4dc7f11 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 10:07:23 -0400 Subject: [PATCH 13/55] Removed unused strings --- config/locales/instructions/en.yml | 7 ------- config/locales/instructions/es.yml | 7 ------- config/locales/instructions/fr.yml | 8 -------- config/locales/users/en.yml | 1 - config/locales/users/es.yml | 1 - config/locales/users/fr.yml | 1 - 6 files changed, 25 deletions(-) diff --git a/config/locales/instructions/en.yml b/config/locales/instructions/en.yml index 9d3eae94ca6..abdf7e0763b 100644 --- a/config/locales/instructions/en.yml +++ b/config/locales/instructions/en.yml @@ -102,13 +102,6 @@ en: intro: 'Password strength: ' iv: Good v: Great! - personal_key: - email_body: Don’t lose your personal key or share it with others. We’ll ask for - it if you reset your password. - email_title: Save it. Keep it safe. - info: You’ll need this personal key if you forget your password. If you reset - your password and don’t have this key, you’ll have to verify your - identity again. sp_handoff_bounced: Your sign in was successful, but %{sp_name} sent you back to %{app_name}. Please contact %{sp_link} for help. sp_handoff_bounced_with_no_sp: your service provider diff --git a/config/locales/instructions/es.yml b/config/locales/instructions/es.yml index 9b1cfc800bb..bc2023c54a5 100644 --- a/config/locales/instructions/es.yml +++ b/config/locales/instructions/es.yml @@ -109,13 +109,6 @@ es: intro: 'Seguridad de la contraseña:' iv: Buena v: '¡Muy buena!' - personal_key: - email_body: No pierdas tu clave personal ni la compartas con otros. La pediremos - si restableces tu contraseña. - email_title: Guárdala. Manténla segura. - info: Necesitarás esta clave personal si olvidas tu contraseña. Si restableces - tu contraseña y no tienes esta clave, deberás verificar tu identidad - nuevamente. sp_handoff_bounced: Su inicio de sesión fue exitoso, pero %{sp_name} lo envió de regreso a %{app_name}. Póngase en contacto con %{sp_link} para obtener ayuda. diff --git a/config/locales/instructions/fr.yml b/config/locales/instructions/fr.yml index 6cd6ae02317..71174ab25f4 100644 --- a/config/locales/instructions/fr.yml +++ b/config/locales/instructions/fr.yml @@ -119,14 +119,6 @@ fr: intro: 'Force du mot de passe : ' iv: Bonne v: Excellente! - personal_key: - email_body: Ne perdez pas votre clé personnelle et ne la partagez pas avec - d’autres. Nous vous le demanderons si vous réinitialisez votre mot de - passe. - email_title: Sauvegarde le. Garde-le en sécurité. - info: Vous aurez besoin de cette clé personnelle si vous oubliez votre mot de - passe. Si vous réinitialisez votre mot de passe et que vous ne possédez - pas cette clé, vous devrez vérifier votre identité à nouveau. sp_handoff_bounced: Votre connexion a réussi, mais %{sp_name} vous a renvoyé à %{app_name}. Veuillez contacter %{sp_link} pour obtenir de l’aide. sp_handoff_bounced_with_no_sp: votre fournisseur de service diff --git a/config/locales/users/en.yml b/config/locales/users/en.yml index 9e09085beb9..316a6db802e 100644 --- a/config/locales/users/en.yml +++ b/config/locales/users/en.yml @@ -22,7 +22,6 @@ en: close: Close confirmation_error: You’ve entered an incorrect personal key. generated_on_html: Your personal key was generated on %{date} - header: Your personal key phones: error_message: You’ve added the maximum number of phone numbers. rules_of_use: diff --git a/config/locales/users/es.yml b/config/locales/users/es.yml index 10e5fe746a1..a883204cc8f 100644 --- a/config/locales/users/es.yml +++ b/config/locales/users/es.yml @@ -23,7 +23,6 @@ es: close: Cerrar confirmation_error: Ha ingresado una clave personal incorrecta. generated_on_html: Tu clave personal fue generada el %{date} - header: Su clave personal phones: error_message: Agregó el número máximo de números de teléfono. rules_of_use: diff --git a/config/locales/users/fr.yml b/config/locales/users/fr.yml index 90ba89b97c6..bbef10bd0f0 100644 --- a/config/locales/users/fr.yml +++ b/config/locales/users/fr.yml @@ -25,7 +25,6 @@ fr: close: Fermer confirmation_error: Vous avez entré un clé personnelle erronée. generated_on_html: Votre clé personnelle a été générée le %{date} - header: Votre clé personnelle phones: error_message: Vous avez ajouté le nombre maximum de numéros de téléphone. rules_of_use: From fc4b574c14600bdffb9511ba3d65925fd74d6f0f Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 11:45:39 -0400 Subject: [PATCH 14/55] Checkin to push --- app/views/shared/_personal_key.html.erb | 2 +- spec/support/features/session_helper.rb | 2 ++ spec/support/shared_examples_for_personal_keys.rb | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 4e6c61b1da3..1da0b8318d0 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -14,7 +14,7 @@ <% end %> -<%= simple_form_for('', url: '/junk') do |f| %> +<%= simple_form_for('') do |f| %> <% @acceptance_prompt = capture do %>

diff --git a/spec/support/features/session_helper.rb b/spec/support/features/session_helper.rb index d98d38b7a89..988f0bb2e7f 100644 --- a/spec/support/features/session_helper.rb +++ b/spec/support/features/session_helper.rb @@ -324,6 +324,8 @@ def acknowledge_and_confirm_personal_key end def click_acknowledge_personal_key + checkbox_header = t('forms.personal_key_partial.acknowledgement.header') + find(text: /#{checkbox_header}/) click_continue end diff --git a/spec/support/shared_examples_for_personal_keys.rb b/spec/support/shared_examples_for_personal_keys.rb index c271dbdc0ed..8e2dce5ee91 100644 --- a/spec/support/shared_examples_for_personal_keys.rb +++ b/spec/support/shared_examples_for_personal_keys.rb @@ -46,7 +46,14 @@ it 'validates as case-insensitive, crockford-normalized, length-limited, dash-flexible' do code_segments = scrape_personal_key.split('-') + # DEBUG + save_screenshot('before-click-acknowledge-personal-key.png'); + click_acknowledge_personal_key + + # DEBUG + save_screenshot('after-click-acknowledge-personal-key.png'); + input = page.find(':focus') # Validate as incorrect From 0f3b0c68ee96ab094eb942847ef7c82bbe9d5abc Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 12:56:55 -0400 Subject: [PATCH 15/55] Pass update_path through to simple_form_for --- app/views/shared/_personal_key.html.erb | 2 +- spec/support/features/session_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 1da0b8318d0..38a29057609 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -14,7 +14,7 @@ <% end %> -<%= simple_form_for('') do |f| %> +<%= simple_form_for('', url: update_path) do |f| %> <% @acceptance_prompt = capture do %>

diff --git a/spec/support/features/session_helper.rb b/spec/support/features/session_helper.rb index 988f0bb2e7f..5b1477f8d0d 100644 --- a/spec/support/features/session_helper.rb +++ b/spec/support/features/session_helper.rb @@ -325,7 +325,7 @@ def acknowledge_and_confirm_personal_key def click_acknowledge_personal_key checkbox_header = t('forms.personal_key_partial.acknowledgement.header') - find(text: /#{checkbox_header}/) + find('label', text: /#{checkbox_header}/) click_continue end From 481be99c7fdafb9184552b06ccd6df474d8ad406 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 13:55:48 -0400 Subject: [PATCH 16/55] Forcibly prevent personal key confirmation dialog. --- app/views/shared/_personal_key.html.erb | 2 +- spec/support/shared_examples_for_personal_keys.rb | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 38a29057609..decabacde1c 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -47,7 +47,7 @@ t('forms.buttons.continue'), update_path, class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', - 'data-toggle': FeatureManagement.idv_personal_key_confirmation_enabled? ? 'modal' : 'skip', +j 'data-toggle': 'skip', ) %> <% end %> diff --git a/spec/support/shared_examples_for_personal_keys.rb b/spec/support/shared_examples_for_personal_keys.rb index 8e2dce5ee91..69d5c0f702c 100644 --- a/spec/support/shared_examples_for_personal_keys.rb +++ b/spec/support/shared_examples_for_personal_keys.rb @@ -46,14 +46,8 @@ it 'validates as case-insensitive, crockford-normalized, length-limited, dash-flexible' do code_segments = scrape_personal_key.split('-') - # DEBUG - save_screenshot('before-click-acknowledge-personal-key.png'); - click_acknowledge_personal_key - # DEBUG - save_screenshot('after-click-acknowledge-personal-key.png'); - input = page.find(':focus') # Validate as incorrect From 24e59bda806699d97292a8d05aed888680e56c76 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 14:03:24 -0400 Subject: [PATCH 17/55] Typo --- app/views/shared/_personal_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index decabacde1c..878d591eb01 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -47,7 +47,7 @@ t('forms.buttons.continue'), update_path, class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', -j 'data-toggle': 'skip', + 'data-toggle': 'skip', ) %> <% end %> From 3d45c3cfb1a418e50c4b82162b815edca29c683e Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 14:13:00 -0400 Subject: [PATCH 18/55] Removed shared examples for personal keys --- .../idv/steps/confirmation_step_spec.rb | 4 - .../users/regenerate_personal_key_spec.rb | 12 +-- .../shared_examples_for_personal_keys.rb | 86 ------------------- 3 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 spec/support/shared_examples_for_personal_keys.rb diff --git a/spec/features/idv/steps/confirmation_step_spec.rb b/spec/features/idv/steps/confirmation_step_spec.rb index 9dd13ed6c6a..34c4b6d0444 100644 --- a/spec/features/idv/steps/confirmation_step_spec.rb +++ b/spec/features/idv/steps/confirmation_step_spec.rb @@ -14,8 +14,6 @@ complete_idv_steps_before_confirmation_step(address_verification_mechanism) end - it_behaves_like 'personal key page' - it 'shows status content for phone verification progress' do expect(page).to have_content(t('idv.messages.confirm')) expect_step_indicator_current_step(t('step_indicator.flows.idv.secure_account')) @@ -41,8 +39,6 @@ expect(page).to have_content(t('step_indicator.flows.idv.get_a_letter')) expect(page).not_to have_content(t('step_indicator.flows.idv.verify_phone_or_address')) end - - it_behaves_like 'personal key page', :gpo end context 'with associated sp' do diff --git a/spec/features/users/regenerate_personal_key_spec.rb b/spec/features/users/regenerate_personal_key_spec.rb index 5a595988db2..0d382c16131 100644 --- a/spec/features/users/regenerate_personal_key_spec.rb +++ b/spec/features/users/regenerate_personal_key_spec.rb @@ -58,16 +58,6 @@ expect(user.reload.encrypted_recovery_code_digest).to_not eq old_digest end end - - describe 'personal key actions and information' do - before do - sign_in_and_2fa_user(user) - visit account_two_factor_authentication_path - click_on(t('account.links.regenerate_personal_key'), match: :prefer_exact) - click_continue - end - - it_behaves_like 'personal key page' - end end end + diff --git a/spec/support/shared_examples_for_personal_keys.rb b/spec/support/shared_examples_for_personal_keys.rb deleted file mode 100644 index 69d5c0f702c..00000000000 --- a/spec/support/shared_examples_for_personal_keys.rb +++ /dev/null @@ -1,86 +0,0 @@ -require 'rbconfig' - -shared_examples_for 'personal key page' do |address_verification_mechanism| - include PersonalKeyHelper - include JavascriptDriverHelper - - describe 'confirmation modal' do - before do - click_continue if javascript_enabled? - end - - it 'displays modal content' do - expect(page).to have_content t('forms.personal_key.title') - expect(page).to have_content t('forms.personal_key.instructions') - end - end - - context 'with javascript enabled', js: true do - before do - page.driver.browser.execute_cdp( - 'Browser.grantPermissions', - origin: page.server_url, - permissions: ['clipboardReadWrite', 'clipboardSanitizedWrite'], - ) - end - - after do - page.driver.browser.execute_cdp('Browser.resetPermissions') - end - - it 'allows a user to copy the code into the confirmation modal' do - click_on t('components.clipboard_button.label') - copied_text = page.evaluate_async_script('navigator.clipboard.readText().then(arguments[0])') - - expect(copied_text).to eq(scrape_personal_key) - - click_continue - mod = mac? ? :meta : :control - page.find(':focus').send_keys [mod, 'v'] - - path_before_submit = current_path - within('[role=dialog]') { click_on t('forms.buttons.continue') } - expect(current_path).not_to eq path_before_submit - end - - it 'validates as case-insensitive, crockford-normalized, length-limited, dash-flexible' do - code_segments = scrape_personal_key.split('-') - - click_acknowledge_personal_key - - input = page.find(':focus') - - # Validate as incorrect - input.fill_in with: 'wrong!' - within('[role=dialog]') { click_on t('forms.buttons.continue') } - expect(page).to have_content(t('users.personal_key.confirmation_error')) - - # Validate as correct, with formatting variations... - - # Include dash between some segments and not others - code = code_segments[0..1].join('-') + code_segments[2..3].join - - # Randomize case - code = code.chars.map { |c| (rand 2) == 0 ? c.downcase : c.upcase }.join - - # De-normalize Crockford encoding - code = code.sub('1', 'l').sub('0', 'O') - - # Add extra characters - code += 'abc123qwerty' - - input.fill_in with: code - - within('[role=dialog]') { click_on t('forms.buttons.continue') } - if address_verification_mechanism == :gpo - expect(current_path).to eq idv_come_back_later_path - else - expect(current_path).to eq account_path - end - end - end - - def mac? - RbConfig::CONFIG['host_os'].match? 'darwin' - end -end From e0264bbfe58b409dc1b174d75f50efb54f4eae9e Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 14:21:25 -0400 Subject: [PATCH 19/55] Personal key confirmation tests --- spec/features/idv/steps/confirmation_step_spec.rb | 2 ++ spec/support/features/session_helper.rb | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/features/idv/steps/confirmation_step_spec.rb b/spec/features/idv/steps/confirmation_step_spec.rb index 34c4b6d0444..277b1a9492b 100644 --- a/spec/features/idv/steps/confirmation_step_spec.rb +++ b/spec/features/idv/steps/confirmation_step_spec.rb @@ -41,6 +41,8 @@ end end + it "forces the user to click the 'acknowledge' checkbox before proceeding" + context 'with associated sp' do let(:sp) { :oidc } diff --git a/spec/support/features/session_helper.rb b/spec/support/features/session_helper.rb index 5b1477f8d0d..a560935b4bf 100644 --- a/spec/support/features/session_helper.rb +++ b/spec/support/features/session_helper.rb @@ -318,9 +318,6 @@ def sign_in_with_totp_enabled_user def acknowledge_and_confirm_personal_key click_acknowledge_personal_key - - page.find(':focus').fill_in with: scrape_personal_key - within('[role=dialog]') { click_continue } end def click_acknowledge_personal_key From fffb7cab89d65625a41af34262523a127fc7fd78 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 15:34:27 -0400 Subject: [PATCH 20/55] Actually check the checkbox --- spec/features/idv/steps/confirmation_step_spec.rb | 12 ++++++++++-- spec/support/features/session_helper.rb | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/features/idv/steps/confirmation_step_spec.rb b/spec/features/idv/steps/confirmation_step_spec.rb index 277b1a9492b..a6249722c80 100644 --- a/spec/features/idv/steps/confirmation_step_spec.rb +++ b/spec/features/idv/steps/confirmation_step_spec.rb @@ -41,11 +41,19 @@ end end - it "forces the user to click the 'acknowledge' checkbox before proceeding" - context 'with associated sp' do let(:sp) { :oidc } + it "forces the user to click the 'acknowledge' checkbox before proceeding" do + click_continue + + expect(page).to have_content(t('forms.validation.required_checkbox')) + expect(current_path).to eq(idv_personal_key_path) + + acknowledge_and_confirm_personal_key + expect(page).to have_current_path(sign_up_completed_path) + end + it 'redirects to the completions page and then to the SP' do acknowledge_and_confirm_personal_key diff --git a/spec/support/features/session_helper.rb b/spec/support/features/session_helper.rb index a560935b4bf..86e35a87ed4 100644 --- a/spec/support/features/session_helper.rb +++ b/spec/support/features/session_helper.rb @@ -322,7 +322,7 @@ def acknowledge_and_confirm_personal_key def click_acknowledge_personal_key checkbox_header = t('forms.personal_key_partial.acknowledgement.header') - find('label', text: /#{checkbox_header}/) + find('label', text: /#{checkbox_header}/).click click_continue end From fc8e1efefcd33b0a806009dcd5b6c40ac45b5e1d Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 16:21:27 -0400 Subject: [PATCH 21/55] Removed unused string --- config/locales/headings/en.yml | 1 - config/locales/headings/es.yml | 1 - config/locales/headings/fr.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/config/locales/headings/en.yml b/config/locales/headings/en.yml index c19a456178e..aca5a659bc6 100644 --- a/config/locales/headings/en.yml +++ b/config/locales/headings/en.yml @@ -34,7 +34,6 @@ en: confirm: Confirm your current password to continue confirm_for_personal_key: Enter password and get a new personal key forgot: Forgot your password? - personal_key: Save your personal key piv_cac: certificate: bad: The PIV/CAC certificate you selected is invalid diff --git a/config/locales/headings/es.yml b/config/locales/headings/es.yml index 01449e023fc..c8fc13dd168 100644 --- a/config/locales/headings/es.yml +++ b/config/locales/headings/es.yml @@ -34,7 +34,6 @@ es: confirm: Confirme la contraseña actual para continuar confirm_for_personal_key: Introduzca la contraseña y obtenga una nueva clave personal forgot: '¿Olvidó su contraseña?' - personal_key: Guarda tu clave personal piv_cac: certificate: bad: El certificado PIV/CAC que seleccionaste no es válido. diff --git a/config/locales/headings/fr.yml b/config/locales/headings/fr.yml index de2c4e53066..c70bd3f926c 100644 --- a/config/locales/headings/fr.yml +++ b/config/locales/headings/fr.yml @@ -34,7 +34,6 @@ fr: confirm: Confirmez votre mot de passe actuel pour continuer confirm_for_personal_key: Entrez le mot de passe et obtenez une nouvelle clé personnelle forgot: Vous avez oublié votre mot de passe? - personal_key: Enregistrez votre clé personnelle piv_cac: certificate: bad: Le certificat PIV/CAC que vous avez sélectionné n’est pas valide. From ec9a9a68344005da9f38ae6fe6c167b68de0a35f Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 16:22:02 -0400 Subject: [PATCH 22/55] Fixed broken specs --- spec/features/idv/analytics_spec.rb | 2 -- spec/views/shared/_personal_key.html.erb_spec.rb | 16 ++-------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 59f6413ab7d..3f513e772d6 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -39,7 +39,6 @@ 'IdV: final resolution' => { success: true }, 'IdV: personal key visited' => {}, 'IdV: personal key submitted' => {}, - 'Frontend: IdV: show personal key modal' => {}, } end let(:gpo_path_events) do @@ -121,7 +120,6 @@ 'IdV: review complete' => { success: true }, 'IdV: final resolution' => { success: true }, 'IdV: personal key visited' => {}, - 'Frontend: IdV: show personal key modal' => {}, 'IdV: personal key submitted' => {}, 'IdV: in person ready to verify visited' => {}, } diff --git a/spec/views/shared/_personal_key.html.erb_spec.rb b/spec/views/shared/_personal_key.html.erb_spec.rb index 594c9060d64..abff6e56ec6 100644 --- a/spec/views/shared/_personal_key.html.erb_spec.rb +++ b/spec/views/shared/_personal_key.html.erb_spec.rb @@ -38,20 +38,8 @@ def self.decode(value) and_return(idv_personal_key_confirmation_enabled) end - context 'without idv personal key confirmation' do - let(:idv_personal_key_confirmation_enabled) { false } - - it 'renders button with [data-toggle="skip"]' do - expect(rendered).to have_css('[data-toggle="skip"]') - end - end - - context 'with idv personal key confirmation' do - let(:idv_personal_key_confirmation_enabled) { true } - - it 'renders button with [data-toggle="modal"]' do - expect(rendered).to have_css('[data-toggle="modal"]') - end + it 'renders with [data-toggle="skip"]' do + expect(rendered).to have_css('[data-toggle="skip"]') end end end From 611bb17342436e593a6166305715d0e7c87719f3 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 16:38:32 -0400 Subject: [PATCH 23/55] Lint nits --- app/views/shared/_personal_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 878d591eb01..f66635d59cd 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -47,7 +47,7 @@ t('forms.buttons.continue'), update_path, class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', - 'data-toggle': 'skip', + 'data-toggle': 'skip', ) %> <% end %> From c44efd3f5c151e42d5025fcc33662383fed61bfe Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 16:53:24 -0400 Subject: [PATCH 24/55] Absolutely trivial lint nit --- spec/features/users/regenerate_personal_key_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/users/regenerate_personal_key_spec.rb b/spec/features/users/regenerate_personal_key_spec.rb index 0d382c16131..f79fcee68aa 100644 --- a/spec/features/users/regenerate_personal_key_spec.rb +++ b/spec/features/users/regenerate_personal_key_spec.rb @@ -60,4 +60,3 @@ end end end - From 360b1b4f0928835cdcf59d7969567a33972c0ca8 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 18:08:52 -0400 Subject: [PATCH 25/55] Spec fixes. --- spec/features/idv/steps/confirmation_step_spec.rb | 2 +- spec/features/idv/steps/review_step_spec.rb | 2 +- spec/features/users/regenerate_personal_key_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/idv/steps/confirmation_step_spec.rb b/spec/features/idv/steps/confirmation_step_spec.rb index a6249722c80..c241792501b 100644 --- a/spec/features/idv/steps/confirmation_step_spec.rb +++ b/spec/features/idv/steps/confirmation_step_spec.rb @@ -27,7 +27,7 @@ it 'allows the user to refresh and still displays the personal key' do # Visit the current path is the same as refreshing visit current_path - expect(page).to have_content(t('headings.personal_key')) + expect(page).to have_content(t('forms.personal_key_partial.acknowledgement.header')) end context 'verifying by gpo' do diff --git a/spec/features/idv/steps/review_step_spec.rb b/spec/features/idv/steps/review_step_spec.rb index 652aabde783..3b90bd99784 100644 --- a/spec/features/idv/steps/review_step_spec.rb +++ b/spec/features/idv/steps/review_step_spec.rb @@ -32,7 +32,7 @@ fill_in 'Password', with: user_password click_idv_continue - expect(page).to have_content(t('headings.personal_key')) + expect(page).to have_content(t('forms.personal_key_partial.acknowledgement.header')) expect(current_path).to eq idv_personal_key_path end diff --git a/spec/features/users/regenerate_personal_key_spec.rb b/spec/features/users/regenerate_personal_key_spec.rb index f79fcee68aa..135e09fd650 100644 --- a/spec/features/users/regenerate_personal_key_spec.rb +++ b/spec/features/users/regenerate_personal_key_spec.rb @@ -52,7 +52,7 @@ expect(page).to have_content(t('account.personal_key.get_new')) click_continue - expect(page).to have_content(t('headings.personal_key')) + expect(page).to have_content(t('forms.personal_key_partial.acknowledgement.header')) acknowledge_and_confirm_personal_key expect(user.reload.encrypted_recovery_code_digest).to_not eq old_digest From ef4c8b285525babf3b8b0e4fdd3e4dab56e43722 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 18:18:31 -0400 Subject: [PATCH 26/55] Removed dead code --- .../packs/personal-key-page-controller.js | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index d51dee5be28..5defc6bcb0d 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -30,36 +30,6 @@ function resetForm() { input.setCustomValidity(''); } -function validateInput() { - let isValid = false; - try { - const value = encodeInput(input.value); - isValid = value === personalKey; - } catch {} - - input.setCustomValidity(isValid ? '' : t('users.personal_key.confirmation_error')); -} - -function show(event) { - event.preventDefault(); - - modal.on('show', function () { - input.focus(); - }); - - trackEvent('IdV: show personal key modal'); - modal.show(); -} - -function hide() { - modal.on('hide', function () { - resetForm(); - }); - - trackEvent('IdV: hide personal key modal'); - modal.hide(); -} - function downloadForIE(event) { event.preventDefault(); @@ -82,11 +52,6 @@ function trackDownload() { trackEvent('IdV: download personal key'); } -if (modalTrigger) { - modalTrigger.addEventListener('click', show); -} -modalDismiss.addEventListener('click', hide); -input.addEventListener('input', validateInput); downloadLink.addEventListener('click', trackDownload); acknowledgmentCheckbox.addEventListener('click', trackAcknowledgment); From 872eb247af68f89d76b63e8fbb1d220cb052398d Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 18:29:41 -0400 Subject: [PATCH 27/55] More dead code removal --- app/javascript/packs/personal-key-page-controller.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 5defc6bcb0d..1a57e582742 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -1,15 +1,10 @@ -import { encodeInput } from '@18f/identity-personal-key-input'; import { trackEvent } from '@18f/identity-analytics'; -import { t } from '@18f/identity-i18n'; const modalSelector = '#personal-key-confirm'; -const modal = new window.LoginGov.Modal({ el: modalSelector }); const personalKeyWords = [].slice.call(document.querySelectorAll('[data-personal-key]')); const formEl = document.getElementById('confirm-key'); const input = formEl.querySelector('input[type="text"]'); -const modalTrigger = document.querySelector('[data-toggle="modal"]'); -const modalDismiss = document.querySelector('[data-dismiss="personal-key-confirm"]'); const downloadLink = document.querySelector('a[download]'); const acknowledgmentCheckbox = document.getElementById('acknowledgment'); @@ -23,13 +18,6 @@ function scrapePersonalKey() { return keywords.join('-').toUpperCase(); } -const personalKey = scrapePersonalKey(); - -function resetForm() { - formEl.reset(); - input.setCustomValidity(''); -} - function downloadForIE(event) { event.preventDefault(); From d5597e0d0a71ca53985a48ab8ed8cd22b304303e Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 18:38:31 -0400 Subject: [PATCH 28/55] Still more dead code --- app/javascript/packs/personal-key-page-controller.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 1a57e582742..b9b489cc106 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -1,10 +1,6 @@ import { trackEvent } from '@18f/identity-analytics'; -const modalSelector = '#personal-key-confirm'; - const personalKeyWords = [].slice.call(document.querySelectorAll('[data-personal-key]')); -const formEl = document.getElementById('confirm-key'); -const input = formEl.querySelector('input[type="text"]'); const downloadLink = document.querySelector('a[download]'); const acknowledgmentCheckbox = document.getElementById('acknowledgment'); From 2b9f1c197f08c5397d4374305387d9956bc87868 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 12 Oct 2022 19:27:15 -0400 Subject: [PATCH 29/55] Fix spec broken by rebase onto current master --- spec/features/idv/analytics_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 3f513e772d6..5a57730d283 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -72,7 +72,6 @@ 'IdV: review complete' => { success: true }, 'IdV: final resolution' => { success: true }, 'IdV: personal key visited' => {}, - 'Frontend: IdV: show personal key modal' => {}, 'IdV: personal key submitted' => {}, 'IdV: come back later visited' => {}, } From b1db85f26dde04650505211fb22c47a6c6d5dac6 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:08:36 -0400 Subject: [PATCH 30/55] Update app/javascript/packs/personal-key-page-controller.js Co-authored-by: Andrew Duthie --- app/javascript/packs/personal-key-page-controller.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index b9b489cc106..5cd8d94eee8 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -25,11 +25,10 @@ function downloadForIE(event) { } function trackAcknowledgment(clickEvent) { - if (clickEvent.target.checked) { - trackEvent('IdV: personal key acknowledged'); - } else { - trackEvent('IdV: personal key un-acknowledged'); - } + trackEvent( + 'IdV: personal key acknowledgment toggled', + { checked: clickEvent.target.checked }, + ); } function trackDownload() { From 0cb10c4ed7c7a8ab7721ef9dad40fa67ab3b07c6 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:09:21 -0400 Subject: [PATCH 31/55] Update app/views/shared/_personal_key.html.erb Co-authored-by: Andrew Duthie --- app/views/shared/_personal_key.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index f66635d59cd..b779cdbe139 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -3,8 +3,6 @@ <%= render 'partials/personal_key/key', code: code %> -
-

<%= render AccordionComponent.new do |c| %> <% c.header { t('forms.personal_key_partial.explanation.header') } %> From 72b0a3a900c17b1e1a15e1cb2d94bb0bbcf24b53 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:32:30 -0400 Subject: [PATCH 32/55] Update app/views/shared/_personal_key.html.erb Co-authored-by: Andrew Duthie --- app/views/shared/_personal_key.html.erb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index b779cdbe139..cbf461feb9b 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -3,14 +3,12 @@ <%= render 'partials/personal_key/key', code: code %>
-
- <%= render AccordionComponent.new do |c| %> - <% c.header { t('forms.personal_key_partial.explanation.header') } %> - <% t('forms.personal_key_partial.explanation.text').each do |paragraph| %> -

<%= paragraph %>

- <% end %> +<%= render AccordionComponent.new do |c| %> + <% c.header { t('forms.personal_key_partial.explanation.header') } %> + <% t('forms.personal_key_partial.explanation.text').each do |paragraph| %> +

<%= paragraph %>

<% end %> -
+<% end %> <%= simple_form_for('', url: update_path) do |f| %> <% @acceptance_prompt = capture do %> From 8acd63650d3c4fd3f96b3b5668dd6c930f1056b0 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:36:40 -0400 Subject: [PATCH 33/55] Update app/views/partials/personal_key/_key.html.erb Co-authored-by: Andrew Duthie --- app/views/partials/personal_key/_key.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index f00265af6c6..7c168c4cf5e 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -31,7 +31,7 @@ end, icon: :file_download, unstyled: true, - class: 'margin-right-2 margin-bottom-2 tablet:margin-bottom-0', + class: 'margin-x-2 display-inline-block', ).with_content(t('forms.backup_code.download')) %> <%= render PrintButtonComponent.new( From b558b2183e18a5d6019d1d4ce3fe9f9120639678 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:38:03 -0400 Subject: [PATCH 34/55] Update app/views/shared/_personal_key.html.erb "valid html" Heh. Co-authored-by: Andrew Duthie --- app/views/shared/_personal_key.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index cbf461feb9b..0fa09af875e 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -17,14 +17,14 @@ <%= t('forms.personal_key_partial.acknowledgement.header') %>

-

+

<%= t('forms.personal_key_partial.acknowledgement.text') %> -

    - <% t('forms.personal_key_partial.acknowledgement.bullets').each do |bullet| %> -
  • <%= bullet %>
  • - <% end %> -

+
    + <% t('forms.personal_key_partial.acknowledgement.bullets').each do |bullet| %> +
  • <%= bullet %>
  • + <% end %> +

<%= t('forms.personal_key_partial.acknowledgement.instructions') %>

From 82ea4870f7d10c2a302814d3df35f7842a1c2c67 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:38:50 -0400 Subject: [PATCH 35/55] Update app/views/shared/_personal_key.html.erb Co-authored-by: Andrew Duthie --- app/views/shared/_personal_key.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 0fa09af875e..56cda17c23a 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -13,9 +13,9 @@ <%= simple_form_for('', url: update_path) do |f| %> <% @acceptance_prompt = capture do %>

- + <%= t('forms.personal_key_partial.acknowledgement.header') %> - +

<%= t('forms.personal_key_partial.acknowledgement.text') %> From 05bca60135b96a19c41a6522243f667f73a97fb4 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 11:42:50 -0400 Subject: [PATCH 36/55] Update app/views/shared/_personal_key.html.erb Co-authored-by: Andrew Duthie --- app/views/shared/_personal_key.html.erb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 56cda17c23a..45faa86e692 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -39,12 +39,7 @@ required: true, ) %> - <%= button_to( - t('forms.buttons.continue'), - update_path, - class: 'display-block usa-button usa-button--full-width usa-button--wide personal-key-continue margin-top-5', - 'data-toggle': 'skip', - ) %> + <%= f.submit(t('forms.buttons.continue'), full_width: true, class: 'margin-top-3') %> <% end %> <%= render 'shared/personal_key_confirmation_modal', code: code, update_path: update_path %> From 756e2f4b673d4872d50355eae736cfe23a5565bd Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 13 Oct 2022 02:07:32 -0400 Subject: [PATCH 37/55] Review comment Remove
and use margin styling insead. --- app/views/partials/personal_key/_key.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index 7c168c4cf5e..aed86428cf8 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -6,15 +6,13 @@ <% end %> -

+

<%= t( 'users.personal_key.generated_on_html', date: content_tag(:strong, I18n.l(Time.zone.today, format: '%B %d, %Y')), ) %>

-
- <%= render ClipboardButtonComponent.new( clipboard_text: code, unstyled: true, From 64adfddb75c8c462f18c3aadb67d1b8e6c1fc577 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 15:08:39 -0400 Subject: [PATCH 38/55] Review comment Re-arranged confirmation text per slack discussion. --- app/views/shared/_personal_key.html.erb | 39 ++++++++++++------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 45faa86e692..919df5aa01e 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -11,36 +11,33 @@ <% end %> <%= simple_form_for('', url: update_path) do |f| %> - <% @acceptance_prompt = capture do %> -

- - <%= t('forms.personal_key_partial.acknowledgement.header') %> - -

-

- <%= t('forms.personal_key_partial.acknowledgement.text') %> -

-
    - <% t('forms.personal_key_partial.acknowledgement.bullets').each do |bullet| %> -
  • <%= bullet %>
  • - <% end %> -
-

- <%= t('forms.personal_key_partial.acknowledgement.instructions') %> -

- <% end %> +

+ + <%= t('forms.personal_key_partial.acknowledgement.header') %> + +

+ +

+ <%= t('forms.personal_key_partial.acknowledgement.text') %> +

+ +
    + <% t('forms.personal_key_partial.acknowledgement.bullets').each do |bullet| %> +
  • <%= bullet %>
  • + <% end %> +
<%= render ValidatedFieldComponent.new( form: f, name: :acknowledgment, as: :boolean, - label: @acceptance_prompt, - label_html: { class: 'margin-y-0' }, + label: t('forms.validation.required_checkbox'), + label_html: { class: 'margin-bottom-105' }, required: true, ) %> + <%= f.submit(t('forms.buttons.continue'), full_width: true, class: 'margin-top-3') %> <% end %> -<%= render 'shared/personal_key_confirmation_modal', code: code, update_path: update_path %> <%== javascript_packs_tag_once 'personal-key-page-controller' %> From 914cdfebc30cf19c938517cbeed6865819c50d44 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 15:28:42 -0400 Subject: [PATCH 39/55] Review comment Moved text for personal key download button to its own string file entry. --- app/views/partials/personal_key/_key.html.erb | 2 +- config/locales/forms/en.yml | 3 ++- config/locales/forms/es.yml | 3 ++- config/locales/forms/fr.yml | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/partials/personal_key/_key.html.erb b/app/views/partials/personal_key/_key.html.erb index aed86428cf8..774205e6428 100644 --- a/app/views/partials/personal_key/_key.html.erb +++ b/app/views/partials/personal_key/_key.html.erb @@ -30,7 +30,7 @@ icon: :file_download, unstyled: true, class: 'margin-x-2 display-inline-block', - ).with_content(t('forms.backup_code.download')) %> + ).with_content(t('forms.personal_key.download')) %> <%= render PrintButtonComponent.new( icon: :print, diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index edc348e3da7..3b78f15b9cf 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -13,7 +13,7 @@ en: caution_delete: If you delete your backup codes you will no longer be able to use them to sign in. confirm_delete: Are you sure you want to delete your backup codes? - download: Download (text file) + download: Download generate: Get codes last_code: You used your last backup code. Please print, copy or download the codes below. You can use these new codes the next time you sign in. @@ -66,6 +66,7 @@ en: personal_key: alternative: Don’t have your personal key? confirmation_label: Personal key + download: Download (text file) instructions: Please confirm you have a copy of your personal key by entering it below. title: Enter your personal key personal_key_partial: diff --git a/config/locales/forms/es.yml b/config/locales/forms/es.yml index f6f67676f36..8e6a929832e 100644 --- a/config/locales/forms/es.yml +++ b/config/locales/forms/es.yml @@ -14,7 +14,7 @@ es: caution_delete: Si elimina sus códigos de respaldo, ya no podrá usarlos para iniciar sesión. confirm_delete: '¿Estás seguro de que deseas eliminar tus códigos de respaldo?' - download: Descargar (archivo de texto) + download: Descargar generate: Obtener códigos last_code: Usted utilizó el último código de seguridad. Imprima, copie o descargue los códigos que aparecen a continuación. Puede introducir @@ -71,6 +71,7 @@ es: personal_key: alternative: '¿No tiene su clave personal?' confirmation_label: Clave personal + download: Descargar (archivo de texto) instructions: Confirme que tiene una copia de su clave personal ingresándola a continuación. title: Ingrese su clave personal diff --git a/config/locales/forms/fr.yml b/config/locales/forms/fr.yml index f77061396d3..4800e3dbfdc 100644 --- a/config/locales/forms/fr.yml +++ b/config/locales/forms/fr.yml @@ -15,7 +15,7 @@ fr: caution_delete: Si vous supprimez vos codes de sauvegarde, vous ne pourrez plus les utiliser pour vous connecter. confirm_delete: Êtes-vous sûr de vouloir supprimer vos codes de sauvegarde? - download: Télécharger (fichier texte) + download: Télécharger generate: Obtenir des codes last_code: Vous avez utilisé votre dernier code de sauvegarde. Veuillez imprimer, copier ou télécharger les codes ci-dessous. Vous pourrez @@ -72,6 +72,7 @@ fr: personal_key: alternative: Vous n’avez pas votre clé personnelle? confirmation_label: Clé personnelle + download: Télécharger (fichier texte) instructions: Veuillez confirmer que vous avez une copie de votre clé personnelle en l’entrant ci-dessous. title: Entrez votre clé personnelle From 27e2024485db04b1f888e9c7ba84dacc9d524006 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 15:59:08 -0400 Subject: [PATCH 40/55] Lint nit and spec helper fix --- app/javascript/packs/personal-key-page-controller.js | 2 +- spec/support/features/session_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 5cd8d94eee8..6b3448251ed 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -26,7 +26,7 @@ function downloadForIE(event) { function trackAcknowledgment(clickEvent) { trackEvent( - 'IdV: personal key acknowledgment toggled', + 'IdV: personal key acknowledgment toggle', { checked: clickEvent.target.checked }, ); } diff --git a/spec/support/features/session_helper.rb b/spec/support/features/session_helper.rb index 86e35a87ed4..dc517a6b51c 100644 --- a/spec/support/features/session_helper.rb +++ b/spec/support/features/session_helper.rb @@ -321,7 +321,7 @@ def acknowledge_and_confirm_personal_key end def click_acknowledge_personal_key - checkbox_header = t('forms.personal_key_partial.acknowledgement.header') + checkbox_header = t('forms.validation.required_checkbox') find('label', text: /#{checkbox_header}/).click click_continue end From b4d906cd24d443abad446508b8e3293989de08db Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 16:29:12 -0400 Subject: [PATCH 41/55] Lint uglifying. --- app/javascript/packs/personal-key-page-controller.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 6b3448251ed..73a40f86346 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -25,10 +25,7 @@ function downloadForIE(event) { } function trackAcknowledgment(clickEvent) { - trackEvent( - 'IdV: personal key acknowledgment toggle', - { checked: clickEvent.target.checked }, - ); + trackEvent('IdV: personal key acknowledgment toggle', { checked: clickEvent.target.checked }); } function trackDownload() { From 32e16f717a576e55a46e434c65f7c57dc864d2c1 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 16:31:24 -0400 Subject: [PATCH 42/55] Removed test for dead code. --- spec/views/shared/_personal_key.html.erb_spec.rb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/spec/views/shared/_personal_key.html.erb_spec.rb b/spec/views/shared/_personal_key.html.erb_spec.rb index abff6e56ec6..1d23828ceb4 100644 --- a/spec/views/shared/_personal_key.html.erb_spec.rb +++ b/spec/views/shared/_personal_key.html.erb_spec.rb @@ -29,17 +29,4 @@ def self.decode(value) expect(data_uri.data).to eq(personal_key) end end - - describe 'continue button' do - let(:idv_personal_key_confirmation_enabled) { nil } - - before do - allow(FeatureManagement).to receive(:idv_personal_key_confirmation_enabled?). - and_return(idv_personal_key_confirmation_enabled) - end - - it 'renders with [data-toggle="skip"]' do - expect(rendered).to have_css('[data-toggle="skip"]') - end - end end From 18155efaa63b6de63c34b4a9adbc64009cc96420 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Oct 2022 16:53:05 -0400 Subject: [PATCH 43/55] Removed unused string --- config/locales/forms/en.yml | 1 - config/locales/forms/es.yml | 1 - config/locales/forms/fr.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index 3b78f15b9cf..03675150023 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -76,7 +76,6 @@ en: - You’ll need to verify your identity again header: You need your personal key if you forget your password. Keep it safe and don’t share it with anyone. - instructions: Check the box above to continue text: 'If you reset your password without your personal key:' explanation: header: What is a personal key? diff --git a/config/locales/forms/es.yml b/config/locales/forms/es.yml index 8e6a929832e..8aa6e9a19ed 100644 --- a/config/locales/forms/es.yml +++ b/config/locales/forms/es.yml @@ -82,7 +82,6 @@ es: - Tendrás que verificar tu identidad nuevamente header: Necesitarás tu clave personal si olvidas tu contraseña. Mantenla en un lugar seguro y no la compartas con nadie. - instructions: Marca la casilla de arriba para continuar. text: 'Si restableces tu contraseña sin tu clave personal:' explanation: header: ¿Qué es una clave personal? diff --git a/config/locales/forms/fr.yml b/config/locales/forms/fr.yml index 4800e3dbfdc..4ab1156a40a 100644 --- a/config/locales/forms/fr.yml +++ b/config/locales/forms/fr.yml @@ -83,7 +83,6 @@ fr: - Vous allez devoir vérifier à nouveau votre identité header: En cas d’oubli de votre mot de passe, vous aurez besoin de votre clé personnelle. Gardez-la en sécurité et ne la partagez avec personne. - instructions: Cochez la case ci-dessus pour continuer. text: 'Si vous réinitialisez votre mot de passe sans votre clé personnelle:' explanation: header: Qu’est-ce qu’une clé personnelle? From 85235cad990afba35311f7cf00145350507add52 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 10:19:37 -0400 Subject: [PATCH 44/55] Update app/javascript/packs/personal-key-page-controller.js Co-authored-by: Andrew Duthie --- app/javascript/packs/personal-key-page-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/packs/personal-key-page-controller.js b/app/javascript/packs/personal-key-page-controller.js index 73a40f86346..e7739b55c8b 100644 --- a/app/javascript/packs/personal-key-page-controller.js +++ b/app/javascript/packs/personal-key-page-controller.js @@ -25,7 +25,7 @@ function downloadForIE(event) { } function trackAcknowledgment(clickEvent) { - trackEvent('IdV: personal key acknowledgment toggle', { checked: clickEvent.target.checked }); + trackEvent('IdV: personal key acknowledgment toggled', { checked: clickEvent.target.checked }); } function trackDownload() { From f79fa64b7e917cae3588c4664a996d181fc1ddb3 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 10:42:15 -0400 Subject: [PATCH 45/55] Review comments Removed personal key confirmation dialog feature flag (the dialog is gone and the flag is now unused). Improved personal key acknowledgment checkbox logging. --- config/application.yml.default | 1 - lib/feature_management.rb | 4 ---- lib/identity_config.rb | 1 - spec/features/idv/analytics_spec.rb | 1 + .../idv/steps/confirmation_step_spec.rb | 17 ----------------- 5 files changed, 1 insertion(+), 23 deletions(-) diff --git a/config/application.yml.default b/config/application.yml.default index abb8196fde2..d3f67d63095 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -107,7 +107,6 @@ idv_max_attempts: 5 idv_min_age_years: 13 idv_native_camera_a_b_testing_enabled: false idv_native_camera_a_b_testing_percent: 10 -idv_personal_key_confirmation_enabled: true idv_send_link_attempt_window_in_minutes: 10 idv_send_link_max_attempts: 5 idv_sp_required: false diff --git a/lib/feature_management.rb b/lib/feature_management.rb index 4275487568b..a26e92bbe38 100644 --- a/lib/feature_management.rb +++ b/lib/feature_management.rb @@ -112,10 +112,6 @@ def self.log_to_stdout? !Rails.env.test? && IdentityConfig.store.log_to_stdout end - def self.idv_personal_key_confirmation_enabled? - IdentityConfig.store.idv_personal_key_confirmation_enabled - end - # Manual allowlist for VOIPs, should only include known VOIPs that we use for smoke tests # @return [Set] set of phone numbers normalized to e164 def self.voip_allowed_phones diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 8f7ec34b0ea..d20424275c7 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -186,7 +186,6 @@ def self.build_store(config_map) config.add(:idv_min_age_years, type: :integer) config.add(:idv_native_camera_a_b_testing_enabled, type: :boolean) config.add(:idv_native_camera_a_b_testing_percent, type: :integer) - config.add(:idv_personal_key_confirmation_enabled, type: :boolean) config.add(:idv_send_link_attempt_window_in_minutes, type: :integer) config.add(:idv_send_link_max_attempts, type: :integer) config.add(:idv_sp_required, type: :boolean) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 5a57730d283..7bb9b8ff1ba 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -39,6 +39,7 @@ 'IdV: final resolution' => { success: true }, 'IdV: personal key visited' => {}, 'IdV: personal key submitted' => {}, + 'IdV: personal key acknowledgment toggled' => {}, } end let(:gpo_path_events) do diff --git a/spec/features/idv/steps/confirmation_step_spec.rb b/spec/features/idv/steps/confirmation_step_spec.rb index c241792501b..0052d2d5733 100644 --- a/spec/features/idv/steps/confirmation_step_spec.rb +++ b/spec/features/idv/steps/confirmation_step_spec.rb @@ -3,13 +3,10 @@ feature 'idv confirmation step', js: true do include IdvStepHelper - let(:idv_personal_key_confirmation_enabled) { true } let(:sp) { nil } let(:address_verification_mechanism) { :phone } before do - allow(IdentityConfig.store).to receive(:idv_personal_key_confirmation_enabled). - and_return(idv_personal_key_confirmation_enabled) start_idv_from_sp(sp) complete_idv_steps_before_confirmation_step(address_verification_mechanism) end @@ -63,19 +60,5 @@ expect(current_url).to start_with('http://localhost:7654/auth/result') end - - context 'with personal key confirmation disabled' do - let(:idv_personal_key_confirmation_enabled) { false } - - it 'redirects to the completions page and then to the SP' do - click_acknowledge_personal_key - - expect(page).to have_current_path(sign_up_completed_path) - - click_agree_and_continue - - expect(current_url).to start_with('http://localhost:7654/auth/result') - end - end end end From 9badbcee85d06ec362da49350f7af2a854922cb0 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 10:45:03 -0400 Subject: [PATCH 46/55] Removed dead code. --- .../_personal_key_confirmation_modal.html.erb | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 app/views/shared/_personal_key_confirmation_modal.html.erb diff --git a/app/views/shared/_personal_key_confirmation_modal.html.erb b/app/views/shared/_personal_key_confirmation_modal.html.erb deleted file mode 100644 index 133f17cca26..00000000000 --- a/app/views/shared/_personal_key_confirmation_modal.html.erb +++ /dev/null @@ -1,34 +0,0 @@ - From a48b000b844228d6c5ae90cc5216e02aa58768a8 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 11:19:11 -0400 Subject: [PATCH 47/55] Added event table entry for checkbox click --- app/controllers/frontend_log_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/frontend_log_controller.rb b/app/controllers/frontend_log_controller.rb index 3cae4dc8967..9d050b30f0d 100644 --- a/app/controllers/frontend_log_controller.rb +++ b/app/controllers/frontend_log_controller.rb @@ -17,6 +17,7 @@ class FrontendLogController < ApplicationController 'IdV: Native camera forced after failed attempts' => :idv_native_camera_forced, 'Multi-Factor Authentication: download backup code' => :multi_factor_auth_backup_code_download, 'Show Password button clicked' => :show_password_button_clicked, + 'IdV: personal key acknowledgment toggled' => :personal_key_acknowledgment_toggled, }.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze # rubocop:enable Layout/LineLength From b618cc055084883a5bb519951f895403f17f24a5 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 12:45:29 -0400 Subject: [PATCH 48/55] Fixed event logging cleanup Broke it the first time. --- app/services/analytics_events.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index af08a97bb6e..fc95fe758e6 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2791,5 +2791,9 @@ def contact_redirect(redirect_url:, step: nil, location: nil, flow: nil, **extra def show_password_button_clicked(path:, **extra) track_event('Show Password Button Clicked', path: path, **extra) end + + def personal_key_acknowledgment_toggled(path:, **extra) + track_event('Personal key acknowledgment checkbox toggled', path: path, **extra) + end end # rubocop:enable Metrics/ModuleLength From 7ad022a8545244507ab25465b17ca8b0c1b47587 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 12:54:48 -0400 Subject: [PATCH 49/55] More event logging --- app/services/analytics_events.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index fc95fe758e6..89e878cb4d6 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2792,8 +2792,12 @@ def show_password_button_clicked(path:, **extra) track_event('Show Password Button Clicked', path: path, **extra) end - def personal_key_acknowledgment_toggled(path:, **extra) - track_event('Personal key acknowledgment checkbox toggled', path: path, **extra) + # Tracks if a user clicks the 'acknowledge' checkbox during personal + # key creatino + # @param [boolean] Whether the user checked or un-checked the box + # with this click + def personal_key_acknowledgment_toggled(checked:, **extra) + track_event('Personal key acknowledgment checkbox toggled', checked: checked, **extra) end end # rubocop:enable Metrics/ModuleLength From b58a667f06a637c5d29b488109d71f4b53db7e68 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 13:09:48 -0400 Subject: [PATCH 50/55] Lint nit --- app/services/analytics_events.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 89e878cb4d6..a39bfc3d4df 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2794,8 +2794,8 @@ def show_password_button_clicked(path:, **extra) # Tracks if a user clicks the 'acknowledge' checkbox during personal # key creatino - # @param [boolean] Whether the user checked or un-checked the box - # with this click + # @param [boolean] checked whether the user checked or un-checked + # the box with this click def personal_key_acknowledgment_toggled(checked:, **extra) track_event('Personal key acknowledgment checkbox toggled', checked: checked, **extra) end From 814e8b2eab49bae9f6f60363339ca47c705c8323 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 14:19:12 -0400 Subject: [PATCH 51/55] Event logging --- app/services/analytics_events.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index a39bfc3d4df..e292ac58313 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2797,7 +2797,7 @@ def show_password_button_clicked(path:, **extra) # @param [boolean] checked whether the user checked or un-checked # the box with this click def personal_key_acknowledgment_toggled(checked:, **extra) - track_event('Personal key acknowledgment checkbox toggled', checked: checked, **extra) + track_event('IdV: Personal key acknowledgment toggled', checked: checked, **extra) end end # rubocop:enable Metrics/ModuleLength From a83b2dcd573b96ca4760a42c03d00df94af556e5 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 18:03:46 -0400 Subject: [PATCH 52/55] Updated logging spec --- app/services/analytics_events.rb | 2 +- spec/features/idv/analytics_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index e292ac58313..1b8e18a064b 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2797,7 +2797,7 @@ def show_password_button_clicked(path:, **extra) # @param [boolean] checked whether the user checked or un-checked # the box with this click def personal_key_acknowledgment_toggled(checked:, **extra) - track_event('IdV: Personal key acknowledgment toggled', checked: checked, **extra) + track_event('IdV: personal key acknowledgment toggled', checked: checked, **extra) end end # rubocop:enable Metrics/ModuleLength diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 7bb9b8ff1ba..573bb134ce1 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -39,7 +39,7 @@ 'IdV: final resolution' => { success: true }, 'IdV: personal key visited' => {}, 'IdV: personal key submitted' => {}, - 'IdV: personal key acknowledgment toggled' => {}, + 'IdV: personal key acknowledgment toggled' => { checked: true }, } end let(:gpo_path_events) do From 436930839cf6af1d88ec21f2a514bc9235d716ee Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 18:06:58 -0400 Subject: [PATCH 53/55] Typo --- app/services/analytics_events.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 1b8e18a064b..393a62c8634 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2793,7 +2793,7 @@ def show_password_button_clicked(path:, **extra) end # Tracks if a user clicks the 'acknowledge' checkbox during personal - # key creatino + # key creation # @param [boolean] checked whether the user checked or un-checked # the box with this click def personal_key_acknowledgment_toggled(checked:, **extra) From bab446fa798c6c65edfa23a84a03281fca23f7d1 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 19:43:24 -0400 Subject: [PATCH 54/55] Text tweak. --- app/views/shared/_personal_key.html.erb | 2 +- config/locales/forms/en.yml | 1 + config/locales/forms/es.yml | 1 + config/locales/forms/fr.yml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_personal_key.html.erb b/app/views/shared/_personal_key.html.erb index 919df5aa01e..a1c6561859e 100644 --- a/app/views/shared/_personal_key.html.erb +++ b/app/views/shared/_personal_key.html.erb @@ -31,7 +31,7 @@ form: f, name: :acknowledgment, as: :boolean, - label: t('forms.validation.required_checkbox'), + label: t('forms.personal_key.required_checkbox'), label_html: { class: 'margin-bottom-105' }, required: true, ) %> diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml index 03675150023..58f19630556 100644 --- a/config/locales/forms/en.yml +++ b/config/locales/forms/en.yml @@ -68,6 +68,7 @@ en: confirmation_label: Personal key download: Download (text file) instructions: Please confirm you have a copy of your personal key by entering it below. + required_checkbox: Please check this box to continue. title: Enter your personal key personal_key_partial: acknowledgement: diff --git a/config/locales/forms/es.yml b/config/locales/forms/es.yml index 8aa6e9a19ed..10027a2e992 100644 --- a/config/locales/forms/es.yml +++ b/config/locales/forms/es.yml @@ -74,6 +74,7 @@ es: download: Descargar (archivo de texto) instructions: Confirme que tiene una copia de su clave personal ingresándola a continuación. + required_checkbox: Marque esta casilla para continuar. title: Ingrese su clave personal personal_key_partial: acknowledgement: diff --git a/config/locales/forms/fr.yml b/config/locales/forms/fr.yml index 4ab1156a40a..8035ab42d0b 100644 --- a/config/locales/forms/fr.yml +++ b/config/locales/forms/fr.yml @@ -75,6 +75,7 @@ fr: download: Télécharger (fichier texte) instructions: Veuillez confirmer que vous avez une copie de votre clé personnelle en l’entrant ci-dessous. + required_checkbox: Veuillez cocher cette case pour continuer. title: Entrez votre clé personnelle personal_key_partial: acknowledgement: From 20936b87981bc8b50f9fc0641e4f8071cf66fa49 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 17 Oct 2022 19:55:36 -0400 Subject: [PATCH 55/55] Tweaked method name --- app/controllers/frontend_log_controller.rb | 2 +- app/services/analytics_events.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/frontend_log_controller.rb b/app/controllers/frontend_log_controller.rb index 9d050b30f0d..9f3f53c5300 100644 --- a/app/controllers/frontend_log_controller.rb +++ b/app/controllers/frontend_log_controller.rb @@ -17,7 +17,7 @@ class FrontendLogController < ApplicationController 'IdV: Native camera forced after failed attempts' => :idv_native_camera_forced, 'Multi-Factor Authentication: download backup code' => :multi_factor_auth_backup_code_download, 'Show Password button clicked' => :show_password_button_clicked, - 'IdV: personal key acknowledgment toggled' => :personal_key_acknowledgment_toggled, + 'IdV: personal key acknowledgment toggled' => :idv_personal_key_acknowledgment_toggled, }.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze # rubocop:enable Layout/LineLength diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 393a62c8634..c98b96037ae 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2796,7 +2796,7 @@ def show_password_button_clicked(path:, **extra) # key creation # @param [boolean] checked whether the user checked or un-checked # the box with this click - def personal_key_acknowledgment_toggled(checked:, **extra) + def idv_personal_key_acknowledgment_toggled(checked:, **extra) track_event('IdV: personal key acknowledgment toggled', checked: checked, **extra) end end