datasourceType setup

This commit is contained in:
Adria Navarro 2023-07-18 18:32:31 +02:00
parent 5bd491b0a8
commit 95faeea286
4 changed files with 6 additions and 1 deletions

View File

@ -44,6 +44,7 @@
<Grid <Grid
{API} {API}
tableId={id} tableId={id}
datasourceType="table"
allowAddRows={!isUsersTable} allowAddRows={!isUsersTable}
allowDeleteRows={!isUsersTable} allowDeleteRows={!isUsersTable}
schemaOverrides={isUsersTable ? userSchemaOverrides : null} schemaOverrides={isUsersTable ? userSchemaOverrides : null}

View File

@ -39,6 +39,7 @@
> >
<Grid <Grid
tableId={table?.tableId} tableId={table?.tableId}
datasourceType="table"
{API} {API}
{allowAddRows} {allowAddRows}
{allowEditRows} {allowEditRows}

View File

@ -29,6 +29,7 @@
export let API = null export let API = null
export let tableId = null export let tableId = null
export let datasourceType = null
export let schemaOverrides = null export let schemaOverrides = null
export let columnWhitelist = null export let columnWhitelist = null
export let allowAddRows = true export let allowAddRows = true
@ -77,6 +78,7 @@
// Keep config store up to date with props // Keep config store up to date with props
$: config.set({ $: config.set({
tableId, tableId,
datasourceType,
schemaOverrides, schemaOverrides,
columnWhitelist, columnWhitelist,
allowAddRows, allowAddRows,

View File

@ -60,6 +60,7 @@ export const deriveStores = context => {
loading, loading,
sort, sort,
tableId, tableId,
datasourceType,
API, API,
scroll, scroll,
validation, validation,
@ -111,7 +112,7 @@ export const deriveStores = context => {
const newFetch = fetchData({ const newFetch = fetchData({
API, API,
datasource: { datasource: {
type: "table", type: datasourceType,
tableId: $tableId, tableId: $tableId,
}, },
options: { options: {