Map first name field
[MAILPOET-2452]
This commit is contained in:
committed by
Rostislav Wolný
parent
f7a9753ae1
commit
5ce2a2d918
@@ -24,6 +24,20 @@ export default (blocks) => {
|
|||||||
mapped.params.label_within = '1';
|
mapped.params.label_within = '1';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'mailpoet-form/first-name-input':
|
||||||
|
mapped.id = 'first_name';
|
||||||
|
mapped.type = 'text';
|
||||||
|
mapped.unique = '1';
|
||||||
|
mapped.static = '0';
|
||||||
|
mapped.name = 'First name';
|
||||||
|
mapped.params.label = block.attributes.label;
|
||||||
|
if (block.attributes.mandatory) {
|
||||||
|
mapped.params.required = '1';
|
||||||
|
}
|
||||||
|
if (block.attributes.labelWithinInput) {
|
||||||
|
mapped.params.label_within = '1';
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'mailpoet-form/submit-button':
|
case 'mailpoet-form/submit-button':
|
||||||
mapped.id = 'submit';
|
mapped.id = 'submit';
|
||||||
mapped.type = 'submit';
|
mapped.type = 'submit';
|
||||||
|
@@ -20,6 +20,14 @@ export default (data) => {
|
|||||||
labelWithinInput: !!item.params.label_within,
|
labelWithinInput: !!item.params.label_within,
|
||||||
};
|
};
|
||||||
return mapped;
|
return mapped;
|
||||||
|
case 'first_name':
|
||||||
|
mapped.name = 'mailpoet-form/first-name-input';
|
||||||
|
mapped.attributes = {
|
||||||
|
label: item.params.label,
|
||||||
|
labelWithinInput: !!item.params.label_within,
|
||||||
|
mandatory: !!item.params.required,
|
||||||
|
};
|
||||||
|
return mapped;
|
||||||
case 'submit':
|
case 'submit':
|
||||||
mapped.name = 'mailpoet-form/submit-button';
|
mapped.name = 'mailpoet-form/submit-button';
|
||||||
mapped.attributes = {
|
mapped.attributes = {
|
||||||
|
Reference in New Issue
Block a user