Skip to content

Commit

Permalink
Fixes #36401 - Update content_facet rabl to show multi_env like in db (
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1984 authored Jun 20, 2023
1 parent 3cb9f1a commit 85e4eae
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app/views/katello/api/v2/content_facet/base.json.rabl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
attributes :id, :uuid
attributes :content_view_id, :content_view_name
attributes :lifecycle_environment_id, :lifecycle_environment_name
attributes :content_source_id, :content_source_name
attributes :kickstart_repository_id, :kickstart_repository_name
attributes :errata_counts
Expand All @@ -10,6 +8,15 @@ attributes :applicable_rpm_count => :applicable_package_count
attributes :upgradable_rpm_count => :upgradable_package_count
attributes :applicable_module_stream_count, :upgradable_module_stream_count

child :content_view_environments => :content_view_environments do
node :content_view do |cve|
{ id: cve.content_view.id, name: cve.content_view.name, composite: cve.content_view.composite }
end
node :lifecycle_environment do |cve|
{ id: cve.lifecycle_environment.id, name: cve.lifecycle_environment.name }
end
end

node :content_view do |content_facet|
content_view = content_facet.single_content_view
if content_view.present?
Expand All @@ -31,14 +38,6 @@ node :lifecycle_environment do |content_facet|
end
end

child :content_views => :content_views do
attributes :id, :name, :composite
end

child :lifecycle_environments => :lifecycle_environments do
attributes :id, :name
end

child :content_source => :content_source do
attributes :id, :name, :url
end
Expand Down

0 comments on commit 85e4eae

Please sign in to comment.