Update form setting datasource type

This commit is contained in:
Andrew Kingston 2021-03-19 13:09:22 +00:00
parent c3401486cc
commit 85377d24ce
2 changed files with 7 additions and 37 deletions

View File

@ -440,36 +440,6 @@
}
]
},
"rowdetail": {
"name": "Row Detail",
"description": "Loads a row, using an id from the URL, which can be used with {{ context }}, in children",
"icon": "ri-profile-line",
"styleable": true,
"hasChildren": true,
"dataProvider": true,
"settings": [
{
"type": "table",
"label": "Table",
"key": "table"
}
]
},
"newrow": {
"name": "New Row",
"description": "Sets up a new row for creation, which can be used with {{ context }}, in children",
"icon": "ri-profile-line",
"hasChildren": true,
"styleable": true,
"dataProvider": true,
"settings": [
{
"type": "table",
"label": "Table",
"key": "table"
}
]
},
"cardhorizontal": {
"name": "Horizontal Card",
"description": "A basic card component that can contain content and actions.",
@ -1144,7 +1114,7 @@
{
"type": "schema",
"label": "Schema",
"key": "datasource"
"key": "dataSource"
},
{
"type": "select",

View File

@ -5,7 +5,7 @@
import { createValidatorFromConstraints } from "./validation"
import { generateID } from "../helpers"
export let datasource
export let dataSource
export let theme
export let size
export let disabled = false
@ -143,15 +143,15 @@
})
}
// Fetches the form schema from this form's datasource, if one exists
// Fetches the form schema from this form's dataSource, if one exists
const fetchSchema = async () => {
if (!datasource?.tableId) {
if (!dataSource?.tableId) {
schema = {}
table = null
} else {
table = await API.fetchTableDefinition(datasource?.tableId)
table = await API.fetchTableDefinition(dataSource?.tableId)
if (table) {
if (datasource?.type === "query") {
if (dataSource?.type === "query") {
schema = {}
const params = table.parameters || []
params.forEach(param => {
@ -171,7 +171,7 @@
<Provider
{actions}
data={{ ...$formState.values, tableId: datasource?.tableId }}>
data={{ ...$formState.values, tableId: dataSource?.tableId }}>
<div
lang="en"
dir="ltr"