From c8c52bbca9e5562d01df6261bfeda82cf23116d2 Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Fri, 31 May 2024 17:10:47 +0800 Subject: [PATCH] feat: disable project upgrade (#26920) --- .../ProjectUpgradeAlert.tsx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx index 20eeb656975..970a4188a30 100644 --- a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx +++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx @@ -8,6 +8,7 @@ import { useParams } from 'common' import { useProjectUpgradeEligibilityQuery } from 'data/config/project-upgrade-eligibility-query' import { useProjectUpgradeMutation } from 'data/projects/project-upgrade-mutation' import { setProjectStatus } from 'data/projects/projects-query' +import { useFlag } from 'hooks' import { PROJECT_STATUS } from 'lib/constants' import { AlertDescription_Shadcn_, @@ -19,6 +20,9 @@ import { IconAlertTriangle, Listbox, Modal, + TooltipContent_Shadcn_, + TooltipTrigger_Shadcn_, + Tooltip_Shadcn_, } from 'ui' const ProjectUpgradeAlert = () => { @@ -27,6 +31,8 @@ const ProjectUpgradeAlert = () => { const queryClient = useQueryClient() const [showUpgradeModal, setShowUpgradeModal] = useState(false) + const projectUpgradeDisabled = useFlag('disableProjectUpgrade') + const formId = 'project-upgrade-form' const { data } = useProjectUpgradeEligibilityQuery({ projectRef: ref }) const currentPgVersion = (data?.current_app_version ?? '').split('supabase-postgres-')[1] @@ -59,11 +65,26 @@ const ProjectUpgradeAlert = () => {

The latest version of Postgres ({latestPgVersion}) is available for your project.

- + + + + + {projectUpgradeDisabled && ( + + Project upgrade is currently disabled + + )} + +