Add support for custom padding in form column

[MAILPOET-3654]
This commit is contained in:
Rostislav Wolny
2021-08-13 10:39:50 +02:00
committed by Veljko V
parent 3700003e15
commit 8d0d2e168b
9 changed files with 53 additions and 2 deletions

View File

@@ -250,6 +250,16 @@ export const nestedColumns = {
attributes: {
width: '200px',
verticalAlignment: 'center',
style: {
spacing: {
padding: {
top: '10px',
right: '20px',
bottom: '30px',
left: '40px',
},
},
},
},
innerBlocks: [
{

View File

@@ -572,6 +572,12 @@ describe('Blocks to Form Body', () => {
const column2 = columns.body[1];
expect(column1.type).to.be.equal('column');
expect(column1.params.width).to.be.equal('200px');
expect(column1.params.padding).to.be.deep.equal({
top: '10px',
right: '20px',
bottom: '30px',
left: '40px',
});
expect(column1.params.vertical_alignment).to.be.equal('center');
expect(column1.body.length).to.be.equal(2);
expect(column2.type).to.be.equal('column');

View File

@@ -495,6 +495,12 @@ describe('Form Body To Blocks', () => {
expect(column1.name).to.be.equal('core/column');
expect(column1.attributes.width).to.be.equal('66.66%');
expect(column1.attributes.verticalAlignment).to.be.equal('center');
expect(column1.attributes.style.spacing.padding).to.be.deep.equal({
top: '10px',
right: '20px',
bottom: '30px',
left: '40px',
});
expect(column1.innerBlocks.length).to.be.equal(2);
const columns11 = column1.innerBlocks[0];
checkBlockBasics(column1.innerBlocks[1]);

View File

@@ -208,6 +208,12 @@ export const nestedColumns = {
params: {
width: 66.66,
vertical_alignment: 'center',
padding: {
top: '10px',
right: '20px',
bottom: '30px',
left: '40px',
},
},
body: [
{