Validate views
This commit is contained in:
parent
d5f34970ad
commit
42e86554c8
|
@ -1,5 +1,5 @@
|
||||||
import { derived } from "svelte/store"
|
import { derived } from "svelte/store"
|
||||||
import { tables, selectedScreen } from "@/stores/builder"
|
import { tables, selectedScreen, viewsV2 } from "@/stores/builder"
|
||||||
import { DerivedBudiStore } from "../BudiStore"
|
import { DerivedBudiStore } from "../BudiStore"
|
||||||
import { findComponentsBySettingsType } from "@/helpers/screen"
|
import { findComponentsBySettingsType } from "@/helpers/screen"
|
||||||
import { Screen } from "@budibase/types"
|
import { Screen } from "@budibase/types"
|
||||||
|
@ -17,16 +17,25 @@ export class ScreenComponentStore extends DerivedBudiStore<
|
||||||
constructor() {
|
constructor() {
|
||||||
const makeDerivedStore = () => {
|
const makeDerivedStore = () => {
|
||||||
return derived(
|
return derived(
|
||||||
[selectedScreen, tables],
|
[selectedScreen, tables, viewsV2],
|
||||||
([$selectedScreen, $tables]): DerivedScreenComponentStore => {
|
([$selectedScreen, $tables, $viewsV2]): DerivedScreenComponentStore => {
|
||||||
function getErrors() {
|
function getErrors() {
|
||||||
const datasources = $tables.list.reduce(
|
const datasources = {
|
||||||
(list, table) => ({
|
...$tables.list.reduce(
|
||||||
...list,
|
(list, table) => ({
|
||||||
[table._id!]: table,
|
...list,
|
||||||
}),
|
[table._id!]: table,
|
||||||
{}
|
}),
|
||||||
)
|
{}
|
||||||
|
),
|
||||||
|
...$viewsV2.list.reduce(
|
||||||
|
(list, view) => ({
|
||||||
|
...list,
|
||||||
|
[view.id]: view,
|
||||||
|
}),
|
||||||
|
{}
|
||||||
|
),
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...getInvalidDatasources($selectedScreen, datasources),
|
...getInvalidDatasources($selectedScreen, datasources),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue