avo
avo copied to clipboard
Enable configuring search_count per resource
Description
This PR allows setting the search count on a per resource basis. It makes sure that the resource specific count takes precedence over the global configuration.
Fixes #2901
Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
Screenshots & recording
Manual review steps
- In the dummy app, inside resources/user.rb, I set count to 5.
- Navigated to /admin/resources/users.
- Typed 'a'. Verified that only 5 search results were displayed out of 39.
- In the dummy app, inside resources/user.rb, I set count to -> { 3 }.
- Navigated to /admin/resources/users.
- Typed 'a'. Verified that only 3 search results were displayed out of 39.
Manual reviewer: please leave a comment with output from the test if that's the case.
Code Climate has analyzed commit 98f0e659 and detected 0 issues on this pull request.
View more on Code Climate.
@Paul-Bob I think there should be tests for this. However I'm not sure where the search related tests are written. If you could tell me, then I'd be happy to write them.
Not sure why CI's failing :shrug: . I checked the failing specs locally and they pass
It's looking great! Thanks @binarygit
spec/features/avo/search_has_many_scope_spec.rb is an example of a search controller test.
We have some helpers for system tests if you want to go that way.
Don't worry about the CI tests I'll have a look, it seems unrelated.
hey @binarygit. I'd like to write something to you. How can I reach you? can you share your email, or are you on our discord?
@Paul-Bob I added the tests. Let me know what you think :pray:
Thank you for the contribution @binarygit !