Removed unused openPopups
This commit is contained in:
parent
7dcc6f2b8c
commit
303f8c38ee
5 changed files with 1 additions and 119 deletions
|
|
@ -5,9 +5,7 @@ import ShadTooltip from "../../components/ShadTooltipComponent";
|
||||||
import Tooltip from "../../components/TooltipComponent";
|
import Tooltip from "../../components/TooltipComponent";
|
||||||
import { useSSE } from "../../contexts/SSEContext";
|
import { useSSE } from "../../contexts/SSEContext";
|
||||||
import { alertContext } from "../../contexts/alertContext";
|
import { alertContext } from "../../contexts/alertContext";
|
||||||
import { PopUpContext } from "../../contexts/popUpContext";
|
|
||||||
import { typesContext } from "../../contexts/typesContext";
|
import { typesContext } from "../../contexts/typesContext";
|
||||||
import NodeModal from "../../modals/NodeModal";
|
|
||||||
import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent";
|
import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent";
|
||||||
import { NodeDataType } from "../../types/flow";
|
import { NodeDataType } from "../../types/flow";
|
||||||
import {
|
import {
|
||||||
|
|
@ -28,8 +26,6 @@ export default function GenericNode({
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
const showError = useRef(true);
|
const showError = useRef(true);
|
||||||
const { types, deleteNode } = useContext(typesContext);
|
const { types, deleteNode } = useContext(typesContext);
|
||||||
|
|
||||||
const { closePopUp, openPopUp } = useContext(PopUpContext);
|
|
||||||
// any to avoid type conflict
|
// any to avoid type conflict
|
||||||
const Icon: any =
|
const Icon: any =
|
||||||
nodeIconsLucide[data.type] || nodeIconsLucide[types[data.type]];
|
nodeIconsLucide[data.type] || nodeIconsLucide[types[data.type]];
|
||||||
|
|
@ -67,13 +63,12 @@ export default function GenericNode({
|
||||||
deleteNode(data.id);
|
deleteNode(data.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
useEffect(() => {}, [closePopUp, data.node.template]);
|
useEffect(() => {}, [data.node.template]);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NodeToolbar>
|
<NodeToolbar>
|
||||||
<NodeToolbarComponent
|
<NodeToolbarComponent
|
||||||
data={data}
|
data={data}
|
||||||
openPopUp={openPopUp}
|
|
||||||
deleteNode={deleteNode}
|
deleteNode={deleteNode}
|
||||||
></NodeToolbarComponent>
|
></NodeToolbarComponent>
|
||||||
</NodeToolbar>
|
</NodeToolbar>
|
||||||
|
|
@ -101,15 +96,6 @@ export default function GenericNode({
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="round-button-div">
|
|
||||||
<button
|
|
||||||
className="relative"
|
|
||||||
onClick={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
openPopUp(<NodeModal data={data} />);
|
|
||||||
}}
|
|
||||||
></button>
|
|
||||||
</div>
|
|
||||||
<div className="round-button-div">
|
<div className="round-button-div">
|
||||||
<div>
|
<div>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
import { PopUpContext } from "../../contexts/popUpContext";
|
|
||||||
import GenericModal from "../../modals/genericModal";
|
import GenericModal from "../../modals/genericModal";
|
||||||
import { TextAreaComponentType } from "../../types/components";
|
import { TextAreaComponentType } from "../../types/components";
|
||||||
|
|
||||||
|
|
@ -17,7 +16,6 @@ export default function PromptAreaComponent({
|
||||||
editNode = false,
|
editNode = false,
|
||||||
}: TextAreaComponentType) {
|
}: TextAreaComponentType) {
|
||||||
const [myValue, setMyValue] = useState(value);
|
const [myValue, setMyValue] = useState(value);
|
||||||
const { openPopUp } = useContext(PopUpContext);
|
|
||||||
const { reactFlowInstance } = useContext(typesContext);
|
const { reactFlowInstance } = useContext(typesContext);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
import { PopUpContext } from "../../contexts/popUpContext";
|
|
||||||
import GenericModal from "../../modals/genericModal";
|
import GenericModal from "../../modals/genericModal";
|
||||||
import { TextAreaComponentType } from "../../types/components";
|
import { TextAreaComponentType } from "../../types/components";
|
||||||
|
|
||||||
|
|
@ -13,7 +12,6 @@ export default function TextAreaComponent({
|
||||||
editNode = false,
|
editNode = false,
|
||||||
}: TextAreaComponentType) {
|
}: TextAreaComponentType) {
|
||||||
const [myValue, setMyValue] = useState(value);
|
const [myValue, setMyValue] = useState(value);
|
||||||
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
|
||||||
const { setDisableCopyPaste } = useContext(TabsContext);
|
const { setDisableCopyPaste } = useContext(TabsContext);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -23,10 +21,6 @@ export default function TextAreaComponent({
|
||||||
}
|
}
|
||||||
}, [disabled, onChange]);
|
}, [disabled, onChange]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setMyValue(value);
|
|
||||||
}, [closePopUp]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { useContext, useState } from "react";
|
||||||
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
||||||
import { Separator } from "../../../../components/ui/separator";
|
import { Separator } from "../../../../components/ui/separator";
|
||||||
import { alertContext } from "../../../../contexts/alertContext";
|
import { alertContext } from "../../../../contexts/alertContext";
|
||||||
import { PopUpContext } from "../../../../contexts/popUpContext";
|
|
||||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||||
import { typesContext } from "../../../../contexts/typesContext";
|
import { typesContext } from "../../../../contexts/typesContext";
|
||||||
import ApiModal from "../../../../modals/ApiModal";
|
import ApiModal from "../../../../modals/ApiModal";
|
||||||
|
|
@ -19,7 +18,6 @@ import DisclosureComponent from "../DisclosureComponent";
|
||||||
|
|
||||||
export default function ExtraSidebar() {
|
export default function ExtraSidebar() {
|
||||||
const { data } = useContext(typesContext);
|
const { data } = useContext(typesContext);
|
||||||
const { openPopUp } = useContext(PopUpContext);
|
|
||||||
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
||||||
useContext(TabsContext);
|
useContext(TabsContext);
|
||||||
const { setSuccessData, setErrorData } = useContext(alertContext);
|
const { setSuccessData, setErrorData } = useContext(alertContext);
|
||||||
|
|
@ -64,7 +62,6 @@ export default function ExtraSidebar() {
|
||||||
<button
|
<button
|
||||||
className="extra-side-bar-buttons"
|
className="extra-side-bar-buttons"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// openPopUp(<ImportModal />);
|
|
||||||
uploadFlow();
|
uploadFlow();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -108,99 +108,6 @@ const NodeToolbarComponent = (props) => {
|
||||||
</button>
|
</button>
|
||||||
</EditNodeModal>
|
</EditNodeModal>
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
|
|
||||||
{/*
|
|
||||||
<Menu as="div" className="relative inline-block text-left z-100">
|
|
||||||
<button className="hover:dark:hover:bg-[#242f47] text-gray-700 transition-all duration-500 ease-in-out dark:bg-gray-800 dark:text-gray-300 shadow-md relative -ml-px inline-flex items-center bg-white px-2 py-2 ring-1 ring-inset ring-gray-300 hover:bg-muted focus:z-10 rounded-r-md">
|
|
||||||
<div>
|
|
||||||
<Menu.Button className="flex items-center">
|
|
||||||
<EllipsisVerticalIcon
|
|
||||||
className="w-5 h-5 "
|
|
||||||
aria-hidden="true"
|
|
||||||
/>
|
|
||||||
</Menu.Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Transition
|
|
||||||
as={Fragment}
|
|
||||||
enter="transition ease-out duration-100"
|
|
||||||
enterFrom="transform opacity-0 scale-95"
|
|
||||||
enterTo="transform opacity-100 scale-100"
|
|
||||||
leave="transition ease-in duration-75"
|
|
||||||
leaveFrom="transform opacity-100 scale-100"
|
|
||||||
leaveTo="transform opacity-0 scale-95"
|
|
||||||
>
|
|
||||||
<Menu.Items className="absolute z-40 mt-2 w-56 origin-top-right rounded-md bg-background shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none top-[28px]">
|
|
||||||
<div className="py-1">
|
|
||||||
<Menu.Item>
|
|
||||||
{({ active }) => (
|
|
||||||
<button
|
|
||||||
onClick={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
props.openPopUp(
|
|
||||||
<EditNodeModal data={props.data} />
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className={classNames(
|
|
||||||
active
|
|
||||||
? "bg-muted text-gray-900"
|
|
||||||
: "text-foreground",
|
|
||||||
"w-full group flex items-center px-4 py-2 text-sm"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Settings
|
|
||||||
className="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500"
|
|
||||||
aria-hidden="true"
|
|
||||||
/>
|
|
||||||
Edit
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item>
|
|
||||||
{({ active }) => (
|
|
||||||
<button
|
|
||||||
onClick={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
console.log(
|
|
||||||
reactFlowInstance.getNode(props.data.id)
|
|
||||||
);
|
|
||||||
paste(
|
|
||||||
{
|
|
||||||
nodes: [
|
|
||||||
reactFlowInstance.getNode(props.data.id),
|
|
||||||
],
|
|
||||||
edges: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
x: 50,
|
|
||||||
y: 10,
|
|
||||||
paneX: reactFlowInstance.getNode(props.data.id)
|
|
||||||
.position.x,
|
|
||||||
paneY: reactFlowInstance.getNode(props.data.id)
|
|
||||||
.position.y,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className={classNames(
|
|
||||||
active
|
|
||||||
? "bg-muted text-gray-900"
|
|
||||||
: "text-foreground",
|
|
||||||
"w-full group flex items-center px-4 py-2 text-sm"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<DocumentDuplicateIcon
|
|
||||||
className="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500"
|
|
||||||
aria-hidden="true"
|
|
||||||
/>
|
|
||||||
Duplicate
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</Menu.Item>
|
|
||||||
</div>
|
|
||||||
</Menu.Items>
|
|
||||||
</Transition>
|
|
||||||
</button>
|
|
||||||
</Menu> */}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue