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 URL param support for populating editor with Cypher and parameters #956

Merged
merged 3 commits into from
Jan 10, 2020

Conversation

oskarhane
Copy link
Member

@oskarhane oskarhane commented Aug 13, 2019

Add newline for each query.
Semi-colons are up to the user to add.

Example usages:
http://localhost:7474/?cmd=edit&arg=RETURN%201;&arg=RETURN%20rand();
http://localhost:7474/?cmd=param&arg=x%20%3d%3E%201;
http://localhost:7474/?cmd=params&arg={x:1.0,%20y:%22hello%22}

Since it's not limited to Cypher, but works for populating the editor with anything the command is was decided to be edit.

Cypher:
Screenshot 2020-01-07 16 11 56

Param:
oskarhane-mbpt 2019-08-13 at 15 02 56

Params:
oskarhane-mbpt 2019-08-13 at 15 06 05

@Dcanzano
Copy link
Collaborator

will this be included in some :help cmd online help

@oskarhane oskarhane force-pushed the cypher-url-param branch 2 times, most recently from a852ab0 to 64fbe33 Compare August 13, 2019 12:19
Copy link
Contributor

@huboneo huboneo left a comment

Choose a reason for hiding this comment

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

Code LGTM ┌(ㆆ㉨ㆆ)ʃ

@oskarhane oskarhane changed the title Add URL param support for populating editor with Cypher Add URL param support for populating editor with Cypher and a parameter Aug 13, 2019
@oskarhane
Copy link
Member Author

I've updated this PR by adding support for 'param' and 'params' as well @huboneo.
See updated description + screenshots.

I'll add something on that note @Dcanzano, thanks for the reminder.

@oskarhane oskarhane changed the title Add URL param support for populating editor with Cypher and a parameter Add URL param support for populating editor with Cypher and parameters Aug 13, 2019
Copy link
Contributor

@huboneo huboneo left a comment

Choose a reason for hiding this comment

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

just a quick questions, otherwise LGTM

cypher: (_, args) => args.join('\n')
cypher: (_, args) => args.join('\n'),
param: (cmdchar, args) => `${cmdchar}param ${args.join(' ')}`,
params: (cmdchar, args) => `${cmdchar}params ${args.join(' ')}`
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to worry about interoperability here? can :play accept params? Also what happens if provided params are malformed/invalid?

@akollegger akollegger self-requested a review October 8, 2019 10:17
@akollegger
Copy link
Member

WDYT about using edit as the command, as the explicit user action is to populate the editor with the attached text?

@oskarhane oskarhane requested a review from huboneo January 7, 2020 15:13
Copy link
Contributor

@huboneo huboneo left a comment

Choose a reason for hiding this comment

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

LGTM ٩(●ᴗ●)۶

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.

4 participants