diff --git a/src/frontend/feature-config.json b/src/frontend/feature-config.json
new file mode 100644
index 000000000000..0100b3ffbee6
--- /dev/null
+++ b/src/frontend/feature-config.json
@@ -0,0 +1,6 @@
+{
+ "ENABLE_DARK_MODE": true,
+ "ENABLE_API": true,
+ "ENABLE_LANGFLOW_STORE": true,
+ "ENABLE_PROFILE_ICONS": true
+}
\ No newline at end of file
diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx
index fd2c7a0802b6..cf4ea95e241f 100644
--- a/src/frontend/src/components/chatComponent/index.tsx
+++ b/src/frontend/src/components/chatComponent/index.tsx
@@ -1,3 +1,4 @@
+import FeatureFlags from "@/../feature-config.json";
import { Transition } from "@headlessui/react";
import { useMemo, useRef, useState } from "react";
import { useHotkeys } from "react-hotkeys-hook";
@@ -140,30 +141,34 @@ export default function FlowToolbar(): JSX.Element {
-
- {currentFlow && currentFlow.data && (
-
-
-
- API
-
-
- )}
-
-
-
-
+ {FeatureFlags.ENABLE_API && (
+ <>
+
+ {currentFlow && currentFlow.data && (
+
+
+
+ API
+
+
+ )}
+
+
+
+
+ >
+ )}
-
+ {FeatureFlags.ENABLE_DARK_MODE && (
+
+ )}
{notificationCenter && (
@@ -216,10 +225,17 @@ export default function Header(): JSX.Element {
data-testid="user-profile-settings"
className="shrink-0"
>
-

+ {FeatureFlags.ENABLE_PROFILE_ICONS ? (
+

+ ) : (
+
+ )}
diff --git a/src/frontend/src/pages/SettingsPage/index.tsx b/src/frontend/src/pages/SettingsPage/index.tsx
index 2e8f49cfc46b..bb08417d4d66 100644
--- a/src/frontend/src/pages/SettingsPage/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/index.tsx
@@ -1,3 +1,6 @@
+import FeatureFlags from "@/../feature-config.json";
+import useAuthStore from "@/stores/authStore";
+import { useStoreStore } from "@/stores/storeStore";
import { useEffect } from "react";
import { Outlet } from "react-router-dom";
import ForwardedIconComponent from "../../components/genericIconComponent";
@@ -10,12 +13,26 @@ export default function SettingsPage(): JSX.Element {
const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId,
);
+
+ const autoLogin = useAuthStore((state) => state.autoLogin);
+ const hasStore = useStoreStore((state) => state.hasStore);
+
+ // Hides the General settings if there is nothing to show
+ const showGeneralSettings =
+ FeatureFlags.ENABLE_PROFILE_ICONS || hasStore || !autoLogin;
+
useEffect(() => {
setCurrentFlowId("");
}, [pathname]);
- const sidebarNavItems = [
- {
+ const sidebarNavItems: {
+ href?: string;
+ title: string;
+ icon: React.ReactNode;
+ }[] = [];
+
+ if (showGeneralSettings) {
+ sidebarNavItems.push({
title: "General",
href: "/settings/general",
icon: (
@@ -24,7 +41,10 @@ export default function SettingsPage(): JSX.Element {
className="w-4 flex-shrink-0 justify-start stroke-[1.5]"
/>
),
- },
+ });
+ }
+
+ sidebarNavItems.push(
{
title: "Global Variables",
href: "/settings/global-variables",
@@ -65,7 +85,7 @@ export default function SettingsPage(): JSX.Element {
/>
),
},
- ];
+ );
return (
{
-
+ {FeatureFlags.ENABLE_PROFILE_ICONS && (
+
+ )}
{!autoLogin && (
import("./pages/StorePage"));
const ViewPage = lazy(() => import("./pages/ViewPage"));
const Router = () => {
+ const autoLogin = useAuthStore((state) => state.autoLogin);
+ const hasStore = useStoreStore((state) => state.hasStore);
+
+ // Hides the General settings if there is nothing to show
+ const showGeneralSettings =
+ FeatureFlags.ENABLE_PROFILE_ICONS || hasStore || !autoLogin;
+
return (
{
}
>
- } />
+
+ }
+ />
} />
} />
- } />
+ {showGeneralSettings && (
+ } />
+ )}
} />
} />
diff --git a/src/frontend/src/stores/storeStore.ts b/src/frontend/src/stores/storeStore.ts
index f27af5e69fe9..aadc40141cd5 100644
--- a/src/frontend/src/stores/storeStore.ts
+++ b/src/frontend/src/stores/storeStore.ts
@@ -1,3 +1,4 @@
+import FeatureFlags from "@/../feature-config.json";
import { create } from "zustand";
import { checkHasApiKey, checkHasStore } from "../controllers/API";
import { StoreStoreType } from "../types/zustand/store";
@@ -9,7 +10,9 @@ export const useStoreStore = create((set) => ({
loadingApiKey: true,
checkHasStore: () => {
checkHasStore().then((res) => {
- set({ hasStore: res?.enabled ?? false });
+ set({
+ hasStore: FeatureFlags.ENABLE_LANGFLOW_STORE && (res?.enabled ?? false),
+ });
});
},
updateValidApiKey: (validApiKey) => set(() => ({ validApiKey: validApiKey })),