Skip to content

Conversation

@linuslundahl
Copy link
Contributor

@linuslundahl linuslundahl commented Jun 18, 2019

filedrop

  • Global file drop support.
  • Allows users to either save cypher as favorite or paste it in the editor.
  • Imports grass files and runs the :style command to give feedback.

changelog: Drag and drop cypher and grass files anywhere to import

@linuslundahl linuslundahl force-pushed the feature/file-drop-to-editor branch from 240ecc9 to c3e9a60 Compare June 18, 2019 14:08
Copy link
Member

@oskarhane oskarhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fantastic change. Much better user experience.
Just a few comments.

setUserSelect(true)
} else if (extension === 'grass') {
fileLoader(files[0], importGrass)
const action = executeCommand(':style')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a race condition here since the loading is async. The executed :style command might show the old style and not the imported one.

"react-dnd": "^2.5.1",
"react-dnd-html5-backend": "^2.5.1",
"react-dom": "^16.8.1",
"react-dropzone": "^4.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something tells me that the yarn lock file should have changes when a dependency is being removed.

export function FileDrop (props) {
const [fileHoverState, setFileHoverState] = useState(false)
const [userSelect, setUserSelect] = useState(false)
const [file, setFile] = useState(null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooks ❤️

Copy link
Member

@oskarhane oskarhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oskarhane oskarhane merged commit 11ff2a4 into neo4j:master Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants