Set default label ''

[MAILPOET-2592]
This commit is contained in:
Pavel Dohnal
2020-01-07 15:22:20 +01:00
committed by Rostislav Wolný
parent 03e8dd860c
commit 34203b3d69
2 changed files with 2 additions and 2 deletions

View File

@@ -82,7 +82,7 @@ export default (data, customFields = []) => {
mapped.attributes.labelWithinInput = !!item.params.label_within; mapped.attributes.labelWithinInput = !!item.params.label_within;
} }
if (item.params) { if (item.params) {
mapped.attributes.label = item.params.label ? item.params.label : null; mapped.attributes.label = item.params.label ? item.params.label : '';
} }
switch (item.id) { switch (item.id) {
case 'email': case 'email':

View File

@@ -224,7 +224,7 @@ describe('Form Body To Blocks', () => {
delete input.params.label; delete input.params.label;
const [block] = formBodyToBlocks([{ ...emailInput, position: '1' }]); const [block] = formBodyToBlocks([{ ...emailInput, position: '1' }]);
checkBlockBasics(block); checkBlockBasics(block);
expect(block.attributes.label).to.be.equal(null); expect(block.attributes.label).to.be.equal('');
}); });
it('Should map first name input to block', () => { it('Should map first name input to block', () => {