-
Notifications
You must be signed in to change notification settings - Fork 206
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
Backend search constraints (length & whitespace) #630
Conversation
Code Climate has analyzed commit 2c46a2bc and detected 0 issues on this pull request. View more on Code Climate. |
@publiclab/reviewers |
Codecov Report
@@ Coverage Diff @@
## main #630 +/- ##
==========================================
+ Coverage 71.27% 71.27% +<.01%
==========================================
Files 32 33 +1
Lines 1288 1295 +7
==========================================
+ Hits 918 923 +5
- Misses 370 372 +2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!! I noticed that in issue and in #535 we have also talked about not allowing the search of blank spaces. I would reframe that proposal -- Do you think, we should allow the search term to be a combination of letters and numbers only?
Thanks!
@gauravano I was going to do this in a follow-up PR - got a little lazy here. It's not that much work so I will just implement it here and mention you for another review. Otherwise this should have been an FTO so I feel bad |
2c46a2b
to
0217483
Compare
No issues. Let me know when you're done or need help. Thank you! |
@gauravano ok this is ready. this is a backend implementation that imposes a 3 character limit, not including spaces. So it allows the person to type spaces and submit them and it trims left and right whitespace and extra white space between words so you can search for a map named "new york" like " new york "and itll still find it. But it doesn't include spaces in the character count so if you tried to search Also does not allow for blank search. Any further restrictions and some optimizations should be a follow up on the front-end. I also did a lot of refactoring of let me know if its good to go! Thanks :) |
Oops, i merged your header fix and now I think it created a conflict here! Sorry! |
cf1015a
to
d4d991e
Compare
@jywarren rebased! |
Super!!! |
* refactor search * delete commented lines * resolve code climate * add flash notice * use request.referrer to reference last page * fix rubocop * refactorings * fix rubocop * more refactorings * fix more rubocop * squeeze center whitespace * strip leading and trailing whitespace * refactor map.rb to fix rubocop class over 250 lines * fix offences * fix cops * offence fix * fix last robocop * fix cop * cop * fix redundant self * remove redunant self pt2 * undo new asset path * tag fix
References ##520 (comment) (<=== Add issue number here)
Note there is a PR open for this but that implementation was not working as expected originally and is also stale now so going to try to just solve the problem myself and close that one
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!