-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1150] Part 2: User Profile Enhancements for Former Names #857
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments added.
i18n/en.js
Outdated
@@ -98,11 +98,31 @@ const en = { | |||
"preferredNameField": { | |||
"placeholder": "Enter preferred name" | |||
}, | |||
"formerNameSubHeader": "Former Names", | |||
"formerNameIntrodution": "Former names are other name(s) you have used in the past for paperwork and administrative purposes (for example, legal name changes, unmarried or “maiden name”, married name). We collect this information so that we can match information we collect from other sources, like state health registries, to you.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should formerNameIntrodution
be corrected to formerNameIntroduction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
i18n/es.js
Outdated
@@ -99,6 +99,26 @@ | |||
"preferredNameField": { | |||
"placeholder": "Ingrese el nombre de pila preferido" | |||
}, | |||
"formerNameSubHeader": "Nombres anteriores", | |||
"formerNameIntrodution": "Los nombres anteriores son otros nombres que ha utilizado en el pasado en documentos y procesos administrativos (por ejemplo, cambios de nombre legal, apellido de soltera, apellido de casada). Recopilamos esta información para poder vincular la información que recopilamos de otras fuentes, como los registros de salud estatales, con la suya. ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
js/components/form.js
Outdated
@@ -64,6 +64,26 @@ export const renderUserProfile = async () => { | |||
</div> | |||
<br> | |||
<hr style="color:#A9AEB1;"> | |||
|
|||
<p class="userProfileSubHeaders" data-i18n="form.formerNameSubHeader">Former Names</p> | |||
<span data-i18n="form.formerNameIntrodution">Former names are other name(s) you have used in the past for paperwork and administrative purposes (for example, legal name changes, unmarried or “maiden name”, married name). We collect this information so that we can match information we collect from other sources, like state health registries, to you.</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
•The state and country dropdowns (from a previous PR) are helpful for long-term analytics
•I think it's important to match the existing UP History data structure so it can be:
(1) Implemented in the user profile in a consistent way
(2) Reliably accessed when needed
Question:
Is this going to be implemented on the My Profile
page, or is that not part of this update?
js/event.js
Outdated
const selectId = `former-name-category-${formerNameItems.length + 1}`; | ||
|
||
const div1 = document.createElement('div'); | ||
div1.classList = ['form-group row former-name-item']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
I think .add
with an array of classes is more widely supported across browsers: div1.classList.add('form-group', 'row', 'former-name-item');
js/event.js
Outdated
div1_1.classList = ['col-md-3']; | ||
|
||
const select = document.createElement('select'); | ||
select.classList = ['form-control']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same about classList.add()
js/event.js
Outdated
|
||
formerNameOptions.forEach((option) => { | ||
const opt = document.createElement("option"); | ||
opt.classList = ["option-dark-mode"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same about classList.add()
js/event.js
Outdated
div1_2.classList = ['col-md-4']; | ||
|
||
const input = document.createElement('input'); | ||
input.classList = ['form-control']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same about classList.add()
js/settingsHelpers.js
Outdated
export const getFormerNameData = () => { | ||
const formerNameItems = document.getElementsByClassName("former-name-item"); | ||
const fNameArray = []; | ||
const mNameArray = []; | ||
const lNameArray = []; | ||
Array.from(formerNameItems).forEach((_, index) => { | ||
const inputElement = document.getElementById( | ||
`former-name-value-${index + 1}` | ||
); | ||
const selectElement = document.getElementById( | ||
`former-name-category-${index + 1}` | ||
); | ||
if (inputElement.value) { | ||
switch (selectElement.value) { | ||
case "first": | ||
fNameArray.push(inputElement.value); | ||
break; | ||
case "middle": | ||
mNameArray.push(inputElement.value); | ||
break; | ||
case "last": | ||
lNameArray.push(inputElement.value); | ||
break; | ||
} | ||
} | ||
}); | ||
return fNameArray.length || mNameArray.length || lNameArray.length | ||
? { | ||
[cId.userProfileUpdateTimestamp]: new Date().toISOString(), | ||
[cId.fName]: fNameArray.length ? fNameArray : undefined, | ||
[cId.mName]: mNameArray.length ? mNameArray : undefined, | ||
[cId.lName]: lNameArray.length ? lNameArray : undefined, | ||
} | ||
: undefined; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see mixed data issues in the [Array]
parts. Those are strings in the existing UP history implementation.
We are starting to use that UP history for some things like NORC Birthday cards, and we need to make sure the data is in a predictable format.
There will be more entries in the array, but I think those should be expanded out so each entry for 231676651, 399159511, and 996038075 is a separate object in the 569151507 UP History array.
Each UP history object needs:
•update string (first/middle/last name).
•update timestamp 371303487.
•profile change requested by 611005658 (this will be the participant's email address for this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated, please check it again.
e7842b5
to
a37c763
Compare
a37c763
to
71660eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming the UP history data structure now matches the existing spec. Thank you.
I ran into an issue in testing where I:
(1) Filled out the form (creating my profile)
(2) Clicked the submit button
(3) Viewed the verification form
(4) Clicked that submit button
Everything worked well to that point.
Then, the data saved correctly, but the form did not advance to the next screen.
Please test this and I'll approve once you're sure that part is working.
app.js
Outdated
@@ -18,7 +18,7 @@ import { firebaseConfig as prodFirebaseConfig } from "./prod/config.js"; | |||
// When doing local development, uncomment this. | |||
// Get the API key file from Box or the DevOps team | |||
// Do not accept PRs with the localDevFirebaseConfig import uncommented | |||
// import { firebaseConfig as localDevFirebaseConfig} from "./local-dev/config.js"; | |||
import { firebaseConfig as localDevFirebaseConfig} from "./local-dev/config.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please disable this before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
This PR addresses issue episphere/connect#1150