Skip to content

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

fix: use prettier on studio too (#17787)

Kevin Grünebergbc1c9090c290
diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml
index c322a6625fa..3d4bc47ad7d 100644
--- a/.github/workflows/prettier.yml
+++ b/.github/workflows/prettier.yml
@@ -19,6 +19,7 @@ jobs:
with:
sparse-checkout: |
apps
+ studio
- name: Setup node
uses: actions/setup-node@v3
with:
@@ -31,7 +32,7 @@ jobs:
npm i prettier@2 prettier-plugin-sql-cst
- name: Run prettier
run: |-
- npx prettier -c 'apps/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
+ npx prettier -c '{apps,studio}/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
# i18n is not a node package, so we handle that one separately
diff --git a/.prettierignore b/.prettierignore
index 3703e192616..9de82e2c6c5 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -7,7 +7,16 @@ apps/**/out
# prettier-plugin-sql-cst only supports sqlite syntax
**/supabase/migrations/*.sql
apps/www/schema.sql
+apps/docs/**/generated/*
examples/slack-clone/nextjs-slack-clone/full-schema.sql
# ignore files with custom js formatting
apps/docs/pages/guides/auth/*.mdx
apps/docs/pages/guides/integrations/*.mdx
+studio/public
+studio/__mocks__
+studio/.next
+studio/.storybook
+studio/.swc
+studio/.turbo
+studio/node
+studio/data
\ No newline at end of file
diff --git a/package.json b/package.json
index 70e8d0d2b1b..b86d225b5cc 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
"dev:docs": "turbo run dev --filter=docs --parallel",
"dev:www": "turbo run dev --filter=www --parallel",
"lint": "turbo run lint",
- "format": "prettier --write \"apps/**/*.{js,jsx,ts,tsx,css,md,mdx,json}\"",
+ "format": "prettier --write \"{apps,studio}/**/*.{js,jsx,ts,tsx,css,md,mdx,json}\"",
"docker:dev": "cd docker && docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up --renew-anon-volumes",
"docker:up": "cd docker && docker compose up",
"docker:down": "cd docker && docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml down --remove-orphans",
diff --git a/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts b/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts
index 0b82ea98cf8..39b91a04358 100644
--- a/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts
+++ b/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts
@@ -83,7 +83,8 @@ FOR DELETE USING (
check: '',
command: 'DELETE',
roles: [],
- }, {
+ },
+ {
id: 'policy-5',
templateName: 'Enable insert access for users based on their user ID *',
description:
diff --git a/studio/components/interfaces/BillingV2/Subscription/Subscription.constants.ts b/studio/components/interfaces/BillingV2/Subscription/Subscription.constants.ts
index 5a1864369ce..6c7ecd3b12a 100644
--- a/studio/components/interfaces/BillingV2/Subscription/Subscription.constants.ts
+++ b/studio/components/interfaces/BillingV2/Subscription/Subscription.constants.ts
@@ -10,7 +10,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'dbSize',
metric: 'DATABASE_SIZE',
category: 'Database',
- unitName: 'GB'
+ unitName: 'GB',
},
{
key: 'db_egress',
@@ -19,7 +19,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'dbEgress',
metric: 'DATABASE_EGRESS',
category: 'Database',
- unitName: 'GB'
+ unitName: 'GB',
},
{
key: 'monthly_active_users',
@@ -28,7 +28,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'mau',
metric: 'MONTHLY_ACTIVE_USERS',
category: 'Authentication',
- unitName: 'MAU'
+ unitName: 'MAU',
},
{
key: 'monthly_active_sso_users',
@@ -37,7 +37,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'mauSso',
metric: 'MONTHLY_ACTIVE_SSO_USERS',
category: 'Authentication',
- unitName: 'MAU'
+ unitName: 'MAU',
},
{
key: 'storage_size',
@@ -46,7 +46,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'storageSize',
metric: 'STORAGE_SIZE',
category: 'Storage',
- unitName: 'GB'
+ unitName: 'GB',
},
{
key: 'storage_egress',
@@ -55,7 +55,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'storageEgress',
metric: 'STORAGE_EGRESS',
category: 'Storage',
- unitName: 'GB'
+ unitName: 'GB',
},
{
key: 'storage_image_render_count',
@@ -64,7 +64,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'storageImageTransformations',
metric: 'STORAGE_IMAGES_TRANSFORMED',
category: 'Storage',
- unitName: 'image'
+ unitName: 'image',
},
{
key: 'realtime_peak_connection',
@@ -73,7 +73,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'realtimePeakConnections',
metric: 'REALTIME_PEAK_CONNECTIONS',
category: 'Realtime',
- unitName: 'connection'
+ unitName: 'connection',
},
{
key: 'realtime_message_count',
@@ -82,7 +82,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'realtimeMessageCount',
metric: 'REALTIME_MESSAGE_COUNT',
category: 'Realtime',
- unitName: 'message'
+ unitName: 'message',
},
{
key: 'func_invocations',
@@ -91,7 +91,7 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'funcInvocations',
metric: 'FUNCTION_INVOCATIONS',
category: 'Edge Functions',
- unitName: 'invocation'
+ unitName: 'invocation',
},
{
key: 'func_count',
@@ -100,6 +100,6 @@ export const BILLING_BREAKDOWN_METRICS = [
anchor: 'funcCount',
metric: 'FUNCTION_COUNT',
category: 'Edge Functions',
- unitName: 'function'
+ unitName: 'function',
},
] as const
diff --git a/studio/components/interfaces/Docs/Docs.types.ts b/studio/components/interfaces/Docs/Docs.types.ts
index e6f3e8cb322..7ea36375c90 100644
--- a/studio/components/interfaces/Docs/Docs.types.ts
+++ b/studio/components/interfaces/Docs/Docs.types.ts
@@ -1,4 +1,4 @@
export type showApiKey = {
key: string
name: string
-}
\ No newline at end of file
+}
diff --git a/studio/components/interfaces/Home/ChartData.types.ts b/studio/components/interfaces/Home/ChartData.types.ts
index 14ab6fbb637..06a0ed1e002 100644
--- a/studio/components/interfaces/Home/ChartData.types.ts
+++ b/studio/components/interfaces/Home/ChartData.types.ts
@@ -1,5 +1,3 @@
-
-
export interface EndpointResponse<T> {
result: Array<T>
error: Object
diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.tsx b/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.tsx
index 5b3dd080f0a..56316baf487 100644
--- a/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.tsx
+++ b/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.tsx
@@ -11,49 +11,49 @@ import BillingBreakdown from './BillingBreakdown/BillingBreakdown'
const BillingSettings = () => {
return (
<>
- <ScaffoldContainer id='subscription'>
+ <ScaffoldContainer id="subscription">
<Subscription />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='cost-control'>
+ <ScaffoldContainer id="cost-control">
<CostControl />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='breakdown'>
+ <ScaffoldContainer id="breakdown">
<BillingBreakdown />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='credits-balance'>
+ <ScaffoldContainer id="credits-balance">
<CreditBalance />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='payment-methods'>
+ <ScaffoldContainer id="payment-methods">
<PaymentMethods />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='email'>
+ <ScaffoldContainer id="email">
<BillingEmail />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='address'>
+ <ScaffoldContainer id="address">
<BillingAddress />
</ScaffoldContainer>
<ScaffoldDivider />
- <ScaffoldContainer id='taxId'>
+ <ScaffoldContainer id="taxId">
<TaxID />
</ScaffoldContainer>
</>
diff --git a/studio/components/interfaces/Settings/Database/BannedIPs.tsx b/studio/components/interfaces/Settings/Database/BannedIPs.tsx
index a1a3ecfe9af..8184e550073 100644
--- a/studio/components/interfaces/Settings/Database/BannedIPs.tsx
+++ b/studio/components/interfaces/Settings/Database/BannedIPs.tsx
@@ -2,10 +2,7 @@ import Link from 'next/link'
import { useState } from 'react'
import { useParams } from 'common/hooks'
import { useStore } from 'hooks'
-import {
- FormHeader,
- FormPanel,
-} from 'components/ui/Forms'
+import { FormHeader, FormPanel } from 'components/ui/Forms'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -24,13 +21,11 @@ import { useBannedIPsDeleteMutation } from 'data/banned-ips/banned-ips-delete-mu
const BannedIPs = () => {
const { ref } = useParams()
const [selectedIPToUnban, setSelectedIPToUnban] = useState<string | null>(null) // Track the selected IP for unban
- const {
- data: ipList
- } = useBannedIPsQuery({
+ const { data: ipList } = useBannedIPsQuery({
projectRef: ref,
})
- const { ui } = useStore();
+ const { ui } = useStore()
const [showUnban, setShowUnban] = useState(false)
const [confirmingIP, setConfirmingIP] = useState<string | null>(null) // Track the IP being confirmed for unban
@@ -38,37 +33,40 @@ const BannedIPs = () => {
onSuccess: () => {
ui.setNotification({
category: 'success',
- message: 'IP address successfully unbanned'
- });
- setSelectedIPToUnban(null); // Reset the selected IP for unban
+ message: 'IP address successfully unbanned',
+ })
+ setSelectedIPToUnban(null) // Reset the selected IP for unban
setShowUnban(false)
},
onError: (error) => {
ui.setNotification({
category: 'error',
message: `Failed to unban IP: ${error?.message}`,
- });
+ })
},
- });
+ })
const onConfirmUnbanIP = () => {
- if (confirmingIP == null || !ref) return;
+ if (confirmingIP == null || !ref) return
unbanIPs({
projectRef: ref,
ips: [confirmingIP], // Pass the IP as an array
- });
+ })
}
const openConfirmationModal = (ip: string) => {
- setSelectedIPToUnban(ip); // Set the selected IP for unban
- setConfirmingIP(ip); // Set the IP being confirmed for unban
- setShowUnban(true);
+ setSelectedIPToUnban(ip) // Set the selected IP for unban
+ setConfirmingIP(ip) // Set the IP being confirmed for unban
+ setShowUnban(true)
}
return (
<div>
<div className="flex items-center justify-between">
- <FormHeader title="Banned IPs" description="We monitor unsuccessful logins and block IPs for security" />
+ <FormHeader
+ title="Banned IPs"
+ description="We monitor unsuccessful logins and block IPs for security"
+ />
<div className="flex items-center space-x-2 mb-6">
<Link href="https://supabase.com/docs/reference/cli/supabase-network-bans">
<a target="_blank">
@@ -95,8 +93,10 @@ const BannedIPs = () => {
</div>
))
) : (
- <p className="text-scale-1100 text-sm px-8 py-4">There are no banned IP addresses for your project.</p>
- )}
+ <p className="text-scale-1100 text-sm px-8 py-4">
+ There are no banned IP addresses for your project.
+ </p>
+ )}
</FormPanel>
<ConfirmationModal
@@ -123,7 +123,7 @@ const BannedIPs = () => {
</Modal.Content>
</ConfirmationModal>
</div>
- );
+ )
}
export default BannedIPs
diff --git a/studio/components/ui/Charts/Charts.constants.ts b/studio/components/ui/Charts/Charts.constants.ts
index f9161102054..d712b2e5a43 100644
--- a/studio/components/ui/Charts/Charts.constants.ts
+++ b/studio/components/ui/Charts/Charts.constants.ts
@@ -38,7 +38,13 @@ export const genStackColorScales = (colors: ValidStackColor[]) =>
}
})
-export const DEFAULT_STACK_COLORS : ValidStackColor[] = ['brand', 'slate', 'blue', 'yellow', 'indigo']
+export const DEFAULT_STACK_COLORS: ValidStackColor[] = [
+ 'brand',
+ 'slate',
+ 'blue',
+ 'yellow',
+ 'indigo',
+]
export enum DateTimeFormats {
FULL = 'MMM D, YYYY, hh:mma',
diff --git a/studio/components/ui/Loading/Loading.anim.json b/studio/components/ui/Loading/Loading.anim.json
index 2a3d102ae4f..b105cbb5561 100644
--- a/studio/components/ui/Loading/Loading.anim.json
+++ b/studio/components/ui/Loading/Loading.anim.json
@@ -1 +1,168 @@
-{"v":"5.7.3","fr":30,"ip":0,"op":45,"w":150,"h":150,"nm":"Loading-brand-green 2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Livello forma 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[75,75,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[70,70,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[8.191,0],[0,0],[0,0],[2.859,-3.601],[0,0],[-8.191,0],[0,0],[0,0],[-2.859,3.601],[0,0]],"o":[[0,0],[0,0],[-0.069,-4.598],[0,0],[-5.093,6.415],[0,0],[0,0],[0.069,4.598],[0,0],[5.093,-6.415]],"v":[[44.681,-16.115],[-0.239,-16.115],[-0.469,-51.136],[-9.195,-54.106],[-52.347,0.24],[-44.681,16.115],[-0.055,16.115],[0.469,51.137],[9.195,54.107],[52.347,-0.24]],"c":true},"ix":2},"nm":"Tracciato 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.243137255311,0.811764717102,0.556862771511,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":5,"ix":5},"lc":1,"lj":2,"bm":0,"nm":"Traccia 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Trasformazione"}],"nm":"Forma 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.423],"y":[1]},"o":{"x":[0.501],"y":[0]},"t":9,"s":[100]},{"t":44,"s":[2]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.571],"y":[-0.005]},"t":0,"s":[98]},{"t":22,"s":[0]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.676],"y":[1]},"o":{"x":[0.376],"y":[0]},"t":0,"s":[105]},{"t":44,"s":[-260]}],"ix":3},"m":1,"ix":2,"nm":"Taglia tracciati 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":45,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
+{
+ "v": "5.7.3",
+ "fr": 30,
+ "ip": 0,
+ "op": 45,
+ "w": 150,
+ "h": 150,
+ "nm": "Loading-brand-green 2",
+ "ddd": 0,
+ "assets": [],
+ "layers": [
+ {
+ "ddd": 0,
+ "ind": 1,
+ "ty": 4,
+ "nm": "Livello forma 1",
+ "sr": 1,
+ "ks": {
+ "o": { "a": 0, "k": 100, "ix": 11 },
+ "r": { "a": 0, "k": 0, "ix": 10 },
+ "p": { "a": 0, "k": [75, 75, 0], "ix": 2 },
+ "a": { "a": 0, "k": [0, 0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [70, 70, 100], "ix": 6 }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "ind": 0,
+ "ty": "sh",
+ "ix": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "i": [
+ [8.191, 0],
+ [0, 0],
+ [0, 0],
+ [2.859, -3.601],
+ [0, 0],
+ [-8.191, 0],
+ [0, 0],
+ [0, 0],
+ [-2.859, 3.601],
+ [0, 0]
+ ],
+ "o": [
+ [0, 0],
+ [0, 0],
+ [-0.069, -4.598],
+ [0, 0],
+ [-5.093, 6.415],
+ [0, 0],
+ [0, 0],
+ [0.069, 4.598],
+ [0, 0],
+ [5.093, -6.415]
+ ],
+ "v": [
+ [44.681, -16.115],
+ [-0.239, -16.115],
+ [-0.469, -51.136],
+ [-9.195, -54.106],
+ [-52.347, 0.24],
+ [-44.681, 16.115],
+ [-0.055, 16.115],
+ [0.469, 51.137],
+ [9.195, 54.107],
+ [52.347, -0.24]
+ ],
+ "c": true
+ },
+ "ix": 2
+ },
+ "nm": "Tracciato 1",
+ "mn": "ADBE Vector Shape - Group",
+ "hd": false
+ },
+ {
+ "ty": "st",
+ "c": { "a": 0, "k": [0.243137255311, 0.811764717102, 0.556862771511, 1], "ix": 3 },
+ "o": { "a": 0, "k": 100, "ix": 4 },
+ "w": { "a": 0, "k": 5, "ix": 5 },
+ "lc": 1,
+ "lj": 2,
+ "bm": 0,
+ "nm": "Traccia 1",
+ "mn": "ADBE Vector Graphic - Stroke",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "o": { "a": 0, "k": 100, "ix": 7 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "nm": "Trasformazione"
+ }
+ ],
+ "nm": "Forma 1",
+ "np": 2,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ },
+ {
+ "ty": "tm",
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "i": { "x": [0.423], "y": [1] },
+ "o": { "x": [0.501], "y": [0] },
+ "t": 9,
+ "s": [100]
+ },
+ { "t": 44, "s": [2] }
+ ],
+ "ix": 1
+ },
+ "e": {
+ "a": 1,
+ "k": [
+ {
+ "i": { "x": [0.667], "y": [1] },
+ "o": { "x": [0.571], "y": [-0.005] },
+ "t": 0,
+ "s": [98]
+ },
+ { "t": 22, "s": [0] }
+ ],
+ "ix": 2
+ },
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "i": { "x": [0.676], "y": [1] },
+ "o": { "x": [0.376], "y": [0] },
+ "t": 0,
+ "s": [105]
+ },
+ { "t": 44, "s": [-260] }
+ ],
+ "ix": 3
+ },
+ "m": 1,
+ "ix": 2,
+ "nm": "Taglia tracciati 1",
+ "mn": "ADBE Vector Filter - Trim",
+ "hd": false
+ }
+ ],
+ "ip": 0,
+ "op": 45,
+ "st": 0,
+ "bm": 0
+ }
+ ],
+ "markers": []
+}
diff --git a/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts b/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts
index 69438ce4b20..a16eab8ce41 100644
--- a/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts
+++ b/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts
@@ -33,7 +33,8 @@ export const getResourcesExceededLimitsOrg = (usageMetrics: UsageMetric[]): stri
return usageMetrics
.filter((usageMetric) => {
- if (!usageMetric.capped || !usageMetric.available_in_plan || usageMetric.unlimited) return false
+ if (!usageMetric.capped || !usageMetric.available_in_plan || usageMetric.unlimited)
+ return false
const freeUnits = usageMetric.pricing_free_units || 0
diff --git a/studio/data/banned-ips/banned-ips-delete-mutations.ts b/studio/data/banned-ips/banned-ips-delete-mutations.ts
index 2ec68c10392..eefc0674116 100644
--- a/studio/data/banned-ips/banned-ips-delete-mutations.ts
+++ b/studio/data/banned-ips/banned-ips-delete-mutations.ts
@@ -8,15 +8,15 @@ import toast from 'react-hot-toast'
export type IPDeleteVariables = {
projectRef: string
/** can only be one for now */
- ips: string[]
+ ips: string[]
}
-export async function deleteBannedIPs({ projectRef, ips }: IPDeleteVariables) {
+export async function deleteBannedIPs({ projectRef, ips }: IPDeleteVariables) {
const { data, error } = await del(`/v1/projects/{ref}/network-bans`, {
- params: {
- path: { ref: projectRef }
+ params: {
+ path: { ref: projectRef },
},
- body: { ipv4_addresses: ips }
+ body: { ipv4_addresses: ips },
})
if (error) throw error
@@ -29,20 +29,17 @@ export const useBannedIPsDeleteMutation = ({
onSuccess,
onError,
...options
-}: Omit<
- UseMutationOptions<IPDeleteData, ResponseError, IPDeleteVariables>,
- 'mutationFn'
-> = {}) => {
+}: Omit<UseMutationOptions<IPDeleteData, ResponseError, IPDeleteVariables>, 'mutationFn'> = {}) => {
const queryClient = useQueryClient()
return useMutation<IPDeleteData, ResponseError, IPDeleteVariables>(
(vars) => deleteBannedIPs(vars),
{
async onSuccess(data, variables, context) {
- const { projectRef, ips } = variables
+ const { projectRef, ips } = variables
await Promise.all([
queryClient.invalidateQueries(BannedIPKeys.list(projectRef)),
- queryClient.invalidateQueries(BannedIPKeys.detail(ips)),
+ queryClient.invalidateQueries(BannedIPKeys.detail(ips)),
])
await onSuccess?.(data, variables, context)
diff --git a/studio/data/banned-ips/banned-ips-query.ts b/studio/data/banned-ips/banned-ips-query.ts
index d9be83f92df..5dd4b7c6f88 100644
--- a/studio/data/banned-ips/banned-ips-query.ts
+++ b/studio/data/banned-ips/banned-ips-query.ts
@@ -5,23 +5,23 @@ import { BannedIPKeys } from './keys'
export type BannedIPVariables = {
projectRef?: string
-};
+}
-export type BannedIPsData = BannedIPVariables[];
-export type BannedIPsError = ResponseError;
+export type BannedIPsData = BannedIPVariables[]
+export type BannedIPsError = ResponseError
export async function getBannedIPs({ projectRef }: BannedIPVariables, signal?: AbortSignal) {
if (!projectRef) throw new Error('projectRef is required')
const { data, error } = await post(`/v1/projects/{ref}/network-bans/retrieve`, {
- params: {
- path: { ref: projectRef }
+ params: {
+ path: { ref: projectRef },
},
signal,
})
if (error) {
- throw error;
+ throw error
}
return data
@@ -42,5 +42,3 @@ export const useBannedIPsQuery = <TData = IPData>(
...options,
}
)
-
-
diff --git a/studio/data/banned-ips/keys.ts b/studio/data/banned-ips/keys.ts
index c92262078d6..0c8d83ef0f5 100644
--- a/studio/data/banned-ips/keys.ts
+++ b/studio/data/banned-ips/keys.ts
@@ -1,4 +1,4 @@
export const BannedIPKeys = {
- list: (projectRef: string | undefined) => ['projects', projectRef, 'banned-ips'] as const,
- detail: (ips: string[] | undefined) => ['banned-ips', ips] as const,
- }
\ No newline at end of file
+ list: (projectRef: string | undefined) => ['projects', projectRef, 'banned-ips'] as const,
+ detail: (ips: string[] | undefined) => ['banned-ips', ips] as const,
+}
diff --git a/studio/data/integrations/github-connection-update-mutate.ts b/studio/data/integrations/github-connection-update-mutate.ts
index ed5d7b2ad7b..f71e86d25e7 100644
--- a/studio/data/integrations/github-connection-update-mutate.ts
+++ b/studio/data/integrations/github-connection-update-mutate.ts
@@ -17,7 +17,7 @@ export async function updateGithubConnection({
},
body: {
// @ts-expect-error
- metadata
+ metadata,
},
})
diff --git a/studio/hooks/analytics/useFillTimeseriesSorted.ts b/studio/hooks/analytics/useFillTimeseriesSorted.ts
index b5ca6d3ec48..32f1a03e3fd 100644
--- a/studio/hooks/analytics/useFillTimeseriesSorted.ts
+++ b/studio/hooks/analytics/useFillTimeseriesSorted.ts
@@ -7,7 +7,7 @@ import { useMemo } from 'react'
const useFillTimeseriesSorted = (...args: Parameters<typeof fillTimeseries>) => {
return useMemo(() => {
const [data, timestampKey] = args
- if (!data[0]?.[timestampKey]) return data;
+ if (!data[0]?.[timestampKey]) return data
const filled = fillTimeseries(...args)
return filled.sort((a, b) => {
diff --git a/studio/lib/cloudprovider-utils.ts b/studio/lib/cloudprovider-utils.ts
index ee163b81827..e40898ff32a 100644
--- a/studio/lib/cloudprovider-utils.ts
+++ b/studio/lib/cloudprovider-utils.ts
@@ -1,12 +1,12 @@
-import { PROVIDERS } from "./constants";
+import { PROVIDERS } from './constants'
export function getCloudProviderArchitecture(cloudProvider: string | undefined) {
- switch (cloudProvider) {
- case PROVIDERS.AWS.id:
- return 'ARM';
- case PROVIDERS.FLY.id:
- return 'x86 64-bit';
- default:
- return '';
- }
+ switch (cloudProvider) {
+ case PROVIDERS.AWS.id:
+ return 'ARM'
+ case PROVIDERS.FLY.id:
+ return 'x86 64-bit'
+ default:
+ return ''
+ }
}
diff --git a/studio/lib/helpers.ts b/studio/lib/helpers.ts
index 6a1a1962442..5e6700b8414 100644
--- a/studio/lib/helpers.ts
+++ b/studio/lib/helpers.ts
@@ -15,9 +15,9 @@ export const tryParseJson = (jsonString: any) => {
export const minifyJSON = (prettifiedJSON: string) => {
try {
if (prettifiedJSON.trim() === '') {
- return null;
+ return null
}
- const res = JSON.stringify(JSON.parse(prettifiedJSON));
+ const res = JSON.stringify(JSON.parse(prettifiedJSON))
if (!isNaN(Number(res))) {
return Number(res)
} else {
diff --git a/studio/lib/local-storage.ts b/studio/lib/local-storage.ts
index 19f8258e6ff..4c4066080cc 100644
--- a/studio/lib/local-storage.ts
+++ b/studio/lib/local-storage.ts
@@ -19,7 +19,7 @@ export function clearLocalStorage() {
function inferSignInClicks() {
// remove old data from local storage
- ['', '_v2'].forEach(suffix => {
+ ;['', '_v2'].forEach((suffix) => {
localStorage.removeItem(`supabase.dashboard.sign_in_clicks${suffix}`)
})
diff --git a/studio/pages/project/[ref]/reports/storage.tsx b/studio/pages/project/[ref]/reports/storage.tsx
index 664265e07a0..e4e68a31d96 100644
--- a/studio/pages/project/[ref]/reports/storage.tsx
+++ b/studio/pages/project/[ref]/reports/storage.tsx
@@ -94,8 +94,7 @@ const useStorageReport = () => {
hook.setParams?.((prev: LogsEndpointParams) => ({ ...prev, ...params }))
})
}
- useEffect(()=>{
-
+ useEffect(() => {
if (cacheHitRate.changeQuery) {
cacheHitRate.changeQuery(PRESET_CONFIG.storage.queries.cacheHitRate.sql([]))
}
@@ -103,7 +102,6 @@ const useStorageReport = () => {
if (topCacheMisses.changeQuery) {
topCacheMisses.changeQuery(PRESET_CONFIG.storage.queries.topCacheMisses.sql([]))
}
-
}, [])
const isLoading = activeHooks.some((hook) => hook.isLoading)
return {
diff --git a/studio/stores/jsonSchema/auth_gotrue_config.json b/studio/stores/jsonSchema/auth_gotrue_config.json
index 7f87191cb6e..3269fee55dd 100644
--- a/studio/stores/jsonSchema/auth_gotrue_config.json
+++ b/studio/stores/jsonSchema/auth_gotrue_config.json
@@ -471,7 +471,7 @@
"MFA_MAX_ENROLLED_FACTORS": {
"title": "Maximum enrolled factors",
"type": "integer"
- }
+ },
"PASSWORD_MIN_LENGTH": {
"title": "Minimum password length",
"type": "integer"
diff --git a/studio/stores/pgmeta/ForeignTableStore.ts b/studio/stores/pgmeta/ForeignTableStore.ts
index 84710e16e7a..6ba1e3d5a7f 100644
--- a/studio/stores/pgmeta/ForeignTableStore.ts
+++ b/studio/stores/pgmeta/ForeignTableStore.ts
@@ -37,12 +37,11 @@ export default class ForeignTableStore extends PostgresMetaInterface<Partial<Pos
if (columnsResponse.error) throw columnsResponse.error
// merge 2 response to create the final array
- const columnsByTableId = (columnsResponse as PostgresColumn[])
- .reduce((acc, curr) => {
- acc[curr.table_id] ??= []
- acc[curr.table_id].push(curr)
- return acc
- }, {} as Record<string, PostgresColumn[]>)
+ const columnsByTableId = (columnsResponse as PostgresColumn[]).reduce((acc, curr) => {
+ acc[curr.table_id] ??= []
+ acc[curr.table_id].push(curr)
+ return acc
+ }, {} as Record<string, PostgresColumn[]>)
const foreignTables: PostgresTable[] = []
foreignTablesResponse.forEach((foreignTable: PostgresTable) => {
const columns = columnsByTableId[foreignTable.id]
diff --git a/studio/stores/pgmeta/MaterializedViewStore.ts b/studio/stores/pgmeta/MaterializedViewStore.ts
index 71a98dc43df..b050e09b835 100644
--- a/studio/stores/pgmeta/MaterializedViewStore.ts
+++ b/studio/stores/pgmeta/MaterializedViewStore.ts
@@ -39,12 +39,11 @@ export default class MaterializedViewStore extends PostgresMetaInterface<Postgre
if (columnsResponse.error) throw columnsResponse.error
// merge 2 response to create the final array
- const columnsByTableId = (columnsResponse as PostgresColumn[])
- .reduce((acc, curr) => {
- acc[curr.table_id] ??= []
- acc[curr.table_id].push(curr)
- return acc
- }, {} as Record<string, PostgresColumn[]>)
+ const columnsByTableId = (columnsResponse as PostgresColumn[]).reduce((acc, curr) => {
+ acc[curr.table_id] ??= []
+ acc[curr.table_id].push(curr)
+ return acc
+ }, {} as Record<string, PostgresColumn[]>)
const materializedViews: PostgresMaterializedView[] = []
materializedViewsResponse.forEach((materializedView: PostgresMaterializedView) => {
const columns = columnsByTableId[materializedView.id]
diff --git a/studio/stores/pgmeta/TableStore.ts b/studio/stores/pgmeta/TableStore.ts
index f6da9e1807d..5f1e257275a 100644
--- a/studio/stores/pgmeta/TableStore.ts
+++ b/studio/stores/pgmeta/TableStore.ts
@@ -42,12 +42,11 @@ export default class TableStore extends PostgresMetaInterface<PostgresTable> {
if (columnsResponse.error) throw columnsResponse.error
// merge 2 response to create the final array
- const columnsByTableId = (columnsResponse as PostgresColumn[])
- .reduce((acc, curr) => {
- acc[curr.table_id] ??= []
- acc[curr.table_id].push(curr)
- return acc
- }, {} as Record<string, PostgresColumn[]>)
+ const columnsByTableId = (columnsResponse as PostgresColumn[]).reduce((acc, curr) => {
+ acc[curr.table_id] ??= []
+ acc[curr.table_id].push(curr)
+ return acc
+ }, {} as Record<string, PostgresColumn[]>)
const tables: PostgresTable[] = []
tablesResponse.forEach((table: PostgresTable) => {
const columns = columnsByTableId[table.id]
diff --git a/studio/stores/pgmeta/ViewStore.ts b/studio/stores/pgmeta/ViewStore.ts
index 063530b2390..66568182004 100644
--- a/studio/stores/pgmeta/ViewStore.ts
+++ b/studio/stores/pgmeta/ViewStore.ts
@@ -37,12 +37,11 @@ export default class ViewStore extends PostgresMetaInterface<SchemaView> {
if (columnsResponse.error) throw columnsResponse.error
// merge 2 response to create the final array
- const columnsByTableId = (columnsResponse as PostgresColumn[])
- .reduce((acc, curr) => {
- acc[curr.table_id] ??= []
- acc[curr.table_id].push(curr)
- return acc
- }, {} as Record<string, PostgresColumn[]>)
+ const columnsByTableId = (columnsResponse as PostgresColumn[]).reduce((acc, curr) => {
+ acc[curr.table_id] ??= []
+ acc[curr.table_id].push(curr)
+ return acc
+ }, {} as Record<string, PostgresColumn[]>)
const views: PostgresView[] = []
viewsResponse.forEach((view: PostgresView) => {
const columns = columnsByTableId[view.id]
diff --git a/studio/tests/components/CopyButton.test.tsx b/studio/tests/components/CopyButton.test.tsx
index d8db3fc667e..0ec81cbb7be 100644
--- a/studio/tests/components/CopyButton.test.tsx
+++ b/studio/tests/components/CopyButton.test.tsx
@@ -4,7 +4,7 @@ import CopyButton from 'components/ui/CopyButton'
import { render } from 'tests/helpers'
test('shows copied text', async () => {
- const callback = jest.fn()
+ const callback = jest.fn()
render(<CopyButton text="some text" onClick={callback} />)
userEvent.click(await screen.findByText('Copy'))
await screen.findByText('Copied')
diff --git a/studio/tests/components/Reports/ReportWidget.test.js b/studio/tests/components/Reports/ReportWidget.test.js
index 85e22e6e6ac..8a292c52db9 100644
--- a/studio/tests/components/Reports/ReportWidget.test.js
+++ b/studio/tests/components/Reports/ReportWidget.test.js
@@ -15,8 +15,8 @@ test('static elements', async () => {
await screen.findByText(/Some chart/)
})
-test("append", async ()=>{
- const appendable = ()=> "some text"
+test('append', async () => {
+ const appendable = () => 'some text'
render(<ReportWidget data={[]} renderer={() => null} append={appendable} />)
await screen.findByText(/some text/)
})
diff --git a/studio/tests/pages/projects/Logs.utils.test.js b/studio/tests/pages/projects/Logs.utils.test.js
index 321bd97f14a..bcc9cb45868 100644
--- a/studio/tests/pages/projects/Logs.utils.test.js
+++ b/studio/tests/pages/projects/Logs.utils.test.js
@@ -214,15 +214,21 @@ test.each([
len: 24,
min: '2023-05-18T00:00:00',
max: '2023-05-18T23:00:00',
- valKey: ['total_auth_requests', 'total_realtime_requests', 'total_rest_requests', 'total_storage_requests'],
- includes: [ {
- // timestamp format is with higher precision and with tz
- timestamp: '2023-05-18T14:00:00.000Z',
- total_auth_requests: 0,
- total_realtime_requests: 0,
- total_rest_requests: 0,
- total_storage_requests: 0,
- },
+ valKey: [
+ 'total_auth_requests',
+ 'total_realtime_requests',
+ 'total_rest_requests',
+ 'total_storage_requests',
+ ],
+ includes: [
+ {
+ // timestamp format is with higher precision and with tz
+ timestamp: '2023-05-18T14:00:00.000Z',
+ total_auth_requests: 0,
+ total_realtime_requests: 0,
+ total_rest_requests: 0,
+ total_storage_requests: 0,
+ },
],
},
])(