You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by hb...@apache.org on 2022/12/29 05:33:03 UTC

[age-viewer] branch main updated: Insert query into editor on error (#84)

This is an automated email from the ASF dual-hosted git repository.

hbshin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/age-viewer.git


The following commit(s) were added to refs/heads/main by this push:
     new 8b9058b  Insert query into editor on error (#84)
8b9058b is described below

commit 8b9058bae90f8b4e8f6ebe860398e827efa94e32
Author: marodins <67...@users.noreply.github.com>
AuthorDate: Wed Dec 28 21:32:58 2022 -0800

    Insert query into editor on error (#84)
    
    * insert query into editor on error
    
    * clean up logging
---
 backend/src/models/GraphCreator.js                        | 2 --
 frontend/src/components/contents/presentations/Editor.jsx | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/backend/src/models/GraphCreator.js b/backend/src/models/GraphCreator.js
index cac5277..3893879 100644
--- a/backend/src/models/GraphCreator.js
+++ b/backend/src/models/GraphCreator.js
@@ -74,7 +74,6 @@ class GraphCreator {
     async readData(file, type, resolve){
         Papa.parse(file, {
             complete: (res) => {
-                console.log(res);
                 res.errors.forEach((e)=>{
                     if (e.type === 'FieldMismatch'){
                         res.data.splice(e.row, 1);
@@ -116,7 +115,6 @@ class GraphCreator {
                 this.createEdge(e, edgeFile.type);
             });
         });
-        console.log(this.query);
         return this.query;
         
     }
diff --git a/frontend/src/components/contents/presentations/Editor.jsx b/frontend/src/components/contents/presentations/Editor.jsx
index 4a9ebe7..cd7f811 100644
--- a/frontend/src/components/contents/presentations/Editor.jsx
+++ b/frontend/src/components/contents/presentations/Editor.jsx
@@ -23,6 +23,7 @@ import uuid from 'react-uuid';
 import PropTypes from 'prop-types';
 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
 import { faTimesCircle, faToggleOff, faToggleOn } from '@fortawesome/free-solid-svg-icons';
+import store from '../../../app/store';
 import AlertContainers from '../../alert/containers/AlertContainers';
 import CodeMirror from '../../editor/containers/CodeMirrorWapperContainer';
 import SideBarToggle from '../../editor/containers/SideBarMenuToggleContainer';
@@ -98,6 +99,10 @@ const Editor = ({
         if (response.type === 'cypher/executeCypherQuery/rejected') {
           if (response.error.name !== 'AbortError') {
             dispatch(() => addAlert('ErrorCypherQuery'));
+            const currentCommand = store.getState().editor.command;
+            if (currentCommand === '') {
+              setCommand(command);
+            }
           }
         }
       });