🚚 chore(frontend): move nameInputComponent to EditFlowSettingsComponent
🔨 refactor(frontend): update import paths for EditFlowSettingsComponent 🔨 refactor(frontend): remove unused id property from createNewFlow function in tabsContext 🔨 refactor(frontend): replace nameInputComponent with EditFlowSettingsComponent in exportModal and flowSettingsModal The nameInputComponent has been renamed to EditFlowSettingsComponent to better reflect its purpose. The import paths have been updated accordingly. The id property is no longer needed in the createNewFlow function in tabsContext, so it has been removed. The exportModal and flowSettingsModal components have been updated to use the new EditFlowSettingsComponent instead of the old nameInputComponent.
This commit is contained in:
parent
b761621751
commit
83b9c3239a
4 changed files with 14 additions and 47 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState, ChangeEvent } from "react";
|
||||
import { Textarea } from "../ui/textarea";
|
||||
import { Label } from "../ui/label";
|
||||
import { Input } from "../ui/input";
|
||||
import { Textarea } from "../../components/ui/textarea";
|
||||
import { Label } from "../../components/ui/label";
|
||||
import { Input } from "../../components/ui/input";
|
||||
|
||||
type InputProps = {
|
||||
name: string | null;
|
||||
|
|
|
|||
|
|
@ -504,7 +504,6 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
|||
const createNewFlow = (flowData, flow) => ({
|
||||
description: flowData.description,
|
||||
name: flow?.name ?? "New Flow",
|
||||
id: uuidv4(),
|
||||
data: flowData.data,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ import {
|
|||
import { Button } from "../../components/ui/button";
|
||||
import { Checkbox } from "../../components/ui/checkbox";
|
||||
import { EXPORT_DIALOG_SUBTITLE } from "../../constants";
|
||||
import EditFlowSettings from "../../components/nameInputComponent";
|
||||
import { Label } from "../../components/ui/label";
|
||||
import { Input } from "../../components/ui/input";
|
||||
import { Textarea } from "../../components/ui/textarea";
|
||||
import EditFlowSettings from "../../components/EditFlowSettingsComponent";
|
||||
|
||||
export default function ExportModal() {
|
||||
const [open, setOpen] = useState(true);
|
||||
|
|
@ -56,44 +53,15 @@ export default function ExportModal() {
|
|||
<DialogDescription>{EXPORT_DIALOG_SUBTITLE}</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<Label>
|
||||
<span className="font-medium">Name</span>
|
||||
|
||||
<Input
|
||||
className="mt-2 focus-visible:ring-1"
|
||||
onChange={(event) => {
|
||||
if (event.target.value != "") {
|
||||
let newFlow = flows.find((f) => f.id === tabId);
|
||||
newFlow.name = event.target.value;
|
||||
setName(event.target.value);
|
||||
updateFlow(newFlow);
|
||||
} else {
|
||||
setName(event.target.value);
|
||||
}
|
||||
}}
|
||||
type="text"
|
||||
name="name"
|
||||
value={name ?? null}
|
||||
placeholder="File name"
|
||||
id="name"
|
||||
/>
|
||||
</Label>
|
||||
<Label>
|
||||
<span className="font-medium">Description (optional)</span>
|
||||
<Textarea
|
||||
name="description"
|
||||
id="description"
|
||||
onChange={(event) => {
|
||||
let newFlow = flows.find((f) => f.id === tabId);
|
||||
newFlow.description = event.target.value;
|
||||
updateFlow(newFlow);
|
||||
}}
|
||||
value={flows.find((f) => f.id === tabId).description ?? null}
|
||||
placeholder="Flow description"
|
||||
className="max-h-[100px] mt-2 focus-visible:ring-1"
|
||||
rows={3}
|
||||
/>
|
||||
</Label>
|
||||
<EditFlowSettings
|
||||
name={name}
|
||||
description={description}
|
||||
flows={flows}
|
||||
tabId={tabId}
|
||||
setName={setName}
|
||||
setDescription={setDescription}
|
||||
updateFlow={updateFlow}
|
||||
/>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id="terms"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
import { Button } from "../../components/ui/button";
|
||||
import { SETTINGS_DIALOG_SUBTITLE } from "../../constants";
|
||||
import { updateFlowInDatabase } from "../../controllers/API";
|
||||
import EditFlowSettings from "../../components/nameInputComponent";
|
||||
import EditFlowSettings from "../../components/EditFlowSettingsComponent";
|
||||
|
||||
export default function FlowSettingsModal() {
|
||||
const [open, setOpen] = useState(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue