manageiq
manageiq copied to clipboard
Add Search Bar for Provision Instances - Select an Image Page
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.
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.
@DavidResende0 or @GilbertCherrie can you give some guidance to @Rajkannan-03 on how they might add the search bar themselves?
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.
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.
-
I tried some other way to add a searchbar
manageiq-ui-classic/app/views/miq_request/_pre_prov.html.haml
Using above code I got a searchbar in a particular page
When I Search using the search bar, I can only filter the instances and not the images.
Could you please guide me on how to proceed from here.
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.
Hello, @GilbertCherrie. I want a search bar option on this page for image searches.
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.
.
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.
.
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.
Hi @jeffibm Thank you for your update.
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.
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?
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.
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.
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.
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.
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.
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.
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
Hi @jeffibm, any update on this ticket.
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?
https://github.com/ManageIQ/manageiq-ui-classic/pull/9159
Hi @jeffibm,
Thank you for your support. I tried all the above code, and it's working properly.