avo icon indicating copy to clipboard operation
avo copied to clipboard

Enable configuring search_count per resource

Open binarygit opened this issue 1 year ago • 3 comments
trafficstars

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

  1. In the dummy app, inside resources/user.rb, I set count to 5.
  2. Navigated to /admin/resources/users.
  3. Typed 'a'. Verified that only 5 search results were displayed out of 39.

  1. In the dummy app, inside resources/user.rb, I set count to -> { 3 }.
  2. Navigated to /admin/resources/users.
  3. 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.

binarygit avatar Jul 02 '24 15:07 binarygit

Code Climate has analyzed commit 98f0e659 and detected 0 issues on this pull request.

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Jul 02 '24 15:07 qlty-cloud-legacy[bot]

@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.

binarygit avatar Jul 02 '24 15:07 binarygit

Not sure why CI's failing :shrug: . I checked the failing specs locally and they pass passing

binarygit avatar Jul 02 '24 16:07 binarygit

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.

Paul-Bob avatar Jul 03 '24 09:07 Paul-Bob

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?

adrianthedev avatar Jul 04 '24 10:07 adrianthedev

Hey adrian. Here’s my email @adrianthedev : [email protected]

I’m not in the discord yet!

binarygit avatar Jul 04 '24 10:07 binarygit

@Paul-Bob I added the tests. Let me know what you think :pray:

binarygit avatar Jul 04 '24 15:07 binarygit

Thank you for the contribution @binarygit !

Paul-Bob avatar Jul 09 '24 14:07 Paul-Bob