Format constant variables
This commit is contained in:
parent
13a073615b
commit
763d9dee8e
21 changed files with 143 additions and 100 deletions
|
|
@ -17,10 +17,10 @@ import TextAreaComponent from "../../../../components/textAreaComponent";
|
|||
import ToggleShadComponent from "../../../../components/toggleShadComponent";
|
||||
import { Button } from "../../../../components/ui/button";
|
||||
import {
|
||||
INPUT_HANDLER_HOVER,
|
||||
LANGFLOW_SUPPORTED_TYPES,
|
||||
OUTPUT_HANDLER_HOVER,
|
||||
TOOLTIP_EMPTY,
|
||||
inputHandleHover,
|
||||
outputHandleHover,
|
||||
} from "../../../../constants/constants";
|
||||
import { postCustomComponentUpdate } from "../../../../controllers/API";
|
||||
import useAlertStore from "../../../../stores/alertStore";
|
||||
|
|
@ -182,7 +182,7 @@ export default function ParameterComponent({
|
|||
return (
|
||||
<div key={index}>
|
||||
{index === 0 && (
|
||||
<span>{left ? inputHandleHover : outputHandleHover}</span>
|
||||
<span>{left ? INPUT_HANDLER_HOVER : OUTPUT_HANDLER_HOVER}</span>
|
||||
)}
|
||||
<span
|
||||
key={index}
|
||||
|
|
@ -304,7 +304,10 @@ export default function ParameterComponent({
|
|||
ref={ref}
|
||||
className={
|
||||
"relative mt-1 flex w-full flex-wrap items-center justify-between bg-muted px-5 py-2" +
|
||||
((name==="code" && type==="code") || (name.includes("code") && proxy) ? " hidden " : "")
|
||||
((name === "code" && type === "code") ||
|
||||
(name.includes("code") && proxy)
|
||||
? " hidden "
|
||||
: "")
|
||||
}
|
||||
>
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import Loading from "../../components/ui/loading";
|
|||
import { Textarea } from "../../components/ui/textarea";
|
||||
import Xmark from "../../components/ui/xmark";
|
||||
import {
|
||||
STATUS_BUILD,
|
||||
STATUS_BUILDING,
|
||||
priorityFields,
|
||||
statusBuild,
|
||||
statusBuilding,
|
||||
} from "../../constants/constants";
|
||||
import { BuildStatus } from "../../constants/enums";
|
||||
import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent";
|
||||
|
|
@ -49,7 +49,12 @@ export default function GenericNode({
|
|||
const [nodeDescription, setNodeDescription] = useState(
|
||||
data.node?.description!
|
||||
);
|
||||
const buildStatus = useFlowStore((state) => state.flowBuildStatus[data.id]);
|
||||
const buildStatus = useFlowStore(
|
||||
(state) => state.flowBuildStatus[data.id]?.status
|
||||
);
|
||||
const lastRunTime = useFlowStore(
|
||||
(state) => state.flowBuildStatus[data.id]?.timestamp
|
||||
);
|
||||
const [validationStatus, setValidationStatus] =
|
||||
useState<validationStatusType | null>(null);
|
||||
const [handles, setHandles] = useState<number>(0);
|
||||
|
|
@ -100,10 +105,7 @@ export default function GenericNode({
|
|||
if (duration === undefined) {
|
||||
return "";
|
||||
} else {
|
||||
const nowTimestamp = new Date(Date.now());
|
||||
// readable last run time like YYYY-MM-DD HH:MM:SS
|
||||
const last_run_datetime = nowTimestamp.toLocaleString();
|
||||
return `Last run: ${last_run_datetime}\nDuration: ${duration}`;
|
||||
return `Duration: ${duration}`;
|
||||
}
|
||||
};
|
||||
const durationString = getDurationString(validationStatus?.data.duration);
|
||||
|
|
@ -487,9 +489,9 @@ export default function GenericNode({
|
|||
<ShadTooltip
|
||||
content={
|
||||
buildStatus === BuildStatus.BUILDING ? (
|
||||
<span> {statusBuilding} </span>
|
||||
<span> {STATUS_BUILDING} </span>
|
||||
) : !validationStatus ? (
|
||||
<span className="flex">{statusBuild}</span>
|
||||
<span className="flex">{STATUS_BUILD}</span>
|
||||
) : (
|
||||
<div className="max-h-96 overflow-auto">
|
||||
{typeof validationStatus.params === "string"
|
||||
|
|
@ -723,6 +725,15 @@ export default function GenericNode({
|
|||
showNode={showNode}
|
||||
/>
|
||||
)}
|
||||
<div>
|
||||
{lastRunTime && (
|
||||
<div className="flex justify-center text-muted-foreground">
|
||||
{lastRunTime.split("\n").map((line, index) => (
|
||||
<div key={index}>{line}</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from "../../components/ui/popover";
|
||||
import { zeroNotifications } from "../../constants/constants";
|
||||
import { ZERO_NOTIFICATIONS } from "../../constants/constants";
|
||||
import useAlertStore from "../../stores/alertStore";
|
||||
import { AlertDropdownType } from "../../types/alerts";
|
||||
import SingleAlert from "./components/singleAlertComponent";
|
||||
|
|
@ -70,7 +70,7 @@ export default function AlertDropdown({
|
|||
))
|
||||
) : (
|
||||
<div className="flex h-full w-full items-center justify-center pb-16 text-ring">
|
||||
{zeroNotifications}
|
||||
{ZERO_NOTIFICATIONS}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
CHAT_FORM_DIALOG_SUBTITLE,
|
||||
outputsModalTitle,
|
||||
textInputModalTitle,
|
||||
OUTPUTS_MODAL_TITLE,
|
||||
TEXT_INPUT_MODAL_TITLE,
|
||||
} from "../../constants/constants";
|
||||
import BaseModal from "../../modals/baseModal";
|
||||
import useFlowStore from "../../stores/flowStore";
|
||||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||
import { NodeType } from "../../types/flow";
|
||||
import { updateVerticesOrder } from "../../utils/buildUtils";
|
||||
import { cn } from "../../utils/utils";
|
||||
import AccordionComponent from "../AccordionComponent";
|
||||
|
|
@ -18,7 +19,6 @@ import NewChatView from "../newChatView";
|
|||
import { Badge } from "../ui/badge";
|
||||
import { Button } from "../ui/button";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs";
|
||||
import { NodeType } from "../../types/flow";
|
||||
|
||||
export default function IOView({ children, open, setOpen }): JSX.Element {
|
||||
const inputs = useFlowStore((state) => state.inputs).filter(
|
||||
|
|
@ -79,10 +79,9 @@ export default function IOView({ children, open, setOpen }): JSX.Element {
|
|||
});
|
||||
}
|
||||
setLockChat(false);
|
||||
if(chatInput) {
|
||||
setNode(chatInput.id, (node:NodeType)=>{
|
||||
|
||||
const newNode = {...node}
|
||||
if (chatInput) {
|
||||
setNode(chatInput.id, (node: NodeType) => {
|
||||
const newNode = { ...node };
|
||||
newNode.data.node!.template["input_value"].value = chatValue;
|
||||
return newNode;
|
||||
});
|
||||
|
|
@ -148,7 +147,7 @@ export default function IOView({ children, open, setOpen }): JSX.Element {
|
|||
>
|
||||
<div className="mx-2 mb-2 flex items-center gap-2 text-sm font-bold">
|
||||
<IconComponent className="h-4 w-4" name={"Type"} />
|
||||
{textInputModalTitle}
|
||||
{TEXT_INPUT_MODAL_TITLE}
|
||||
</div>
|
||||
{nodes
|
||||
.filter((node) =>
|
||||
|
|
@ -209,7 +208,7 @@ export default function IOView({ children, open, setOpen }): JSX.Element {
|
|||
>
|
||||
<div className="mx-2 mb-2 flex items-center gap-2 text-sm font-bold">
|
||||
<IconComponent className="h-4 w-4" name={"FileType2"} />
|
||||
{outputsModalTitle}
|
||||
{OUTPUTS_MODAL_TITLE}
|
||||
</div>
|
||||
{nodes
|
||||
.filter((node) =>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Node } from "reactflow";
|
||||
import { savedHover } from "../../../../constants/constants";
|
||||
import { SAVED_HOVER } from "../../../../constants/constants";
|
||||
import FlowSettingsModal from "../../../../modals/flowSettingsModal";
|
||||
import useAlertStore from "../../../../stores/alertStore";
|
||||
import useFlowStore from "../../../../stores/flowStore";
|
||||
|
|
@ -128,7 +128,7 @@ export const MenuBar = ({
|
|||
</div>
|
||||
<ShadTooltip
|
||||
content={
|
||||
savedHover +
|
||||
SAVED_HOVER +
|
||||
new Date(currentFlow.updated_at ?? "").toLocaleString("en-US", {
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { useEffect, useState } from "react";
|
|||
import IconComponent from "../../../components/genericIconComponent";
|
||||
import { Textarea } from "../../../components/ui/textarea";
|
||||
import {
|
||||
chatInputPlaceholder,
|
||||
chatInputPlaceholderSend,
|
||||
CHAT_INPUT_PLACEHOLDER,
|
||||
CHAT_INPUT_PLACEHOLDER_SEND,
|
||||
} from "../../../constants/constants";
|
||||
import useFlowsManagerStore from "../../../stores/flowsManagerStore";
|
||||
import { chatInputType } from "../../../types/components";
|
||||
|
|
@ -84,7 +84,7 @@ export default function ChatInput({
|
|||
"form-modal-lockchat"
|
||||
)}
|
||||
placeholder={
|
||||
noInput ? chatInputPlaceholder : chatInputPlaceholderSend
|
||||
noInput ? CHAT_INPUT_PLACEHOLDER : CHAT_INPUT_PLACEHOLDER_SEND
|
||||
}
|
||||
/>
|
||||
<div className="form-modal-send-icon-position">
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { useEffect, useRef, useState } from "react";
|
|||
import IconComponent from "../../components/genericIconComponent";
|
||||
import { NOCHATOUTPUT_NOTICE_ALERT } from "../../constants/alerts_constants";
|
||||
import {
|
||||
chatFirstInitialText,
|
||||
chatSecondInitialText,
|
||||
CHAT_FIRST_INITIAL_TEXT,
|
||||
CHAT_SECOND_INITIAL_TEXT,
|
||||
} from "../../constants/constants";
|
||||
import { deleteFlowPool } from "../../controllers/API";
|
||||
import useAlertStore from "../../stores/alertStore";
|
||||
|
|
@ -182,14 +182,14 @@ export default function NewChatView({
|
|||
<br />
|
||||
<div className="langflow-chat-desc">
|
||||
<span className="langflow-chat-desc-span">
|
||||
{chatFirstInitialText}{" "}
|
||||
{CHAT_FIRST_INITIAL_TEXT}{" "}
|
||||
<span>
|
||||
<IconComponent
|
||||
name="MessageSquare"
|
||||
className="mx-1 inline h-5 w-5 animate-bounce "
|
||||
/>
|
||||
</span>{" "}
|
||||
{chatSecondInitialText}
|
||||
{CHAT_SECOND_INITIAL_TEXT}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect } from "react";
|
||||
import { editTextModalTitle } from "../../constants/constants";
|
||||
import { EDIT_TEXT_MODAL_TITLE } from "../../constants/constants";
|
||||
import { TypeModal } from "../../constants/enums";
|
||||
import GenericModal from "../../modals/genericModal";
|
||||
import { TextAreaComponentType } from "../../types/components";
|
||||
|
|
@ -38,7 +38,7 @@ export default function TextAreaComponent({
|
|||
<GenericModal
|
||||
type={TypeModal.TEXT}
|
||||
buttonText="Finish Editing"
|
||||
modalTitle={editTextModalTitle}
|
||||
modalTitle={EDIT_TEXT_MODAL_TITLE}
|
||||
value={value}
|
||||
setValue={(value: string) => {
|
||||
onChange(value);
|
||||
|
|
|
|||
|
|
@ -56,3 +56,6 @@ export const USER_ADD_SUCCESS_ALERT = "Success! New user added!";
|
|||
export const DEL_KEY_SUCCESS_ALERT = "Success! Key deleted!";
|
||||
export const FLOW_BUILD_SUCCESS_ALERT = `Flow built successfully`;
|
||||
export const SAVE_SUCCESS_ALERT = "Changes saved successfully!";
|
||||
|
||||
// Generic Node
|
||||
|
||||
|
|
|
|||
|
|
@ -691,38 +691,39 @@ export const priorityFields = new Set(["code", "template"]);
|
|||
export const INPUT_TYPES = new Set(["ChatInput", "TextInput"]);
|
||||
export const OUTPUT_TYPES = new Set(["ChatOutput", "TextOutput"]);
|
||||
|
||||
export const chatFirstInitialText =
|
||||
export const CHAT_FIRST_INITIAL_TEXT =
|
||||
"Start a conversation and click the agent's thoughts";
|
||||
|
||||
export const chatSecondInitialText = "to inspect the chaining process.";
|
||||
export const CHAT_SECOND_INITIAL_TEXT = "to inspect the chaining process.";
|
||||
|
||||
export const zeroNotifications = "No new notifications";
|
||||
export const ZERO_NOTIFICATIONS = "No new notifications";
|
||||
|
||||
export const successBuild = "Built sucessfully ✨";
|
||||
export const SUCCESS_BUILD = "Built sucessfully ✨";
|
||||
|
||||
export const alertSaveWApi =
|
||||
export const ALERT_SAVE_WITH_API =
|
||||
"Caution: Uncheck this box only removes API keys from fields specifically designated for API keys.";
|
||||
|
||||
export const saveWApiCheckbox = "Save with my API keys";
|
||||
export const editTextModalTitle = "Edit Text";
|
||||
export const editTextPlaceholder = "Type message here.";
|
||||
export const inputHandleHover = "Avaliable input components:";
|
||||
export const outputHandleHover = "Avaliable output components:";
|
||||
export const textInputModalTitle = "Text Inputs";
|
||||
export const outputsModalTitle = "Text Outputs";
|
||||
export const langflowChatTitle = "Langflow Chat";
|
||||
export const chatInputPlaceholder =
|
||||
export const SAVE_WITH_API_CHECKBOX = "Save with my API keys";
|
||||
export const EDIT_TEXT_MODAL_TITLE = "Edit Text";
|
||||
export const EDIT_TEXT_PLACEHOLDER = "Type message here.";
|
||||
export const INPUT_HANDLER_HOVER = "Avaliable input components:";
|
||||
export const OUTPUT_HANDLER_HOVER = "Avaliable output components:";
|
||||
export const TEXT_INPUT_MODAL_TITLE = "Text Inputs";
|
||||
export const OUTPUTS_MODAL_TITLE = "Text Outputs";
|
||||
export const LANGFLOW_CHAT_TITLE = "Langflow Chat";
|
||||
export const CHAT_INPUT_PLACEHOLDER =
|
||||
"No chat input variables found. Click to run your flow.";
|
||||
export const chatInputPlaceholderSend = "Send a message...";
|
||||
export const editCodeTitle = "Edit Code";
|
||||
export const myCollectionDesc =
|
||||
export const CHAT_INPUT_PLACEHOLDER_SEND = "Send a message...";
|
||||
export const EDIT_CODE_TITLE = "Edit Code";
|
||||
export const MY_COLLECTION_DESC =
|
||||
"Manage your personal projects. Download and upload entire collections.";
|
||||
export const storeDesc = "Explore community-shared flows and components.";
|
||||
export const storeTitle = "Langflow Store";
|
||||
export const noApi = "You don't have an API key. ";
|
||||
export const insertApi = "Insert your Langflow API key.";
|
||||
export const invalidApi = "Your API key is not valid. ";
|
||||
export const createApi = `Don’t have an API key? Sign up at`;
|
||||
export const statusBuild = "Build to validate status.";
|
||||
export const statusBuilding = "Building...";
|
||||
export const savedHover = "Last saved at ";
|
||||
export const STORE_DESC = "Explore community-shared flows and components.";
|
||||
export const STORE_TITLE = "Langflow Store";
|
||||
export const NO_API_KEY = "You don't have an API key. ";
|
||||
export const INSERT_API_KEY = "Insert your Langflow API key.";
|
||||
export const INVALID_API_KEY = "Your API key is not valid. ";
|
||||
export const CREATE_API_KEY = `Don’t have an API key? Sign up at`;
|
||||
export const STATUS_BUILD = "Build to validate status.";
|
||||
export const STATUS_BUILDING = "Building...";
|
||||
export const SAVED_HOVER = "Last saved at ";
|
||||
export const RUN_TIMESTAMP_PREFIX = "Last Run: ";
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import {
|
|||
API_SUCCESS_ALERT,
|
||||
} from "../../constants/alerts_constants";
|
||||
import {
|
||||
createApi,
|
||||
insertApi,
|
||||
invalidApi,
|
||||
noApi,
|
||||
CREATE_API_KEY,
|
||||
INSERT_API_KEY,
|
||||
INVALID_API_KEY,
|
||||
NO_API_KEY,
|
||||
} from "../../constants/constants";
|
||||
import { AuthContext } from "../../contexts/authContext";
|
||||
import { addApiKeyStore } from "../../controllers/API";
|
||||
|
|
@ -68,8 +68,11 @@ export default function StoreApiKeyModal({
|
|||
<BaseModal.Trigger asChild>{children}</BaseModal.Trigger>
|
||||
<BaseModal.Header
|
||||
description={
|
||||
(hasApiKey && !validApiKey ? invalidApi : !hasApiKey ? noApi : "") +
|
||||
insertApi
|
||||
(hasApiKey && !validApiKey
|
||||
? INVALID_API_KEY
|
||||
: !hasApiKey
|
||||
? NO_API_KEY
|
||||
: "") + INSERT_API_KEY
|
||||
}
|
||||
>
|
||||
<span className="pr-2">API Key</span>
|
||||
|
|
@ -104,7 +107,7 @@ export default function StoreApiKeyModal({
|
|||
</div>
|
||||
<div className="flex items-end justify-between">
|
||||
<span className="pr-1 text-xs text-muted-foreground">
|
||||
{createApi}{" "}
|
||||
{CREATE_API_KEY}{" "}
|
||||
<a
|
||||
className="text-high-indigo underline"
|
||||
href="https://langflow.store/"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
} from "../../constants/alerts_constants";
|
||||
import {
|
||||
CODE_PROMPT_DIALOG_SUBTITLE,
|
||||
editCodeTitle,
|
||||
EDIT_CODE_TITLE,
|
||||
} from "../../constants/constants";
|
||||
import { postCustomComponent, postValidateCode } from "../../controllers/API";
|
||||
import useAlertStore from "../../stores/alertStore";
|
||||
|
|
@ -39,7 +39,10 @@ export default function CodeAreaModal({
|
|||
setOpen: mySetOpen,
|
||||
}: codeAreaModalPropsType): JSX.Element {
|
||||
const [code, setCode] = useState(value);
|
||||
const [open, setOpen] = (mySetOpen !== undefined && myOpen !== undefined) ? [myOpen, mySetOpen] : useState(false);
|
||||
const [open, setOpen] =
|
||||
mySetOpen !== undefined && myOpen !== undefined
|
||||
? [myOpen, mySetOpen]
|
||||
: useState(false);
|
||||
const dark = useDarkStore((state) => state.dark);
|
||||
const unselectAll = useFlowStore((state) => state.unselectAll);
|
||||
|
||||
|
|
@ -149,7 +152,7 @@ export default function CodeAreaModal({
|
|||
<BaseModal open={open} setOpen={setOpen}>
|
||||
<BaseModal.Trigger>{children}</BaseModal.Trigger>
|
||||
<BaseModal.Header description={CODE_PROMPT_DIALOG_SUBTITLE}>
|
||||
<span className="pr-2"> {editCodeTitle} </span>
|
||||
<span className="pr-2"> {EDIT_CODE_TITLE} </span>
|
||||
<IconComponent
|
||||
name="prompts"
|
||||
className="h-6 w-6 pl-1 text-primary "
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import { Button } from "../../components/ui/button";
|
|||
import { Checkbox } from "../../components/ui/checkbox";
|
||||
import { API_WARNING_NOTICE_ALERT } from "../../constants/alerts_constants";
|
||||
import {
|
||||
ALERT_SAVE_WITH_API,
|
||||
EXPORT_DIALOG_SUBTITLE,
|
||||
alertSaveWApi,
|
||||
saveWApiCheckbox,
|
||||
SAVE_WITH_API_CHECKBOX,
|
||||
} from "../../constants/constants";
|
||||
import useAlertStore from "../../stores/alertStore";
|
||||
import { useDarkStore } from "../../stores/darkStore";
|
||||
|
|
@ -56,10 +56,12 @@ const ExportModal = forwardRef(
|
|||
}}
|
||||
/>
|
||||
<label htmlFor="terms" className="export-modal-save-api text-sm ">
|
||||
{saveWApiCheckbox}
|
||||
{SAVE_WITH_API_CHECKBOX}
|
||||
</label>
|
||||
</div>
|
||||
<span className=" text-xs text-destructive ">{alertSaveWApi}</span>
|
||||
<span className=" text-xs text-destructive ">
|
||||
{ALERT_SAVE_WITH_API}
|
||||
</span>
|
||||
</BaseModal.Content>
|
||||
|
||||
<BaseModal.Footer>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { useEffect } from "react";
|
|||
import IconComponent from "../../../components/genericIconComponent";
|
||||
import { Textarea } from "../../../components/ui/textarea";
|
||||
import {
|
||||
chatInputPlaceholder,
|
||||
chatInputPlaceholderSend,
|
||||
CHAT_INPUT_PLACEHOLDER,
|
||||
CHAT_INPUT_PLACEHOLDER_SEND,
|
||||
} from "../../../constants/constants";
|
||||
import { chatInputType } from "../../../types/components";
|
||||
import { classNames } from "../../../utils/utils";
|
||||
|
|
@ -55,7 +55,7 @@ export default function ChatInput({
|
|||
? "Thinking..."
|
||||
: typeof chatValue === "object" &&
|
||||
Object.keys(chatValue)?.length === 0
|
||||
? chatInputPlaceholder
|
||||
? CHAT_INPUT_PLACEHOLDER
|
||||
: chatValue
|
||||
}
|
||||
onChange={(event): void => {
|
||||
|
|
@ -70,7 +70,9 @@ export default function ChatInput({
|
|||
|
||||
"form-modal-lockchat"
|
||||
)}
|
||||
placeholder={noInput ? chatInputPlaceholder : chatInputPlaceholderSend}
|
||||
placeholder={
|
||||
noInput ? CHAT_INPUT_PLACEHOLDER : CHAT_INPUT_PLACEHOLDER_SEND
|
||||
}
|
||||
/>
|
||||
<div className="form-modal-send-icon-position">
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ import {
|
|||
MSG_ERROR_ALERT,
|
||||
} from "../../constants/alerts_constants";
|
||||
import {
|
||||
CHAT_FIRST_INITIAL_TEXT,
|
||||
CHAT_FORM_DIALOG_SUBTITLE,
|
||||
chatFirstInitialText,
|
||||
chatSecondInitialText,
|
||||
langflowChatTitle,
|
||||
CHAT_SECOND_INITIAL_TEXT,
|
||||
LANGFLOW_CHAT_TITLE,
|
||||
} from "../../constants/constants";
|
||||
import { AuthContext } from "../../contexts/authContext";
|
||||
import { getBuildStatus } from "../../controllers/API";
|
||||
|
|
@ -594,20 +594,20 @@ export default function FormModal({
|
|||
<span>
|
||||
👋{" "}
|
||||
<span className="langflow-chat-span">
|
||||
{langflowChatTitle}
|
||||
{LANGFLOW_CHAT_TITLE}
|
||||
</span>
|
||||
</span>
|
||||
<br />
|
||||
<div className="langflow-chat-desc">
|
||||
<span className="langflow-chat-desc-span">
|
||||
{chatFirstInitialText}{" "}
|
||||
{CHAT_FIRST_INITIAL_TEXT}{" "}
|
||||
<span>
|
||||
<IconComponent
|
||||
name="MessageSquare"
|
||||
className="mx-1 inline h-5 w-5 animate-bounce "
|
||||
/>
|
||||
</span>{" "}
|
||||
{chatSecondInitialText}
|
||||
{CHAT_SECOND_INITIAL_TEXT}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import {
|
|||
TEMP_NOTICE_ALERT,
|
||||
} from "../../constants/alerts_constants";
|
||||
import {
|
||||
EDIT_TEXT_PLACEHOLDER,
|
||||
INVALID_CHARACTERS,
|
||||
MAX_WORDS_HIGHLIGHT,
|
||||
PROMPT_DIALOG_SUBTITLE,
|
||||
TEXT_DIALOG_SUBTITLE,
|
||||
editTextPlaceholder,
|
||||
regexHighlight,
|
||||
} from "../../constants/constants";
|
||||
import { TypeModal } from "../../constants/enums";
|
||||
|
|
@ -227,7 +227,7 @@ export default function GenericModal({
|
|||
setInputValue(event.target.value);
|
||||
checkVariables(event.target.value);
|
||||
}}
|
||||
placeholder={editTextPlaceholder}
|
||||
placeholder={EDIT_TEXT_PLACEHOLDER}
|
||||
onKeyDown={(e) => {
|
||||
handleKeyDown(e, inputValue, "");
|
||||
}}
|
||||
|
|
@ -249,7 +249,7 @@ export default function GenericModal({
|
|||
onChange={(event) => {
|
||||
setInputValue(event.target.value);
|
||||
}}
|
||||
placeholder={editTextPlaceholder}
|
||||
placeholder={EDIT_TEXT_PLACEHOLDER}
|
||||
onKeyDown={(e) => {
|
||||
handleKeyDown(e, value, "");
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import SidebarNav from "../../components/sidebarComponent";
|
|||
import { Button } from "../../components/ui/button";
|
||||
import { CONSOLE_ERROR_MSG } from "../../constants/alerts_constants";
|
||||
import {
|
||||
MY_COLLECTION_DESC,
|
||||
USER_PROJECTS_HEADER,
|
||||
myCollectionDesc,
|
||||
} from "../../constants/constants";
|
||||
import useAlertStore from "../../stores/alertStore";
|
||||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||
|
|
@ -75,7 +75,7 @@ export default function HomePage(): JSX.Element {
|
|||
return (
|
||||
<PageLayout
|
||||
title={USER_PROJECTS_HEADER}
|
||||
description={myCollectionDesc}
|
||||
description={MY_COLLECTION_DESC}
|
||||
button={
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {
|
|||
INVALID_API_ERROR_ALERT,
|
||||
NOAPI_ERROR_ALERT,
|
||||
} from "../../constants/alerts_constants";
|
||||
import { storeDesc, storeTitle } from "../../constants/constants";
|
||||
import { STORE_DESC, STORE_TITLE } from "../../constants/constants";
|
||||
import { AuthContext } from "../../contexts/authContext";
|
||||
import { getStoreComponents, getStoreTags } from "../../controllers/API";
|
||||
import StoreApiKeyModal from "../../modals/StoreApiKeyModal";
|
||||
|
|
@ -174,8 +174,8 @@ export default function StorePage(): JSX.Element {
|
|||
return (
|
||||
<PageLayout
|
||||
betaIcon
|
||||
title={storeTitle}
|
||||
description={storeDesc}
|
||||
title={STORE_TITLE}
|
||||
description={STORE_DESC}
|
||||
button={
|
||||
<>
|
||||
{StoreApiKeyModal && (
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
FLOW_BUILD_SUCCESS_ALERT,
|
||||
MISSED_ERROR_ALERT,
|
||||
} from "../constants/alerts_constants";
|
||||
import { RUN_TIMESTAMP_PREFIX } from "../constants/constants";
|
||||
import { BuildStatus } from "../constants/enums";
|
||||
import { getFlowPool } from "../controllers/API";
|
||||
import { VertexBuildTypeAPI } from "../types/api";
|
||||
|
|
@ -469,7 +470,10 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
verticesLayers: newLayers,
|
||||
runId: runId,
|
||||
});
|
||||
get().updateBuildStatus(newIds, BuildStatus.TO_BUILD);
|
||||
get().updateBuildStatus(
|
||||
vertexBuildData.next_vertices_ids,
|
||||
BuildStatus.TO_BUILD
|
||||
);
|
||||
}
|
||||
|
||||
get().addDataToFlowPool(
|
||||
|
|
@ -546,17 +550,27 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
});
|
||||
},
|
||||
updateBuildStatus: (nodeIdList: string[], status: BuildStatus) => {
|
||||
console.log("updateBuildStatus", nodeIdList, status);
|
||||
const newFlowBuildStatus = { ...get().flowBuildStatus };
|
||||
nodeIdList.forEach((id) => {
|
||||
newFlowBuildStatus[id] = status;
|
||||
newFlowBuildStatus[id] = {
|
||||
status,
|
||||
};
|
||||
if (status == BuildStatus.BUILT) {
|
||||
const timestamp_string = new Date(Date.now()).toLocaleString();
|
||||
newFlowBuildStatus[
|
||||
id
|
||||
].timestamp = `${RUN_TIMESTAMP_PREFIX} ${timestamp_string}`;
|
||||
}
|
||||
console.log("updateBuildStatus", newFlowBuildStatus);
|
||||
});
|
||||
set({ flowBuildStatus: newFlowBuildStatus });
|
||||
},
|
||||
revertBuiltStatusFromBuilding: () => {
|
||||
const newFlowBuildStatus = { ...get().flowBuildStatus };
|
||||
Object.keys(newFlowBuildStatus).forEach((id) => {
|
||||
if (newFlowBuildStatus[id] === BuildStatus.BUILDING) {
|
||||
newFlowBuildStatus[id] = BuildStatus.BUILT;
|
||||
if (newFlowBuildStatus[id].status === BuildStatus.BUILDING) {
|
||||
newFlowBuildStatus[id].status = BuildStatus.BUILT;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -115,7 +115,9 @@ export type FlowStoreType = {
|
|||
} | null;
|
||||
updateBuildStatus: (nodeId: string[], status: BuildStatus) => void;
|
||||
revertBuiltStatusFromBuilding: () => void;
|
||||
flowBuildStatus: { [key: string]: BuildStatus };
|
||||
flowBuildStatus: {
|
||||
[key: string]: { status: BuildStatus; timestamp?: string };
|
||||
};
|
||||
updateFlowPool: (
|
||||
nodeId: string,
|
||||
data: FlowPoolObjectType | ChatOutputType | chatInputType,
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import {
|
|||
INPUT_TYPES,
|
||||
LANGFLOW_SUPPORTED_TYPES,
|
||||
OUTPUT_TYPES,
|
||||
SUCCESS_BUILD,
|
||||
specialCharsRegex,
|
||||
successBuild,
|
||||
} from "../constants/constants";
|
||||
import { downloadFlowsFromDatabase } from "../controllers/API";
|
||||
import {
|
||||
|
|
@ -1092,7 +1092,7 @@ export function getGroupStatus(
|
|||
flow: FlowType,
|
||||
ssData: { [key: string]: { valid: boolean; params: string } }
|
||||
) {
|
||||
let status = { valid: true, params: successBuild };
|
||||
let status = { valid: true, params: SUCCESS_BUILD };
|
||||
const { nodes } = flow.data!;
|
||||
const ids = nodes.map((n: NodeType) => n.data.id);
|
||||
ids.forEach((id) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue