From 1dafd72d486cbe6a4b7bf6d8f52a042033fee0cd Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 20 Feb 2023 21:05:56 -0330 Subject: [PATCH] Fix bearer typo --- .../TableGridEditor/TableGridEditor.tsx | 12 ++-- studio/pages/project/[ref]/api/index.tsx | 72 ------------------- 2 files changed, 6 insertions(+), 78 deletions(-) diff --git a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx index 71c6f5b35bc..30d3e925357 100644 --- a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx +++ b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx @@ -6,7 +6,7 @@ import type { PostgresColumn, PostgresTable } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { SchemaView } from 'types' -import { checkPermissions, useFlag, useStore } from 'hooks' +import { checkPermissions, useFlag, useStore, useParams } from 'hooks' import GridHeaderActions from './GridHeaderActions' import NotFoundState from './NotFoundState' import SidePanelEditor from './SidePanelEditor' @@ -19,6 +19,7 @@ import { useProjectJsonSchemaQuery } from 'data/docs/project-json-schema-query' import { snakeToCamel } from 'lib/helpers' import LangSelector from 'components/to-be-cleaned/Docs/LangSelector' import { JsonEditValue } from './SidePanelEditor/RowEditor/RowEditor.types' +import Introduction from 'components/to-be-cleaned/Docs/Pages/Tables/Introduction' interface Props { /** Theme for the editor */ @@ -69,10 +70,9 @@ const TableGridEditor: FC = ({ const { meta, ui, vault } = useStore() const router = useRouter() const { query } = router - const { page } = query - + const { ref: projectRef } = useParams() const gridRef = useRef(null) - const projectRef = ui.selectedProject?.ref + const tables = meta.tables.list() const { data: settings } = useProjectApiQuery({ projectRef: projectRef }) @@ -330,7 +330,7 @@ const TableGridEditor: FC = ({ autoApiService={autoApiService} selectedLang={selectedLang} showApiKey={true} - page={page} + page="table-editor" /> {jsonSchema?.definitions && ( @@ -341,7 +341,7 @@ const TableGridEditor: FC = ({ resources={resources} definitions={jsonSchema.definitions} paths={jsonSchema.paths} - showApiKey={true} + showApiKey={showApiKey.key} refreshDocs={refreshDocs} /> )} diff --git a/studio/pages/project/[ref]/api/index.tsx b/studio/pages/project/[ref]/api/index.tsx index ff1ef6824f0..7e8216d627f 100644 --- a/studio/pages/project/[ref]/api/index.tsx +++ b/studio/pages/project/[ref]/api/index.tsx @@ -140,78 +140,6 @@ const DocView: FC = observer(({}) => { apiKey={anonKey} autoApiService={autoApiService} /> - {/*
-
- - - {selectedLang == 'bash' && ( -
-
- - Project API key : -
- - setShowApiKey(DEFAULT_KEY)}> - hide - - - setShowApiKey({ - key: anonKey, - name: 'anon (public)', - }) - } - > - anon (public) - - {canReadServiceKey && ( - - setShowApiKey({ - key: autoApiService.serviceApiKey, - name: 'service_role (secret)', - }) - } - > - service_role (secret) - - )} - - } - > - - -
- )} -
-
*/}
{resource ? (