Skip to content

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

SahSantoshh
Copy link

Description

Fixes 2842

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • 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. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@github-actions-actions bot added the Feature label Mar 4, 2025
@SahSantoshhSahSantoshh marked this pull request as draft March 4, 2025 14:03
@codeclimateCodeClimate
Copy link

codeclimate bot commented Mar 4, 2025

Code Climate has analyzed commit 034cbb1 and detected 1 issue on this pull request.

Here's the issue category breakdown:

CategoryCount
Complexity1

View more on Code Climate.

@SahSantoshhSahSantoshh force-pushed the feature/ability_to_see_search_result_in_index_page branch from 26d949a to 7a5e338 Compare March 7, 2025 14:37
@github-actionsGitHub Actions
Copy link
Contributor

-actions bot commented Mar 23, 2025

This PR has been marked as stale because there was no activity for the past 15 days.

@github-actions-actions bot added the Stale label Mar 23, 2025
@SahSantoshh
Copy link
Author

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 😄

@SahSantoshhSahSantoshh marked this pull request as ready for review April 7, 2025 12:19
@github-actions-actions bot removed the Stale label Apr 9, 2025
@SahSantoshhSahSantoshh marked this pull request as draft April 9, 2025 17:27
@SahSantoshh
Copy link
Author

SahSantoshh commented Apr 9, 2025

Issues with the branch

  1. search query is not being added to url
  2. pagination is not working
  3. debounce not working

@Paul-Bob could you please take a look and guide me through

@Paul-Bob
Copy link
Contributor

Hi @SahSantoshh

I'll have a look during this week, thank you for your patience!

@Paul-Bob
Copy link
Contributor

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!

@SahSantoshhSahSantoshh marked this pull request as ready for review April 17, 2025 16:44
@SahSantoshhSahSantoshh force-pushed the feature/ability_to_see_search_result_in_index_page branch from 14ecd75 to 589a142 Compare April 29, 2025 12:12
@SahSantoshhSahSantoshh force-pushed the feature/ability_to_see_search_result_in_index_page branch from 589a142 to 0510c89 Compare April 29, 2025 12:18
Copy link
Contributor

@Paul-Bob Paul-Bob left a 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?

Comment on lines 75 to 88
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
}
),
Copy link
Contributor

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?

Copy link
Author

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

Comment on lines +371 to +373
def set_search_params
@index_params[:q] = params[:q] if params[:q].present?
end
Copy link
Contributor

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?

Copy link
Author

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.

@SahSantoshh
Copy link
Author

Issues:

  • View Type is not maintained anymore after main branch rebase

@Paul-Bob
Copy link
Contributor

Issues:

  • View Type is not maintained anymore after main branch rebase

View type is now fetched from the resource, @resource.view_type instead from @index_params

@Paul-Bob
Copy link
Contributor

@SahSantoshh, please re-request a review once the changes and discussion points have been addressed.

image

@SahSantoshhSahSantoshh marked this pull request as draft May 6, 2025 14:03
@SahSantoshhSahSantoshh marked this pull request as ready for review May 6, 2025 14:41
@SahSantoshhSahSantoshh requested a review from Paul-Bob May 6, 2025 14:41
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Ability to see the search result in index page
2 participants