Project

General

Profile

« Previous | Next » 

Revision b9df73be

Added by Ohad Levy about 7 years ago

fixes #19479, #10587, #19500 - two pane notifications are visible

- notification is now inside the content div, allowing two-pane server
responses to include it.
- refactored all notifications to use notification helpers (notice,
warning and error) instead of direct flash manipulation
- also added the usage of flash now via the helpers, and fixed
it in a couple of places it was used incorrectly (mostly clone rendering
which does not redirect at all).
- fixed consisteny to remove trailing dots from toast messages (as it
seems most strings are without dot suffix).
- safer handing if notification div or its data is undefined.

View differences:

app/controllers/concerns/foreman/controller/puppet/hosts_controller_extensions.rb
if failed_hosts.empty?
if proxy
notice _('The %{proxy_type} proxy of the selected hosts was set to %{proxy_name}.') % {:proxy_name => proxy.name, :proxy_type => proxy_type}
notice _('The %{proxy_type} proxy of the selected hosts was set to %{proxy_name}') % {:proxy_name => proxy.name, :proxy_type => proxy_type}
else
notice _('The %{proxy_type} proxy of the selected hosts was cleared.') % {:proxy_type => proxy_type}
end
else
error n_("The %{proxy_type} proxy could not be set for host: %{host_names}.",
"The %{proxy_type} puppet ca proxy could not be set for hosts: %{host_names}.",
"The %{proxy_type} puppet ca proxy could not be set for hosts: %{host_names}",
failed_hosts.count) % {:proxy_type => proxy_type, :host_names => failed_hosts.map {|h, err| "#{h} (#{err})"}.to_sentence}
end
redirect_back_or_to hosts_path
......
end
else
error n_("The %{proxy_type} proxy could not be set for host: %{host_names}.",
"The %{proxy_type} puppet ca proxy could not be set for hosts: %{host_names}.",
"The %{proxy_type} puppet ca proxy could not be set for hosts: %{host_names}",
errors.count) % {:proxy_type => proxy_type, :host_names => errors.map {|h, err| "#{h} (#{err})"}.to_sentence}
end
end

Also available in: Unified diff