From edd20a042cc226b704f3920cc3dc9ad3cb9bff68 Mon Sep 17 00:00:00 2001 From: Amal-Vijayan Date: Thu, 22 Feb 2024 17:47:01 +0530 Subject: [PATCH] Conversion progress --- .../index.jsx} | 27 ++- .../automate-method-input-parameter/helper.js | 31 +++ .../automate-method-input-parameter/index.jsx | 131 +++++++++++ .../schema.js} | 16 +- .../automate-method-form/automateModal.jsx | 25 --- .../automate-method-form/combinedSchema.js | 203 ------------------ .../components/automate-method-form/index.jsx | 142 +++--------- .../automate-method-form/schema.config.js | 155 +++++++++++++ .../components/automate-method-form/schema.js | 87 ++++++++ 9 files changed, 469 insertions(+), 348 deletions(-) rename app/javascript/components/automate-method-form/{codeMirror.js => automate-method-code-mirror/index.jsx} (50%) create mode 100644 app/javascript/components/automate-method-form/automate-method-input-parameter/helper.js create mode 100644 app/javascript/components/automate-method-form/automate-method-input-parameter/index.jsx rename app/javascript/components/automate-method-form/{method-input-parameters/helper.js => automate-method-input-parameter/schema.js} (58%) delete mode 100644 app/javascript/components/automate-method-form/automateModal.jsx delete mode 100644 app/javascript/components/automate-method-form/combinedSchema.js create mode 100644 app/javascript/components/automate-method-form/schema.config.js create mode 100644 app/javascript/components/automate-method-form/schema.js diff --git a/app/javascript/components/automate-method-form/codeMirror.js b/app/javascript/components/automate-method-form/automate-method-code-mirror/index.jsx similarity index 50% rename from app/javascript/components/automate-method-form/codeMirror.js rename to app/javascript/components/automate-method-form/automate-method-code-mirror/index.jsx index 17d0aaeff89..ff20cc2b04d 100644 --- a/app/javascript/components/automate-method-form/codeMirror.js +++ b/app/javascript/components/automate-method-form/automate-method-code-mirror/index.jsx @@ -3,7 +3,7 @@ import CodeMirror from 'codemirror'; import 'codemirror/lib/codemirror.css'; import 'codemirror/mode/javascript/javascript'; -const ReactCodeMirror = ({ code, onChange }) => { +const AutomateMethodCodeMirror = () => { const codeMirrorRef = useRef(null); useEffect(() => { @@ -14,22 +14,33 @@ const ReactCodeMirror = ({ code, onChange }) => { }); editor.on('change', (instance) => { - if (onChange) { - onChange(instance.getValue()); - } + console.log(instance) }); - editor.setValue(code); + + editor.setValue('test'); return () => { editor.toTextArea(); }; - }, [code, onChange]); + }, []); return (
-