Store columns block vertical alignment settings
[MAILPOET-2609]
This commit is contained in:
committed by
Pavel Dohnal
parent
6dc1fa5177
commit
d6b06ec371
@@ -108,6 +108,7 @@ const mapBlocks = (blocks, customFields = [], parent = null) => {
|
|||||||
type: 'columns',
|
type: 'columns',
|
||||||
body: mapBlocks(block.innerBlocks, customFields, block),
|
body: mapBlocks(block.innerBlocks, customFields, block),
|
||||||
params: {
|
params: {
|
||||||
|
vertical_alignment: block.attributes.verticalAlignment || null,
|
||||||
class_name: block.attributes.className || null,
|
class_name: block.attributes.className || null,
|
||||||
text_color: block.attributes.textColor || null,
|
text_color: block.attributes.textColor || null,
|
||||||
background_color: block.attributes.backgroundColor || null,
|
background_color: block.attributes.backgroundColor || null,
|
||||||
|
@@ -165,7 +165,9 @@ export const nestedColumns = {
|
|||||||
clientId: 'columns-1',
|
clientId: 'columns-1',
|
||||||
name: 'core/columns',
|
name: 'core/columns',
|
||||||
isValid: true,
|
isValid: true,
|
||||||
attributes: {},
|
attributes: {
|
||||||
|
verticalAlignment: 'center',
|
||||||
|
},
|
||||||
innerBlocks: [
|
innerBlocks: [
|
||||||
{
|
{
|
||||||
clientId: 'column-1-1',
|
clientId: 'column-1-1',
|
||||||
|
@@ -310,6 +310,7 @@ describe('Blocks to Form Body', () => {
|
|||||||
expect(columns.body.length).to.be.equal(2);
|
expect(columns.body.length).to.be.equal(2);
|
||||||
expect(columns.type).to.be.equal('columns');
|
expect(columns.type).to.be.equal('columns');
|
||||||
expect(columns.position).to.be.equal('2');
|
expect(columns.position).to.be.equal('2');
|
||||||
|
expect(columns.params.vertical_alignment).to.be.equal('center');
|
||||||
const column1 = columns.body[0];
|
const column1 = columns.body[0];
|
||||||
const column2 = columns.body[1];
|
const column2 = columns.body[1];
|
||||||
expect(column1.type).to.be.equal('column');
|
expect(column1.type).to.be.equal('column');
|
||||||
|
@@ -320,6 +320,7 @@ describe('Form Body To Blocks', () => {
|
|||||||
const blocks = formBodyToBlocks([email, nested, unknown]);
|
const blocks = formBodyToBlocks([email, nested, unknown]);
|
||||||
expect(blocks.length).to.be.equal(2);
|
expect(blocks.length).to.be.equal(2);
|
||||||
expect(blocks[1].name).to.be.equal('core/columns');
|
expect(blocks[1].name).to.be.equal('core/columns');
|
||||||
|
expect(blocks[1].attributes.verticalAlignment).to.be.equal('center');
|
||||||
// First level
|
// First level
|
||||||
const column1 = blocks[1].innerBlocks[0];
|
const column1 = blocks[1].innerBlocks[0];
|
||||||
expect(column1.name).to.be.equal('core/column');
|
expect(column1.name).to.be.equal('core/column');
|
||||||
|
@@ -178,6 +178,9 @@ export const customHtml = {
|
|||||||
export const nestedColumns = {
|
export const nestedColumns = {
|
||||||
position: '2',
|
position: '2',
|
||||||
type: 'columns',
|
type: 'columns',
|
||||||
|
params: {
|
||||||
|
vertical_alignment: 'center',
|
||||||
|
},
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
position: '1',
|
position: '1',
|
||||||
|
Reference in New Issue
Block a user