change gender string defaults

This commit is contained in:
Ben Wheeler 2019-09-25 09:57:40 -04:00
parent d905f624ca
commit ccffa35037

View file

@ -66,8 +66,14 @@ class GenderStep extends React.Component {
} }
handleValidSubmit (formData, formikBag) { handleValidSubmit (formData, formikBag) {
formikBag.setSubmitting(false); formikBag.setSubmitting(false);
if (!formData.gender || formData.gender === 'null') { // handle defaults:
formData.gender = ''; // default to blank // when gender is specifically made blank, use "(blank)"
if (!formData.gender || formData.gender === '') {
formData.gender = '(blank)';
}
// when user clicks Next without making any selection, use "(skipped)"
if (formData.gender === 'null') {
formData.gender = '(skipped)';
} }
delete formData.custom; delete formData.custom;
this.props.onNextStep(formData); this.props.onNextStep(formData);
@ -155,7 +161,7 @@ class GenderStep extends React.Component {
id="GenderRadioOptionPreferNot" id="GenderRadioOptionPreferNot"
label={this.props.intl.formatMessage({id: 'registration.genderOptionPreferNotToSay'})} label={this.props.intl.formatMessage({id: 'registration.genderOptionPreferNotToSay'})}
selectedValue={values.gender} selectedValue={values.gender}
value="Prefer not to say" value="(Prefer not to say)"
onSetFieldValue={setFieldValue} onSetFieldValue={setFieldValue}
/> />
<div className="join-flow-privacy-message join-flow-gender-privacy"> <div className="join-flow-privacy-message join-flow-gender-privacy">