Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new FileDrop implementation. #936

Merged
merged 4 commits into from
Jun 20, 2019

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.

@@ -138,7 +138,6 @@
"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