Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 4478b6a

Browse files
committed
Merge branch 'staging' into develop
2 parents 130ae11 + 6f18586 commit 4478b6a

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

functions/displayBlock.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types'
77
* @author WebDevStudios
88
* @param {object} block The block data.
99
* @param {number} index A unique key required by React.
10-
* @return {Element} A block-based component.
10+
* @return {Element} A block-based component.
1111
*/
1212
export default function displayBlock(block, index) {
1313
const {attributes, name} = block
@@ -43,7 +43,7 @@ export default function displayBlock(block, index) {
4343
case 'core/spacer':
4444
return <Blocks.BlockSpacer {...attributes} key={index} />
4545
default:
46-
return <pre key={index}>{JSON.stringify(attributes, null, 2)}</pre>
46+
return <pre key={index}>{JSON.stringify(block, null, 2)}</pre>
4747
}
4848
}
4949

functions/formatBlockData.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import getFormById from '@/api/wordpress/gravityForms/getFormById'
44
* Format and retrieve expanded block data.
55
*
66
* @author WebDevStudios
7-
* @param {Array} blocks Basic block data.
8-
* @return {Array} Formatted block data.
7+
* @param {Array} blocks Basic block data.
8+
* @return {Array} Formatted block data.
99
*/
1010
export default async function formatBlockData(blocks) {
1111
if (!blocks || !blocks.length) {
@@ -14,7 +14,7 @@ export default async function formatBlockData(blocks) {
1414

1515
return await Promise.all(
1616
blocks.map(async (block) => {
17-
const {name, attributes} = block
17+
const {name, attributes, innerBlocks} = block
1818

1919
switch (name) {
2020
case 'gravityforms/form':
@@ -23,7 +23,9 @@ export default async function formatBlockData(blocks) {
2323
break
2424
}
2525

26-
return {name, attributes}
26+
const innerBlocksFormatted = await formatBlockData(innerBlocks)
27+
28+
return {name, attributes, innerBlocks: innerBlocksFormatted}
2729
})
2830
)
2931
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
"eslint-plugin-prettier": "^3.3.1",
6565
"eslint-plugin-react": "^7.22.0",
6666
"eslint-plugin-react-hooks": "^4.2.0",
67-
"graphql": "^15.4.0",
67+
"graphql": "^15.5.0",
6868
"husky": "^4.3.8",
6969
"lint-staged": "^10.5.3",
7070
"next-seo": "^4.17.0",
71-
"next-sitemap": "^1.4.5",
71+
"next-sitemap": "^1.4.13",
7272
"postcss-flexbugs-fixes": "^4.2.1",
7373
"postcss-preset-env": "^6.7.0",
7474
"prettier": "^2.2.1",

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7047,10 +7047,10 @@ graphql-tag@^2.11.0:
70477047
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd"
70487048
integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA==
70497049

7050-
graphql@^15.4.0:
7051-
version "15.4.0"
7052-
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4.0.tgz#e459dea1150da5a106486ba7276518b5295a4347"
7053-
integrity sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA==
7050+
graphql@^15.5.0:
7051+
version "15.5.0"
7052+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5"
7053+
integrity sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==
70547054

70557055
gud@^1.0.0:
70567056
version "1.0.0"
@@ -9263,10 +9263,10 @@ next-seo@^4.17.0:
92639263
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-4.17.0.tgz#fb3dbe0ed7414aa9d83872ef5d8510980a6dae7e"
92649264
integrity sha512-/hnb3oq7bhi8s7bup7+Lm6VzzgRucj+JrWtp+dJiYs/04H0N/NhmE9MpepixQ16fFj6G/39JLYxhzsO/QZG/Kw==
92659265

9266-
next-sitemap@^1.4.5:
9267-
version "1.4.5"
9268-
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.4.5.tgz#009f99f279cab63ca64803830e467fae2aae2e27"
9269-
integrity sha512-gi7xeBiJrzcSJekT0xRh26KEEU8c+v4yenzy3BDehvm2rXzl2tOFbUoSESuQkv8iHm2Gz5WC8Og297t/VRGmkw==
9266+
next-sitemap@^1.4.13:
9267+
version "1.4.13"
9268+
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.4.13.tgz#2c7638f1a48a43db8aa138e53cf9c857e540052f"
9269+
integrity sha512-jaf6VsYHU5zIJUYiciN6xSrGqrMoT3xwrmLvCk+//B9jxg+aXqTdl3jKH9QYcHSf5aHo/skAmqMbiXZqaEfwjg==
92709270
dependencies:
92719271
"@corex/deepmerge" "^2.5.3"
92729272
matcher "^3.0.0"

0 commit comments

Comments
 (0)