Move type to ui
This commit is contained in:
parent
0ae0141b26
commit
1f28bf978b
|
@ -3,7 +3,7 @@ import { tables } from "./tables"
|
|||
import { selectedScreen } from "./screens"
|
||||
import { viewsV2 } from "./viewsV2"
|
||||
import { findComponentsBySettingsType } from "@/helpers/screen"
|
||||
import { DatasourceType, Screen } from "@budibase/types"
|
||||
import { UIDatasourceType, Screen } from "@budibase/types"
|
||||
import { queries } from "./queries"
|
||||
import { views } from "./views"
|
||||
import { featureFlag } from "@/helpers"
|
||||
|
@ -21,11 +21,11 @@ function reduceBy<TItem extends {}, TKey extends keyof TItem>(
|
|||
)
|
||||
}
|
||||
|
||||
const friendlyNameByType: Partial<Record<DatasourceType, string>> = {
|
||||
const friendlyNameByType: Partial<Record<UIDatasourceType, string>> = {
|
||||
viewV2: "view",
|
||||
}
|
||||
|
||||
const validationKeyByType: Record<DatasourceType, string | null> = {
|
||||
const validationKeyByType: Record<UIDatasourceType, string | null> = {
|
||||
table: "tableId",
|
||||
view: "name",
|
||||
viewV2: "id",
|
||||
|
@ -53,7 +53,7 @@ export const screenComponentErrors = derived(
|
|||
)) {
|
||||
const componentSettings = component[setting.key]
|
||||
const { label } = componentSettings
|
||||
const type = componentSettings.type as DatasourceType
|
||||
const type = componentSettings.type as UIDatasourceType
|
||||
|
||||
const validationKey = validationKeyByType[type]
|
||||
if (!validationKey) {
|
||||
|
|
|
@ -57,5 +57,3 @@ export interface RestConfig {
|
|||
}
|
||||
dynamicVariables?: DynamicVariable[]
|
||||
}
|
||||
|
||||
export type DatasourceType = "table" | "view" | "viewV2" | "query" | "custom"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export type UIDatasourceType = "table" | "view" | "viewV2" | "query" | "custom"
|
|
@ -2,3 +2,4 @@ export * from "./stores"
|
|||
export * from "./bindings"
|
||||
export * from "./components"
|
||||
export * from "./dataFetch"
|
||||
export * from "./datasource"
|
||||
|
|
Loading…
Reference in New Issue