From 26c311d6d3744a6ba6e155247dbabb7abc29dfb1 Mon Sep 17 00:00:00 2001 From: sherifButt <90522472+sherifButt@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:35:19 +0000 Subject: [PATCH] - Linked Meta Response settings with components - fixed bugs --- .../components/Generic/Badges/Badge/index.jsx | 15 +- .../Generic/Blocks/TextAreaBlock/index.jsx | 2 + .../Generic/Blocks/ToggleBlock/index.jsx | 4 +- .../Generic/Buttons/Button/index.jsx | 27 +++ .../Generic/Inputs/TextArea/index.jsx | 40 +++- .../Generic/Inputs/ToggleSwitch/index.jsx | 2 +- .../MetaInputs/OptionSelect/index.jsx | 84 +++---- .../ChatContainer/MetaInputs/index.jsx | 11 +- .../WorkspaceChat/ChatContainer/index.jsx | 6 +- frontend/src/models/metaResponse.js | 76 ------- frontend/src/pages/WorkspaceChat/index.jsx | 3 +- .../ChatEnableMetaResponse/index.jsx | 6 +- .../ChatSettings/ChatPromptSettings/index.jsx | 44 +++- .../WorkspaceSettings/ChatSettings/index.jsx | 1 - .../EnableSystemPrompt/index.jsx | 17 +- .../MetaResponse/FeatureSettings/index.jsx | 210 ++++++++++++++---- .../WorkspaceSettings/MetaResponse/index.jsx | 119 ++++++++-- .../src/pages/WorkspaceSettings/index.jsx | 32 ++- server/endpoints/workspaces.js | 184 +-------------- server/models/workspaceMetaResponse.js | 206 ++++++++++++++++- 20 files changed, 688 insertions(+), 401 deletions(-) create mode 100644 frontend/src/components/Generic/Buttons/Button/index.jsx diff --git a/frontend/src/components/Generic/Badges/Badge/index.jsx b/frontend/src/components/Generic/Badges/Badge/index.jsx index 2a04cf6a..3eb31abd 100644 --- a/frontend/src/components/Generic/Badges/Badge/index.jsx +++ b/frontend/src/components/Generic/Badges/Badge/index.jsx @@ -30,7 +30,10 @@ export default function Badge({ showClose = false, bg = "bg-green-500", animated = false, + active = false, onClose = () => {}, // Callback for close icon + onSelect = () => {}, // Callback for badge click + onDoubleClick = () => {}, // Callback for badge double click }) { const { text: textColor, @@ -64,7 +67,9 @@ export default function Badge({ lg: "shadow-lg", xl: "shadow-xl", }[shadow]; - const backgroundClasses = `${bg} bg-opacity-10 hover:bg-opacity-20`; + const backgroundClasses = `${bg} ${ + active ? "bg-opacity-20" : "bg-opacity-10" + } hover:bg-opacity-30`; // SVG Icons const DotIcon = () => ( @@ -91,7 +96,9 @@ export default function Badge({ return (
{showDot && (
@@ -103,10 +110,10 @@ export default function Badge({

{showClose && (
- +
)}
diff --git a/frontend/src/components/Generic/Blocks/TextAreaBlock/index.jsx b/frontend/src/components/Generic/Blocks/TextAreaBlock/index.jsx index b28cfda4..2d5adc4e 100644 --- a/frontend/src/components/Generic/Blocks/TextAreaBlock/index.jsx +++ b/frontend/src/components/Generic/Blocks/TextAreaBlock/index.jsx @@ -15,6 +15,7 @@ export default function TextAreaBlock({ wrap, code, onSave, + value, }) { return (
@@ -32,6 +33,7 @@ export default function TextAreaBlock({