Project

General

Profile

« Previous | Next » 

Revision 984a8793

Added by Shimon Shtein over 8 years ago

Fixes #12794 - Defined logic when properties should be sent to server

If hostgroup is not set - always send the parameters.
On hostgroup change - remove inherited parameters from the request, so the values from the hostgroup will take place.
On save - send the values according to the state of the "inherit" button.

(cherry picked from commit d94f4d361dd9ca35a41cee1e00f72476200c8238)

View differences:

app/views/hosts/_form.html.erb
{ :include_blank => true,
:disable_button => _(HostsAndHostgroupsHelper::INHERIT_TEXT),
:disable_button_enabled => inherited_by_default?(:compute_profile_id, @host),
:user_set => params[:host] && params[:host][:compute_profile_id]
:user_set => user_set?(:compute_profile_id)
},
{ :label => _("Compute profile"), :'data-url' => compute_resource_selected_hosts_path,
:onchange => 'computeResourceSelected(this);',
......
<%= select_f f, :environment_id, Environment.with_taxonomy_scope_override(@location,@organization).order(:name), :id, :to_label, { :include_blank => true,
:disable_button => _(HostsAndHostgroupsHelper::INHERIT_TEXT),
:disable_button_enabled => inherited_by_default?(:environment_id, @host),
:user_set => params[:host] && params[:host][:environment_id]
:user_set => user_set?(:environment_id)
},
{:onchange => 'update_puppetclasses(this)', :'data-url' => hostgroup_or_environment_selected_hosts_path,
:'data-host-id' => @host.id, :help_inline => :indicator} %>

Also available in: Unified diff