From 26286fd16243e524f18b46fb91c6784fd3fc0247 Mon Sep 17 00:00:00 2001 From: Ignacio Dobronich Date: Tue, 28 Oct 2025 13:22:56 -0300 Subject: [PATCH] chore: compute Instances entitlements (#39848) chore: Compute Instances entitlements --- .../interfaces/DiskManagement/DiskManagementForm.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx index 34b228bc60e..19ab6c1881f 100644 --- a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx +++ b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx @@ -64,6 +64,7 @@ import { } from './ui/DiskManagement.constants' import { NoticeBar } from './ui/NoticeBar' import { SpendCapDisabledSection } from './ui/SpendCapDisabledSection' +import { useCheckEntitlements } from 'hooks/misc/useCheckEntitlements' export function DiskManagementForm() { const { ref: projectRef } = useParams() @@ -88,6 +89,8 @@ export function DiskManagementForm() { }, }) + const { hasAccess, entitlementConfig } = useCheckEntitlements('instances.compute_update') + const [isDialogOpen, setIsDialogOpen] = useState(false) const [refetchInterval, setRefetchInterval] = useState(false) const [message, setMessageState] = useState(null) @@ -192,7 +195,7 @@ export function DiskManagementForm() { const isRequestingChanges = data?.requested_modification !== undefined const readReplicas = (databases ?? []).filter((db) => db.identifier !== projectRef) - const isPlanUpgradeRequired = org?.plan.id === 'free' + const isPlanUpgradeRequired = !hasAccess const { formState } = form const usedSize = Math.round(((diskUtil?.metrics.fs_used_bytes ?? 0) / GB) * 100) / 100 @@ -200,8 +203,7 @@ export function DiskManagementForm() { const usedPercentage = (usedSize / totalSize) * 100 const disableIopsThroughputConfig = - RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3.includes(form.watch('computeSize')) && - org?.plan.id !== 'free' + RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3.includes(form.watch('computeSize')) && !hasAccess const isBranch = project?.parent_project_ref !== undefined @@ -316,7 +318,7 @@ export function DiskManagementForm() { } description="You will need to upgrade to at least the Pro Plan to configure compute and disk"