diff --git a/src/backend/base/langflow/api/v1/schemas.py b/src/backend/base/langflow/api/v1/schemas.py index 4a6868003..9ccdb0085 100644 --- a/src/backend/base/langflow/api/v1/schemas.py +++ b/src/backend/base/langflow/api/v1/schemas.py @@ -321,4 +321,3 @@ class FlowDataRequest(BaseModel): class ConfigResponse(BaseModel): frontend_timeout: int - diff --git a/src/frontend/src/components/tableComponent/index.tsx b/src/frontend/src/components/tableComponent/index.tsx index 4114f5ec6..534ed171f 100644 --- a/src/frontend/src/components/tableComponent/index.tsx +++ b/src/frontend/src/components/tableComponent/index.tsx @@ -17,6 +17,7 @@ interface TableComponentProps extends AgGridReactProps { rowData: NonNullable; alertTitle?: string; alertDescription?: string; + editable?: boolean | string[]; } const TableComponent = forwardRef< @@ -48,20 +49,29 @@ const TableComponent = forwardRef< } const colDef = props.columnDefs.map((col, index) => { + let newCol = { + ...col, + headerName: toTitleCase(col.headerName), + }; if (props.onSelectionChanged && index === 0) { - return { - ...col, - headerName: toTitleCase(col.headerName), + newCol = { + ...newCol, checkboxSelection: true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true, }; - } else { - return { - ...col, - headerName: toTitleCase(col.headerName), + } + if ( + (typeof props.editable === "boolean" && props.editable) || + (Array.isArray(props.editable) && + props.editable.includes(newCol.headerName ?? "")) + ) { + newCol = { + ...newCol, + editable: true, }; } + return newCol; }); return ( diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index c7f52f99e..0a33f9639 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -28,6 +28,7 @@ import { UploadFileTypeAPI, errorsTypeAPI, } from "./../../types/api/index"; +import { Message } from "../../types/messages"; /** * Fetches all objects from the API endpoint. @@ -1049,3 +1050,7 @@ export async function deleteMessagesFn(ids: number[]) { throw error; } } + +export async function updateMessageApi(data: Message) { + return await api.post(`${BASE_URL_API}monitor/messages/${data.index}`, data); +} diff --git a/src/frontend/src/modals/IOModal/components/chatView/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/index.tsx index a625cd611..61cf44516 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/index.tsx @@ -18,6 +18,12 @@ import { chatViewProps } from "../../../../types/components"; import { classNames } from "../../../../utils/utils"; import ChatInput from "./chatInput"; import ChatMessage from "./chatMessage"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, +} from "../../../../components/ui/select"; export default function ChatView({ sendMessage, @@ -118,10 +124,21 @@ export default function ChatView({ if (lockChat) setLockChat(false); } + function handleSelectChange(event: string): void { + switch (event) { + case "builds": + clearChat(); + break; + case "buildsNSession": + console.log("delete build and session"); + break; + } + } + function updateChat( chat: ChatMessageType, message: string, - stream_url?: string + stream_url?: string, ) { // if (message === "") return; chat.message = message; @@ -149,18 +166,44 @@ export default function ChatView({
- +
{chatHistory?.length > 0 ? ( diff --git a/src/frontend/src/pages/SettingsPage/pages/messagesPage/components/headerMessages/index.tsx b/src/frontend/src/pages/SettingsPage/pages/messagesPage/components/headerMessages/index.tsx index 2347699b2..42fd1c7aa 100644 --- a/src/frontend/src/pages/SettingsPage/pages/messagesPage/components/headerMessages/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/messagesPage/components/headerMessages/index.tsx @@ -21,9 +21,7 @@ const HeaderMessagesComponent = ({ className="ml-2 h-5 w-5 text-primary" /> -

- Manage your messages as you like. -

+

@Rodrigo