+ <% 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',
+ ) %>
+
+ <%= 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 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.
-
+<%= 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 %>
<% t('forms.personal_key_partial.acknowledgement.bullets').each do |bullet| %>
- <%= "
#{bullet}
".html_safe %>
+
<%= bullet %>
<% end %>
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 %>
-
-