From afc52c643e74c87f58c7a8adf2c420ce78522f9d Mon Sep 17 00:00:00 2001 From: sherifButt <90522472+sherifButt@users.noreply.github.com> Date: Mon, 18 Mar 2024 08:37:36 +0000 Subject: [PATCH] - added metaResponse:Bool and metaResponseSettings:String columns to workspaces table via prisma. - added workspacMetaResponse routes and models --- .../OptionSelect/index.jsx | 0 .../{DynamicInput => MetaInputs}/index.jsx | 18 +- .../WorkspaceChat/ChatContainer/index.jsx | 15 +- .../src/components/WorkspaceChat/index.jsx | 6 +- server/endpoints/workspaceMetaResponse.js | 294 ++++++++++++++++++ server/index.js | 2 + server/models/workspaceMetaResponse.js | 69 ++++ .../20240316221455_init/migration.sql | 3 + server/prisma/schema.prisma | 4 +- 9 files changed, 390 insertions(+), 21 deletions(-) rename frontend/src/components/WorkspaceChat/ChatContainer/{DynamicInput => MetaInputs}/OptionSelect/index.jsx (100%) rename frontend/src/components/WorkspaceChat/ChatContainer/{DynamicInput => MetaInputs}/index.jsx (89%) create mode 100644 server/endpoints/workspaceMetaResponse.js create mode 100644 server/models/workspaceMetaResponse.js create mode 100644 server/prisma/migrations/20240316221455_init/migration.sql diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/DynamicInput/OptionSelect/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/MetaInputs/OptionSelect/index.jsx similarity index 100% rename from frontend/src/components/WorkspaceChat/ChatContainer/DynamicInput/OptionSelect/index.jsx rename to frontend/src/components/WorkspaceChat/ChatContainer/MetaInputs/OptionSelect/index.jsx diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/DynamicInput/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/MetaInputs/index.jsx similarity index 89% rename from frontend/src/components/WorkspaceChat/ChatContainer/DynamicInput/index.jsx rename to frontend/src/components/WorkspaceChat/ChatContainer/MetaInputs/index.jsx index a161d749..6f4fe561 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/DynamicInput/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/MetaInputs/index.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; // import TextInput from './TextInput'; -import OptionSelect from "@/components/WorkspaceChat/ChatContainer/DynamicInput/OptionSelect"; +import OptionSelect from "@/components/WorkspaceChat/ChatContainer/MetaInputs/OptionSelect"; import { Cursor, Keyboard } from "@phosphor-icons/react"; import PromptInput from "../PromptInput"; // import RangeSlider from './RangeSlider'; @@ -9,7 +9,6 @@ import PromptInput from "../PromptInput"; // import DateTimePicker from './DateTimePicker'; // import FileUpload from './FileUpload'; // import Rating from './Rating'; -// import Checkbox from './Checkbox'; const inputComponents = { text: PromptInput, @@ -20,12 +19,11 @@ const inputComponents = { // datetime: DateTimePicker, // file: FileUpload, // rating: Rating, - // checkbox: Checkbox }; -const DynamicInput = ({ +const MetaInputs = ({ inputs, - isDynamicInput, + isMetaInputs, submit, setMessage, workspace, @@ -48,13 +46,13 @@ const DynamicInput = ({ : inputComponents[inputs?.type] || null; // Condition to show the dynamic input or the forced text input - const shouldShowDynamicInput = - isDynamicInput && inputs !== undefined && !isForcedTextInput; + const shouldShowMetaInputs = + isMetaInputs && inputs !== undefined && !isForcedTextInput; return (
- {shouldShowDynamicInput ? ( + {shouldShowMetaInputs ? ( )} - {isDynamicInput && inputs != undefined && ( + {isMetaInputs && inputs != undefined && (