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 0a53f0655098..ef1a1596d25f 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 @@ -117,6 +117,7 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', ' $scope.emsCommonModel.name = data.name; $scope.emsCommonModel.emstype = data.emstype; $scope.emsCommonModel.zone = data.zone; + $scope.emsCommonModel.zone_hidden = data.zone_hidden; $scope.emsCommonModel.tenant_mapping_enabled = data.tenant_mapping_enabled; $scope.emsCommonModel.hostname = data.hostname; $scope.emsCommonModel.default_hostname = data.default_hostname; diff --git a/app/controllers/mixins/ems_common_angular.rb b/app/controllers/mixins/ems_common_angular.rb index e9e98b5bc76a..5d8b1a218178 100644 --- a/app/controllers/mixins/ems_common_angular.rb +++ b/app/controllers/mixins/ems_common_angular.rb @@ -361,6 +361,7 @@ def ems_form_fields render :json => {:name => @ems.name, :emstype => @ems.emstype, :zone => zone, + :zone_hidden => zone == Zone::MAINTENANCE_ZONE_NAME, :tenant_mapping_enabled => @ems.tenant_mapping_enabled == true, :provider_id => @ems.provider_id || "", :hostname => @ems.hostname, @@ -397,6 +398,7 @@ def ems_form_fields render :json => { :name => @ems.name, :emstype => @ems.emstype, :zone => zone, + :zone_hidden => zone == Zone::MAINTENANCE_ZONE_NAME, :provider_id => @ems.provider_id || "", :default_hostname => @ems.connection_configurations.default.endpoint.hostname, :amqp_hostname => amqp_hostname, @@ -441,6 +443,7 @@ def ems_form_fields render :json => {:name => @ems.name, :emstype => @ems.emstype, :zone => zone, + :zone_hidden => zone == Zone::MAINTENANCE_ZONE_NAME, :hostname => @ems.hostname, :default_hostname => @ems.connection_configurations.default.endpoint.hostname, :default_api_port => @ems.connection_configurations.default.endpoint.port, diff --git a/app/views/configuration_manager/_shared_form.html.haml b/app/views/configuration_manager/_shared_form.html.haml index 8403228c7441..1c969b2523f6 100644 --- a/app/views/configuration_manager/_shared_form.html.haml +++ b/app/views/configuration_manager/_shared_form.html.haml @@ -23,7 +23,7 @@ "auto-focus" => ""} %span.help-block{"ng-show" => "angularForm.name.$error.required"} = _("Required") - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} + .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!emsCommonModel.zone_hidden"} %label.col-md-2.control-label{"for" => "prov_zone"} = _("Zone") .col-md-8 diff --git a/app/views/ems_container/_form.html.haml b/app/views/ems_container/_form.html.haml index d61d974ed25a..568781bb6202 100644 --- a/app/views/ems_container/_form.html.haml +++ b/app/views/ems_container/_form.html.haml @@ -41,7 +41,7 @@ "style" => "color: black; font-weight: normal;"} = @emstype_display - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} + .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!emsCommonModel.zone_hidden"} %label.col-md-2.control-label{"for" => "ems_zone"} = _("Zone") .col-md-4 diff --git a/app/views/ems_infra/_form.html.haml b/app/views/ems_infra/_form.html.haml index 43b074730287..2b697c020d8b 100644 --- a/app/views/ems_infra/_form.html.haml +++ b/app/views/ems_infra/_form.html.haml @@ -50,7 +50,7 @@ "checkchange" => "", "selectpicker-for-select-tag" => "") - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} + .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!emsCommonModel.zone_hidden"} %label.col-md-2.control-label{"for" => "ems_zone"} = _("Zone") .col-md-4 diff --git a/app/views/ems_physical_infra/_form.html.haml b/app/views/ems_physical_infra/_form.html.haml index 8c7263d5b6ae..be3627265d84 100644 --- a/app/views/ems_physical_infra/_form.html.haml +++ b/app/views/ems_physical_infra/_form.html.haml @@ -40,7 +40,7 @@ "style" => "color: black; font-weight: normal;"} = @emstype_display - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} + .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!emsCommonModel.zone_hidden"} %label.col-md-2.control-label{"for" => "ems_zone"} = _("Zone") .col-md-8 diff --git a/app/views/shared/views/ems_common/angular/_form.html.haml b/app/views/shared/views/ems_common/angular/_form.html.haml index 3280ee3e8b2f..1e46a2e6ad03 100644 --- a/app/views/shared/views/ems_common/angular/_form.html.haml +++ b/app/views/shared/views/ems_common/angular/_form.html.haml @@ -177,7 +177,7 @@ "checkchange" => "", "selectpicker-for-select-tag" => "") - .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"} + .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!emsCommonModel.zone_hidden"} %label.col-md-2.control-label{"for" => "ems_zone"} = _("Zone") .col-md-4