diff --git a/packages/builder/src/components/backend/DataTable/TableDataTable.svelte b/packages/builder/src/components/backend/DataTable/TableDataTable.svelte index bd8ee258fd..7ef779d300 100644 --- a/packages/builder/src/components/backend/DataTable/TableDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/TableDataTable.svelte @@ -26,16 +26,14 @@ $: id = $tables.selected?._id $: isUsersTable = id === TableNames.USERS $: isInternal = $tables.selected?.type !== "external" - $: datasource = { + $: gridDatasource = { type: "table", tableId: id, } - - $: datasource = $datasources.list.find(datasource => { + $: tableDatasource = $datasources.list.find(datasource => { return datasource._id === $tables.selected?.sourceId }) - - $: relationshipsEnabled = relationshipSupport(datasource) + $: relationshipsEnabled = relationshipSupport(tableDatasource) const relationshipSupport = datasource => { const integration = $integrations[datasource?.source] @@ -58,7 +56,7 @@
({ /** * Create a new view - * @param tableId the id of the table where the view will be created * @param view the view object */ create: async view => { @@ -10,9 +9,18 @@ export const buildViewV2Endpoints = API => ({ body: view, }) }, + /** + * Updates a view + * @param view the view object + */ + update: async view => { + return await API.put({ + url: `/api/v2/views/${view.id}`, + body: view, + }) + }, /** * Fetches all rows in a view - * @param tableId the id of the table * @param viewId the id of the view */ fetch: async viewId => { @@ -20,7 +28,6 @@ export const buildViewV2Endpoints = API => ({ }, /** * Delete a view - * @param tableId the id of the table * @param viewId the id of the view */ delete: async viewId => { diff --git a/packages/frontend-core/src/components/grid/cells/DataCell.svelte b/packages/frontend-core/src/components/grid/cells/DataCell.svelte index cb8616a735..3a2a5f957f 100644 --- a/packages/frontend-core/src/components/grid/cells/DataCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/DataCell.svelte @@ -34,7 +34,7 @@ column.schema.autocolumn || column.schema.disabled || column.schema.type === "formula" || - (!$config.allowEditRows && row._id) + (!$config.canEditRows && row._id) // Register this cell API if the row is focused $: { diff --git a/packages/frontend-core/src/components/grid/cells/GutterCell.svelte b/packages/frontend-core/src/components/grid/cells/GutterCell.svelte index dd11066b98..5357d4b5cf 100644 --- a/packages/frontend-core/src/components/grid/cells/GutterCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/GutterCell.svelte @@ -40,7 +40,7 @@
@@ -48,14 +48,14 @@ {#if !disableNumber}
{row.__idx + 1}
{/if} {/if} - {#if rowSelected && $config.allowDeleteRows} + {#if rowSelected && $config.canDeleteRows}
dispatch("request-bulk-delete")}>
{:else} -
+
Edit column @@ -175,7 +175,7 @@ icon="Label" on:click={makeDisplayColumn} disabled={idx === "sticky" || - !$config.allowSchemaChanges || + !$config.canEditPrimaryDisplay || bannedDisplayColumnTypes.includes(column.schema.type)} > Use as display column diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index 556e6ca16e..ea7cd73a4b 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -1,5 +1,6 @@