Fix getting proper contexts
This commit is contained in:
parent
2d9a793090
commit
9efd1a76f0
|
@ -8,6 +8,7 @@ import {
|
||||||
UIComponentError,
|
UIComponentError,
|
||||||
ComponentDefinition,
|
ComponentDefinition,
|
||||||
DependsOnComponentSetting,
|
DependsOnComponentSetting,
|
||||||
|
Screen,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { queries } from "./queries"
|
import { queries } from "./queries"
|
||||||
import { views } from "./views"
|
import { views } from "./views"
|
||||||
|
@ -66,6 +67,7 @@ export const screenComponentErrorList = derived(
|
||||||
if (!$selectedScreen) {
|
if (!$selectedScreen) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
const screen = $selectedScreen
|
||||||
|
|
||||||
const datasources = {
|
const datasources = {
|
||||||
...reduceBy("_id", $tables.list),
|
...reduceBy("_id", $tables.list),
|
||||||
|
@ -79,7 +81,9 @@ export const screenComponentErrorList = derived(
|
||||||
const errors: UIComponentError[] = []
|
const errors: UIComponentError[] = []
|
||||||
|
|
||||||
function checkComponentErrors(component: Component, ancestors: string[]) {
|
function checkComponentErrors(component: Component, ancestors: string[]) {
|
||||||
errors.push(...getInvalidDatasources(component, datasources, definitions))
|
errors.push(
|
||||||
|
...getInvalidDatasources(screen, component, datasources, definitions)
|
||||||
|
)
|
||||||
errors.push(...getMissingRequiredSettings(component, definitions))
|
errors.push(...getMissingRequiredSettings(component, definitions))
|
||||||
errors.push(...getMissingAncestors(component, definitions, ancestors))
|
errors.push(...getMissingAncestors(component, definitions, ancestors))
|
||||||
|
|
||||||
|
@ -95,6 +99,7 @@ export const screenComponentErrorList = derived(
|
||||||
)
|
)
|
||||||
|
|
||||||
function getInvalidDatasources(
|
function getInvalidDatasources(
|
||||||
|
screen: Screen,
|
||||||
component: Component,
|
component: Component,
|
||||||
datasources: Record<string, any>,
|
datasources: Record<string, any>,
|
||||||
definitions: Record<string, ComponentDefinition>
|
definitions: Record<string, ComponentDefinition>
|
||||||
|
|
Loading…
Reference in New Issue