diff --git a/apps/studio/components/interfaces/APIKeys/APIKeyRow.tsx b/apps/studio/components/interfaces/APIKeys/APIKeyRow.tsx index a7833369882..ace11af3d92 100644 --- a/apps/studio/components/interfaces/APIKeys/APIKeyRow.tsx +++ b/apps/studio/components/interfaces/APIKeys/APIKeyRow.tsx @@ -54,21 +54,23 @@ export const APIKeyRow = ({ - - - - diff --git a/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx b/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx index 94e9523d568..9bd053a40ce 100644 --- a/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx +++ b/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx @@ -1,6 +1,6 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' import dayjs from 'dayjs' -import { ReactNode, useMemo, useRef } from 'react' +import { useMemo, useRef } from 'react' import { useParams } from 'common' import AlertError from 'components/ui/AlertError' @@ -8,11 +8,11 @@ import { FormHeader } from 'components/ui/Forms/FormHeader' import { APIKeysData, useAPIKeysQuery } from 'data/api-keys/api-keys-query' import useLogsQuery from 'hooks/analytics/useLogsQuery' import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' -import { Card, CardContent, EyeOffIcon, Skeleton, cn } from 'ui' +import { Card, EyeOffIcon } from 'ui' +import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' import { Table, TableBody, - TableCell, TableHead, TableHeader, TableRow, @@ -75,106 +75,59 @@ export const SecretAPIKeys = () => { const empty = secretApiKeys?.length === 0 && !isLoadingApiKeys && !isLoadingPermissions - const RowLoading = () => ( - - - - - - - - - - - - - - - ) - - const TableContainer = ({ children, className }: { children: ReactNode; className?: string }) => ( + return (
} /> - - - - - - - Name - - - API Key - - - Last Seen - - + {isLoadingApiKeys || isLoadingPermissions ? ( + + ) : !canReadAPIKeys ? ( + +
+ +

+ You do not have permission to read API Secret Keys +

+

+ Contact your organization owner/admin to request access. +

+
+
+ ) : isErrorApiKeys ? ( + + ) : empty ? ( + +
+

No secret API keys found

+

+ Your project is not accessible via secret keys—there are no active secret keys + created. +

+
+
+ ) : ( + +
+ + + Name + API Key + Last Seen + - {children} + + {secretApiKeys.map((apiKey) => ( + + ))} +
-
-
+ + )}
) - - if (isLoadingApiKeys || isLoadingPermissions) { - return ( - - - - - ) - } - - if (!canReadAPIKeys) { - return ( - -
- -

- You do not have permission to read API Secret Keys -

-

- Contact your organization owner/admin to request access. -

-
-
- ) - } - - if (isErrorApiKeys) { - return ( - - - - ) - } - - if (empty) { - return ( - -
-

No secret API keys found

-

- Your project is not accessible via secret keys—there are no active secret keys created. -

-
-
- ) - } - - return ( - - {secretApiKeys.map((apiKey) => ( - - ))} - - ) } diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/CreateCredentialModal.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/CreateCredentialModal.tsx index 0cd7cbf7c62..5ebafadc367 100644 --- a/apps/studio/components/interfaces/Storage/StorageSettings/CreateCredentialModal.tsx +++ b/apps/studio/components/interfaces/Storage/StorageSettings/CreateCredentialModal.tsx @@ -1,5 +1,6 @@ import { zodResolver } from '@hookform/resolvers/zod' import { PermissionAction } from '@supabase/shared-types/out/constants' +import { Plus } from 'lucide-react' import { useState } from 'react' import { useForm } from 'react-hook-form' import { z } from 'zod' @@ -86,7 +87,12 @@ export const CreateCredentialModal = ({ visible, onOpenChange }: CreateCredentia - diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx index 4be54f62c57..9a1d087728c 100644 --- a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx +++ b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx @@ -14,7 +14,6 @@ import { ScaffoldSectionDescription, ScaffoldSectionTitle, } from 'components/layouts/Scaffold' -import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' import { DocsButton } from 'components/ui/DocsButton' import NoPermission from 'components/ui/NoPermission' @@ -36,6 +35,12 @@ import { FormField_Shadcn_, Form_Shadcn_, Switch, + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, WarningIcon, } from 'ui' import { Input } from 'ui-patterns/DataInputs/Input' @@ -116,7 +121,7 @@ export const S3Connection = () => { return ( <> -
+
Connection @@ -225,7 +230,7 @@ export const S3Connection = () => { -
+
Access keys @@ -255,20 +260,26 @@ export const S3Connection = () => { ) : ( <> {isLoadingStorageCreds ? ( -
- -
+ ) : ( -
- Description, - Access key ID, - Created at, - , - ]} - body={ - hasStorageCreds ? ( + +
+ + + + Description + + + Access key ID + + + Created at + + + + + + {hasStorageCreds ? ( storageCreds.data?.map((cred) => ( { /> )) ) : ( - - + +

No access keys created

There are no access keys associated with your project yet

-
-
- ) - } - /> - + + + )} +
+
+ )} )} diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/StorageCredItem.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/StorageCredItem.tsx index 216449b4168..043780f89be 100644 --- a/apps/studio/components/interfaces/Storage/StorageSettings/StorageCredItem.tsx +++ b/apps/studio/components/interfaces/Storage/StorageSettings/StorageCredItem.tsx @@ -10,6 +10,8 @@ import { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, + TableCell, + TableRow, } from 'ui' export const StorageCredItem = ({ @@ -45,20 +47,20 @@ export const StorageCredItem = ({ } return ( - - + + {description} - - + +
{access_key}
- - {daysSince(created_at)} - +
+ {daysSince(created_at)} + {canRemoveAccessKey && ( @@ -82,7 +84,7 @@ export const StorageCredItem = ({ )} - - + +
) }