Fix view form block not showing data and move size setting to general section

This commit is contained in:
Andrew Kingston 2022-08-23 15:08:39 +01:00
parent 3ea5e598e3
commit df2b86ec4b
2 changed files with 21 additions and 20 deletions

View File

@ -4399,11 +4399,12 @@
}, },
{ {
"type": "text", "type": "text",
"label": "Row ID to update", "label": "Row ID",
"key": "rowId", "key": "rowId",
"dependsOn": { "dependsOn": {
"setting": "actionType", "setting": "actionType",
"value": "Update" "value": "Create",
"invert": true
} }
}, },
{ {
@ -4412,6 +4413,22 @@
"key": "title", "key": "title",
"nested": true "nested": true
}, },
{
"type": "select",
"label": "Size",
"key": "size",
"options": [
{
"label": "Medium",
"value": "spectrum--medium"
},
{
"label": "Large",
"value": "spectrum--large"
}
],
"defaultValue": "spectrum--medium"
},
{ {
"section": true, "section": true,
"name": "Fields", "name": "Fields",
@ -4437,22 +4454,6 @@
} }
] ]
}, },
{
"type": "select",
"label": "Size",
"key": "size",
"options": [
{
"label": "Medium",
"value": "spectrum--medium"
},
{
"label": "Large",
"value": "spectrum--large"
}
],
"defaultValue": "spectrum--medium"
},
{ {
"type": "boolean", "type": "boolean",
"label": "Disabled", "label": "Disabled",

View File

@ -90,7 +90,7 @@
// using a create form, we just want a fake array so that our repeater // using a create form, we just want a fake array so that our repeater
// will actually render the form, but data doesn't matter. // will actually render the form, but data doesn't matter.
$: dataProvider = $: dataProvider =
actionType === "Update" actionType !== "Create"
? `{{ literal ${safe(providerId)} }}` ? `{{ literal ${safe(providerId)} }}`
: { rows: [{}] } : { rows: [{}] }
@ -133,7 +133,7 @@
<BlockComponent <BlockComponent
type="form" type="form"
props={{ props={{
actionType, actionType: actionType === "Create" ? "Create" : "Update",
dataSource, dataSource,
size, size,
disabled: disabled || actionType === "View", disabled: disabled || actionType === "View",