Revert "chore: utilize initWithKps flag"

This commit is contained in:
dragarcia authored and Joshen Lim committed 2022-09-01 22:42:57 +08:00
1 parent d9e9434c7c
commit e07a9d3b40
8 files changed
+13 -28

No files matched your search

@@ -21,7 +21,6 @@ const ProjectPausedState: FC<Props> = ({ 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<Props> = ({ 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' })
}
-2
View File
@@ -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) {
+2 -4
View File
@@ -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])
@@ -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])
@@ -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])
@@ -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])
@@ -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])
+2 -4
View File
@@ -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])