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

Add Search Bar for Provision Instances - Select an Image Page #22871

Closed
Rajkannan-2252 opened this issue Feb 1, 2024 · 21 comments
Closed

Add Search Bar for Provision Instances - Select an Image Page #22871

Rajkannan-2252 opened this issue Feb 1, 2024 · 21 comments

Comments

@Rajkannan-2252
Copy link

Hi @Fryguy,

I need search bar for this page

When I go to provision instances, I have a list of multiple images. I need search bar for this page

Path: Compute/Cloud/Instances/Instances by Provider/Provision Instances-Select an Image

Could you please guide me on how to add a search bar?

For your reference, I shared the screenshot below.

Search bar

@Fryguy
Copy link
Member

Fryguy commented Feb 7, 2024

If you are coming from the Compute/Cloud/Instances/Instances by Provider path, the image you choose there should be pre-selected here. If not, that's probably a bug - can you open a separate issue for that if you are seeing that problem?

I agree about the search here being useful though, so that's a good feature.

@Fryguy
Copy link
Member

Fryguy commented Feb 7, 2024

@DavidResende0 or @GilbertCherrie can you give some guidance to @Rajkannan-03 on how they might add the search bar themselves?

@GilbertCherrie
Copy link
Member

Hi @Rajkannan-03 I'm not too sure on where exactly it would go, but essentially in the manageiq-ui-classic repo we have the ruby controller files for each page. In these controllers we have the function:

  def show_searchbar?
    true
  end

Adding this to the correct controller should allow a search bar to be displayed. If this search bar works with the instances table is something I'm not sure about though and this might need to be investigated.

@Rajkannan-2252
Copy link
Author

Hi @GilbertCherrie

1)I tried the below code for the search bar as per your guidance.

def show_searchbar?
true
end

i) miq_request_controller.rb
ii) vm_cloud_controller.rb
I added a search code for both .rb files but did not get a search option.

  1. I tried some other way to add a searchbar

    manageiq-ui-classic/app/views/miq_request/_pre_prov.html.haml

search code

Using above code I got a searchbar in a particular page

search by ins

When I Search using the search bar, I can only filter the instances and not the images.

search test image

Could you please guide me on how to proceed from here.

@GilbertCherrie
Copy link
Member

That is what I was worried about. It seems like the search bar doesn't recognize that as a data table to search through. Not sure if @DavidResende0 or @jeffibm have anything to add but I believe you might need to create a custom search bar for this page.

@Rajkannan-2252
Copy link
Author

Hello, @GilbertCherrie. I want a search bar option on this page for image searches.

Search bar

@Rajkannan-2252
Copy link
Author

Hi @jeffibm I want a search bar option on this particular page because of the multiple images listed over here.

Path: Compute/Cloud/Instances/Instances by Provider/Provision Instances-Select an Image

Could you please guide me on how to add a search bar?

For your reference, I shared the screenshot below.

Search bar
.

@jeffibm
Copy link
Member

jeffibm commented Feb 16, 2024

Hi @jeffibm I want a search bar option on this particular page because of the multiple images listed over here.

Path: Compute/Cloud/Instances/Instances by Provider/Provision Instances-Select an Image

Could you please guide me on how to add a search bar?

For your reference, I shared the screenshot below.

Search bar
.

Hey @Rajkannan-03 , I need to debugg the code to see how its been implemented.

Let me discuss with the team and find answers for you.

@Rajkannan-2252
Copy link
Author

Hi @jeffibm Thank you for your update.

@jeffibm
Copy link
Member

jeffibm commented Feb 20, 2024

We have to make a lot of changes in the code base to bring the search feature to the Provision instance - select an image page.

When we are on this page, and reload the browser, it goes back to its previous page, making it difficult to reuse the existing components.

Even if we bring the search bar here, after the search it goes back to the previous page and filters the previous list.

So to accomplish this, we have to work the rails and react codes to reuse the existing features (recommended), or,
create a new react component, plug into this page, and find a way to connect the data to the filter.

Either way, it's a time-consuming work.

The hide deprecated checkbox is doing a filtering process. Maybe we can connect a search feature with it.

@Rajkannan-2252
Copy link
Author

Hi @jeffibm Thanks for the update.

If it is possible, connect the search feature in the hide deprecated checkbox, which is doing a filtering process.

Could you please guide me on how to connect the search feature to the hide deprecated checkbox?

@jeffibm
Copy link
Member

jeffibm commented Feb 20, 2024

Hi @jeffibm Thanks for the update.

If it is possible, connect the search feature in the hide deprecated checkbox, which is doing a filtering process.

Could you please guide me on how to connect the search feature to the hide deprecated checkbox?

I have no idea at the moment.

I am currently trying to debug the existing code to find a way to do it.

Will keep you posted.

@jeffibm
Copy link
Member

jeffibm commented Feb 20, 2024

the eligible_for_provisioning and non_deprecated are scope methods added to the query. We can't make a similar approach. not sure how to pass a value to those methods, but I believe that's not the way to do it.

I tried other ways to do it, but no luck so far.

@Rajkannan-2252
Copy link
Author

Hello @jeffibm Thanks for the input

We are trying this from our end too. Meanwhile, kindly let us know if in case you get some outputs for the same.

@Rajkannan-2252
Copy link
Author

Hi @GilbertCherrie I want a search bar option on this particular page because of the multiple images listed over here.

Path: Compute/Cloud/Instances/Instances by Provider/Provision Instances-Select an Image

Could you please guide me on how to add a search bar?

For your reference, I shared the screenshot below.

Search bar

@GilbertCherrie
Copy link
Member

GilbertCherrie commented Feb 21, 2024

You would have to open up an issue for an enhancement request and then at some point somebody can take a look. As of right now this is not a high priority issue but you can still open up an issue for it so we can track it.

EDIT: Just realized this is an enhancement issue. Leave this issue open as is and at some point somebody can take a look. As I said this issue is low priority since there is a workaround for it so not sure how long until it gets looked at. If you need it quickly you can try to raise a pr and somebody can review/merge it if it is good.

@Rajkannan-2252
Copy link
Author

Hi @jeffibm This is a high-priority issue for us.

Anything possible to add a search feature for the Provision instance: Select an image page.

@jeffibm
Copy link
Member

jeffibm commented Mar 9, 2024

Hi @jeffibm This is a high-priority issue for us.

Anything possible to add a search feature for the Provision instance: Select an image page.

Hey @Rajkannan-2252 ,
Just wanted to inform you that currently, all our available resources are engaged in high-priority tasks. Rest assured, as soon as they become available, we'll address the search feature you want. Thank you

@Rajkannan-2252
Copy link
Author

Hi @jeffibm, any update on this ticket.

@jeffibm
Copy link
Member

jeffibm commented Apr 18, 2024

Hey @Rajkannan-2252 , I raised a PR for this recently, and is up for review.

Could you see the videos posted in the PR below and confirm if this is what you want?

ManageIQ/manageiq-ui-classic#9159

@Rajkannan-2252
Copy link
Author

Hi @jeffibm,

Thank you for your support. I tried all the above code, and it's working properly.

@jeffibm jeffibm closed this as completed Apr 29, 2024
@Fryguy Fryguy added this to Roadmap Jun 12, 2024
@Fryguy Fryguy moved this to Backlog in Roadmap Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants