diff --git a/assets/js/src/form_editor/store/blocks_to_form_body.jsx b/assets/js/src/form_editor/store/blocks_to_form_body.jsx index e1a695187f..fff5ebaf01 100644 --- a/assets/js/src/form_editor/store/blocks_to_form_body.jsx +++ b/assets/js/src/form_editor/store/blocks_to_form_body.jsx @@ -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'; diff --git a/assets/js/src/form_editor/store/form_body_to_blocks.jsx b/assets/js/src/form_editor/store/form_body_to_blocks.jsx index b188dc5990..2f061176c9 100644 --- a/assets/js/src/form_editor/store/form_body_to_blocks.jsx +++ b/assets/js/src/form_editor/store/form_body_to_blocks.jsx @@ -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 = {