From a29746598900e8c5429f24228ac361f73ff11f00 Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Mon, 7 Apr 2025 15:35:06 -0700 Subject: [PATCH] move cta save buttons to top of workspace setting screens --- .../WorkspaceSettings/ChatSettings/index.jsx | 19 +++---- .../GeneralAppearance/index.jsx | 20 +++---- .../VectorDatabase/index.jsx | 55 ++++++++++--------- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx index 5a8347eb103..d551183e08a 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx @@ -9,6 +9,7 @@ import ChatTemperatureSettings from "./ChatTemperatureSettings"; import ChatModeSelection from "./ChatModeSelection"; import WorkspaceLLMSelection from "./WorkspaceLLMSelection"; import ChatQueryRefusalResponse from "./ChatQueryRefusalResponse"; +import CTAButton from "@/components/lib/CTAButton"; export default function ChatSettings({ workspace }) { const [settings, setSettings] = useState({}); @@ -45,13 +46,20 @@ export default function ChatSettings({ workspace }) { if (!workspace) return null; return ( -
+
+ {hasChanges && ( +
+ + {saving ? "Updating..." : "Update Workspace"} + +
+ )} - {hasChanges && ( - - )}
); diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx index 101a3a9b89f..6b47da93cd3 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx @@ -6,6 +6,7 @@ import WorkspaceName from "./WorkspaceName"; import SuggestedChatMessages from "./SuggestedChatMessages"; import DeleteWorkspace from "./DeleteWorkspace"; import WorkspacePfp from "./WorkspacePfp"; +import CTAButton from "@/components/lib/CTAButton"; export default function GeneralInfo({ slug }) { const [workspace, setWorkspace] = useState(null); @@ -44,29 +45,28 @@ export default function GeneralInfo({ slug }) { if (!workspace || loading) return null; return ( - <> +
+ {hasChanges && ( +
+ + {saving ? "Updating..." : "Update Workspace"} + +
+ )} - {hasChanges && ( - - )} - +
); } diff --git a/frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx b/frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx index 7d7d44e8f44..a780669278c 100644 --- a/frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx @@ -8,6 +8,7 @@ import DocumentSimilarityThreshold from "./DocumentSimilarityThreshold"; import ResetDatabase from "./ResetDatabase"; import VectorCount from "./VectorCount"; import VectorSearchMode from "./VectorSearchMode"; +import CTAButton from "@/components/lib/CTAButton"; export default function VectorDatabase({ workspace }) { const [hasChanges, setHasChanges] = useState(false); @@ -35,30 +36,34 @@ export default function VectorDatabase({ workspace }) { if (!workspace) return null; return ( -
-
- - -
- - - - - {hasChanges && ( - - )} - +
+
+ {hasChanges && ( +
+ + {saving ? "Updating..." : "Update Workspace"} + +
+ )} +
+ + +
+ + + + + +
); }