-
Notifications
You must be signed in to change notification settings - Fork 358
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 Resource Pool UI for Cloud managers #8929
Conversation
When navigating to the resource pools of cloud providers, I encounter a situation where the displayed path at the top of the UI indicates "compute > Infrastructure > Resource Pools." This difference occurs because in the breadcrumb_options method of the resource_pool_controller, the logic seems to be configured to include "Infrastructure" as part of the breadcrumb when navigating to resource pools and here the :menu_section is set to :inf, as a result, the UI continues to highlight "Infrastructure > Resource Pools," even after navigating to Now, the question is, Do I need to create separate controllers like resource_pool_cloud_controller and resource_pool_infra_controller by writing modules. Making this decision involves considering potential changes to other files writing seperate files, making changes to routes and YAML configurations. Alternatively, Is there a possibility of implementing conditional logic within the breadcrumb_options method and :menu_section in the existing resource_pool_controller to handle both cloud and infrastructure resource pools. |
def textual_resource_pools | ||
num = @record.try(:resource_pools) ? @record.number_of(:resource_pools) : 0 | ||
h = {:label => _('Resource Pools'), :icon => "pficon pficon-resource-pool", :value => num} | ||
if num.positive? && role_allows?(:feature => "resource_pool_show_list") | ||
h[:title] = _("Show all Resource Pools") | ||
h[:link] = ems_cloud_path(@record.id, :display => 'resource_pools') | ||
end | ||
h | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks at least very similar to the textual_resource_pools
method in the ResourcePoolHelper
could we reuse that one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The h[:link] options in the textual_resource_pools
methods of both files looks different. Perhaps we can't reuse it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link from ems_cloud_helper
/ems_cloud/5?display=resource_pools
Link from resource_pool_helper
/resource_pool/show/5?display=resource_pools
cc @jeffibm please review as well |
Hey @Guddetisandeep , could you please add some screenshots in the description for sprint review documentation purpose. |
I just saw them in the comment in here #8929 (comment) |
Hey @Fryguy , do we need to change the branch name of this PR? |
@jeffibm do you mean because it is based off of his fork's master branch? That is technically okay from our point of view it just makes for a weird workflow for @Guddetisandeep if he works on more than 1 PR at a time in this repo. |
Hey @Guddetisandeep , we have a failing spec |
2a34501
to
94b9a7a
Compare
I have updated the PR with the modified spec_file that should address the issue with the failing spec |
Thanks @Guddetisandeep! fyi when you force push one of the merges has to approve the workflow again, but I think if you just push fast-forward commits it will run without approval. |
I spent some time taking a closer look at this today and have a couple of questions:
|
f1edea2
to
641d35f
Compare
aebf2cf
to
46e17f0
Compare
b4810da
to
9608ca8
Compare
The line -
Menu::Item.new(' identifies the navigation selection. so you might want to change it a unique name. |
app/presenters/menu/default_menu.rb
Outdated
@@ -84,6 +84,7 @@ def clouds_menu_section | |||
Menu::Item.new('orchestration_stack', N_('Stacks'), 'orchestration_stack', {:feature => 'orchestration_stack_show_list'}, '/orchestration_stack/show_list'), | |||
Menu::Item.new('auth_key_pair_cloud', N_('Key Pairs'), 'auth_key_pair_cloud', {:feature => 'auth_key_pair_cloud_show_list'}, '/auth_key_pair_cloud/show_list'), | |||
Menu::Item.new('placement_group', N_('Placement Groups'), 'placement_group', {:feature => 'placement_group_show_list'}, '/placement_group/show_list'), | |||
Menu::Item.new('resource_pool_cloud', N_('Resource Pools'), 'resource_pool_cloud', {:feature => 'resource_pool_show_list'}, '/resource_pool_cloud/show_list'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the identifier name to Menu::Item.new('resource_pool_cloud') for the cloud section, and for the infrastructure_menu_section
, I changed it to Menu::Item.new('resource_pool_infra'). After clicking on these two menus, I noticed that neither of them gets highlighted, although they function correctly and display data. Is it also necessary to make similar changes in the miq_product_features.yml
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffibm ^
Hey @jeffibm can you give this a re-review? |
hey @Guddetisandeep , could you please squash the commits. |
Per mentioned in ManageIQ/manageiq-api#1248, would you update your api queries to use |
ddeb02e
to
e13b1c4
Compare
the menu items seem to be working now - To get this working, I can see that, you changed the Also the breadcrumbs now looks like - |
We have a failing spec in Probably because the |
1d05888
to
f212495
Compare
@miq-bot cross-repo-tests ManageIQ/manageiq#22879 |
From Pull Request: ManageIQ/manageiq-ui-classic#8929
@Guddetisandeep cross-repo test isn't running properly, but I tried merging your UI and core PRs locally and I'm seeing the same failures as we see here so the errors aren't resolved by just having your core PR applied. |
Yes, I see some errors in this repo PR. I will work on resolving them and update the PR accordingly. |
Checked commit Guddetisandeep@995bd1f with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint app/helpers/application_helper/toolbar/resource_pool_cloud_center.rb
app/helpers/application_helper/toolbar/resource_pool_infras_center.rb
app/helpers/ems_cloud_helper/textual_summary.rb
app/helpers/resource_pool_cloud_helper/textual_summary.rb
app/helpers/resource_pool_infra_helper/textual_summary.rb
app/helpers/vm_helper/textual_summary.rb
app/views/resource_pool_cloud/show.html.haml
app/views/resource_pool_infra/_config.html.haml
app/views/resource_pool_infra/show.html.haml
app/views/resource_pool_infra/show_list.html.haml
|
@GilbertCherrie can you review this PR? |
@agrare This pr looks good. I was able to check the infrastructure resource pools but don't have any data for cloud resource pools. Do you think you can check the cloud resource pools page? |
Dependent PR for enabling Resource Pool feature under Clouds section(Compute > Clouds > Resource Pools)
manageiq Core changes
Update Resource Pool Identifiers and UI for Cloud and Infrastructure Categorization manageiq#22879
manageiq-ui-classic changes
Add Resource Pool UI for Cloud managers #8929
manageiq-schema changes
Update resource pool feature identifiers to infrastructure-specific manageiq-schema#718
manageiq-api changes
Update Resource Pool API to include type attribute manageiq-api#1248
Added
Resource pool
option for cloud providers and also showing the Resource pool option undercompute > clouds > Cloud Resource pools
TODO:
Resource Pools
under cloud or Infrastructure in the compute section highlights both options. It should only highlight the relevant one based on the selection.