|
|
@ -4,6 +4,7 @@ import { backendUiStore, store } from "builderStore" |
|
|
import { findAllMatchingComponents, findComponentPath } from "./storeUtils" |
|
|
import { findAllMatchingComponents, findComponentPath } from "./storeUtils" |
|
|
import { makePropSafe } from "@budibase/string-templates" |
|
|
import { makePropSafe } from "@budibase/string-templates" |
|
|
import { TableNames } from "../constants" |
|
|
import { TableNames } from "../constants" |
|
|
|
|
|
import { search } from "../../../server/src/api/controllers/row" |
|
|
|
|
|
|
|
|
// Regex to match all instances of template strings
|
|
|
// Regex to match all instances of template strings
|
|
|
const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g |
|
|
const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g |
|
|
@ -64,6 +65,7 @@ export const getDatasourceForProvider = component => { |
|
|
return { |
|
|
return { |
|
|
tableId: component[datasourceSetting?.key], |
|
|
tableId: component[datasourceSetting?.key], |
|
|
type: "table", |
|
|
type: "table", |
|
|
|
|
|
searchableOnly: datasourceSetting.searchableOnly, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return null |
|
|
return null |
|
|
@ -195,6 +197,12 @@ export const getSchemaForDatasource = datasource => { |
|
|
schema = cloneDeep(table.views?.[datasource.name]?.schema) |
|
|
schema = cloneDeep(table.views?.[datasource.name]?.schema) |
|
|
} else { |
|
|
} else { |
|
|
schema = cloneDeep(table.schema) |
|
|
schema = cloneDeep(table.schema) |
|
|
|
|
|
// Find searchable fields only
|
|
|
|
|
|
if (datasource.searchableOnly) { |
|
|
|
|
|
Object.keys(table.schema).forEach(key => { |
|
|
|
|
|
if (!table.schema[key].searchable) delete schema[key] |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|