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

Fixes #38112 - Order LCEs by LCE path in Content View GUI and Hammer #11267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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_organization_readable_environments
organization_readable_environments = organization.readable_promotion_paths.flatten
organization_readable_environments.insert(0, organization.library)
organization_readable_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_organization_readable_environments => :environments do
attributes :id, :name, :label

node :publish_date do |env|
Expand Down
Loading