Skip to content

Commit

Permalink
Merge pull request #9207 from jeffbonson/fix-child-services-link
Browse files Browse the repository at this point in the history
Fix child services link
  • Loading branch information
GilbertCherrie authored Jun 20, 2024
2 parents b63e5bb + 5e32298 commit 8adaffa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
16 changes: 16 additions & 0 deletions app/helpers/service_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
module ServiceHelper
include TextualSummary

def child_service_summary(child_services)
rows = []
data = {:title => _("Child Services"), :mode => "miq_child_services"}
child_services.sort_by { |o| o.name.downcase }.each do |service|
rows.push(
{
:cells => [{:icon => 'pficon pficon-service', :value => service.name}],
:title => _("View this Service"),
:onclick => {:url => "/service/show/#{service.id}"},
}
)
end
data[:rows] = rows
miq_structured_list(data)
end
end
11 changes: 1 addition & 10 deletions app/views/service/_svcs_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@
- unless child_services.blank?
.row
.col-md-12.col-lg-6
%h3
= _('Child Services')
%table.table.table-striped.table-bordered.table-hover
%tbody
- child_services.sort_by { |o| o.name.downcase }.each do |s|
%tr{:onclick => "miqTreeSelect('s-#{s.id}');", :title => _("View this Service")}
%td.table-view-pf-select
%i.pficon.pficon-service
%td
= h(s.name)
= child_service_summary(child_services)
.row
.col-md-12
%h3
Expand Down

0 comments on commit 8adaffa

Please sign in to comment.