From 9efd1a76f0d5964728c35ef88439df3667341e5e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 19 Feb 2025 14:05:15 +0100 Subject: [PATCH] Fix getting proper contexts --- packages/builder/src/stores/builder/screenComponent.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/stores/builder/screenComponent.ts b/packages/builder/src/stores/builder/screenComponent.ts index bb10bb2307..310bf2172c 100644 --- a/packages/builder/src/stores/builder/screenComponent.ts +++ b/packages/builder/src/stores/builder/screenComponent.ts @@ -8,6 +8,7 @@ import { UIComponentError, ComponentDefinition, DependsOnComponentSetting, + Screen, } from "@budibase/types" import { queries } from "./queries" import { views } from "./views" @@ -66,6 +67,7 @@ export const screenComponentErrorList = derived( if (!$selectedScreen) { return [] } + const screen = $selectedScreen const datasources = { ...reduceBy("_id", $tables.list), @@ -79,7 +81,9 @@ export const screenComponentErrorList = derived( const errors: UIComponentError[] = [] 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(...getMissingAncestors(component, definitions, ancestors)) @@ -95,6 +99,7 @@ export const screenComponentErrorList = derived( ) function getInvalidDatasources( + screen: Screen, component: Component, datasources: Record, definitions: Record