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

Draft
wants to merge 23 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.

@SahSantoshh SahSantoshh marked this pull request as draft March 4, 2025 14:03
Copy link

codeclimate bot commented Mar 4, 2025

Code Climate has analyzed commit 81df621 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

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

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

@github-actions github-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 😄

@SahSantoshh SahSantoshh marked this pull request as ready for review April 7, 2025 12:19
@github-actions github-actions bot removed the Stale label Apr 9, 2025
@SahSantoshh SahSantoshh 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!

@SahSantoshh SahSantoshh marked this pull request as ready for review April 17, 2025 16:44
@SahSantoshh SahSantoshh force-pushed the feature/ability_to_see_search_result_in_index_page branch from 14ecd75 to 589a142 Compare April 29, 2025 12:12
@SahSantoshh SahSantoshh 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

@SahSantoshh
Copy link
Author

Issues:

  • View Type is not maintained anymore after main branch rebase

@Paul-Bob
Copy link
Contributor

Paul-Bob commented May 1, 2025

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

Paul-Bob commented May 6, 2025

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

image

@SahSantoshh SahSantoshh marked this pull request as draft May 6, 2025 14:03
@SahSantoshh SahSantoshh marked this pull request as ready for review May 6, 2025 14:41
@SahSantoshh SahSantoshh requested a review from Paul-Bob May 6, 2025 14:41
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.

Thanks for your patience on this PR, @SahSantoshh.

There's one question I'd like to clarify, I'll quote it from the previous review:

I tested it on index and seems to work as expected, how does it behave on association fields, on a has_many for example?


I've also left a comment on one of the discussions from the last review:
#3712 (comment)

@SahSantoshh SahSantoshh force-pushed the feature/ability_to_see_search_result_in_index_page branch from 4a25fef to e44936b Compare May 18, 2025 05:08
@SahSantoshh SahSantoshh requested a review from Paul-Bob May 18, 2025 05:09
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.

@SahSantoshh I already left a review, let me know if you have any question

@Paul-Bob
Copy link
Contributor

Main question is:

how does it behave on association fields, on a has_many for example?

@SahSantoshh
Copy link
Author

Sorry, I missed this one.
Thanks for quoting it again. the search doesn't work on has_many. Let me check why

@SahSantoshh
Copy link
Author

SahSantoshh commented May 18, 2025

@Paul-Bob could you please let me know some more details to deal with search for associations as well. It seems little tricky to deal with association search :)

@Paul-Bob
Copy link
Contributor

First, we need to verify the URL's proper transmission from the stimulus controller, I suspect it is not correctly seted for associations. Please review the previous search component's URL computation method for reference.

@SahSantoshh SahSantoshh marked this pull request as draft May 24, 2025 16:02
Sign up for free to join this conversation on GitHub. 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