Skip to content

Commit

Permalink
Render 'layouts/empty' partial correctly.
Browse files Browse the repository at this point in the history
Render 'layouts/empty' partial when replacing right cell after accordion is switched from "Configured Systems" to "Providers" when there are no Foreman Providers in the database.
Also render "layouts/empty" partial from explorer view only when active tree is Providers tree, existing code was rendering empty partial when returning back to explorer if "Configured Systems" was the last active accordion.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1741310
  • Loading branch information
h-kataria committed Feb 25, 2020
1 parent 3710c3c commit cd18bb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/controllers/provider_foreman_controller.rb
Expand Up @@ -202,6 +202,7 @@ def validate_before_save?
def provider_active_tree?
x_active_tree == :configuration_manager_providers_tree
end
helper_method(:provider_active_tree?)

private

Expand Down Expand Up @@ -389,6 +390,10 @@ def update_partials(record_showing, presenter)
presenter.hide(:form_buttons_div)
presenter.update(:main_div, r[:partial => "configuration_profile",
:locals => {:controller => controller_name}])
elsif ManageIQ::Providers::ConfigurationManager.none? && provider_active_tree?
presenter.update(:main_div, r[:partial => "layouts/empty",
:locals => {:add_message => _("Add a new Configuration Management Provider"),
:documentation => ::Settings.docs.configuration_provider}])
else
presenter.update(:main_div, r[:partial => 'layouts/x_gtl'])
end
Expand Down
7 changes: 4 additions & 3 deletions app/views/provider_foreman/explorer.html.haml
Expand Up @@ -22,10 +22,11 @@
= render(:partial => 'provider_foreman/configuration_script', :locals => {:controller => "provider_foreman"})
- else
#main_div
- if ManageIQ::Providers::ConfigurationManager.any?
= render(:partial => 'layouts/x_gtl')
- else
- if ManageIQ::Providers::ConfigurationManager.none? && provider_active_tree?
= render :partial => 'layouts/empty',
:locals => {:add_message => _("Add a new Configuration Management Provider"),
:documentation => ::Settings.docs.configuration_provider}
- else
= render(:partial => 'layouts/x_gtl')


0 comments on commit cd18bb1

Please sign in to comment.