Merge branch 'master' into chore/move-code-to-sdk
This commit is contained in:
commit
8956b9036d
|
@ -1 +1 @@
|
||||||
Subproject commit bcd86d9034ba954f013da4c10171bf495ab88189
|
Subproject commit b23fb3b17961fb04badd9487913a683fcf26dbe6
|
|
@ -1,6 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset, store } from "builderStore"
|
||||||
import { findClosestMatchingComponent } from "builderStore/componentUtils"
|
import {
|
||||||
|
findClosestMatchingComponent,
|
||||||
|
findComponent,
|
||||||
|
} from "builderStore/componentUtils"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
|
@ -20,8 +23,23 @@
|
||||||
component => component._component.endsWith("/form")
|
component => component._component.endsWith("/form")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const resolveDatasource = (currentAsset, componentInstance, form) => {
|
||||||
|
if (!form && componentInstance._id != $store.selectedComponentId) {
|
||||||
|
const block = findComponent(
|
||||||
|
currentAsset.props,
|
||||||
|
$store.selectedComponentId
|
||||||
|
)
|
||||||
|
const def = store.actions.components.getDefinition(block._component)
|
||||||
|
return def?.block === true
|
||||||
|
? getDatasourceForProvider(currentAsset, block)
|
||||||
|
: {}
|
||||||
|
} else {
|
||||||
|
return getDatasourceForProvider(currentAsset, form)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get that form's schema
|
// Get that form's schema
|
||||||
$: datasource = getDatasourceForProvider($currentAsset, form)
|
$: datasource = resolveDatasource($currentAsset, componentInstance, form)
|
||||||
$: formSchema = getSchemaForDatasource($currentAsset, datasource)?.schema
|
$: formSchema = getSchemaForDatasource($currentAsset, datasource)?.schema
|
||||||
|
|
||||||
// Get the schema for the relationship field that this picker is using
|
// Get the schema for the relationship field that this picker is using
|
||||||
|
|
Loading…
Reference in New Issue