Fix form block crash on no data tables (#11995)
* Fix form block crash on no data tables * Refactor * Refactor
This commit is contained in:
parent
d41f81bb45
commit
d8f1b7960e
|
@ -948,12 +948,15 @@ export const buildFormSchema = (component, asset) => {
|
||||||
|
|
||||||
if (component._component.endsWith("formblock")) {
|
if (component._component.endsWith("formblock")) {
|
||||||
let schema = {}
|
let schema = {}
|
||||||
|
|
||||||
const datasource = getDatasourceForProvider(asset, component)
|
const datasource = getDatasourceForProvider(asset, component)
|
||||||
const info = getSchemaForDatasource(component, datasource)
|
const info = getSchemaForDatasource(component, datasource)
|
||||||
|
|
||||||
|
if (!info?.schema) {
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
if (!component.fields) {
|
if (!component.fields) {
|
||||||
Object.values(info?.schema)
|
Object.values(info.schema)
|
||||||
.filter(
|
.filter(
|
||||||
({ autocolumn, name }) =>
|
({ autocolumn, name }) =>
|
||||||
!autocolumn && !["_rev", "_id"].includes(name)
|
!autocolumn && !["_rev", "_id"].includes(name)
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$: datasource = getDatasourceForProvider($currentAsset, componentInstance)
|
$: datasource = getDatasourceForProvider($currentAsset, componentInstance)
|
||||||
$: resourceId = datasource.resourceId || datasource.tableId
|
$: resourceId = datasource?.resourceId || datasource?.tableId
|
||||||
|
|
||||||
$: if (!isEqual(value, cachedValue)) {
|
$: if (!isEqual(value, cachedValue)) {
|
||||||
cachedValue = cloneDeep(value)
|
cachedValue = cloneDeep(value)
|
||||||
|
|
Loading…
Reference in New Issue