-
Notifications
You must be signed in to change notification settings - Fork 356
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
Configuration manager non explorer version #6782
Configuration manager non explorer version #6782
Conversation
4b56a07
to
9501afc
Compare
ccc47fd
to
35cca40
Compare
Looks great on the screenshots, I think we should support filters on the two empty sidebars as well. I'm not sure how complex it is to do so, so it might be better to do it in a separate PR. Anyway, great job 👍 |
That's an easy one to do, i will add that in here |
bb6aa63
to
3c482ce
Compare
@@ -143,7 +143,7 @@ def process_elements(elements, klass, task, display_name = nil, order_field = ni | |||
end | |||
|
|||
def explorer_controller? | |||
%w[vm_cloud vm_infra vm_or_template infra_networking].include?(controller_name) | |||
%w[vm_cloud vm_infra vm_or_template infra_networking automation_manager].include?(controller_name) |
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.
shouldn't be configuration_manager
?
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.
no, configuration_manger
is no longer an explorer controller but shares some code with automation_manager
controller and that is explorer style screen, so i need to add this here so i can redirect appropriately from shared methods.
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.
OH, right
Tried, seems working, @mzazrivec wanna test too? |
f8d41fc
to
36436dc
Compare
36436dc
to
ec82ba1
Compare
end | ||
|
||
def provider_class | ||
ManageIQ::Providers::Foreman::Provider |
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.
Why is Foreman still here?
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.
@Fryguy This is still here because currently UI does not have a type drop down in Add a new Provider form, i was hoping once we have new Data driven Provider form in place we will have a type drop down for user to select what type of Provider they want to add with their respective fields. Do you think i should i add a Type drop down on the Add form, if yes, what should be the options, then we can change this code to use value from the type field.
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.
How do we do it for other providers?
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.
Or is this related to the problem with the Provider model vs ExtManagementSystem model?
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.
other provider have a type field on the form, based upon the type selected a Provider object is created. I am working on adding a Type
field to the Add Configuration Manager form with similar logic that we have for other providers. Should get that in shortly.
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.
Is there a point to all this?
Consider that for now Foreman::Provider is precisely the class this controller needs.
None of this code should exists in the first place, aren't we just wasting time that could be spent on finishing the proper way of doing that via the API?
(I mean, introducing little tech debt is probably cheaper than designing technical debt to introduce :) .)
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.
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.
@h-kataria happy to help add permissions and supported_for_create to the provider, would rather that than hard coding Foreman
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.
If these are meant to be temporary, then I'm fine with that, especially as the goal is to move towards pluggable DDF for this feature.
aren't we just wasting time that could be spent on finishing the proper way of doing that via the API?
Isn't that what we are doing with this discussion? It's clear there's a general design issue with respect to provider/manager split, so discussing it is something we need to do anyway for the API. It helps to have that discussion in context with the code that is actually consuming it, hence me bringing in @agrare, as he has some opinions on how best to deal with the provider/manager split.
Also this thread started as me noticing Foreman in the code when the purpose of the PR is to remove Foreman from the code, so it stood out. It's not clear from the code that the purpose for the method is to drive the drop-down for adding a new provider.
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.
line of code in question does not drive the drop-down as currently there is no Type drop-down in the UI. Currently users can only add a Foreman Provider and this line is providing class for the new record, when the Add button is UI is pressed.
if %w[ManageIQ::Providers::ConfigurationManager].include?(record.type) || record.type.starts_with?('ManageIQ::Providers::Foreman') | ||
redirect_to(:controller => 'provider_foreman', :action => 'show', :id => params[:id]) | ||
elsif %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type) | ||
if %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type) |
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.
Can we prefer if record.kind_of?(ManageIQ::Providers::ExternalAutomationManager)
, so we can remove the plugin reference entirely?
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 see technically this was original code (didn't realize initially), so this can be a followup
if %w[ManageIQ::Providers::ConfigurationManager].include?(record.type) || record.type.starts_with?('ManageIQ::Providers::Foreman') | ||
redirect_to(:controller => 'provider_foreman', :action => 'show', :id => params[:id]) | ||
elsif %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type) | ||
if %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type) | ||
redirect_to(:controller => 'automation_manager', :action => 'show', :id => params[:id]) | ||
elsif %w[ManageIQ::Providers::EmbeddedAnsible::AutomationManager].include?(record.type) |
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.
Same here - if record.kind_of?(ManageIQ::Providers::EmbeddedAutomationManager)
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 see technically this was original code (didn't realize initially), so this can be a followup
app/helpers/application_helper/toolbar/ems_configurations_center.rb
Outdated
Show resolved
Hide resolved
stub_user(:features => :all) | ||
controller.instance_variable_set(:@sb, {}) | ||
end | ||
describe EmsConfigurationController, "::AdvancedSearch" do |
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.
Not for this PR, but it's weird to me to have a EmsConfigurationController, "::AdvancedSearch"
in a file named application_controller/advanced_search_spec.rb
as the latter is generic and the former is specific.
@@ -28,7 +28,6 @@ | |||
:ems_vmware_cloud => { :tip_prefix => 'Ems Cloud' }, | |||
# Other remaining providers | |||
:automation_manager_ansible_tower => { :key_prefix => 'at-' }, | |||
:configuration_manager_foreman => { :key_prefix => 'fr-' }, |
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.
should the configuration_manager entry about 12 lines down be uncommented and/or deleted?
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.
@h-kataria Is this a valid concern? ☝️
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.
@Fryguy now that the tree is removed from the left side in Configuration Managers area, we do not need this entry.
- ConfiguredSystem controller changed to use updated named_scope - Moved EmsConfiguration specific code into controller that's being used when pressing new/edit buttons in UI. - Added/Updated accidentally deleted code back in RestfulRedirect controller and it's spec test. - Fixed a typo in ems_configurations_center_tb - removed redundant `provider_manager_foreman` entry from tree_node/ext_management_system_spec
Checked commits h-kataria/manageiq-ui-classic@6173e3a~...3f8593e with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint app/controllers/ems_configuration_controller.rb
app/controllers/mixins/automation_manager_controller_mixin.rb
app/helpers/application_helper/toolbar/configured_system_center.rb
app/helpers/application_helper/toolbar/configured_systems_center.rb
app/helpers/application_helper/toolbar/ems_configuration_center.rb
app/helpers/application_helper/toolbar/ems_configurations_center.rb
app/presenters/menu/default_menu.rb
app/views/automation_manager/_form.html.haml
app/views/configuration_manager/_shared_form.html.haml
app/views/configuration_profile/show.html.haml
app/views/configuration_profile/show_list.html.haml
app/views/configured_system/show.html.haml
app/views/configured_system/show_list.html.haml
app/views/ems_configuration/edit.html.haml
app/views/ems_configuration/new.html.haml
app/views/ems_configuration/show.html.haml
app/views/ems_configuration/show_list.html.haml
app/views/layouts/listnav/_configuration_profile.html.haml
app/views/layouts/listnav/_configured_system.html.haml
app/views/layouts/listnav/_ems_configuration.html.haml
|
end | ||
|
||
def breadcrumb_name(_model) | ||
"#{ui_lookup(:ui_title => 'foreman')} #{_('Provider')}" |
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.
Is ui_title correct here (i.e. is it still 'foreman')?
this line was added in ManageIQ#6782, should keep the next line that uses `arel_table`
…lorer_version Configuration manager non explorer version (cherry picked from commit fdc0b7a)
Jansa backport details:
|
this line was added in ManageIQ#6782, should keep the next line that uses `arel_table`
New screens under Configuration main tab with non-explorer version of
These screens replace subtab
Management
underConfiguration
maintab.@skateman it's a work in progress to address #6756 (comment). just creating a wip PR as i am working thru further cleanup and fixing things as i compare new screens with original explorer version to match all the current feature implementations. I will also add some screesnhots, once i have this bit more cleaned up.
Pending core ManageIQ/manageiq#19949
Schema PR ManageIQ/manageiq-schema#464
before changes screenshots
Sub menu under Configuration main menu
Configuration Manager node selection
Configuration Profile node selection
Configured System node selection
after changes screenshots
New sub menus under Configuration main menu
Blank screen with Add Provider button where there are no Configuration Manager Providers yet in db
List of all Configuration Managers with advanced search/filters
Configuration Manager Summary
List of All Configuration Profiles with advanced search/filters
Configuration Profile Summary
List of All Configured Systems
Configured System Summary