Skip to content

Commit 5f3b776

Browse files
committed
fix: move FEATURE_FLAG to shared module to prevent client-side crash
1 parent f749f97 commit 5f3b776

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

apps/webapp/app/components/admin/FeatureFlagsDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { Button } from "~/components/primitives/Buttons";
1212
import { Callout } from "~/components/primitives/Callout";
1313
import { cn } from "~/utils/cn";
14-
import { FEATURE_FLAG } from "~/v3/featureFlags.server";
14+
import { FEATURE_FLAG } from "~/v3/featureFlags";
1515
import type { FlagControlType } from "~/v3/featureFlags.server";
1616
import { UNSET_VALUE, BooleanControl, EnumControl, StringControl } from "./FlagControls";
1717

apps/webapp/app/routes/admin.feature-flags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
77
import { z } from "zod";
88
import { prisma } from "~/db.server";
99
import { requireUser } from "~/services/session.server";
10+
import { FEATURE_FLAG } from "~/v3/featureFlags";
1011
import {
11-
FEATURE_FLAG,
1212
flags as getGlobalFlags,
1313
getAllFlagControlTypes,
1414
validatePartialFeatureFlags,

apps/webapp/app/v3/featureFlags.server.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { z } from "zod";
22
import { prisma, type PrismaClientOrTransaction } from "~/db.server";
3-
4-
export const FEATURE_FLAG = {
5-
defaultWorkerInstanceGroupId: "defaultWorkerInstanceGroupId",
6-
runsListRepository: "runsListRepository",
7-
taskEventRepository: "taskEventRepository",
8-
hasQueryAccess: "hasQueryAccess",
9-
hasLogsPageAccess: "hasLogsPageAccess",
10-
hasAiAccess: "hasAiAccess",
11-
hasAiModelsAccess: "hasAiModelsAccess",
12-
} as const;
3+
export { FEATURE_FLAG } from "~/v3/featureFlags";
4+
import { FEATURE_FLAG } from "~/v3/featureFlags";
135

146
const FeatureFlagCatalog = {
157
[FEATURE_FLAG.defaultWorkerInstanceGroupId]: z.string(),

apps/webapp/app/v3/featureFlags.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const FEATURE_FLAG = {
2+
defaultWorkerInstanceGroupId: "defaultWorkerInstanceGroupId",
3+
runsListRepository: "runsListRepository",
4+
taskEventRepository: "taskEventRepository",
5+
hasQueryAccess: "hasQueryAccess",
6+
hasLogsPageAccess: "hasLogsPageAccess",
7+
hasAiAccess: "hasAiAccess",
8+
hasAiModelsAccess: "hasAiModelsAccess",
9+
} as const;

0 commit comments

Comments
 (0)