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

Display multibuild flavors when asking for local project sources #16915

Closed
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 src/api/app/controllers/source_project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def render_project_issues
end

def render_project_packages
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.pluck(:name)
# TODO: Display multibuild flavors when passing the expand param
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.sort_by(&:name)
render locals: { expand: params.key?(:expand) }, formats: [:xml]
end

Expand Down
11 changes: 8 additions & 3 deletions src/api/app/views/source_project/show.xml.builder
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
xml.directory(count: @packages.count) do
@packages.map do |name, project|
@packages.map do |package, project|
if expand
xml.entry(name: name, originproject: project)
xml.entry(name: package, originproject: project)
elsif package.multibuild?
xml.entry(name: package.name)
package.multibuild_flavors.each do |flavor|
xml.entry(name: "#{package.name}:#{flavor}", originpackage: package.name)
end
else
xml.entry(name: name)
xml.entry(name: package)
end
end
end