Add data mappers for custom html block

[MAILPOET-2462]
This commit is contained in:
Rostislav Wolny
2019-12-10 17:22:29 +01:00
committed by Pavel Dohnal
parent 5d5bcd6ab0
commit d3bc831f69
4 changed files with 70 additions and 0 deletions

View File

@@ -83,6 +83,17 @@ export default (blocks) => {
static: '0',
params: '',
};
case 'mailpoet-form/custom-html':
return {
...mapped,
id: 'html',
type: 'html',
name: 'Custom text or HTML',
static: '0',
params: {
text: block.attributes && block.attributes.content ? block.attributes.content : '',
},
};
default:
return null;
}

View File

@@ -70,6 +70,15 @@ export default (data) => {
name: 'mailpoet-form/divider',
clientId: `divider_${index}`,
};
case 'html':
return {
...mapped,
name: 'mailpoet-form/custom-html',
clientId: `custom_html_${index}`,
attributes: {
content: item.params && item.params.text ? item.params.text : '',
},
};
default:
return null;
}