Skip to content

Commit

Permalink
Fixes #38112 - Order LCEs by LCE path in Content View GUI and Hammer
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanshekar committed Dec 18, 2024
1 parent 363db98 commit 2ee377e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/models/katello/content_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ def latest_version_id
end

def latest_version_env
latest_version_object.try(:environments) || []
environments = organization.readable_promotion_paths.flatten
environments.insert(0, organization.library)
environments.intersection(latest_version_object.try(:environments) || [])
end

def last_task
Expand Down
6 changes: 6 additions & 0 deletions app/models/katello/content_view_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def to_s
name
end

def sorted_content_view_environments
content_view_environments = organization.readable_promotion_paths.flatten
content_view_environments.insert(0, organization.library)
content_view_environments.intersection(environments)
end

def self.contains_file(file_unit_id)
where(id: Katello::Repository.where(id: Katello::RepositoryFileUnit.where(file_unit_id: file_unit_id).select(:repository_id)).select(:content_view_version_id))
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end
extends 'katello/api/v2/common/timestamps'

version = @object || @resource
child :environments => :environments do
child :sorted_content_view_environments => :environments do
attributes :id, :name, :label

node :publish_date do |env|
Expand Down

0 comments on commit 2ee377e

Please sign in to comment.