Declined option across all fields

This commit is contained in:
Olivia Ruiz-Knott
2020-06-02 10:29:29 -04:00
parent 2bc7b4ee00
commit a868df9b72
2 changed files with 19 additions and 7 deletions

View File

@@ -119,33 +119,40 @@ class AccountSettingsPage extends React.Component {
demographicsGenderOptions: DEMOGRAPHICS_GENDER_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.gender.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsEthnicityOptions: DEMOGRAPHICS_ETHNICITY_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.ethnicity.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsIncomeOptions: DEMOGRAPHICS_INCOME_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.income.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsMilitaryHistoryOptions: DEMOGRAPHICS_MILITARY_HISTORY_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.military_history.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsEducationLevelOptions: DEMOGRAPHICS_EDUCATION_LEVEL_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.education_level.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsWorkStatusOptions: DEMOGRAPHICS_WORK_STATUS_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.work_status.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
demographicsWorkSectorOptions: DEMOGRAPHICS_WORK_SECTOR_OPTIONS.map(key => ({
value: key,
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.work_sector.options.${key || 'empty'}`]),
})),
})).concat(this.getDeclinedOption()),
}));
getDeclinedOption() {
return [{
value: 'declined',
label: this.props.intl.formatMessage(messages[`account.settings.field.demographics.options.declined`])
}]
}
isEditable(fieldName) {
return !this.props.staticFields.includes(fieldName);
}

View File

@@ -713,6 +713,11 @@ const messages = defineMessages({
defaultMessage: 'Other',
description: 'The label for the Other work sector option.',
},
'account.settings.field.demographics.options.declined': {
id: 'account.settings.field.demographics.options.declined',
defaultMessage: 'Prefer not to respond',
description: 'The label for the declined option.',
},
'account.settings.field.time.zone': {
id: 'account.settings.field.time.zone',