- Safeguard your files with policies that define the operations allowed for your users at the
- bucket level.
-
- {buckets.length === 0 &&
}
-
- {/* Sections for policies grouped by buckets */}
- {buckets.map((bucket) => {
- const bucketPolicies = get(
- find(formattedStorageObjectPolicies, { name: bucket.name }),
- ['policies'],
- []
- ).sort((a: any, b: any) => a.name.localeCompare(b.name))
-
- return (
+
+
+ Buckets
+
+ Write policies for each bucket to control access to the bucket and its contents
+
+ {buckets.length === 0 && }
+
+ {/* Sections for policies grouped by buckets */}
+
+ {buckets.map((bucket) => {
+ const bucketPolicies = get(
+ find(formattedStorageObjectPolicies, { name: bucket.name }),
+ ['policies'],
+ []
+ ).sort((a: any, b: any) => a.name.localeCompare(b.name))
+
+ return (
+
+ )
+ })}
+
+
+
+
+ Schema
+
+ Write policies for the tables under the storage schema directly for greater control
+
+
+
+ {/* Section for policies under storage.objects that are not tied to any buckets */}
+
+ {/* Section for policies under storage.buckets */}
+
- )
- })}
-
-
-
- You may also write policies for the tables under the storage schema directly for greater
- control
-
-
- {/* Section for policies under storage.objects that are not tied to any buckets */}
-
-
- {/* Section for policies under storage.buckets */}
-
+
+
)}
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx
index 178141b7c3485..26eb07822ced7 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx
@@ -4,6 +4,10 @@ import { Archive, Edit, MoreVertical, Trash } from 'lucide-react'
import {
Badge,
Button,
+ Card,
+ CardContent,
+ CardHeader,
+ CardTitle,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -28,35 +32,33 @@ const PolicyRow = ({
}: PolicyRowProps) => {
const { name, command } = policy
return (
-
-
-
-
{command}
-
- {name}
-
+
+
+
{command}
+
+ {name}
-
-
- } />
-
-
- onSelectPolicyEdit(policy, bucketName, table)}
- >
-
- Edit
-
-
- onSelectPolicyDelete(policy)}>
-
- Delete
-
-
-
-
-
+
+
+
+ } />
+
+
+ onSelectPolicyEdit(policy, bucketName, table)}
+ >
+
+ Edit
+
+
+ onSelectPolicyDelete(policy)}>
+
+ Delete
+
+
+
+
)
}
@@ -69,39 +71,24 @@ const StoragePoliciesBucketRow = ({
onSelectPolicyEdit = () => {},
onSelectPolicyDelete = () => {},
}: any) => {
- const getFooterLabel = () => {
- if (isEmpty(bucket))
- return table === 'objects'
- ? `${policies.length} polic${
- policies.length > 1 ? 'ies' : 'y'
- } that are not tied to any buckets`
- : `${policies.length} polic${policies.length > 1 ? 'ies' : 'y'} that target your buckets`
- return `${policies.length} polic${policies.length > 1 ? 'ies' : 'y'} in ${bucket.name}`
- }
-
return (
-
-
-
-
- {label}
-
- {bucket.public &&
Public}
-
-
- ,
- ]}
- >
+
+
+
+
+
{label}
+ {bucket.public &&
Public}
+
+
+
{policies.length === 0 ? (
-
+
No policies created yet
-
+
) : (
-
+
{policies.map((policy: any) => (
))}
- {policies.length !== 0 ? (
-
- ) : null}
)}
-
+
)
}
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesPlaceholder.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesPlaceholder.tsx
index 4dd36cabfa931..50bee986b545d 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesPlaceholder.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesPlaceholder.tsx
@@ -1,23 +1,13 @@
-import Panel from 'components/ui/Panel'
-import { Archive } from 'lucide-react'
+import { CardContent, Card } from 'ui'
const StoragePoliciesPlaceholder = () => (
-
-
- ,
- ]}
- >
-
+
+
Create a bucket first to start writing policies!
-
-
+
+
)
export default StoragePoliciesPlaceholder
diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
index e8fbe4a986a93..eb16fee9daa49 100644
--- a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
@@ -9,11 +9,15 @@ import * as z from 'zod'
import { useParams } from 'common'
import { useIsProjectActive } from 'components/layouts/ProjectLayout/ProjectContext'
+import {
+ ScaffoldSection,
+ ScaffoldSectionDescription,
+ ScaffoldSectionTitle,
+} from 'components/layouts/Scaffold'
import Table from 'components/to-be-cleaned/Table'
import AlertError from 'components/ui/AlertError'
-import { FormHeader } from 'components/ui/Forms/FormHeader'
+import { DocsButton } from 'components/ui/DocsButton'
import NoPermission from 'components/ui/NoPermission'
-import Panel from 'components/ui/Panel'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useProjectStorageConfigQuery } from 'data/config/project-storage-config-query'
import { useProjectStorageConfigUpdateUpdateMutation } from 'data/config/project-storage-config-update-mutation'
@@ -24,10 +28,12 @@ import {
AlertDescription_Shadcn_,
Alert_Shadcn_,
Button,
+ Card,
+ CardContent,
+ CardFooter,
FormControl_Shadcn_,
FormField_Shadcn_,
Form_Shadcn_,
- Separator,
Switch,
WarningIcon,
} from 'ui'
@@ -102,90 +108,87 @@ export const S3Connection = () => {
return (
<>
-
-