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 support for handling multiple commands from browser.post_connect_cmd #548

Merged
merged 2 commits into from
May 23, 2017

Conversation

oskarhane
Copy link
Member

@oskarhane oskarhane commented May 23, 2017

They are assumed to be separated by semicolon.

Example: browser.post_connect_cmd=play welcome; style http://server.com/style.grass; config useBoltRouting: true

Remember to leave out the command character : from commands in the server config.
Also, execution of Cypher is not possible.

I had to refactor some in the tests files to have the tests running as expected. There seems to be a bug in either configureMockStore or createEpicMiddleware.

They are assumed to be splitted by semicolon.
{ str: ';:play cypher;', expect: [':play cypher'] },
{ str: ':play cypher; :param x: 1', expect: [':play cypher', ':param x: 1'] },
{ str: 'RETURN 1; RETURN 3; :play start', expect: ['RETURN 1', 'RETURN 3', ':play start'] }
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Splitting on ; means that if you have a cypher query containing ; then that will also split.
Test case: { str: 'MATCH (n: {foo: "bar;"}) RETURN n', expect: ['MATCH (n: {foo: "bar;"}) RETURN n'] }

@oskarhane
Copy link
Member Author

Added basic semicolons-within-quotes detection @pe4cey.

@oskarhane oskarhane force-pushed the 3.0-multi-post_connect_cmd branch from 396a74c to 4269c9d Compare May 23, 2017 09:21
@oskarhane oskarhane force-pushed the 3.0-multi-post_connect_cmd branch from 4269c9d to 42067f3 Compare May 23, 2017 09:22
Copy link
Contributor

@pe4cey pe4cey left a comment

Choose a reason for hiding this comment

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

lgtm

@pe4cey pe4cey merged commit 8c7c2e5 into neo4j:3.0 May 23, 2017
@oskarhane oskarhane deleted the 3.0-multi-post_connect_cmd branch May 27, 2017 06:30
@TheRealMarcusChiu
Copy link

breaking commands on ; renders the following to fail
browser.post_connect_cmd=style node { diameter: 50px; color: #FFFFFF }

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.

3 participants