Browse Source

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

pull/7456/head
Andrew Kingston 4 years ago
parent
commit
df2b86ec4b
  1. 37
      packages/client/manifest.json
  2. 4
      packages/client/src/components/app/blocks/FormBlock.svelte

37
packages/client/manifest.json

@ -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",

4
packages/client/src/components/app/blocks/FormBlock.svelte

@ -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",

Loading…
Cancel
Save