Skip to content

Commit e24c3df

Browse files
nipunn1313Convex, Inc.
authored and
Convex, Inc.
committed
Gate ability to view seatless plans (#38007)
Gate behind a launchdarkly flag. Once orb starts passing them down, we'll want to be able to see what the UI looks like w/o full launching. GitOrigin-RevId: e2ce3da252fbe6e28915c94dafac448269581950
1 parent 70286ad commit e24c3df

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

npm-packages/dashboard/src/api/billing.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useLaunchDarkly } from "hooks/useLaunchDarkly";
12
import { useBBMutation, useBBQuery } from "./api";
23

34
export function useTeamOrbSubscription(teamId?: number) {
@@ -150,6 +151,8 @@ export function useListInvoices(teamId?: number) {
150151
}
151152

152153
export function useListPlans(teamId?: number) {
154+
const { seatlessPlans } = useLaunchDarkly();
155+
153156
const { data, error, isLoading } = useBBQuery({
154157
path: "/teams/{team_id}/list_active_plans",
155158
pathParams: {
@@ -165,8 +168,13 @@ export function useListPlans(teamId?: number) {
165168
throw error;
166169
}
167170

171+
let plans = data?.plans;
172+
if (plans && !seatlessPlans) {
173+
plans = plans.filter((plan) => plan.seatPrice);
174+
}
175+
168176
return {
169-
plans: data?.plans,
177+
plans,
170178
isLoading,
171179
};
172180
}

npm-packages/dashboard/src/hooks/useLaunchDarkly.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const flagDefaults: {
1616
commandPalette: boolean;
1717
commandPaletteDeleteProjects: boolean;
1818
multipleUserIdentities: boolean;
19+
seatlessPlans: boolean;
1920
} = {
2021
oauthProviderConfiguration: {},
2122
spendingLimits: false,
@@ -24,6 +25,7 @@ const flagDefaults: {
2425
commandPalette: false,
2526
commandPaletteDeleteProjects: false,
2627
multipleUserIdentities: false,
28+
seatlessPlans: false,
2729
};
2830

2931
function kebabCaseKeys(object: typeof flagDefaults) {

0 commit comments

Comments
 (0)