Fixed flow settings modal not editing description and not closing

This commit is contained in:
Lucas Oliveira 2023-06-15 08:34:17 -03:00
commit 435927df8e
4 changed files with 57 additions and 55 deletions

View file

@ -34,16 +34,7 @@ export const EditFlowSettings: React.FC<InputProps> = ({
setIsMaxLength(false); setIsMaxLength(false);
} }
if (value !== "") { setName(value)
let newFlow = flows.find((f) => f.id === tabId);
if (newFlow) {
newFlow.name = value;
setName(value);
updateFlow(newFlow);
}
} else {
setName(value);
}
}; };
const handleDescriptionChange = (event: ChangeEvent<HTMLTextAreaElement>) => { const handleDescriptionChange = (event: ChangeEvent<HTMLTextAreaElement>) => {

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Before After
Before After

View file

@ -35,6 +35,14 @@ export default function FlowSettingsModal() {
} }
function handleSaveFlow(flow) { function handleSaveFlow(flow) {
if (name !== "") {
let newFlow = flows.find((f) => f.id === tabId);
if (newFlow) {
newFlow.name = name;
newFlow.description = description;
updateFlow(newFlow);
}
}
try { try {
updateFlowInDatabase(flow); updateFlowInDatabase(flow);
// updateFlowStyleInDataBase(flow); // updateFlowStyleInDataBase(flow);
@ -73,6 +81,7 @@ export default function FlowSettingsModal() {
onClick={() => { onClick={() => {
handleSaveFlow(flows.find((f) => f.id === tabId)); handleSaveFlow(flows.find((f) => f.id === tabId));
setSuccessData({ title: "Changes saved successfully" }); setSuccessData({ title: "Changes saved successfully" });
closePopUp();
}} }}
type="submit" type="submit"
> >

View file

@ -41,6 +41,7 @@ import { SearxIcon } from "./icons/Searx";
import { SlackIcon } from "./icons/Slack"; import { SlackIcon } from "./icons/Slack";
import clsx, { ClassValue } from "clsx"; import clsx, { ClassValue } from "clsx";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
import { WeaviateIcon } from "./icons/Weaviate";
export function classNames(...classes: Array<string>) { export function classNames(...classes: Array<string>) {
return classes.filter(Boolean).join(" "); return classes.filter(Boolean).join(" ");
@ -174,7 +175,7 @@ export const nodeIcons: {
// ReadTheDocsLoader: ReadTheDocsIcon, // does not work // ReadTheDocsLoader: ReadTheDocsIcon, // does not work
Searx: SearxIcon, Searx: SearxIcon,
SlackDirectoryLoader: SlackIcon, SlackDirectoryLoader: SlackIcon,
// Weaviate: WeaviateIcon, // Weaviate: WeaviateIcon, // does not work
// WikipediaAPIWrapper: WikipediaIcon, // WikipediaAPIWrapper: WikipediaIcon,
// WolframAlphaQueryRun: WolframIcon, // WolframAlphaQueryRun: WolframIcon,
// WolframAlphaAPIWrapper: WolframIcon, // WolframAlphaAPIWrapper: WolframIcon,