fix(settings): Change challenge label and input

Closes #17318
This commit is contained in:
nathanhannig
2018-07-19 17:18:31 -07:00
committed by Stuart Taylor
parent bd40601305
commit ae37a2caed
2 changed files with 6 additions and 2 deletions

View File

@ -48,6 +48,7 @@ function DynamicForm({
<FormFields
errors={ errors }
fields={ fields }
formId={ id }
options={ options }
/>
{

View File

@ -19,6 +19,7 @@ const propTypes = {
value: PropTypes.string.isRequired
})
).isRequired,
formId: PropTypes.string,
options: PropTypes.shape({
errors: PropTypes.objectOf(
PropTypes.oneOfType([
@ -34,7 +35,7 @@ const propTypes = {
};
function FormFields(props) {
const { errors = {}, fields, options = {} } = props;
const { errors = {}, fields, formId, options = {} } = props;
const {
ignored = [],
placeholder = true,
@ -48,7 +49,9 @@ function FormFields(props) {
.filter(field => !ignored.includes(field))
.map(key => fields[key])
.map(({ name, onChange, value, pristine }) => {
const key = _.kebabCase(name);
const key = formId ?
`${formId}_${_.kebabCase(name)}` :
_.kebabCase(name);
const type = name in types ? types[name] : 'text';
return (
<Row className='inline-form-field' key={ key }>