Skip to content

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

chore: utilize initWithoutKps flag

dragarcia8cb47e8810b1
diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
index a3b11e308dc..5cac365a082 100644
--- a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
+++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
@@ -21,6 +21,7 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT
const enablePermissions = useFlag('enablePermissions')
+ const kpsDisabled = useFlag('initWithoutKps')
const isOwner = ui.selectedOrganization?.is_owner
const [showConfirmRestore, setShowConfirmRestore] = useState(false)
@@ -41,7 +42,7 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
}
const onConfirmRestore = async () => {
- await post(`${API_URL}/projects/${project.ref}/restore`, {})
+ await post(`${API_URL}/projects/${project.ref}/restore`, { kps_disabled: kpsDisabled })
app.onProjectUpdated({ ...project, status: PROJECT_STATUS.RESTORING })
ui.setNotification({ category: 'success', message: 'Restoring project' })
}
diff --git a/studio/pages/new/[slug].tsx b/studio/pages/new/[slug].tsx
index 589a768b650..8ad97239162 100644
--- a/studio/pages/new/[slug].tsx
+++ b/studio/pages/new/[slug].tsx
@@ -41,6 +41,7 @@ const Wizard: NextPageWithLayout = () => {
const enablePermissions = useFlag('enablePermissions')
const projectCreationDisabled = useFlag('disableProjectCreationAndUpdate')
+ const kpsDisabled = useFlag('initWithoutKps')
const subscriptionStats = useSubscriptionStats()
const [projectName, setProjectName] = useState('')
@@ -163,6 +164,7 @@ const Wizard: NextPageWithLayout = () => {
db_pass: dbPass,
db_region: dbRegion,
db_pricing_tier_id: (PRICING_TIER_PRODUCT_IDS as any)[dbPricingTierKey],
+ kps_disabled: kpsDisabled,
}
const response = await post(`${API_URL}/projects`, data)
if (response.error) {
diff --git a/studio/pages/project/[ref]/reports/index.tsx b/studio/pages/project/[ref]/reports/index.tsx
index 7d1972b6381..b0a37992441 100644
--- a/studio/pages/project/[ref]/reports/index.tsx
+++ b/studio/pages/project/[ref]/reports/index.tsx
@@ -4,7 +4,7 @@ import { useRouter } from 'next/router'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { NextPageWithLayout } from 'types'
-import { checkPermissions, useStore } from 'hooks'
+import { checkPermissions, useFlag, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { API_URL, PROJECT_STATUS } from 'lib/constants'
import { useProjectContentStore } from 'stores/projectContentStore'
@@ -28,9 +28,11 @@ export const UserReportPage: NextPageWithLayout = () => {
subject: { id: ui.profile?.id },
})
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
}, [project])
diff --git a/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx b/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx
index 901c93ae87c..c6befab26b1 100644
--- a/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx
+++ b/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx
@@ -4,7 +4,7 @@ import { observer } from 'mobx-react-lite'
import { find } from 'lodash'
import { API_URL } from 'lib/constants'
-import { useStore } from 'hooks'
+import { useFlag, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { PROJECT_STATUS } from 'lib/constants'
import { StorageLayout } from 'components/layouts'
@@ -26,9 +26,11 @@ const PageLayout: NextPageWithLayout = () => {
const storageStore = useStorageStore()
const { buckets, loaded, openCreateBucketModal } = storageStore
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
}, [project])
diff --git a/studio/pages/project/[ref]/storage/buckets/index.tsx b/studio/pages/project/[ref]/storage/buckets/index.tsx
index 1204c62c4fe..0fc1c81c598 100644
--- a/studio/pages/project/[ref]/storage/buckets/index.tsx
+++ b/studio/pages/project/[ref]/storage/buckets/index.tsx
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { API_URL } from 'lib/constants'
-import { useStore } from 'hooks'
+import { useFlag, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { PROJECT_STATUS } from 'lib/constants'
import { StorageLayout } from 'components/layouts'
@@ -24,9 +24,11 @@ const PageLayout: NextPageWithLayout = ({}) => {
const storageStore = useStorageStore()
const { openCreateBucketModal } = storageStore
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
}, [project])
diff --git a/studio/pages/project/[ref]/storage/policies.tsx b/studio/pages/project/[ref]/storage/policies.tsx
index 50f477bbfb5..03dfb98ceb7 100644
--- a/studio/pages/project/[ref]/storage/policies.tsx
+++ b/studio/pages/project/[ref]/storage/policies.tsx
@@ -5,7 +5,7 @@ import { observer } from 'mobx-react-lite'
import { API_URL } from 'lib/constants'
import { post } from 'lib/common/fetch'
import { PROJECT_STATUS } from 'lib/constants'
-import { useStore } from 'hooks'
+import { useFlag, useStore } from 'hooks'
import { StorageLayout } from 'components/layouts'
import { StoragePolicies } from 'components/to-be-cleaned/Storage'
import { NextPageWithLayout } from 'types'
@@ -20,9 +20,11 @@ const PageLayout: NextPageWithLayout = () => {
const { ui, meta } = useStore()
const project = ui.selectedProject
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
meta.roles.load()
}, [project])
diff --git a/studio/pages/project/[ref]/storage/settings.tsx b/studio/pages/project/[ref]/storage/settings.tsx
index 4de917bef40..f3bea8db5e6 100644
--- a/studio/pages/project/[ref]/storage/settings.tsx
+++ b/studio/pages/project/[ref]/storage/settings.tsx
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { API_URL, PROJECT_STATUS } from 'lib/constants'
-import { useStore } from 'hooks'
+import { useFlag, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { StorageLayout } from 'components/layouts'
import { StorageSettings } from 'components/to-be-cleaned/Storage'
@@ -19,9 +19,11 @@ const PageLayout: NextPageWithLayout = () => {
const { ui } = useStore()
const project = ui.selectedProject
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
}, [project])
diff --git a/studio/pages/project/[ref]/storage/usage.tsx b/studio/pages/project/[ref]/storage/usage.tsx
index 3f3e7fc2849..77f589b0283 100644
--- a/studio/pages/project/[ref]/storage/usage.tsx
+++ b/studio/pages/project/[ref]/storage/usage.tsx
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { API_URL } from 'lib/constants'
-import { useStore } from 'hooks'
+import { useFlag, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { PROJECT_STATUS } from 'lib/constants'
import { StorageLayout } from 'components/layouts'
@@ -20,9 +20,11 @@ const PageLayout: NextPageWithLayout = () => {
const { ui } = useStore()
const project = ui.selectedProject
+ const kpsDisabled = useFlag('initWithoutKps')
+
useEffect(() => {
if (project && project.status === PROJECT_STATUS.INACTIVE) {
- post(`${API_URL}/projects/${ref}/restore`, {})
+ post(`${API_URL}/projects/${ref}/restore`, { kps_disabled: kpsDisabled })
}
}, [project])