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

Escape comma #25

Merged
merged 12 commits into from
May 15, 2017
Merged

Escape comma #25

merged 12 commits into from
May 15, 2017

Conversation

alechirsch
Copy link
Collaborator

I had a use case where I needed to filter on items that included a comma. I added some logic to support escaping the comma character.

@alechirsch
Copy link
Collaborator Author

Getting the timeout failure again...

@alechirsch
Copy link
Collaborator Author

@jamesdixon Do you have time to look at this?

@jamesdixon
Copy link
Contributor

@alechirsch unfortunately, i do not. Right in the middle of beginning the beta phase for our product. I'll take a look when I can!

@jamesdixon
Copy link
Contributor

@alechirsch i'd be more than happy to add you as a contributor if you'd be interested

@alechirsch
Copy link
Collaborator Author

@jamesdixon I am interested, I have never been a contributor for an open source package before though. Would that give me publishing privileges to npm as well?

@jamesdixon
Copy link
Contributor

@alechirsch initially, it would just give you the ability to manage issues, merge PRs, etc.

@alechirsch
Copy link
Collaborator Author

@jamesdixon Sounds good to me

@alechirsch
Copy link
Collaborator Author

@jamesdixon Any updates for this?

@jamesdixon
Copy link
Contributor

@alechirsch sorry for the delay. Added you as a collaborator

@alechirsch
Copy link
Collaborator Author

@jamesdixon are you good with this PR?

@jamesdixon
Copy link
Contributor

jamesdixon commented Jan 21, 2017

@alechirsch are you talking about the use case for something like

?filter[status]=scheduled,late

?

@alechirsch
Copy link
Collaborator Author

alechirsch commented Jan 21, 2017

This is the use case where you have a comma in the data itself, for example if you had a row with the data "city, state", what you send across is "city\\\\,state"

@jamesdixon
Copy link
Contributor

Ok, thanks. Would you mind adding a test for this specific case?

@alechirsch
Copy link
Collaborator Author

@jamesdixon Sure thing, I have been very busy recently. Not sure when I will get it in.

@alechirsch
Copy link
Collaborator Author

@jamesdixon Finally got around to adding a test for this.

value = value.toString().indexOf(',') !== -1 ? value.split(',') : value;
qb.whereIn(key, value);

if (_isNull(value)){
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the fix for filtering on null

@alechirsch
Copy link
Collaborator Author

@jamesdixon Should I go ahead and merge this? Would you be able to release to npm?

@jamesdixon
Copy link
Contributor

@alechirsch my apologies for the delayed reply. Things have been very busy for me and it's honestly been difficult to divert attention to my open source projects.

That said, feel free to merge this and the other PRs. I'd recommend we label this as a beta given that there have been a lot of changes. Once you've merged, I can publish to NPM and start testing in my own project.

Thanks for all of your hard work!

James

@alechirsch
Copy link
Collaborator Author

@jamesdixon Great, I agree this should be kept labeled as beta.

@alechirsch alechirsch merged commit 2515be0 into scoutforpets:master May 15, 2017
@alechirsch alechirsch deleted the escape-comma branch May 15, 2017 18:24
@jamesdixon
Copy link
Contributor

@alechirsch would you mind updating the changelog and close out any bugs that these PRs resolved? I can publish to NPM once that's done. Thanks!

@alechirsch
Copy link
Collaborator Author

alechirsch commented May 15, 2017

@jamesdixon I closed related issues. The change log does not have anything for beta1, was there a separate place where you put that or was it not added.

@jamesdixon
Copy link
Contributor

@alechirsch thanks. It probably wasn't added, but I wouldn't worry about it at this point 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants