Skip to content

Commit

Permalink
Hide the zone in the provider edit form if the provider is suspended
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jul 11, 2018
1 parent 2412a34 commit fbd5e21
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/views/configuration_manager/_shared_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_container/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_infra/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_physical_infra/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/views/ems_common/angular/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbd5e21

Please sign in to comment.