Skip to content

Commit 8666a4d

Browse files
committed
revertt clustersize logic
1 parent 4934379 commit 8666a4d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

web-admin/src/features/projects/status/overview/DeploymentSection.svelte

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
import { page } from "$app/stores";
33
import {
44
createAdminServiceGetProject,
5+
createAdminServiceGetBillingSubscription,
56
V1DeploymentStatus,
67
} from "@rilldata/web-admin/client";
8+
import {
9+
isFreePlan,
10+
isProPlan,
11+
isTrialPlan,
12+
} from "@rilldata/web-admin/features/billing/plans/utils";
713
import { extractBranchFromPath } from "@rilldata/web-admin/features/branches/branch-utils";
814
import { useDashboardsLastUpdated } from "@rilldata/web-admin/features/dashboards/listing/selectors";
915
import { useGithubLastSynced } from "@rilldata/web-admin/features/projects/selectors";
@@ -111,6 +117,12 @@
111117
112118
// Slots
113119
$: currentSlots = Number(projectData?.prodSlots) || 0;
120+
121+
// Billing plan detection
122+
$: subscriptionQuery = createAdminServiceGetBillingSubscription(organization);
123+
$: planName = $subscriptionQuery?.data?.subscription?.plan?.name ?? "";
124+
$: showSlots =
125+
isTrialPlan(planName) || isFreePlan(planName) || isProPlan(planName);
114126
</script>
115127

116128
<OverviewCard title="Deployment">
@@ -147,7 +159,7 @@
147159
</span>
148160
</div>
149161

150-
{#if currentSlots > 0}
162+
{#if !$subscriptionQuery?.isLoading && showSlots}
151163
<div class="info-row">
152164
<span class="info-label">Cluster Size</span>
153165
<span class="info-value">

0 commit comments

Comments
 (0)