From b35b48b939b43a6c38294b4d790c5bf8267a4e70 Mon Sep 17 00:00:00 2001 From: Mooli Tayer Date: Sun, 24 Dec 2017 17:02:27 +0200 Subject: [PATCH] Remove datawarehouse views --- .../ems_common/ems_common_form_controller.js | 2 +- app/controllers/application_controller.rb | 2 - .../ems_datawarehouse_controller.rb | 47 -------- app/controllers/mixins/ems_common_angular.rb | 20 ---- app/helpers/application_helper.rb | 5 - .../toolbar/ems_datawarehouse_center.rb | 80 -------------- .../toolbar/ems_datawarehouses_center.rb | 92 ---------------- .../application_helper/toolbar_chooser.rb | 1 - app/helpers/datawarehouse_summary_helper.rb | 11 -- app/helpers/ems_datawarehouse_helper.rb | 4 - .../textual_summary.rb | 38 ------- app/presenters/menu/default_menu.rb | 14 +-- app/views/ems_datawarehouse/_form.html.haml | 69 ------------ .../ems_datawarehouse/_form_fields.html.haml | 20 ---- .../ems_datawarehouse/discover.html.haml | 1 - app/views/ems_datawarehouse/edit.html.haml | 17 --- app/views/ems_datawarehouse/new.html.haml | 19 ---- app/views/ems_datawarehouse/show.html.haml | 2 - .../ems_datawarehouse/show_list.html.haml | 2 - .../_endpoints_angular.html.haml | 3 +- .../angular/_multi_auth_credentials.html.haml | 19 +--- .../listnav/_ems_datawarehouse.html.haml | 15 --- config/routes.rb | 34 +----- ...nageIQ_Providers_DatawarehouseManager.yaml | 86 --------------- .../ems_datawarehouse_controller_spec.rb | 100 ------------------ .../json/alerts_center/icons_response.json | 3 +- .../alerts_center/providers_response.json | 2 +- .../services/alerts_center_service_spec.js | 8 +- .../routing/ems_datawarehouse_routing_spec.rb | 50 --------- 29 files changed, 12 insertions(+), 754 deletions(-) delete mode 100644 app/controllers/ems_datawarehouse_controller.rb delete mode 100644 app/helpers/application_helper/toolbar/ems_datawarehouse_center.rb delete mode 100644 app/helpers/application_helper/toolbar/ems_datawarehouses_center.rb delete mode 100644 app/helpers/datawarehouse_summary_helper.rb delete mode 100644 app/helpers/ems_datawarehouse_helper.rb delete mode 100644 app/helpers/ems_datawarehouse_helper/textual_summary.rb delete mode 100644 app/views/ems_datawarehouse/_form.html.haml delete mode 100644 app/views/ems_datawarehouse/_form_fields.html.haml delete mode 100644 app/views/ems_datawarehouse/discover.html.haml delete mode 100644 app/views/ems_datawarehouse/edit.html.haml delete mode 100644 app/views/ems_datawarehouse/new.html.haml delete mode 100644 app/views/ems_datawarehouse/show.html.haml delete mode 100644 app/views/ems_datawarehouse/show_list.html.haml delete mode 100644 app/views/layouts/listnav/_ems_datawarehouse.html.haml delete mode 100644 product/views/ManageIQ_Providers_DatawarehouseManager.yaml delete mode 100644 spec/controllers/ems_datawarehouse_controller_spec.rb delete mode 100644 spec/routing/ems_datawarehouse_routing_spec.rb diff --git a/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js b/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js index a3530b0b75c7..41b787145905 100644 --- a/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js +++ b/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js @@ -294,7 +294,7 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', ' $scope.emsCommonModel.metrics_password != '' && $scope.angularForm.metrics_password.$valid)) { return true; } else if($scope.currentTab == "default" && - ["ems_container", "ems_middleware", "ems_datawarehouse", "ems_physical_infra"].indexOf($scope.emsCommonModel.ems_controller) >= 0 && + ["ems_container", "ems_middleware", "ems_physical_infra"].indexOf($scope.emsCommonModel.ems_controller) >= 0 && ($scope.emsCommonModel.emstype) && ($scope.emsCommonModel.default_hostname != '' && $scope.emsCommonModel.default_api_port) && ($scope.emsCommonModel.default_password != '' && $scope.angularForm.default_password.$valid)) { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0cc3aed3f154..7d8c174d66ad 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1671,8 +1671,6 @@ def render_or_redirect_partial(pfx) javascript_redirect edit_ems_container_path(params[:id]) elsif params[:pressed] == "ems_middleware_edit" && params[:id] javascript_redirect edit_ems_middleware_path(params[:id]) - elsif params[:pressed] == "ems_datawarehouse_edit" && params[:id] - javascript_redirect edit_ems_datawarehouse_path(params[:id]) elsif params[:pressed] == "ems_network_edit" && params[:id] javascript_redirect edit_ems_network_path(params[:id]) elsif params[:pressed] == "ems_physical_infra_edit" && params[:id] diff --git a/app/controllers/ems_datawarehouse_controller.rb b/app/controllers/ems_datawarehouse_controller.rb deleted file mode 100644 index 7c43c0ea4b56..000000000000 --- a/app/controllers/ems_datawarehouse_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -class EmsDatawarehouseController < ApplicationController - include Mixins::GenericListMixin - include Mixins::GenericShowMixin - include EmsCommon - include Mixins::EmsCommonAngular - include Mixins::GenericSessionMixin - - before_action :check_privileges - before_action :get_session_data - after_action :cleanup_action - after_action :set_session_data - - def textual_group_list - [%i(properties status), %i(smart_management)] - end - helper_method :textual_group_list - - def self.model - ManageIQ::Providers::DatawarehouseManager - end - - def self.table_name - @table_name ||= "ems_datawarehouse" - end - - def show_link(ems, options = {}) - ems_datawarehouse_path(ems.id, options) - end - - def ems_path(*args) - ems_datawarehouse_path(*args) - end - - def new_ems_path - new_ems_datawarehouse_path - end - - def restful? - true - end - - def ems_datawarehouse_form_fields - ems_form_fields - end - - menu_section :dwh -end diff --git a/app/controllers/mixins/ems_common_angular.rb b/app/controllers/mixins/ems_common_angular.rb index 43c623b83154..8fa60b3b07df 100644 --- a/app/controllers/mixins/ems_common_angular.rb +++ b/app/controllers/mixins/ems_common_angular.rb @@ -436,17 +436,6 @@ def ems_form_fields :ems_controller => controller_name, :default_auth_status => default_auth_status} end - - render :json => {:name => @ems.name, - :emstype => @ems.emstype, - :zone => zone, - :default_hostname => @ems.connection_configurations.default.endpoint.hostname, - :default_api_port => @ems.connection_configurations.default.endpoint.port, - :service_account => service_account.to_s, - :bearer_token_exists => @ems.authentication_token(:bearer).nil? ? false : true, - :ems_controller => controller_name, - :default_auth_status => default_auth_status, - } if controller_name == "ems_datawarehouse" end private ############################ @@ -589,11 +578,6 @@ def set_ems_record_vars(ems, mode = nil) default_endpoint.merge!(endpoint_security_options(ems.security_protocol, default_tls_ca_certs)) end - if ems.kind_of?(ManageIQ::Providers::Hawkular::DatawarehouseManager) - params[:cred_type] = ems.default_authentication_type - default_endpoint = {:role => :default, :hostname => hostname, :port => port} - end - if ems.kind_of?(ManageIQ::Providers::Nuage::NetworkManager) default_endpoint = {:role => :default, :hostname => hostname, :port => port, :security_protocol => ems.security_protocol} amqp_endpoint = {:role => :amqp, :hostname => amqp_hostname, :port => amqp_port, :security_protocol => amqp_security_protocol} @@ -725,10 +709,6 @@ def build_credentials(ems, mode) creds[:bearer] = {:auth_key => default_key, :save => (mode != :validate)} creds.delete(:default) end - if ems.kind_of?(ManageIQ::Providers::DatawarehouseManager) - default_key = params[:default_password] ? params[:default_password] : ems.authentication_key - creds[:default] = {:auth_key => default_key, :userid => "_", :save => (mode != :validate)} - end creds end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bf513305a860..7701b6b2dada 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -345,9 +345,6 @@ def view_to_url(view, parent = nil) if controller == "ems_middleware" && action == "show" return ems_middlewares_path end - if controller == "ems_datawarehouse" && action == "show" - return ems_datawarehouses_path - end if controller == "ems_network" && action == "show" return ems_networks_path end @@ -1435,7 +1432,6 @@ def render_listnav_filename ems_cloud ems_cluster ems_container - ems_datawarehouse ems_infra ems_middleware ems_network @@ -1506,7 +1502,6 @@ def render_listnav_filename ems_cloud ems_cluster ems_container - ems_datawarehouse ems_infra ems_middleware ems_network diff --git a/app/helpers/application_helper/toolbar/ems_datawarehouse_center.rb b/app/helpers/application_helper/toolbar/ems_datawarehouse_center.rb deleted file mode 100644 index 4ccbaaba4f8f..000000000000 --- a/app/helpers/application_helper/toolbar/ems_datawarehouse_center.rb +++ /dev/null @@ -1,80 +0,0 @@ -class ApplicationHelper::Toolbar::EmsDatawarehouseCenter < ApplicationHelper::Toolbar::Basic - button_group('ems_datawarehouse_vmdb', [ - select( - :ems_datawarehouse_vmdb_choice, - 'fa fa-cog fa-lg', - t = N_('Configuration'), - t, - :items => [ - button( - :ems_datawarehouse_refresh, - 'fa fa-refresh fa-lg', - N_('Refresh items and relationships related to this Datawarehouse Provider'), - N_('Refresh items and relationships'), - :confirm => N_("Refresh items and relationships related to this Datawarehouse Provider?")), - separator, - button( - :ems_datawarehouse_edit, - 'pficon pficon-edit fa-lg', - t = N_('Edit this Datawarehouse Provider'), - t), - button( - :ems_datawarehouse_delete, - 'pficon pficon-delete fa-lg', - t = N_('Remove this Datawarehouse Provider from Inventory'), - t, - :url_parms => "&refresh=y", - :confirm => N_("Warning: This Datawarehouse Provider and ALL" \ - " of its components will be permanently removed!")), - ] - ), - ]) - button_group('ems_datawarehouse_monitoring', [ - select( - :ems_datawarehouser_monitoring_choice, - 'ff ff-monitoring fa-lg', - t = N_('Monitoring'), - t, - :items => [ - button( - :ems_datawarehouse_timeline, - 'ff ff-timeline fa-lg', - N_('Show Timelines for this Datawarehouse Provider'), - N_('Timelines'), - :url_parms => "?display=timeline"), - ] - ), - ]) - button_group('ems_datawarehouse_policy', [ - select( - :ems_datawarehouse_policy_choice, - 'fa fa-shield fa-lg', - t = N_('Policy'), - t, - :items => [ - button( - :ems_datawarehouse_tag, - 'pficon pficon-edit fa-lg', - N_('Edit Tags for this Datawarehouse Provider'), - N_('Edit Tags')), - ] - ), - ]) - button_group('ems_datawarehouse_authentication', [ - select( - :ems_datawarehouse_authentication_choice, - 'fa fa-lock fa-lg', - t = N_('Authentication'), - t, - :items => [ - button( - :ems_datawarehouse_recheck_auth_status, - 'fa fa-search fa-lg', - N_("Re-check Authentication Status for this Datawarehouse Provider"), - N_('Re-check Authentication Status'), - :klass => ApplicationHelper::Button::GenericFeatureButton, - :options => {:feature => :authentication_status}), - ] - ), - ]) -end diff --git a/app/helpers/application_helper/toolbar/ems_datawarehouses_center.rb b/app/helpers/application_helper/toolbar/ems_datawarehouses_center.rb deleted file mode 100644 index 5ebd74db767b..000000000000 --- a/app/helpers/application_helper/toolbar/ems_datawarehouses_center.rb +++ /dev/null @@ -1,92 +0,0 @@ -class ApplicationHelper::Toolbar::EmsDatawarehousesCenter < ApplicationHelper::Toolbar::Basic - button_group('ems_datawarehouse_vmdb', [ - select( - :ems_datawarehouse_vmdb_choice, - 'fa fa-cog fa-lg', - t = N_('Configuration'), - t, - :items => [ - button( - :ems_datawarehouse_refresh, - 'fa fa-refresh fa-lg', - N_('Refresh Items and Relationships for these Datawarehouse Providers'), - N_('Refresh Items and Relationships'), - :confirm => N_("Refresh Items and Relationships related to these Datawarehouse Providers?"), - :enabled => false, - :url_parms => "main_div", - :send_checked => true, - :onwhen => "1+"), - separator, - button( - :ems_datawarehouse_new, - 'pficon pficon-add-circle-o fa-lg', - t = N_('Add a New Datawarehouse Provider'), - t, - :url => "/new", - :klass => ApplicationHelper::Button::ButtonNewDiscover), - button( - :ems_datawarehouse_edit, - 'pficon pficon-edit fa-lg', - N_('Select a single Datawarehouse Providers to edit'), - N_('Edit Selected Datawarehouse Providers'), - :url_parms => "main_div", - :send_checked => true, - :enabled => false, - :onwhen => "1"), - button( - :ems_datawarehouse_delete, - 'pficon pficon-delete fa-lg', - N_('Remove selected Datawarehouse Providers from Inventory'), - N_('Remove Datawarehouse Providers from Inventory'), - :url_parms => "main_div", - :send_checked => true, - :confirm => N_("Warning: The selected Datawarehouse Providers and ALL " \ - "of their components will be permanently removed!"), - :enabled => false, - :onwhen => "1+"), - ] - ), - ]) - button_group('ems_datawarehouse_policy', [ - select( - :ems_datawarehouse_policy_choice, - 'fa fa-shield fa-lg', - t = N_('Policy'), - t, - :enabled => false, - :onwhen => "1+", - :items => [ - button( - :ems_datawarehouse_tag, - 'pficon pficon-edit fa-lg', - N_('Edit Tags for these Datawarehouse Providers'), - N_('Edit Tags'), - :url_parms => "main_div", - :send_checked => true, - :enabled => false, - :onwhen => "1+"), - ] - ), - ]) - button_group('ems_datawarehouse_authentication', [ - select( - :ems_datawarehouse_authentication_choice, - 'fa fa-lock fa-lg', - t = N_('Authentication'), - t, - :enabled => false, - :onwhen => "1+", - :items => [ - button( - :ems_datawarehouse_recheck_auth_status, - 'fa fa-search fa-lg', - N_('Re-check Authentication Status for the selected Datawarehouse Providers'), - N_('Re-check Authentication Status'), - :url_parms => "main_div", - :send_checked => true, - :enabled => false, - :onwhen => "1+"), - ] - ), - ]) -end diff --git a/app/helpers/application_helper/toolbar_chooser.rb b/app/helpers/application_helper/toolbar_chooser.rb index 7aa789900635..c76da6737134 100644 --- a/app/helpers/application_helper/toolbar_chooser.rb +++ b/app/helpers/application_helper/toolbar_chooser.rb @@ -498,7 +498,6 @@ def center_toolbar_filename_classic ems_cloud ems_cluster ems_container - ems_datawarehouse ems_middleware container_project container_route diff --git a/app/helpers/datawarehouse_summary_helper.rb b/app/helpers/datawarehouse_summary_helper.rb deleted file mode 100644 index b72956f70329..000000000000 --- a/app/helpers/datawarehouse_summary_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module DatawarehouseSummaryHelper - include TextualMixins::TextualName - - def textual_ems - textual_link(@record.ext_management_system) - end - - def textual_nativeid - @record.nativeid - end -end diff --git a/app/helpers/ems_datawarehouse_helper.rb b/app/helpers/ems_datawarehouse_helper.rb deleted file mode 100644 index b03c0a67a704..000000000000 --- a/app/helpers/ems_datawarehouse_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -module EmsDatawarehouseHelper - include DatawarehouseSummaryHelper - include_concern 'TextualSummary' -end diff --git a/app/helpers/ems_datawarehouse_helper/textual_summary.rb b/app/helpers/ems_datawarehouse_helper/textual_summary.rb deleted file mode 100644 index c5e0d778663a..000000000000 --- a/app/helpers/ems_datawarehouse_helper/textual_summary.rb +++ /dev/null @@ -1,38 +0,0 @@ -module EmsDatawarehouseHelper::TextualSummary - include TextualMixins::TextualRefreshStatus - # - # Groups - # - - def textual_group_properties - TextualGroup.new(_("Properties"), %i(name type hostname port)) - end - - def textual_group_status - TextualGroup.new(_("Status"), %i(refresh_status refresh_date)) - end - - def textual_group_smart_management - TextualTags.new(_("Smart Management"), %i(tags)) - end - - # - # Items - # - - def textual_name - @record.name - end - - def textual_type - @record.emstype_description - end - - def textual_hostname - @record.hostname - end - - def textual_port - @record.supports_port? ? @record.port : nil - end -end diff --git a/app/presenters/menu/default_menu.rb b/app/presenters/menu/default_menu.rb index c4a0e43182d0..9c38834d1452 100644 --- a/app/presenters/menu/default_menu.rb +++ b/app/presenters/menu/default_menu.rb @@ -115,15 +115,6 @@ def container_menu_section ]) end - def datawarehouse_menu_section - if ::Settings.product.datawarehouse_manager - Menu::Section.new(:dwh, N_("Datawarehouse"), 'pficon pficon-enterprise', [ - Menu::Item.new('ems_datawarehouse', N_('Providers'), 'ems_datawarehouse', - {:feature => 'ems_datawarehouse_show_list'}, '/ems_datawarehouse') - ]) - end - end - def network_menu_section Menu::Section.new(:net, N_("Networks"), 'pficon pficon-network', [ Menu::Item.new('ems_network', N_('Providers'), 'ems_network', {:feature => 'ems_network_show_list'}, '/ems_network'), @@ -290,9 +281,8 @@ def help_menu_section def default_menu [cloud_inteligence_menu_section, services_menu_section, compute_menu_section, configuration_menu_section, - network_menu_section, datawarehouse_menu_section, storage_menu_section, - control_menu_section, automation_menu_section, optimize_menu_section, monitor_menu_section, - settings_menu_section, help_menu_section].compact + network_menu_section, storage_menu_section, control_menu_section, automation_menu_section, + optimize_menu_section, monitor_menu_section, settings_menu_section, help_menu_section].compact end private diff --git a/app/views/ems_datawarehouse/_form.html.haml b/app/views/ems_datawarehouse/_form.html.haml deleted file mode 100644 index 7cad7cf1e597..000000000000 --- a/app/views/ems_datawarehouse/_form.html.haml +++ /dev/null @@ -1,69 +0,0 @@ -- @angular_form = true - -.form-horizontal{'ng-cloak' => '', - 'ng-show' => 'afterGet'} - = render :partial => "layouts/flash_msg" - %div - .form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"} - %label.col-md-2.control-label{"for" => "ems_name"} - = _('Name') - .col-md-8 - %input.form-control{"type" => "text", - "id" => "ems_name", - "name" => "name", - "ng-model" => "emsCommonModel.name", - "maxlength" => ViewHelper::MAX_NAME_LEN.to_s, - "required" => "", - "checkchange" => "", - "auto-focus" => ""} - %span.help-block{"ng-show" => "angularForm.name.$error.required"} - = _("Required") - - .form-group{"ng-class" => "{'has-error': angularForm.emstype.$invalid}"} - %label.col-md-2.control-label{"for" => "ems_type"} - = _('Type') - .col-md-8 - = select_tag('emstype', - options_for_select([["<#{_('Choose')}>", nil]] + @ems_types, :disabled => ["<#{_('Choose')}>", nil]), - "ng-if" => "newRecord", - "ng-model" => "emsCommonModel.emstype", - "ng-change" => "providerTypeChanged()", - "required" => "", - "checkchange" => "", - "selectpicker-for-select-tag" => "") - %div{"ng-if" => "!newRecord"} - %label.form-control{"type" => "text", - "id" => "ems_type", - "name" => "emstype", - "ng-if" => "!newRecord", - "readonly" => true, - "style" => "color: black; font-weight: normal;"} - = @emstype_display - - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} - %label.col-md-2.control-label{"for" => "ems_zone"} - = _("Zone") - .col-md-8 - - if @server_zones.length <= 1 - %input.form-control{"type" => "text", - "id" => "ems_zone", - "name" => "zone", - "ng-model" => "emsCommonModel.zone", - "maxlength" => 15, - "required" => "", - "checkchange" => "", - "readonly" => true, - "style" => "color: black;"} - - else - = select_tag('zone', - options_for_select(@server_zones.sort_by { |name, _name| name }), - "ng-model" => "emsCommonModel.zone", - "checkchange" => "", - "required" => "", - "selectpicker-for-select-tag" => "") - - - %hr - = render :partial => "/layouts/angular/multi_auth_credentials", :locals => {:record => @ems, :ng_model => "emsCommonModel"} - - = render :partial => "layouts/angular/x_edit_buttons_angular", :locals => {:record => @ems, :restful => true} diff --git a/app/views/ems_datawarehouse/_form_fields.html.haml b/app/views/ems_datawarehouse/_form_fields.html.haml deleted file mode 100644 index 610cc8ed880a..000000000000 --- a/app/views/ems_datawarehouse/_form_fields.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- unless @edit[:new][:emstype].blank? - .form-group - %label.control-label.col-md-2 - = _('Hostname or IP address') - .col-md-8 - = text_field_tag("hostname", - @edit[:new][:hostname], - :maxlength => ViewHelper::MAX_HOSTNAME_LEN, - "class" => "form-control", - "data-miq_observe" => {:interval => '.5', :url => url}.to_json, - :title => _('Hostname or IPv4/IPv6 address')) - .form-group - %label.control-label.col-md-2 - = _('Port') - .col-md-8 - = text_field_tag("port", - @edit[:new][:port], - :maxlength => 5, - "class" => "form-control", - "data-miq_observe" => {:interval => '.5', :url => url}.to_json) diff --git a/app/views/ems_datawarehouse/discover.html.haml b/app/views/ems_datawarehouse/discover.html.haml deleted file mode 100644 index 946660d79313..000000000000 --- a/app/views/ems_datawarehouse/discover.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render :partial => "layouts/discover" diff --git a/app/views/ems_datawarehouse/edit.html.haml b/app/views/ems_datawarehouse/edit.html.haml deleted file mode 100644 index b0aaf45c4d16..000000000000 --- a/app/views/ems_datawarehouse/edit.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -= form_for(@ems, - :url => ems_datawarehouse_path(@ems), - :method => :patch, - :html => {"ng-controller" => "emsCommonFormController", - "name" => "angularForm", - "ng-show" => "afterGet", - "update-url" => ems_datawarehouse_path(@ems).to_s, - "form-fields-url" => "/#{controller_name}/ems_datawarehouse_form_fields/", - "novalidate" => true}) do |f| - %input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} - %input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"} - %input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} - = render :partial => "form" - -:javascript - ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); - miq_bootstrap($('#form_id').val()); diff --git a/app/views/ems_datawarehouse/new.html.haml b/app/views/ems_datawarehouse/new.html.haml deleted file mode 100644 index ab7b9976dfca..000000000000 --- a/app/views/ems_datawarehouse/new.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -- url = @ems.persisted? ? ems_datawarehouses_path(@ems) : ems_datawarehouses_path -= form_for(@ems, - :url => url, - :method => :post, - :html => {"ng-controller" => "emsCommonFormController", - "name" => "angularForm", - "ng-show" => "afterGet", - "create-url" => url.to_s, - "form-fields-url" => "/#{controller_name}/ems_datawarehouse_form_fields/", - "novalidate" => true}) do |f| - %input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} - %input{:type => 'hidden', :id => "button_name", :name => "button", :value => "add"} - %input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} - - = render :partial => "form" - -:javascript - ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); - miq_bootstrap($('#form_id').val()); diff --git a/app/views/ems_datawarehouse/show.html.haml b/app/views/ems_datawarehouse/show.html.haml deleted file mode 100644 index 9af1120a11e3..000000000000 --- a/app/views/ems_datawarehouse/show.html.haml +++ /dev/null @@ -1,2 +0,0 @@ --# needed by render :action => "show" in application controller -= render :partial => "shared/views/ems_common/show" diff --git a/app/views/ems_datawarehouse/show_list.html.haml b/app/views/ems_datawarehouse/show_list.html.haml deleted file mode 100644 index 039604839f28..000000000000 --- a/app/views/ems_datawarehouse/show_list.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -#main_div - = render :partial => 'layouts/gtl' diff --git a/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml b/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml index 136c5348df31..cb3891be71b7 100644 --- a/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml +++ b/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml @@ -1,4 +1,4 @@ -- return unless %w(ems_cloud ems_infra ems_container ems_middleware ems_network ems_datawarehouse ems_physical_infra).include?(controller_name) +- return unless %w(ems_cloud ems_infra ems_container ems_middleware ems_network ems_physical_infra).include?(controller_name) - prefix ||= "default" - ng_reqd_hostname ||= true - ng_reqd_api_port ||= true @@ -151,7 +151,6 @@ "emsCommonModel.emstype == 'rhevm' || " + | "emsCommonModel.emstype == 'vmware_cloud' || " + | "emsCommonModel.emstype == 'hawkular' || " + | - "emsCommonModel.emstype == 'hawkular_datawarehouse' || " + | "emsCommonModel.emstype == 'lenovo_ph_infra' || " + | "emsCommonModel.ems_controller == 'ems_container'"} | %label.col-md-2.control-label{"for" => "#{prefix}_api_port"} diff --git a/app/views/layouts/angular/_multi_auth_credentials.html.haml b/app/views/layouts/angular/_multi_auth_credentials.html.haml index 8d36a67e521e..e0f7b038a439 100644 --- a/app/views/layouts/angular/_multi_auth_credentials.html.haml +++ b/app/views/layouts/angular/_multi_auth_credentials.html.haml @@ -54,7 +54,6 @@ .form-group .col-md-12{"ng-if" => "#{ng_model}.ems_controller == 'ems_container' || " + | "#{ng_model}.ems_controller == 'ems_middleware' || " + | - "#{ng_model}.ems_controller == 'ems_datawarehouse' || " + | "#{ng_model}.ems_controller == 'ems_physical_infra' || " + | "#{ng_model}.ems_controller == 'ems_network'"} | = render :partial => "layouts/angular-bootstrap/endpoints_angular", @@ -101,7 +100,7 @@ :id => record.id, :prefix => "default", :ng_reqd_api_port => "false"} - %div{"ng-if" => controller_name != "ems_container" && controller_name != "ems_datawarehouse"} + %div{"ng-if" => controller_name != "ems_container"} = render :partial => "layouts/angular-bootstrap/auth_credentials_angular_bootstrap", :locals => {:ng_show => "true", :ng_model => "#{ng_model}", @@ -111,21 +110,6 @@ :id => record.id, :prefix => "default", :basic_info_needed => true} - %div{"ng-if" => controller_name == "ems_datawarehouse"} - = render :partial => "layouts/angular-bootstrap/auth_credentials_angular_bootstrap", - :locals => {:ng_show => "true", - :ng_model => ng_model.to_s, - :validate_url => validate_url, - :id => record.id, - :prefix => "default", - :ng_show_userid => "false", - :ng_reqd_password => true, - :password_label => _("Token"), - :verify_label => _("Confirm Token"), - :passwd_mismatch => _("Tokens do not match"), - :change_stored_password => _("Change stored token"), - :cancel_password_change => _("Cancel stored token"), - :basic_info_needed => true} %div{"ng-if" => controller_name == "ems_container"} = render :partial => "layouts/angular-bootstrap/auth_credentials_angular_bootstrap", :locals => {:ng_show => "true", @@ -439,7 +423,6 @@ %div{"ng-if" => "#{ng_model}.emstype == 'gce' || " + | "#{ng_model}.emstype == 'scvmm' || " + | "#{ng_model}.emstype == 'lenovo_ph_infra' || " + | - "#{ng_model}.emstype == 'hawkular_datawarehouse' || " + | "#{ng_model}.emstype == 'hawkular'"} | :javascript miq_tabs_show_hide("#amqp_tab", false); diff --git a/app/views/layouts/listnav/_ems_datawarehouse.html.haml b/app/views/layouts/listnav/_ems_datawarehouse.html.haml deleted file mode 100644 index 94944e58ae10..000000000000 --- a/app/views/layouts/listnav/_ems_datawarehouse.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -- if @record.try(:name) - #accordion.panel-group - = miq_accordion_panel(truncate(@record.name, :length => truncate_length), true, "icon") do - = render_quadicon(@record, :mode => :icon, :size => 72, :typ => :listnav) - - = miq_accordion_panel(_("Properties"), false, "ems_datawarehouse_prop") do - %ul.nav.nav-pills.nav-stacked - = li_link(:text => _('Summary'), - :record => @record, - :display => 'main', - :title => _("Show Summary")) - = miq_accordion_panel(_("Relationships"), false, "ems_datawarehouse_rel") do - %ul.nav.nav-pills.nav-stacked - - %w().each do |ent| - = multiple_relationship_link(@record, ent) diff --git a/config/routes.rb b/config/routes.rb index bbba4a4012ec..4e71d49602de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1646,37 +1646,6 @@ save_post }, - :ems_datawarehouse => { - :get => %w( - download_data - download_summary_pdf - ems_datawarehouse_form_fields - show_list - tagging_edit - tag_edit_form_field_changed - ) + - compare_get, - :post => %w( - button - create - dynamic_checkbox_refresh - form_field_changed - listnav_search_selected - quick_search - sections_field_changed - show - show_list - tl_chooser - update - wait_for_task - tagging_edit - tag_edit_form_field_changed - ) + - adv_search_post + - compare_post + - exp_post + - save_post - }, :ems_network => { :get => %w( @@ -3453,7 +3422,7 @@ controller_routes.each do |controller_name, controller_actions| # Default route with no action to controller's index action unless [ - :ems_cloud, :ems_infra, :ems_physical_infra, :ems_container, :ems_middleware, :ems_datawarehouse, :ems_network + :ems_cloud, :ems_infra, :ems_physical_infra, :ems_container, :ems_middleware, :ems_network ].include?(controller_name) match controller_name.to_s, :controller => controller_name, :action => :index, :via => :get end @@ -3496,6 +3465,5 @@ resources :ems_physical_infra, :as => :ems_physical_infras resources :ems_container, :as => :ems_containers resources :ems_middleware, :as => :ems_middlewares - resources :ems_datawarehouse, :as => :ems_datawarehouses resources :ems_network, :as => :ems_networks end diff --git a/product/views/ManageIQ_Providers_DatawarehouseManager.yaml b/product/views/ManageIQ_Providers_DatawarehouseManager.yaml deleted file mode 100644 index e3cbdf92d351..000000000000 --- a/product/views/ManageIQ_Providers_DatawarehouseManager.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: Datawarehouse Providers - -# Menu name -name: EmsDatawarehouse - -# Main DB table report is based on -db: ManageIQ::Providers::DatawarehouseManager - -# Columns to fetch from the main table -cols: -- name -- hostname -- ipaddress -- emstype_description -- port - -# Included tables (joined, has_one, has_many) and columns -include: - -# Included tables and columns for query performance -include_for_find: - :tags: {} - -# Order of columns (from all tables) -col_order: -- name -- hostname -- ipaddress -- port -- emstype_description - -col_formats: -- -- -- -- :string_truncate_50 -- - -# Column titles, in order -headers: -- Name -- Hostname -- IP Address -- Port -- Type - -# Condition(s) string for the SQL query -conditions: - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: diff --git a/spec/controllers/ems_datawarehouse_controller_spec.rb b/spec/controllers/ems_datawarehouse_controller_spec.rb deleted file mode 100644 index e33762584dea..000000000000 --- a/spec/controllers/ems_datawarehouse_controller_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -describe EmsDatawarehouseController do - let!(:server) { EvmSpecHelper.local_miq_server(:zone => zone) } - let(:zone) { FactoryGirl.build(:zone) } - before(:each) do - stub_user(:features => :all) - end - - it "#new" do - controller.instance_variable_set(:@breadcrumbs, []) - get :new - - expect(response.status).to eq(200) - end - - describe "#show" do - before do - session[:settings] = {:views => {}, :quadicons => {}} - EvmSpecHelper.create_guid_miq_server_zone - login_as FactoryGirl.create(:user) - @dwh = FactoryGirl.create(:ems_hawkular_datawarehouse) - end - - subject { get :show, :id => @dwh.id } - - context "render" do - render_views - it { is_expected.to render_template('shared/views/ems_common/show') } - - it do - is_expected.to have_http_status 200 - is_expected.to render_template(:partial => "layouts/listnav/_ems_datawarehouse") - end - end - end - - describe "Datawarehouse - create, update" do - before do - allow(controller).to receive(:check_privileges).and_return(true) - allow(controller).to receive(:assert_privileges).and_return(true) - login_as FactoryGirl.create(:user, :features => "ems_datawarehouse_new") - end - - render_views - - it 'creates on post' do - expect do - post :create, :params => { - "button" => "add", - "cred_type" => "default", - "name" => "lotsofdata", - "emstype" => "hawkular_datawarehouse", - "zone" => zone.name, - "default_hostname" => "lotsofdata.com", - "default_api_port" => "443", - "default_userid" => "", - "default_password" => "VERY_SECRET", - } - end.to change { ManageIQ::Providers::Hawkular::DatawarehouseManager.count }.by(1) - end - - it 'creates and updates an authentication record on post' do - expect do - post :create, :params => { - "button" => "add", - "cred_type" => "default", - "name" => "lotsofdata", - "emstype" => "hawkular_datawarehouse", - "zone" => zone.name, - "default_hostname" => "lotsofdata.com", - "default_userid" => "", - "default_password" => "VERY_SECRET", - } - end.to change { Authentication.count }.by(1) - - expect(response.status).to eq(200) - dwh = ManageIQ::Providers::Hawkular::DatawarehouseManager.where(:name => "lotsofdata").first - expect(dwh.authentications.size).to eq(1) - - expect do - post :update, :params => { - "id" => dwh.id, - "button" => "save", - "cred_type" => "default", - "name" => "not_so_much_data", - "emstype" => "hawkular_datawarehouse", - "default_hostname" => "host_hawkular_updated", - "default_userid" => "", - "default_password" => "MUCH_WOW", - } - end.not_to change { Authentication.count } - - expect(response.status).to eq(200) - dwh.reload - expect(dwh.name).to eq("not_so_much_data") - expect(dwh.authentications.first).to have_attributes(:auth_key => "MUCH_WOW") - end - end - - include_examples '#download_summary_pdf', :ems_hawkular_datawarehouse -end diff --git a/spec/javascripts/fixtures/json/alerts_center/icons_response.json b/spec/javascripts/fixtures/json/alerts_center/icons_response.json index 540b1f5fe7b5..40b6c44ca1e7 100644 --- a/spec/javascripts/fixtures/json/alerts_center/icons_response.json +++ b/spec/javascripts/fixtures/json/alerts_center/icons_response.json @@ -1,5 +1,4 @@ { "ManageIQ::Providers::Kubernetes::ContainerManager::ContainerNode": "/assets/100/container_node-1692bacf91834f0b8ea684497f8107b00039bf3e5c1eeca7d68eb3363f38af67.png", - "ManageIQ::Providers::Openshift::ContainerManager":"/assets/svg/vendor-openshift-1d618a8a9b84a545ce01bf41e996f2614b8cf433e1845fcf953af8ff43788707.svg", - "ManageIQ::Providers::Hawkular::DatawarehouseManager":"/assets/svg/vendor-hawkular-1d618a8a9b84a545ce01bf41e996f2614b8cf433e1845fcf953af8ff43788707.svg" + "ManageIQ::Providers::Openshift::ContainerManager":"/assets/svg/vendor-openshift-1d618a8a9b84a545ce01bf41e996f2614b8cf433e1845fcf953af8ff43788707.svg" } diff --git a/spec/javascripts/fixtures/json/alerts_center/providers_response.json b/spec/javascripts/fixtures/json/alerts_center/providers_response.json index f776f2be1bdf..e5a8a630d1cf 100644 --- a/spec/javascripts/fixtures/json/alerts_center/providers_response.json +++ b/spec/javascripts/fixtures/json/alerts_center/providers_response.json @@ -6,7 +6,7 @@ { "id": 1, "name": "Provider 1", - "type": "ManageIQ::Providers::Hawkular::DatawarehouseManager", + "type": "ManageIQ::Providers::Openshift::ContainerManager", "tags": [ { "id": 1 diff --git a/spec/javascripts/services/alerts_center_service_spec.js b/spec/javascripts/services/alerts_center_service_spec.js index 26cf4c119086..3e47ee468c17 100644 --- a/spec/javascripts/services/alerts_center_service_spec.js +++ b/spec/javascripts/services/alerts_center_service_spec.js @@ -152,12 +152,12 @@ describe('alertsCenterService', function() { expect(alertsList.length).toBe(4); - expect(alertsList[0].objectType).toBe("Hawkular"); - expect(alertsList[0].objectTypeImg).toMatch(/svg\/vendor-hawkular/); + expect(alertsList[0].objectType).toBe("Openshift"); + expect(alertsList[0].objectTypeImg).toMatch(/svg\/vendor-openshift/); expect(alertsList[0].assigned).toBe(true); - expect(alertsList[1].objectType).toBe("Hawkular"); - expect(alertsList[1].objectTypeImg).toMatch(/svg\/vendor-hawkular/); + expect(alertsList[1].objectType).toBe("Openshift"); + expect(alertsList[1].objectTypeImg).toMatch(/svg\/vendor-openshift/); expect(alertsList[1].assigned).toBe(false); expect(alertsList[2].objectType).toBe("Openshift"); diff --git a/spec/routing/ems_datawarehouse_routing_spec.rb b/spec/routing/ems_datawarehouse_routing_spec.rb deleted file mode 100644 index 4ae25e734d54..000000000000 --- a/spec/routing/ems_datawarehouse_routing_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -require "routing/shared_examples" - -describe EmsContainerController do - let(:controller_name) { "ems_datawarehouse" } - %w( - button - form_field_changed - listnav_search_selected - save_default_search - show - show_list - update - ).each do |task| - describe "##{task}" do - it 'routes with POST' do - expect(post("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}") - end - end - end - - describe "#index" do - it "routes with GET" do - expect(get("/#{controller_name}")).to route_to("#{controller_name}#index") - end - end - - describe "#create" do - it "routes with POST" do - expect(post("/#{controller_name}")).to route_to("#{controller_name}#create") - end - end - - describe "#edit" do - it "routes with GET" do - expect(get("/#{controller_name}/123/edit")).to route_to("#{controller_name}#edit", :id => "123") - end - end - - describe "#show" do - it "routes with GET" do - expect(get("/#{controller_name}/123")).to route_to("#{controller_name}#show", :id => "123") - end - end - - describe "#update" do - it "routes with POST" do - expect(post("/#{controller_name}/update/123")).to route_to("#{controller_name}#update", :id => "123") - end - end -end