Skip to content

Commit 5cd436a

Browse files
authored
override feature flag for FLY (supabase#30578)
1 parent acfbc8a commit 5cd436a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { ArrowUpRight } from 'lucide-react'
2+
13
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
24
import type { Project } from 'data/projects/project-detail-query'
35
import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
46
import type { Organization } from 'types'
5-
import { ArrowUpRight } from 'lucide-react'
6-
import { useFlag } from 'hooks/ui/useFlag'
77

88
export const generateSettingsMenu = (
99
ref?: string,
@@ -27,6 +27,7 @@ export const generateSettingsMenu = (
2727
const storageEnabled = features?.storage ?? true
2828
const warehouseEnabled = features?.warehouse ?? false
2929
const logDrainsEnabled = features?.logDrains ?? false
30+
const newDiskComputeEnabled = features?.diskAndCompute ?? false
3031

3132
return [
3233
{
@@ -38,7 +39,7 @@ export const generateSettingsMenu = (
3839
url: `/project/${ref}/settings/general`,
3940
items: [],
4041
},
41-
...(IS_PLATFORM && features?.diskAndCompute
42+
...(IS_PLATFORM && newDiskComputeEnabled
4243
? [
4344
{
4445
name: 'Compute and Disk',

apps/studio/hooks/ui/useFlag.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { useContext } from 'react'
2-
32
import FlagContext from 'components/ui/Flag/FlagContext'
3+
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
44

55
export function useFlag<T = boolean>(name: string) {
6+
const project = useSelectedProject()
67
const store: any = useContext(FlagContext)
78

9+
// Temporary override as Fly projects are cant seem to upgrade their compute with the new disk UI
10+
if (name === 'diskAndComputeForm' && project?.cloud_provider === 'FLY') {
11+
return false
12+
}
13+
814
const isObjectEmpty = (objectName: Object) => {
915
return Object.keys(objectName).length === 0
1016
}

0 commit comments

Comments
 (0)