Ensure 'table' type sources are updated with a default datasource. Search visible settings sections for other elements IF a source is not already set.
This commit is contained in:
parent
5d54bb2de8
commit
7356c8b161
1 changed files with 19 additions and 2 deletions
|
@ -481,10 +481,27 @@ export const getFrontendStore = () => {
|
|||
return null
|
||||
}
|
||||
|
||||
const dataSourceField = definition.settings.find(
|
||||
setting => setting.type == "dataSource"
|
||||
let dataSourceField = definition.settings.find(
|
||||
setting => setting.type == "dataSource" || setting.type == "table"
|
||||
)
|
||||
|
||||
if (!dataSourceField) {
|
||||
// Check other visible sections for datasource/table elements.
|
||||
const sections = definition.settings.filter(
|
||||
item => item?.section && item.visible
|
||||
)
|
||||
|
||||
for (let section of sections) {
|
||||
let sectionSourceField = section.settings.find(
|
||||
setting => setting.type == "dataSource" || setting.type == "table"
|
||||
)
|
||||
if (sectionSourceField) {
|
||||
dataSourceField = sectionSourceField
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let defaultDatasource
|
||||
if (dataSourceField) {
|
||||
const _tables = get(tables)
|
||||
|
|
Loading…
Reference in a new issue