From e07a9d3b403f9ebff06985fcd9ca9411ca055fa9 Mon Sep 17 00:00:00 2001 From: dragarcia Date: Thu, 1 Sep 2022 22:28:44 +0800 Subject: [PATCH] Revert "chore: utilize initWithKps flag" --- .../components/layouts/ProjectLayout/ProjectPausedState.tsx | 3 +-- studio/pages/new/[slug].tsx | 2 -- studio/pages/project/[ref]/reports/index.tsx | 6 ++---- studio/pages/project/[ref]/storage/buckets/[bucketId].tsx | 6 ++---- studio/pages/project/[ref]/storage/buckets/index.tsx | 6 ++---- studio/pages/project/[ref]/storage/policies.tsx | 6 ++---- studio/pages/project/[ref]/storage/settings.tsx | 6 ++---- studio/pages/project/[ref]/storage/usage.tsx | 6 ++---- 8 files changed, 13 insertions(+), 28 deletions(-) diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx index e57fe2cb52a..a3b11e308dc 100644 --- a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx +++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx @@ -21,7 +21,6 @@ const ProjectPausedState: FC = ({ project }) => { const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT const enablePermissions = useFlag('enablePermissions') - const kpsEnabled = useFlag('initWithKps') const isOwner = ui.selectedOrganization?.is_owner const [showConfirmRestore, setShowConfirmRestore] = useState(false) @@ -42,7 +41,7 @@ const ProjectPausedState: FC = ({ project }) => { } const onConfirmRestore = async () => { - await post(`${API_URL}/projects/${project.ref}/restore`, { kps_enabled: kpsEnabled }) + await post(`${API_URL}/projects/${project.ref}/restore`, {}) 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 c5104c1c2ae..589a768b650 100644 --- a/studio/pages/new/[slug].tsx +++ b/studio/pages/new/[slug].tsx @@ -41,7 +41,6 @@ const Wizard: NextPageWithLayout = () => { const enablePermissions = useFlag('enablePermissions') const projectCreationDisabled = useFlag('disableProjectCreationAndUpdate') - const kpsEnabled = useFlag('initWithKps') const subscriptionStats = useSubscriptionStats() const [projectName, setProjectName] = useState('') @@ -164,7 +163,6 @@ const Wizard: NextPageWithLayout = () => { db_pass: dbPass, db_region: dbRegion, db_pricing_tier_id: (PRICING_TIER_PRODUCT_IDS as any)[dbPricingTierKey], - kps_enabled: kpsEnabled, } 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 3c8315fd8e4..7d1972b6381 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, useFlag, useStore } from 'hooks' +import { checkPermissions, useStore } from 'hooks' import { post } from 'lib/common/fetch' import { API_URL, PROJECT_STATUS } from 'lib/constants' import { useProjectContentStore } from 'stores/projectContentStore' @@ -28,11 +28,9 @@ export const UserReportPage: NextPageWithLayout = () => { subject: { id: ui.profile?.id }, }) - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } }, [project]) diff --git a/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx b/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx index 721cd9cc538..901c93ae87c 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 { useFlag, useStore } from 'hooks' +import { useStore } from 'hooks' import { post } from 'lib/common/fetch' import { PROJECT_STATUS } from 'lib/constants' import { StorageLayout } from 'components/layouts' @@ -26,11 +26,9 @@ const PageLayout: NextPageWithLayout = () => { const storageStore = useStorageStore() const { buckets, loaded, openCreateBucketModal } = storageStore - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } }, [project]) diff --git a/studio/pages/project/[ref]/storage/buckets/index.tsx b/studio/pages/project/[ref]/storage/buckets/index.tsx index 80ca79f9f03..1204c62c4fe 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 { useFlag, useStore } from 'hooks' +import { useStore } from 'hooks' import { post } from 'lib/common/fetch' import { PROJECT_STATUS } from 'lib/constants' import { StorageLayout } from 'components/layouts' @@ -24,11 +24,9 @@ const PageLayout: NextPageWithLayout = ({}) => { const storageStore = useStorageStore() const { openCreateBucketModal } = storageStore - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } }, [project]) diff --git a/studio/pages/project/[ref]/storage/policies.tsx b/studio/pages/project/[ref]/storage/policies.tsx index 09d5f8d667f..50f477bbfb5 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 { useFlag, useStore } from 'hooks' +import { useStore } from 'hooks' import { StorageLayout } from 'components/layouts' import { StoragePolicies } from 'components/to-be-cleaned/Storage' import { NextPageWithLayout } from 'types' @@ -20,11 +20,9 @@ const PageLayout: NextPageWithLayout = () => { const { ui, meta } = useStore() const project = ui.selectedProject - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } meta.roles.load() }, [project]) diff --git a/studio/pages/project/[ref]/storage/settings.tsx b/studio/pages/project/[ref]/storage/settings.tsx index 84101380950..4de917bef40 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 { useFlag, useStore } from 'hooks' +import { useStore } from 'hooks' import { post } from 'lib/common/fetch' import { StorageLayout } from 'components/layouts' import { StorageSettings } from 'components/to-be-cleaned/Storage' @@ -19,11 +19,9 @@ const PageLayout: NextPageWithLayout = () => { const { ui } = useStore() const project = ui.selectedProject - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } }, [project]) diff --git a/studio/pages/project/[ref]/storage/usage.tsx b/studio/pages/project/[ref]/storage/usage.tsx index 01482b0a520..3f3e7fc2849 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 { useFlag, useStore } from 'hooks' +import { useStore } from 'hooks' import { post } from 'lib/common/fetch' import { PROJECT_STATUS } from 'lib/constants' import { StorageLayout } from 'components/layouts' @@ -20,11 +20,9 @@ const PageLayout: NextPageWithLayout = () => { const { ui } = useStore() const project = ui.selectedProject - const kpsEnabled = useFlag('initWithKps') - useEffect(() => { if (project && project.status === PROJECT_STATUS.INACTIVE) { - post(`${API_URL}/projects/${ref}/restore`, { kps_enabled: kpsEnabled }) + post(`${API_URL}/projects/${ref}/restore`, {}) } }, [project])