diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index b93a100c74ec2..e148169e47a45 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fixes + +- Fix a regression where the Cover block migration would not work with custom units for `minHeight` ([#28627](https://github.com/WordPress/gutenberg/pull/28627)) + ## 2.27.0 (2020-12-17) ### Enhancement diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index fe08fb9cd72a8..270e1cd5f792f 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -74,6 +74,9 @@ const deprecated = [ minHeight: { type: 'number', }, + minHeightUnit: { + type: 'string', + }, gradient: { type: 'string', }, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html index 00094d59af0fa..79f8a553b77af 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html @@ -12,3 +12,15 @@ + +
+
+ +

+ +
+
+ diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json index c1902f57919ea..9155ddd543594 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json @@ -28,5 +28,41 @@ } ], "originalContent": "\n\t
\n\t\t\n\t
\n" + }, + { + "clientId": "_clientId_1", + "name": "core/cover", + "isValid": true, + "attributes": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "hasParallax": false, + "dimRatio": 0, + "backgroundType": "image", + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "title": "", + "contentAlign": "center", + "isRepeated": false, + "minHeight": 48, + "minHeightUnit": "vw", + "className": "alignfull" + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "", + "dropCap": false + }, + "innerBlocks": [], + "originalContent": "

" + } + ], + "originalContent": "\n\t
\n\t\t\n\t
\n" } ] diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json index c38b616c41d0d..cb1f14786bf34 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json @@ -27,6 +27,47 @@ "\n\t\n\n" ] }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + }, + { + "blockName": "core/cover", + "attrs": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "dimRatio": 0, + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "minHeight": 48, + "minHeightUnit": "vw", + "align": "full" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\t\t

\n\t\t", + "innerContent": [ + "\n\t\t

\n\t\t" + ] + } + ], + "innerHTML": "\n\n\t
\n\t\t\n\t
\n\n", + "innerContent": [ + "\n\n\t
\n\t\t", + null, + "\n\t
\n\n" + ] + }, { "blockName": null, "attrs": {}, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html index b9dfae00e3e66..f079f578eca39 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html @@ -5,3 +5,9 @@

+ + +
+

+
+