Validate views

This commit is contained in:
Adria Navarro 2025-01-21 15:18:31 +01:00
parent d5f34970ad
commit 42e86554c8
1 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,5 @@
import { derived } from "svelte/store"
import { tables, selectedScreen } from "@/stores/builder"
import { tables, selectedScreen, viewsV2 } from "@/stores/builder"
import { DerivedBudiStore } from "../BudiStore"
import { findComponentsBySettingsType } from "@/helpers/screen"
import { Screen } from "@budibase/types"
@ -17,16 +17,25 @@ export class ScreenComponentStore extends DerivedBudiStore<
constructor() {
const makeDerivedStore = () => {
return derived(
[selectedScreen, tables],
([$selectedScreen, $tables]): DerivedScreenComponentStore => {
[selectedScreen, tables, viewsV2],
([$selectedScreen, $tables, $viewsV2]): DerivedScreenComponentStore => {
function getErrors() {
const datasources = $tables.list.reduce(
(list, table) => ({
...list,
[table._id!]: table,
}),
{}
)
const datasources = {
...$tables.list.reduce(
(list, table) => ({
...list,
[table._id!]: table,
}),
{}
),
...$viewsV2.list.reduce(
(list, view) => ({
...list,
[view.id]: view,
}),
{}
),
}
return {
...getInvalidDatasources($selectedScreen, datasources),
}