Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix bearer typo

Terry Sutton1dafd72d486c
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<Props> = ({
const { meta, ui, vault } = useStore()
const router = useRouter()
const { query } = router
- const { page } = query
-
+ const { ref: projectRef } = useParams()
const gridRef = useRef<SupabaseGridRef>(null)
- const projectRef = ui.selectedProject?.ref
+
const tables = meta.tables.list()
const { data: settings } = useProjectApiQuery({ projectRef: projectRef })
@@ -330,7 +330,7 @@ const TableGridEditor: FC<Props> = ({
autoApiService={autoApiService}
selectedLang={selectedLang}
showApiKey={true}
- page={page}
+ page="table-editor"
/>
{jsonSchema?.definitions && (
@@ -341,7 +341,7 @@ const TableGridEditor: FC<Props> = ({
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<any> = observer(({}) => {
apiKey={anonKey}
autoApiService={autoApiService}
/>
- {/* <div className="bg-scale-100 dark:bg-scale-300" style={{ width: '50%' }}>
- <div className="z-0 flex ">
- <button
- type="button"
- onClick={() => setSelectedLang('js')}
- className={`${
- selectedLang == 'js'
- ? 'bg-scale-300 font-medium text-scale-1200 dark:bg-scale-200'
- : 'bg-scale-100 text-scale-900 dark:bg-scale-100'
- } relative inline-flex items-center border-r border-scale-200 p-1 px-2 text-sm transition hover:text-scale-1200 focus:outline-none`}
- >
- JavaScript
- </button>
- <button
- type="button"
- onClick={() => setSelectedLang('bash')}
- className={`${
- selectedLang == 'bash'
- ? 'bg-scale-300 font-medium text-scale-1200 dark:bg-scale-200'
- : 'bg-scale-100 text-scale-900 dark:bg-scale-100'
- } relative inline-flex items-center border-r border-scale-200 p-1 px-2 text-sm transition hover:text-scale-1200 focus:outline-none`}
- >
- Bash
- </button>
- {selectedLang == 'bash' && (
- <div className="flex">
- <div className="flex items-center gap-2 p-1 pl-2 text-xs text-scale-900">
- <IconKey size={12} strokeWidth={1.5} />
- <span>Project API key :</span>
- </div>
- <Dropdown
- align="end"
- side="bottom"
- className="p-0 pl-2 pr-8 text-sm bg-transparent border-none cursor-pointer text-scale-900"
- overlay={
- <>
- <Dropdown.Item key="hide" onClick={() => setShowApiKey(DEFAULT_KEY)}>
- hide
- </Dropdown.Item>
- <Dropdown.Item
- key="anon"
- onClick={() =>
- setShowApiKey({
- key: anonKey,
- name: 'anon (public)',
- })
- }
- >
- anon (public)
- </Dropdown.Item>
- {canReadServiceKey && (
- <Dropdown.Item
- key="service"
- onClick={() =>
- setShowApiKey({
- key: autoApiService.serviceApiKey,
- name: 'service_role (secret)',
- })
- }
- >
- service_role (secret)
- </Dropdown.Item>
- )}
- </>
- }
- >
- <Button type="default">{showApiKey.name}</Button>
- </Dropdown>
- </div>
- )}
- </div>
- </div> */}
</div>
<div className="">
{resource ? (