Prevent adding form steps inside other form steps and fix illegalChildren usage

This commit is contained in:
Andrew Kingston 2021-08-20 15:16:20 +01:00
parent 86dbd918f2
commit 8cb9870cf7
2 changed files with 5 additions and 4 deletions

View File

@ -46,7 +46,7 @@
<ActionMenu disabled={!item.isCategory}>
<ActionButton
icon={item.icon}
disabled={isChildAllowed(item, $selectedComponent)}
disabled={!item.isCategory && isChildAllowed(item, $selectedComponent)}
quiet
size="S"
slot="control"
@ -66,6 +66,7 @@
dataCy={`component-${item.name}`}
icon={item.icon}
on:click={() => onItemChosen(item)}
disabled={isChildAllowed(item, $selectedComponent)}
>
{item.name}
</MenuItem>

View File

@ -1702,7 +1702,7 @@
"name": "Form",
"icon": "Form",
"hasChildren": true,
"illegalChildren": ["section"],
"illegalChildren": ["section", "form"],
"actions": [
"ValidateForm",
"ClearForm",
@ -1764,9 +1764,9 @@
},
"formstep": {
"name": "Form Step",
"icon": "Form",
"icon": "AssetsAdded",
"hasChildren": true,
"illegalChildren": ["section"],
"illegalChildren": ["section", "form", "form step"],
"styles": ["size"],
"settings": [
{