From c8594a16c30d60d14f33aadff50f9bff22bdb5cb Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 22 May 2023 20:02:35 -0300 Subject: [PATCH] Changed name of function to disable copy and paste --- .../src/components/floatComponent/index.tsx | 6 +++--- .../src/components/inputComponent/index.tsx | 6 +++--- .../src/components/inputListComponent/index.tsx | 6 +++--- src/frontend/src/components/intComponent/index.tsx | 6 +++--- src/frontend/src/contexts/tabsContext.tsx | 10 +++++----- .../src/modals/chatModal/chatInput/index.tsx | 6 +++--- src/frontend/src/modals/codeAreaModal/index.tsx | 6 +++--- src/frontend/src/modals/exportModal/index.tsx | 14 +++++++------- .../FlowPage/components/tabComponent/index.tsx | 6 +++--- src/frontend/src/pages/FlowPage/index.tsx | 6 +++--- src/frontend/src/types/tabs/index.ts | 4 ++-- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index 11a1dedbc..c09f3b9e0 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -14,7 +14,7 @@ export default function FloatComponent({ onChange(""); } }, [disabled, onChange]); - const {setDisableCP} = useContext(TabsContext) + const {setDisableCopyPaste} = useContext(TabsContext) return (
{ - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} />
diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 778d9d6ef..b4f52902d 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -11,7 +11,7 @@ export default function InputComponent({ }: InputComponentType) { const [myValue, setMyValue] = useState(value ?? ""); const [pwdVisible, setPwdVisible] = useState(false); - const {setDisableCP} = useContext(TabsContext) + const {setDisableCopyPaste} = useContext(TabsContext) useEffect(() => { if (disabled) { setMyValue(""); @@ -29,10 +29,10 @@ export default function InputComponent({ { - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} className={classNames( "block w-full pr-12 form-input dark:bg-gray-900 dark:border-gray-600 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm", diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index c7bfa53fb..57ddd7a4e 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -17,7 +17,7 @@ export default function InputListComponent({ onChange([""]); } }, [disabled, onChange]); - const {setDisableCP} = useContext(TabsContext) + const {setDisableCopyPaste} = useContext(TabsContext) return (
{ - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} /> {idx === inputList.length - 1 ? ( diff --git a/src/frontend/src/components/intComponent/index.tsx b/src/frontend/src/components/intComponent/index.tsx index da38c02bb..c66f5e156 100644 --- a/src/frontend/src/components/intComponent/index.tsx +++ b/src/frontend/src/components/intComponent/index.tsx @@ -14,7 +14,7 @@ export default function IntComponent({ onChange(""); } }, [disabled, onChange]); - const {setDisableCP} =useContext(TabsContext) + const {setDisableCopyPaste} =useContext(TabsContext) return (
{ - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} /> diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 6f8877d57..8f0832c3a 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -27,8 +27,8 @@ const TabsContextInitialValue: TabsContextType = { downloadFlow: (flow: FlowType) => {}, uploadFlow: () => {}, hardReset: () => {}, - disableCP:false, - setDisableCP:(state:boolean)=>{}, + disableCopyPaste:false, + setDisableCopyPaste:(state:boolean)=>{}, getNodeId: () => "", paste: (selection: {nodes: any, edges: any}, position: {x: number, y: number}) => {}, }; @@ -307,13 +307,13 @@ export function TabsProvider({ children }: { children: ReactNode }) { return newFlows; }); } - const [disableCP, setDisableCP] = useState(false); + const [disableCopyPaste, setDisableCopyPaste] = useState(false); return ( @@ -28,10 +28,10 @@ export default function ChatInput({ } }} onBlur={() => { - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} rows={1} ref={inputRef} diff --git a/src/frontend/src/modals/codeAreaModal/index.tsx b/src/frontend/src/modals/codeAreaModal/index.tsx index 4568905ad..515e9089e 100644 --- a/src/frontend/src/modals/codeAreaModal/index.tsx +++ b/src/frontend/src/modals/codeAreaModal/index.tsx @@ -23,7 +23,7 @@ export default function CodeAreaModal({ const [code, setCode] = useState(value); const { dark } = useContext(darkContext); const { setErrorData, setSuccessData } = useContext(alertContext); - const { setDisableCP } = useContext(TabsContext); + const { setDisableCopyPaste } = useContext(TabsContext); const { closePopUp } = useContext(PopUpContext); const ref = useRef(); function setModalOpen(x: boolean) { @@ -112,10 +112,10 @@ export default function CodeAreaModal({ setCode(value); }} onBlur={() => { - setDisableCP(false) + setDisableCopyPaste(false) }} onFocus={() => { - setDisableCP(true) + setDisableCopyPaste(true) }} className="h-full w-full rounded-lg" /> diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index ff3749c57..a81c62053 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -16,7 +16,7 @@ export default function ExportModal() { const { closePopUp } = useContext(PopUpContext); const ref = useRef(); const { setErrorData } = useContext(alertContext); - const { flows, tabIndex, updateFlow, downloadFlow,setDisableCP } = useContext(TabsContext); + const { flows, tabIndex, updateFlow, downloadFlow,setDisableCopyPaste } = useContext(TabsContext); function setModalOpen(x: boolean) { setOpen(x); if (x === false) { @@ -114,10 +114,10 @@ export default function ExportModal() { id="name" className="focus:border focus:border-blue block w-full px-3 py-2 border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-800 dark:border-gray-600 dark:focus:border-blue-500 dark:focus:ring-blue-500 text-gray-900 dark:text-gray-100" onBlur={() => { - setDisableCP(false); + setDisableCopyPaste(false); }} onFocus={() => { - setDisableCP(true); + setDisableCopyPaste(true); }} />
@@ -134,10 +134,10 @@ export default function ExportModal() {