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

Configuration manager non explorer version #6782

Merged

Conversation

h-kataria
Copy link
Contributor

@h-kataria h-kataria commented Mar 20, 2020

New screens under Configuration main tab with non-explorer version of

  • Providers
  • Profiles
  • Configured Systems

These screens replace subtab Management under Configuration 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
before_cm_explorer

Configuration Manager node selection
cm_node_summary

Configuration Profile node selection
cp_node_summary

Configured System node selection
cs_node_summary

after changes screenshots
New sub menus under Configuration main menu
configuration_menu

Blank screen with Add Provider button where there are no Configuration Manager Providers yet in db
after

List of all Configuration Managers with advanced search/filters
cm_list

Configuration Manager Summary
cm_summary

List of All Configuration Profiles with advanced search/filters
Screenshot from 2020-04-14 17-45-06

Configuration Profile Summary
cp_summary

List of All Configured Systems
cs_list_view

Configured System Summary
cs_summary

@h-kataria h-kataria requested a review from skateman March 20, 2020 22:04
@h-kataria h-kataria force-pushed the configuration_manager_non_explorer_version branch from 4b56a07 to 9501afc Compare March 23, 2020 14:26
@h-kataria h-kataria requested review from himdel and removed request for martinpovolny March 24, 2020 19:30
@h-kataria h-kataria force-pushed the configuration_manager_non_explorer_version branch from ccc47fd to 35cca40 Compare March 24, 2020 22:26
@skateman
Copy link
Member

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 👍

@h-kataria
Copy link
Contributor Author

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

@h-kataria h-kataria changed the title [WIP] - Configuration manager non explorer version Configuration manager non explorer version Mar 25, 2020
@h-kataria h-kataria removed the wip label Mar 25, 2020
@h-kataria h-kataria force-pushed the configuration_manager_non_explorer_version branch 2 times, most recently from bb6aa63 to 3c482ce Compare March 25, 2020 21:15
@@ -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)
Copy link
Member

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?

Copy link
Contributor Author

@h-kataria h-kataria Mar 26, 2020

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH, right

@skateman
Copy link
Member

Tried, seems working, @mzazrivec wanna test too?

@h-kataria h-kataria force-pushed the configuration_manager_non_explorer_version branch 4 times, most recently from f8d41fc to 36436dc Compare April 1, 2020 13:21
@h-kataria h-kataria added the wip label Apr 2, 2020
@h-kataria h-kataria force-pushed the configuration_manager_non_explorer_version branch from 36436dc to ec82ba1 Compare April 2, 2020 14:25
end

def provider_class
ManageIQ::Providers::Foreman::Provider
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@himdel himdel Apr 27, 2020

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 :) .)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fryguy I agree with @himdel that's the the reason i did not change Add new provider form in this PR. Even if we decide to make changes to existing form , i would prefer a separate follow up PR, this PR is getting way too big.

Copy link
Member

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

Copy link
Member

@Fryguy Fryguy Apr 28, 2020

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.

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Member

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)
Copy link
Member

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)

Copy link
Member

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

stub_user(:features => :all)
controller.instance_variable_set(:@sb, {})
end
describe EmsConfigurationController, "::AdvancedSearch" do
Copy link
Member

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-' },
Copy link
Member

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?

Copy link
Member

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? ☝️

Copy link
Contributor Author

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
@miq-bot
Copy link
Member

miq-bot commented Apr 23, 2020

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
59 files checked, 76 offenses detected

app/controllers/ems_configuration_controller.rb

  • ⚠️ - Line 71, Col 3 - Lint/IneffectiveAccessModifier - private (on line 69) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.

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

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/configuration_manager/_shared_form.html.haml

  • ⚠️ - Line 98 - Layout/TrailingBlankLines: Final newline missing.

app/views/configuration_profile/show.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/configuration_profile/show_list.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 1 - id attribute must be in lisp-case

app/views/configured_system/show.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/configured_system/show_list.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 1 - id attribute must be in lisp-case

app/views/ems_configuration/edit.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/ems_configuration/new.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/ems_configuration/show.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.

app/views/ems_configuration/show_list.html.haml

  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 1 - id attribute must be in lisp-case

app/views/layouts/listnav/_configuration_profile.html.haml

  • ⚠️ - Line 17 - Avoid using instance variables in partials views
  • ⚠️ - Line 17 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.
  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 21 - Avoid using instance variables in partials views
  • ⚠️ - Line 21 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 21 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 21 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 21 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 21 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 21 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 21 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 21 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 4 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.

app/views/layouts/listnav/_configured_system.html.haml

  • ⚠️ - Line 17 - Avoid using instance variables in partials views
  • ⚠️ - Line 17 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.
  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 22 - Avoid using instance variables in partials views
  • ⚠️ - Line 22 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.
  • ⚠️ - Line 4 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.

app/views/layouts/listnav/_ems_configuration.html.haml

  • ⚠️ - Line 16 - Avoid using instance variables in partials views
  • ⚠️ - Line 16 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 16 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 16 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 16 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 16 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 16 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 1 - Layout/TrailingBlankLines: Final newline missing.
  • ⚠️ - Line 22 - Avoid using instance variables in partials views
  • ⚠️ - Line 22 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 22 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 22 - Layout/ExtraSpacing: Unnecessary spacing detected.
  • ⚠️ - Line 22 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 22 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 22 - Layout/SpaceAroundOperators: Operator => should be surrounded by a single space.
  • ⚠️ - Line 4 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Avoid using instance variables in partials views
  • ⚠️ - Line 9 - Style/BracesAroundHashParameters: Missing curly braces around a hash parameter.

end

def breadcrumb_name(_model)
"#{ui_lookup(:ui_title => 'foreman')} #{_('Provider')}"
Copy link
Member

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')?

@Fryguy Fryguy merged commit fdc0b7a into ManageIQ:master May 8, 2020
@h-kataria h-kataria deleted the configuration_manager_non_explorer_version branch May 13, 2020 17:57
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request May 21, 2020
this line was added in ManageIQ#6782, should keep the next line that uses `arel_table`
simaishi pushed a commit that referenced this pull request May 21, 2020
…lorer_version

Configuration manager non explorer version

(cherry picked from commit fdc0b7a)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit 978f54bfd2a26a3802d9181de86a8841c3cb26ad
Author: Jason Frey <[email protected]>
Date:   Thu May 7 22:06:12 2020 -0400

    Merge pull request #6782 from h-kataria/configuration_manager_non_explorer_version

    Configuration manager non explorer version

    (cherry picked from commit fdc0b7a2e3794dc15e077ff71e9841486f4c8524)

kbrock pushed a commit to kbrock/manageiq-ui-classic that referenced this pull request Aug 8, 2020
this line was added in ManageIQ#6782, should keep the next line that uses `arel_table`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants