Skip to content
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

Adding Search Bar Functionality for Cloud Tenant Show Page #9217

Open
Dhamo1107 opened this issue Jul 1, 2024 · 6 comments
Open

Adding Search Bar Functionality for Cloud Tenant Show Page #9217

Dhamo1107 opened this issue Jul 1, 2024 · 6 comments
Assignees

Comments

@Dhamo1107
Copy link

Summary:

  • I'm trying to implement a search bar functionality on the Cloud Tenant Show page using the SearchBar React component.

Implementation Details:
Frontend:

  • SearchBar component added to the Cloud Tenant Show.html.haml page with advanced search props is set to false

Backend Integration Needed:

  • Need guidance on where to add the backend logic to handle search text parameters.

Any guidance on integrating the search functionality with the backend would be highly beneficial. Specifically:

  • In CloudTenantController, GenericShowMixin is included, So the show method is in GenericShowMixin, in this how to handle search params and send data to front end based on search params

  • How to update the view with filtered data?

Thank you for your assistance.

image

@GilbertCherrie
Copy link
Member

GilbertCherrie commented Jul 16, 2024

I'm not too sure on how we can add search bars to these embedded list pages. It looks like this pr: #9190 is doing the same thing if you wanted to check out the code and try to see if it works locally. I haven't had a chance to review the pr so not sure if it works or not.

@Dhamo1107
Copy link
Author

Dhamo1107 commented Jul 16, 2024

Hi @GilbertCherrie,

Thanks for your opinion. I have completed that feature by making the following changes:

  1. Updated Condition in get_view_process_search_text Method in application_controller.rb:
    return nil if @display || @in_a_form => return nil if @in_a_form
    We have images in @display, so it was returning nil.
    if (!@parent && @lastaction == "show_list") || @explorer => if (!@parent && @lastaction == "show_list") || @explorer || @display
    Added @display to the condition to proceed with the next steps.

  2. Added Search Bar in show.html.haml:
    .display-search-bar
    = react('SearchBar', searchText: @search_text, action: 'show', advancedSearch: false)

After making these changes, the search bar is working perfectly for images, instances, security groups, cloud volumes, etc., in tenants page in the cloud menu.

I am currently looking into how to run test cases to ensure existing functionalities are working correctly. If you have any insights on the get_view_process_search_text method in the application controller, please guide me on whether this approach is correct. You can also check this locally.

Thanks!

@GilbertCherrie
Copy link
Member

I'm not too familiar with this function. If anything just finish the pr and we can review it at the end to make sure everything is correct.

@Dhamo1107
Copy link
Author

Hi @GilbertCherrie, I have created the PR please check it! #9225

@GilbertCherrie
Copy link
Member

@Dhamo1107 Thank you for the pr. We will take a look when we have the chance and discuss any changes in the pr.

@miq-bot
Copy link
Member

miq-bot commented Nov 1, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants