From 1f8a9cc41c294c201be8dabc47f64674939bf4ac Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 15:55:28 +0530 Subject: [PATCH 01/15] chore: move AddWhatCondModal to legacy --- .../recorder => legacy/src}/AddWhatCondModal.tsx | 10 +++++----- src/components/recorder/PairDetail.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename {src/components/recorder => legacy/src}/AddWhatCondModal.tsx (92%) diff --git a/src/components/recorder/AddWhatCondModal.tsx b/legacy/src/AddWhatCondModal.tsx similarity index 92% rename from src/components/recorder/AddWhatCondModal.tsx rename to legacy/src/AddWhatCondModal.tsx index 53fd38b8..fa05304d 100644 --- a/src/components/recorder/AddWhatCondModal.tsx +++ b/legacy/src/AddWhatCondModal.tsx @@ -1,11 +1,11 @@ import { WhereWhatPair } from "maxun-core"; -import { GenericModal } from "../ui/GenericModal"; -import { modalStyle } from "./AddWhereCondModal"; +import { GenericModal } from "../../src/components/ui/GenericModal"; +import { modalStyle } from "../../src/components/recorder/AddWhereCondModal"; import { Button, TextField, Typography } from "@mui/material"; import React, { useRef } from "react"; -import { KeyValueForm } from "./KeyValueForm"; -import { ClearButton } from "../ui/buttons/ClearButton"; -import { useSocketStore } from "../../context/socket"; +import { KeyValueForm } from "../../src/components/recorder/KeyValueForm"; +import { ClearButton } from "../../src/components/ui/buttons/ClearButton"; +import { useSocketStore } from "../../src/context/socket"; interface AddWhatCondModalProps { isOpen: boolean; diff --git a/src/components/recorder/PairDetail.tsx b/src/components/recorder/PairDetail.tsx index da9be05a..28d6e171 100644 --- a/src/components/recorder/PairDetail.tsx +++ b/src/components/recorder/PairDetail.tsx @@ -12,7 +12,7 @@ import NotificationImportantIcon from '@mui/icons-material/NotificationImportant import { RemoveButton } from "../ui/buttons/RemoveButton"; import { AddWhereCondModal } from "./AddWhereCondModal"; import { useSocketStore } from "../../context/socket"; -import { AddWhatCondModal } from "./AddWhatCondModal"; +import { AddWhatCondModal } from "../../../legacy/src/AddWhatCondModal"; interface PairDetailProps { pair: WhereWhatPair | null; From 6f60e67a54675d22014f5378a901d9e55f0dadb6 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 15:56:51 +0530 Subject: [PATCH 02/15] chore: move DisplayConditionSettings to legacy --- .../src}/DisplayWhereConditionSettings.tsx | 10 +++++----- src/components/recorder/AddWhereCondModal.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename {src/components/recorder => legacy/src}/DisplayWhereConditionSettings.tsx (91%) diff --git a/src/components/recorder/DisplayWhereConditionSettings.tsx b/legacy/src/DisplayWhereConditionSettings.tsx similarity index 91% rename from src/components/recorder/DisplayWhereConditionSettings.tsx rename to legacy/src/DisplayWhereConditionSettings.tsx index 784d26c4..b159375f 100644 --- a/src/components/recorder/DisplayWhereConditionSettings.tsx +++ b/legacy/src/DisplayWhereConditionSettings.tsx @@ -1,10 +1,10 @@ import React from "react"; -import { Dropdown as MuiDropdown } from "../ui/DropdownMui"; +import { Dropdown as MuiDropdown } from "../../src/components/ui/DropdownMui"; import { Checkbox, FormControlLabel, FormGroup, MenuItem, Stack, TextField } from "@mui/material"; -import { AddButton } from "../ui/buttons/AddButton"; -import { RemoveButton } from "../ui/buttons/RemoveButton"; -import { KeyValueForm } from "./KeyValueForm"; -import { WarningText } from "../ui/texts"; +import { AddButton } from "../../src/components/ui/buttons/AddButton"; +import { RemoveButton } from "../../src/components/ui/buttons/RemoveButton"; +import { KeyValueForm } from "../../src/components/recorder/KeyValueForm"; +import { WarningText } from "../../src/components/ui/texts"; interface DisplayConditionSettingsProps { whereProp: string; diff --git a/src/components/recorder/AddWhereCondModal.tsx b/src/components/recorder/AddWhereCondModal.tsx index 758c9e75..45019d8f 100644 --- a/src/components/recorder/AddWhereCondModal.tsx +++ b/src/components/recorder/AddWhereCondModal.tsx @@ -8,7 +8,7 @@ import React, { useRef } from "react"; import { GenericModal } from "../ui/GenericModal"; import { WhereWhatPair } from "maxun-core"; import { SelectChangeEvent } from "@mui/material/Select/Select"; -import { DisplayConditionSettings } from "./DisplayWhereConditionSettings"; +import { DisplayConditionSettings } from "../../../legacy/src/DisplayWhereConditionSettings"; import { useSocketStore } from "../../context/socket"; interface AddWhereCondModalProps { From b6f4ca7a3a119663713efb50ddc1898c12a0e127 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 15:57:42 +0530 Subject: [PATCH 03/15] chore: move LeftSidePanel to legacy --- .../recorder => legacy/src}/LeftSidePanel.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {src/components/recorder => legacy/src}/LeftSidePanel.tsx (89%) diff --git a/src/components/recorder/LeftSidePanel.tsx b/legacy/src/LeftSidePanel.tsx similarity index 89% rename from src/components/recorder/LeftSidePanel.tsx rename to legacy/src/LeftSidePanel.tsx index 8fddbbb4..61daa339 100644 --- a/src/components/recorder/LeftSidePanel.tsx +++ b/legacy/src/LeftSidePanel.tsx @@ -1,14 +1,14 @@ import { Box, Paper, Tab, Tabs } from "@mui/material"; import React, { useCallback, useEffect, useState } from "react"; -import { getActiveWorkflow, getParamsOfActiveWorkflow } from "../../api/workflow"; -import { useSocketStore } from '../../context/socket'; +import { getActiveWorkflow, getParamsOfActiveWorkflow } from "../../src/api/workflow"; +import { useSocketStore } from '../../src/context/socket'; import { WhereWhatPair, WorkflowFile } from "maxun-core"; -import { emptyWorkflow } from "../../shared/constants"; -import { LeftSidePanelContent } from "./LeftSidePanelContent"; -import { useGlobalInfoStore } from "../../context/globalInfo"; +import { emptyWorkflow } from "../../src/shared/constants"; +import { LeftSidePanelContent } from "../../src/components/recorder/LeftSidePanelContent"; +import { useGlobalInfoStore } from "../../src/context/globalInfo"; import { TabContext, TabPanel } from "@mui/lab"; -import { LeftSidePanelSettings } from "./LeftSidePanelSettings"; -import { RunSettings } from "../run/RunSettings"; +import { LeftSidePanelSettings } from "../../src/components/recorder/LeftSidePanelSettings"; +import { RunSettings } from "../../src/components/run/RunSettings"; const fetchWorkflow = (id: string, callback: (response: WorkflowFile) => void) => { getActiveWorkflow(id).then( From e9e3ba013b654fb5d6d2a56fb1f85ad7fb0c5d68 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:00:54 +0530 Subject: [PATCH 04/15] chore: move LeftSidePanelContent to legacy --- legacy/src/LeftSidePanel.tsx | 2 +- .../recorder => legacy/src}/LeftSidePanelContent.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) rename {src/components/recorder => legacy/src}/LeftSidePanelContent.tsx (88%) diff --git a/legacy/src/LeftSidePanel.tsx b/legacy/src/LeftSidePanel.tsx index 61daa339..b4402ff5 100644 --- a/legacy/src/LeftSidePanel.tsx +++ b/legacy/src/LeftSidePanel.tsx @@ -4,7 +4,7 @@ import { getActiveWorkflow, getParamsOfActiveWorkflow } from "../../src/api/work import { useSocketStore } from '../../src/context/socket'; import { WhereWhatPair, WorkflowFile } from "maxun-core"; import { emptyWorkflow } from "../../src/shared/constants"; -import { LeftSidePanelContent } from "../../src/components/recorder/LeftSidePanelContent"; +import { LeftSidePanelContent } from "./LeftSidePanelContent"; import { useGlobalInfoStore } from "../../src/context/globalInfo"; import { TabContext, TabPanel } from "@mui/lab"; import { LeftSidePanelSettings } from "../../src/components/recorder/LeftSidePanelSettings"; diff --git a/src/components/recorder/LeftSidePanelContent.tsx b/legacy/src/LeftSidePanelContent.tsx similarity index 88% rename from src/components/recorder/LeftSidePanelContent.tsx rename to legacy/src/LeftSidePanelContent.tsx index 745e0e31..2efad5df 100644 --- a/src/components/recorder/LeftSidePanelContent.tsx +++ b/legacy/src/LeftSidePanelContent.tsx @@ -1,12 +1,12 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { Pair } from "./Pair"; +import { Pair } from "../../src/components/recorder/Pair"; import { WhereWhatPair, WorkflowFile } from "maxun-core"; -import { useSocketStore } from "../../context/socket"; +import { useSocketStore } from "../../src/context/socket"; import { Socket } from "socket.io-client"; -import { AddButton } from "../ui/buttons/AddButton"; -import { AddPair } from "../../api/workflow"; -import { GenericModal } from "../ui/GenericModal"; -import { PairEditForm } from "./PairEditForm"; +import { AddButton } from "../../src/components/ui/buttons/AddButton"; +import { AddPair } from "../../src/api/workflow"; +import { GenericModal } from "../../src/components/ui/GenericModal"; +import { PairEditForm } from "../../src/components/recorder/PairEditForm"; import { Tooltip } from "@mui/material"; interface LeftSidePanelContentProps { From 187eadf397193753c8b64b238f0f1baeca1246b8 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:01:27 +0530 Subject: [PATCH 05/15] chore: move LeftSidePanelSettings to legacy --- {src/components/recorder => legacy/src}/LeftSidePanelSettings.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/components/recorder => legacy/src}/LeftSidePanelSettings.tsx (100%) diff --git a/src/components/recorder/LeftSidePanelSettings.tsx b/legacy/src/LeftSidePanelSettings.tsx similarity index 100% rename from src/components/recorder/LeftSidePanelSettings.tsx rename to legacy/src/LeftSidePanelSettings.tsx From 152afd08caacf558a2131b053fc2975115305296 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:02:36 +0530 Subject: [PATCH 06/15] chore: move export const PairDetail = ({ pair, index }: PairDetailProps) => { to legacy --- legacy/src/LeftSidePanel.tsx | 2 +- legacy/src/LeftSidePanelSettings.tsx | 6 +++--- .../recorder => legacy/src}/PairDetail.tsx | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) rename {src/components/recorder => legacy/src}/PairDetail.tsx (96%) diff --git a/legacy/src/LeftSidePanel.tsx b/legacy/src/LeftSidePanel.tsx index b4402ff5..c9a6f41d 100644 --- a/legacy/src/LeftSidePanel.tsx +++ b/legacy/src/LeftSidePanel.tsx @@ -7,7 +7,7 @@ import { emptyWorkflow } from "../../src/shared/constants"; import { LeftSidePanelContent } from "./LeftSidePanelContent"; import { useGlobalInfoStore } from "../../src/context/globalInfo"; import { TabContext, TabPanel } from "@mui/lab"; -import { LeftSidePanelSettings } from "../../src/components/recorder/LeftSidePanelSettings"; +import { LeftSidePanelSettings } from "./LeftSidePanelSettings"; import { RunSettings } from "../../src/components/run/RunSettings"; const fetchWorkflow = (id: string, callback: (response: WorkflowFile) => void) => { diff --git a/legacy/src/LeftSidePanelSettings.tsx b/legacy/src/LeftSidePanelSettings.tsx index 87c73ce1..b7c9b095 100644 --- a/legacy/src/LeftSidePanelSettings.tsx +++ b/legacy/src/LeftSidePanelSettings.tsx @@ -1,8 +1,8 @@ import React from "react"; import { Button, MenuItem, TextField, Typography } from "@mui/material"; -import { Dropdown } from "../ui/DropdownMui"; -import { RunSettings } from "../run/RunSettings"; -import { useSocketStore } from "../../context/socket"; +import { Dropdown } from "../../src/components/ui/DropdownMui"; +import { RunSettings } from "../../src/components/run/RunSettings"; +import { useSocketStore } from "../../src/context/socket"; interface LeftSidePanelSettingsProps { params: any[] diff --git a/src/components/recorder/PairDetail.tsx b/legacy/src/PairDetail.tsx similarity index 96% rename from src/components/recorder/PairDetail.tsx rename to legacy/src/PairDetail.tsx index 28d6e171..570792d9 100644 --- a/src/components/recorder/PairDetail.tsx +++ b/legacy/src/PairDetail.tsx @@ -6,13 +6,13 @@ import TreeView from '@mui/lab/TreeView'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import TreeItem from '@mui/lab/TreeItem'; -import { AddButton } from "../ui/buttons/AddButton"; -import { WarningText } from "../ui/texts"; +import { AddButton } from "../../src/components/ui/buttons/AddButton"; +import { WarningText } from "../../src/components/ui/texts"; import NotificationImportantIcon from '@mui/icons-material/NotificationImportant'; -import { RemoveButton } from "../ui/buttons/RemoveButton"; -import { AddWhereCondModal } from "./AddWhereCondModal"; -import { useSocketStore } from "../../context/socket"; -import { AddWhatCondModal } from "../../../legacy/src/AddWhatCondModal"; +import { RemoveButton } from "../../src/components/ui/buttons/RemoveButton"; +import { AddWhereCondModal } from "../../src/components/recorder/AddWhereCondModal"; +import { useSocketStore } from "../../src/context/socket"; +import { AddWhatCondModal } from "./AddWhatCondModal"; interface PairDetailProps { pair: WhereWhatPair | null; From 2457b4edc9b31418c4d4fd1e454ad705b846b386 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:03:13 +0530 Subject: [PATCH 07/15] chore: move PairDisplayDiv to legacy --- {src/components/recorder => legacy/src}/PairDisplayDiv.tsx | 0 src/components/recorder/Pair.tsx | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {src/components/recorder => legacy/src}/PairDisplayDiv.tsx (100%) diff --git a/src/components/recorder/PairDisplayDiv.tsx b/legacy/src/PairDisplayDiv.tsx similarity index 100% rename from src/components/recorder/PairDisplayDiv.tsx rename to legacy/src/PairDisplayDiv.tsx diff --git a/src/components/recorder/Pair.tsx b/src/components/recorder/Pair.tsx index 12d2eca7..e4b9c53c 100644 --- a/src/components/recorder/Pair.tsx +++ b/src/components/recorder/Pair.tsx @@ -5,7 +5,7 @@ import { WorkflowFile } from "maxun-core"; import { ClearButton } from "../ui/buttons/ClearButton"; import { GenericModal } from "../ui/GenericModal"; import { PairEditForm } from "./PairEditForm"; -import { PairDisplayDiv } from "./PairDisplayDiv"; +import { PairDisplayDiv } from "../../../legacy/src/PairDisplayDiv"; import { EditButton } from "../ui/buttons/EditButton"; import { BreakpointButton } from "../ui/buttons/BreakpointButton"; import VisibilityIcon from '@mui/icons-material/Visibility'; From 850b31b81455433690d03e11065c11f7ca5e0b0a Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:03:53 +0530 Subject: [PATCH 08/15] chore: move PairEditForm to legacy --- src/components/recorder/Pair.tsx | 2 +- src/components/recorder/PairEditForm.tsx | 161 ----------------------- 2 files changed, 1 insertion(+), 162 deletions(-) delete mode 100644 src/components/recorder/PairEditForm.tsx diff --git a/src/components/recorder/Pair.tsx b/src/components/recorder/Pair.tsx index e4b9c53c..3e85cc0c 100644 --- a/src/components/recorder/Pair.tsx +++ b/src/components/recorder/Pair.tsx @@ -4,7 +4,7 @@ import { AddPair, deletePair, UpdatePair } from "../../api/workflow"; import { WorkflowFile } from "maxun-core"; import { ClearButton } from "../ui/buttons/ClearButton"; import { GenericModal } from "../ui/GenericModal"; -import { PairEditForm } from "./PairEditForm"; +import { PairEditForm } from "../../../legacy/src/PairEditForm"; import { PairDisplayDiv } from "../../../legacy/src/PairDisplayDiv"; import { EditButton } from "../ui/buttons/EditButton"; import { BreakpointButton } from "../ui/buttons/BreakpointButton"; diff --git a/src/components/recorder/PairEditForm.tsx b/src/components/recorder/PairEditForm.tsx deleted file mode 100644 index aa3354ec..00000000 --- a/src/components/recorder/PairEditForm.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { Button, TextField, Typography } from "@mui/material"; -import React, { FC } from "react"; -import { Preprocessor, WhereWhatPair } from "maxun-core"; - -interface PairProps { - index: string; - id?: string; - where: string | null; - what: string | null; -} - -interface PairEditFormProps { - onSubmitOfPair: (value: WhereWhatPair, index: number) => void; - numberOfPairs: number; - index?: string; - where?: string; - what?: string; - id?: string; -} - -export const PairEditForm: FC = ( - { - onSubmitOfPair, - numberOfPairs, - index, - where, - what, - id, - }) => { - const [pairProps, setPairProps] = React.useState({ - where: where || null, - what: what || null, - index: index || "1", - id: id || '', - }); - const [errors, setErrors] = React.useState({ - where: null, - what: null, - index: '', - }); - - const handleInputChange = (event: React.ChangeEvent) => { - const { id, value } = event.target; - if (id === 'index') { - if (parseInt(value, 10) < 1) { - setErrors({ ...errors, index: 'Index must be greater than 0' }); - return; - } else { - setErrors({ ...errors, index: '' }); - } - } - setPairProps({ ...pairProps, [id]: value }); - }; - - const validateAndSubmit = (event: React.SyntheticEvent) => { - event.preventDefault(); - let whereFromPair, whatFromPair; - // validate where - whereFromPair = { - where: pairProps.where && pairProps.where !== '{"url":"","selectors":[""] }' - ? JSON.parse(pairProps.where) - : {}, - what: [], - }; - const validationError = Preprocessor.validateWorkflow({ workflow: [whereFromPair] }); - setErrors({ ...errors, where: null }); - if (validationError) { - setErrors({ ...errors, where: validationError.message }); - return; - } - // validate what - whatFromPair = { - where: {}, - what: pairProps.what && pairProps.what !== '[{"action":"","args":[""] }]' - ? JSON.parse(pairProps.what) : [], - }; - const validationErrorWhat = Preprocessor.validateWorkflow({ workflow: [whatFromPair] }); - setErrors({ ...errors, "what": null }); - if (validationErrorWhat) { - setErrors({ ...errors, what: validationErrorWhat.message }); - return; - } - //validate index - const index = parseInt(pairProps?.index, 10); - if (index > (numberOfPairs + 1)) { - if (numberOfPairs === 0) { - setErrors(prevState => ({ - ...prevState, - index: 'Index of the first pair must be 1' - })); - return; - } else { - setErrors(prevState => ({ - ...prevState, - index: `Index must be in the range 1-${numberOfPairs + 1}` - })); - return; - } - } else { - setErrors({ ...errors, index: '' }); - } - // submit the pair - onSubmitOfPair(pairProps.id - ? { - id: pairProps.id, - where: whereFromPair?.where || {}, - what: whatFromPair?.what || [], - } - : { - where: whereFromPair?.where || {}, - what: whatFromPair?.what || [], - } - , index); - }; - - return ( -
- Raw pair edit form: - - - - - - - ); -}; From 7bd7fba1c3bbf6f3013138fb3cdc615b2f9c8de4 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:06:29 +0530 Subject: [PATCH 09/15] chore: move PairEditForm to legacy --- legacy/src/LeftSidePanelContent.tsx | 2 +- legacy/src/PairEditForm.tsx | 161 ++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 legacy/src/PairEditForm.tsx diff --git a/legacy/src/LeftSidePanelContent.tsx b/legacy/src/LeftSidePanelContent.tsx index 2efad5df..6cbc8854 100644 --- a/legacy/src/LeftSidePanelContent.tsx +++ b/legacy/src/LeftSidePanelContent.tsx @@ -6,7 +6,7 @@ import { Socket } from "socket.io-client"; import { AddButton } from "../../src/components/ui/buttons/AddButton"; import { AddPair } from "../../src/api/workflow"; import { GenericModal } from "../../src/components/ui/GenericModal"; -import { PairEditForm } from "../../src/components/recorder/PairEditForm"; +import { PairEditForm } from "./PairEditForm"; import { Tooltip } from "@mui/material"; interface LeftSidePanelContentProps { diff --git a/legacy/src/PairEditForm.tsx b/legacy/src/PairEditForm.tsx new file mode 100644 index 00000000..aa3354ec --- /dev/null +++ b/legacy/src/PairEditForm.tsx @@ -0,0 +1,161 @@ +import { Button, TextField, Typography } from "@mui/material"; +import React, { FC } from "react"; +import { Preprocessor, WhereWhatPair } from "maxun-core"; + +interface PairProps { + index: string; + id?: string; + where: string | null; + what: string | null; +} + +interface PairEditFormProps { + onSubmitOfPair: (value: WhereWhatPair, index: number) => void; + numberOfPairs: number; + index?: string; + where?: string; + what?: string; + id?: string; +} + +export const PairEditForm: FC = ( + { + onSubmitOfPair, + numberOfPairs, + index, + where, + what, + id, + }) => { + const [pairProps, setPairProps] = React.useState({ + where: where || null, + what: what || null, + index: index || "1", + id: id || '', + }); + const [errors, setErrors] = React.useState({ + where: null, + what: null, + index: '', + }); + + const handleInputChange = (event: React.ChangeEvent) => { + const { id, value } = event.target; + if (id === 'index') { + if (parseInt(value, 10) < 1) { + setErrors({ ...errors, index: 'Index must be greater than 0' }); + return; + } else { + setErrors({ ...errors, index: '' }); + } + } + setPairProps({ ...pairProps, [id]: value }); + }; + + const validateAndSubmit = (event: React.SyntheticEvent) => { + event.preventDefault(); + let whereFromPair, whatFromPair; + // validate where + whereFromPair = { + where: pairProps.where && pairProps.where !== '{"url":"","selectors":[""] }' + ? JSON.parse(pairProps.where) + : {}, + what: [], + }; + const validationError = Preprocessor.validateWorkflow({ workflow: [whereFromPair] }); + setErrors({ ...errors, where: null }); + if (validationError) { + setErrors({ ...errors, where: validationError.message }); + return; + } + // validate what + whatFromPair = { + where: {}, + what: pairProps.what && pairProps.what !== '[{"action":"","args":[""] }]' + ? JSON.parse(pairProps.what) : [], + }; + const validationErrorWhat = Preprocessor.validateWorkflow({ workflow: [whatFromPair] }); + setErrors({ ...errors, "what": null }); + if (validationErrorWhat) { + setErrors({ ...errors, what: validationErrorWhat.message }); + return; + } + //validate index + const index = parseInt(pairProps?.index, 10); + if (index > (numberOfPairs + 1)) { + if (numberOfPairs === 0) { + setErrors(prevState => ({ + ...prevState, + index: 'Index of the first pair must be 1' + })); + return; + } else { + setErrors(prevState => ({ + ...prevState, + index: `Index must be in the range 1-${numberOfPairs + 1}` + })); + return; + } + } else { + setErrors({ ...errors, index: '' }); + } + // submit the pair + onSubmitOfPair(pairProps.id + ? { + id: pairProps.id, + where: whereFromPair?.where || {}, + what: whatFromPair?.what || [], + } + : { + where: whereFromPair?.where || {}, + what: whatFromPair?.what || [], + } + , index); + }; + + return ( +
+ Raw pair edit form: + + + + + + + ); +}; From 80ee0803594c98fb51b0ae0234670071ffc1c3da Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:07:47 +0530 Subject: [PATCH 10/15] fix: define modalStyles inside ColapsibleRow --- src/components/run/ColapsibleRow.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/run/ColapsibleRow.tsx b/src/components/run/ColapsibleRow.tsx index 63025a46..67e82bf0 100644 --- a/src/components/run/ColapsibleRow.tsx +++ b/src/components/run/ColapsibleRow.tsx @@ -9,7 +9,6 @@ import { deleteRunFromStorage } from "../../api/storage"; import { columns, Data } from "./RunsTable"; import { RunContent } from "./RunContent"; import { GenericModal } from "../ui/GenericModal"; -import { modalStyle } from "../recorder/AddWhereCondModal"; import { getUserById } from "../../api/auth"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material/styles"; @@ -230,3 +229,15 @@ export const CollapsibleRow = ({ row, handleDelete, isOpen, onToggleExpanded, cu ); } + +export const modalStyle = { + top: '45%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '30%', + backgroundColor: 'background.paper', + p: 4, + height: 'fit-content', + display: 'block', + padding: '20px', +}; \ No newline at end of file From 1e6b9e6878cad188f948456be41f6194ef6db4e3 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:08:41 +0530 Subject: [PATCH 11/15] fix: import modalStyle inside CollapsibleRow --- src/components/run/RunSettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/run/RunSettings.tsx b/src/components/run/RunSettings.tsx index 33427d16..51dcd08f 100644 --- a/src/components/run/RunSettings.tsx +++ b/src/components/run/RunSettings.tsx @@ -3,7 +3,7 @@ import { GenericModal } from "../ui/GenericModal"; import { MenuItem, TextField, Typography, Switch, FormControlLabel } from "@mui/material"; import { Dropdown } from "../ui/DropdownMui"; import Button from "@mui/material/Button"; -import { modalStyle } from "../recorder/AddWhereCondModal"; +import { modalStyle } from "../run/ColapsibleRow"; interface RunSettingsProps { isOpen: boolean; From cab8d6ce91fcca511bb82aa1670b325f1773d71f Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 25 Nov 2025 16:09:29 +0530 Subject: [PATCH 12/15] chore: move AddWhereCondModal to legacy --- legacy/src/AddWhatCondModal.tsx | 2 +- .../recorder => legacy/src}/AddWhereCondModal.tsx | 8 ++++---- legacy/src/PairDetail.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename {src/components/recorder => legacy/src}/AddWhereCondModal.tsx (94%) diff --git a/legacy/src/AddWhatCondModal.tsx b/legacy/src/AddWhatCondModal.tsx index fa05304d..e653405a 100644 --- a/legacy/src/AddWhatCondModal.tsx +++ b/legacy/src/AddWhatCondModal.tsx @@ -1,6 +1,6 @@ import { WhereWhatPair } from "maxun-core"; import { GenericModal } from "../../src/components/ui/GenericModal"; -import { modalStyle } from "../../src/components/recorder/AddWhereCondModal"; +import { modalStyle } from "./AddWhereCondModal"; import { Button, TextField, Typography } from "@mui/material"; import React, { useRef } from "react"; import { KeyValueForm } from "../../src/components/recorder/KeyValueForm"; diff --git a/src/components/recorder/AddWhereCondModal.tsx b/legacy/src/AddWhereCondModal.tsx similarity index 94% rename from src/components/recorder/AddWhereCondModal.tsx rename to legacy/src/AddWhereCondModal.tsx index 45019d8f..f53d05a7 100644 --- a/src/components/recorder/AddWhereCondModal.tsx +++ b/legacy/src/AddWhereCondModal.tsx @@ -1,15 +1,15 @@ -import { Dropdown as MuiDropdown } from "../ui/DropdownMui"; +import { Dropdown as MuiDropdown } from "../../src/components/ui/DropdownMui"; import { Button, MenuItem, Typography } from "@mui/material"; import React, { useRef } from "react"; -import { GenericModal } from "../ui/GenericModal"; +import { GenericModal } from "../../src/components/ui/GenericModal"; import { WhereWhatPair } from "maxun-core"; import { SelectChangeEvent } from "@mui/material/Select/Select"; -import { DisplayConditionSettings } from "../../../legacy/src/DisplayWhereConditionSettings"; -import { useSocketStore } from "../../context/socket"; +import { DisplayConditionSettings } from "./DisplayWhereConditionSettings"; +import { useSocketStore } from "../../src/context/socket"; interface AddWhereCondModalProps { isOpen: boolean; diff --git a/legacy/src/PairDetail.tsx b/legacy/src/PairDetail.tsx index 570792d9..66098b17 100644 --- a/legacy/src/PairDetail.tsx +++ b/legacy/src/PairDetail.tsx @@ -10,7 +10,7 @@ import { AddButton } from "../../src/components/ui/buttons/AddButton"; import { WarningText } from "../../src/components/ui/texts"; import NotificationImportantIcon from '@mui/icons-material/NotificationImportant'; import { RemoveButton } from "../../src/components/ui/buttons/RemoveButton"; -import { AddWhereCondModal } from "../../src/components/recorder/AddWhereCondModal"; +import { AddWhereCondModal } from "./AddWhereCondModal"; import { useSocketStore } from "../../src/context/socket"; import { AddWhatCondModal } from "./AddWhatCondModal"; From c226a31e3d68f009fd5010aea3b8f08b11895a3f Mon Sep 17 00:00:00 2001 From: amhsirak Date: Sun, 30 Nov 2025 19:28:54 +0530 Subject: [PATCH 13/15] chore: archive Renderer.tsx to legacy --- {src/components/recorder => legacy/src}/Renderer.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/components/recorder => legacy/src}/Renderer.tsx (100%) diff --git a/src/components/recorder/Renderer.tsx b/legacy/src/Renderer.tsx similarity index 100% rename from src/components/recorder/Renderer.tsx rename to legacy/src/Renderer.tsx From 7a424d133fa1fa4b8f03b40e6c92b32309cf30b6 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Sun, 30 Nov 2025 19:30:06 +0530 Subject: [PATCH 14/15] chore: archive Pair.tsx to legacy --- legacy/src/LeftSidePanelContent.tsx | 2 +- {src/components/recorder => legacy/src}/Pair.tsx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename {src/components/recorder => legacy/src}/Pair.tsx (91%) diff --git a/legacy/src/LeftSidePanelContent.tsx b/legacy/src/LeftSidePanelContent.tsx index 6cbc8854..5ab5b2bd 100644 --- a/legacy/src/LeftSidePanelContent.tsx +++ b/legacy/src/LeftSidePanelContent.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { Pair } from "../../src/components/recorder/Pair"; +import { Pair } from "./Pair"; import { WhereWhatPair, WorkflowFile } from "maxun-core"; import { useSocketStore } from "../../src/context/socket"; import { Socket } from "socket.io-client"; diff --git a/src/components/recorder/Pair.tsx b/legacy/src/Pair.tsx similarity index 91% rename from src/components/recorder/Pair.tsx rename to legacy/src/Pair.tsx index 3e85cc0c..c718c775 100644 --- a/src/components/recorder/Pair.tsx +++ b/legacy/src/Pair.tsx @@ -1,13 +1,13 @@ import React, { FC, useState } from 'react'; import { Stack, Button, IconButton, Tooltip, Badge } from "@mui/material"; -import { AddPair, deletePair, UpdatePair } from "../../api/workflow"; +import { AddPair, deletePair, UpdatePair } from "../../src/api/workflow"; import { WorkflowFile } from "maxun-core"; -import { ClearButton } from "../ui/buttons/ClearButton"; -import { GenericModal } from "../ui/GenericModal"; -import { PairEditForm } from "../../../legacy/src/PairEditForm"; -import { PairDisplayDiv } from "../../../legacy/src/PairDisplayDiv"; -import { EditButton } from "../ui/buttons/EditButton"; -import { BreakpointButton } from "../ui/buttons/BreakpointButton"; +import { ClearButton } from "../../src/components/ui/buttons/ClearButton"; +import { GenericModal } from "../../src/components/ui/GenericModal"; +import { PairEditForm } from "./PairEditForm"; +import { PairDisplayDiv } from "./PairDisplayDiv"; +import { EditButton } from "../../src/components/ui/buttons/EditButton"; +import { BreakpointButton } from "../../src/components/ui/buttons/BreakpointButton"; import VisibilityIcon from '@mui/icons-material/Visibility'; import styled from "styled-components"; import { LoadingButton } from "@mui/lab"; From 2d44b558e3222f6ac8cd58f3321fc5677168bca8 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Sun, 30 Nov 2025 19:35:21 +0530 Subject: [PATCH 15/15] chore: del integration.ts --- server/src/routes/integration.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 server/src/routes/integration.ts diff --git a/server/src/routes/integration.ts b/server/src/routes/integration.ts deleted file mode 100644 index 3c4672c5..00000000 --- a/server/src/routes/integration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Router } from 'express'; -import logger from "../logger"; -// import { loadIntegrations, saveIntegrations } from '../workflow-management/integrations/gsheet'; -import { requireSignIn } from '../middlewares/auth'; - -export const router = Router(); - -router.post('/upload-credentials', requireSignIn, async (req, res) => { - try { - const { fileName, credentials, spreadsheetId, range } = req.body; - if (!fileName || !credentials || !spreadsheetId || !range) { - return res.status(400).json({ message: 'Credentials, Spreadsheet ID, and Range are required.' }); - } - // *** TEMPORARILY WE STORE CREDENTIALS HERE *** - } catch (error: any) { - logger.log('error', `Error saving credentials: ${error.message}`); - return res.status(500).json({ message: 'Failed to save credentials.', error: error.message }); - } -}); \ No newline at end of file