From 1ddd0bca21b59c67c16f6af11afd444ae49f0601 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 15 Aug 2023 16:32:36 +0100 Subject: [PATCH] Allow configuring access for views --- .../backend/DataTable/ViewV2DataTable.svelte | 2 ++ .../buttons/grid/GridManageAccessButton.svelte | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte index 82a722253c..5cb65e340f 100644 --- a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte @@ -4,6 +4,7 @@ import { API } from "api" import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte" import GridFilterButton from "components/backend/DataTable/buttons/grid/GridFilterButton.svelte" + import GridManageAccessButton from "components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte"; $: id = $viewsV2.selected?.id $: datasource = { @@ -31,6 +32,7 @@ + diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte index cc15ae564e..8c7eb49923 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte @@ -3,6 +3,15 @@ import { getContext } from "svelte" const { datasource } = getContext("grid") + + $: resourceId = getResourceID($datasource) + + const getResourceID = datasource => { + if (!datasource) { + return null + } + return datasource.type === "table" ? datasource.tableId : datasource.id + } - +