Refactor blocks client id generating from form data
[MAILPOET-2462]
This commit is contained in:
committed by
Pavel Dohnal
parent
d3bc831f69
commit
a577680122
@@ -8,7 +8,7 @@ export default (data) => {
|
||||
}
|
||||
return data.map((item, index) => {
|
||||
const mapped = {
|
||||
clientId: item.id,
|
||||
clientId: `${item.id}_${index}`,
|
||||
isValid: true,
|
||||
innerBlocks: [],
|
||||
attributes: {
|
||||
@@ -68,13 +68,11 @@ export default (data) => {
|
||||
return {
|
||||
...mapped,
|
||||
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 : '',
|
||||
},
|
||||
|
Reference in New Issue
Block a user