- Notifications
You must be signed in to change notification settings - Fork 278
Feature/ability to see search result in index page's table #3712
New issue
Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.
By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on ? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/ability to see search result in index page's table #3712
Conversation
Code Climate has analyzed commit 034cbb1 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
26d949a
to 7a5e338
Compare This PR has been marked as stale because there was no activity for the past 15 days. |
Screen.Recording.2025-04-07.at.6.00.16.PM.mov@Paul-Bob @adrianthedev finally the search is working now, Please let me know what would nest step 😄 |
Issues with the branch
@Paul-Bob could you please take a look and guide me through |
Hi @SahSantoshh I'll have a look during this week, thank you for your patience! |
Hi @SahSantoshh I noticed that debounce was already working. I've just pushed a commit enabling pagination and URL update with the current search query! |
14ecd75
to 589a142
Compare ExecutionContext
# Conflicts: # app/controllers/avo/base_controller.rb
589a142
to 0510c89
Compare 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.
Amazing work here @SahSantoshh!
I've left some comments with questions and some tweaks, let's discuss on those.
I tested it on index and seems to work as expected, how does it behave on association fields, on a has_many for example?
turbo_stream.replace( | ||
"#{@resource.model_key}_list", | ||
partial: "avo/index/resource_table_component", | ||
locals: { | ||
resources: @resources, | ||
resource: @resource, | ||
reflection: @reflection, | ||
parent_record: @parent_record, | ||
parent_resource: @parent_resource, | ||
pagy: @pagy, | ||
query: @query, | ||
actions: @actions | ||
} | ||
), |
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.
Do we need to call the extra partial?
I wonder if we can use the partial code directly here, I give it a quick try and something was not working properly, could you please explore this a bit?
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.
yeah, tried some approach it didn't work. so pushing the changes a head
def set_search_params | ||
@index_params[:q] = params[:q] if params[:q].present? | ||
end |
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.
Do we need this or could we use params[:q]
directly?
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.
@Paul-Bob we might not need it but as we are setting pagination and sorting params, so thought it would be better to follow the convention.
Issues:
|
View type is now fetched from the resource, |
@SahSantoshh, please re-request a review once the changes and discussion points have been addressed. |
Description
Fixes 2842
Checklist:
Screenshots & recording
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.