Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Provider PhysicalSwitches page summary show #3954

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def controller_to_model
"OsProcess" => "processes",
"scan_histories" => "scan_histories",
"based_volumes" => "based_volumes",
"PersistentVolume" => "persistent_volumes"
"PersistentVolume" => "persistent_volumes",
"PhysicalSwitch" => "physical_switches"
}.freeze

def model_to_report_data
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/ems_physical_infra_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def textual_physical_racks
end

def textual_physical_switches
textual_link(@record.physical_switches)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most likely, adding :as => PhysicalSwitch would have the same effect

More to the point, the new code does not use role_allows?, so it can't stay as is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that, this was an old solution that I put before fixing the base model for PhysicalSwitch. I put back the textual link call, which is working with new solution.

textual_link(@record.physical_switches, :as => PhysicalSwitch)
end

def textual_physical_servers
Expand Down
4 changes: 4 additions & 0 deletions app/views/layouts/listnav/_ems_physical_infra.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
= miq_accordion_panel(_("Relationships"), false, "ems_rel") do
%ul.nav.nav-pills.nav-stacked
%li
= li_link(:count => @record.number_of(:physical_switches),
:text => _('Physical Switches'),
:record => @record,
:display => 'physical_switches')
= li_link(:count => @record.number_of(:physical_servers),
:tables => 'physical_servers',
:record => @record,
Expand Down