Map last name field

[MAILPOET-2452]
This commit is contained in:
Pavel Dohnal
2019-12-04 12:47:51 +01:00
committed by Rostislav Wolný
parent 5ce2a2d918
commit 9460006727
2 changed files with 22 additions and 0 deletions

View File

@@ -38,6 +38,20 @@ export default (blocks) => {
mapped.params.label_within = '1';
}
break;
case 'mailpoet-form/last-name-input':
mapped.id = 'last_name';
mapped.type = 'text';
mapped.unique = '1';
mapped.static = '0';
mapped.name = 'Last 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':
mapped.id = 'submit';
mapped.type = 'submit';

View File

@@ -28,6 +28,14 @@ export default (data) => {
mandatory: !!item.params.required,
};
return mapped;
case 'last_name':
mapped.name = 'mailpoet-form/last-name-input';
mapped.attributes = {
label: item.params.label,
labelWithinInput: !!item.params.label_within,
mandatory: !!item.params.required,
};
return mapped;
case 'submit':
mapped.name = 'mailpoet-form/submit-button';
mapped.attributes = {