Skip to content

Commit

Permalink
Do not display the zone when editing a paused foreman/ansible prov
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jan 30, 2019
1 parent c748ab5 commit 0f86afd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ManageIQ.angular.app.controller('configurationManagerFormController', ['$http',

vm.configurationManagerModel.name = data.name;
vm.configurationManagerModel.zone = data.zone;
vm.configurationManagerModel.zone_hidden = data.zone_hidden;
vm.configurationManagerModel.url = data.url;
vm.configurationManagerModel.verify_ssl = data.verify_ssl === 1;
vm.configurationManagerModel.default_userid = data.default_userid;
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/mixins/manager_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def form_fields

render :json => {:name => provider.name,
:zone => provider.zone.name,
:zone_hidden => !manager.enabled?,
:url => provider.url,
:verify_ssl => provider.verify_ssl,
:default_userid => provider.authentications.first.userid,
Expand Down Expand Up @@ -341,7 +342,7 @@ def sync_form_to_instance
@provider.name = params[:name]
@provider.url = params[:url]
@provider.verify_ssl = params[:verify_ssl].eql?("on") || params[:verify_ssl].eql?("true")
@provider.zone = Zone.find_by(:name => params[:zone].to_s)
@provider.zone = Zone.find_by(:name => params[:zone].to_s) if params[:zone]
end

def provider_list(id, model)
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}", "ng-if" => "!emsCommonModel.zone_hidden"}
.form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!vm.configurationManagerModel.zone_hidden"}
%label.col-md-2.control-label{"for" => "prov_zone"}
= _("Zone")
.col-md-8
Expand Down

0 comments on commit 0f86afd

Please sign in to comment.