Skip to content

Commit fb7c04e

Browse files
committed
fix: auto-strip the Drupal 8 attributes object from schema to fix JSON Schema Form errors
1 parent b58788f commit fb7c04e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs-site/src/components/schema-form/utils.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export function prepSchema(schema) {
1010
delete newSchema.not;
1111
}
1212

13+
// temporarily remove the Drupal-specific attributes object -- workaround to form error
14+
if (newSchema.properties['attributes']){
15+
delete newSchema.properties['attributes'];
16+
}
17+
1318
for (let property in newSchema.properties) {
1419
if (newSchema.properties[property].title === 'DEPRECATED') {
1520
delete newSchema.properties[property];
@@ -20,7 +25,7 @@ export function prepSchema(schema) {
2025
delete newSchema.properties[property].ref;
2126
}
2227
} catch (error) {
23-
console.log('ref does not exist!');
28+
// console.log('ref does not exist!');
2429
}
2530

2631
try {
@@ -30,7 +35,7 @@ export function prepSchema(schema) {
3035
}
3136
}
3237
} catch (error) {
33-
console.log('$ref does not exist!');
38+
// console.log('$ref does not exist!');
3439
}
3540
}
3641

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11259,6 +11259,11 @@ react-draggable@3.x, "react-draggable@^2.2.6 || ^3.0.3":
1125911259
classnames "^2.2.5"
1126011260
prop-types "^15.6.0"
1126111261

11262+
react-fast-compare@^2.0.4:
11263+
version "2.0.4"
11264+
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
11265+
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==
11266+
1126211267
react-grid-layout@^0.16.6:
1126311268
version "0.16.6"
1126411269
resolved "https://registry.yarnpkg.com/react-grid-layout/-/react-grid-layout-0.16.6.tgz#9b2407a2b946c2260ebaf66f13b556e1da4efeb2"

0 commit comments

Comments
 (0)