-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit the number of build problems shown in staging project
The list can get quite long and for consistency with the old staging workflow (obs_factory). Co-authored-by: Ana María Martínez Gómez <ammartinez@suse.de>
- Loading branch information
1 parent
f0c46fe
commit ae102f9
Showing
3 changed files
with
40 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
src/api/app/views/webui2/webui/staging/workflows/_problems.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
:ruby | ||
max_problems = 5 | ||
project_class = project.name.tr(':', '_') | ||
item_project_class = 'hidden-item-' + project_class | ||
|
||
- if project.problems.empty? | ||
.text-center | ||
%i.fas.fa-check-circle.fa-2x.text-success | ||
- else | ||
%ul.list-group.list-group-flush | ||
- project.problems.each do |name, states| | ||
%li.list-group-item.table-list-group-item | ||
= link_to("#{name}:", package_show_path(package: name, project: project)) | ||
- states.each do |state, values| | ||
= state | ||
= surround '(', ')' do | ||
- values.each do |value| | ||
- coma = ', ' unless values.last == value | ||
= succeed coma do | ||
- if state == 'unresolvable' | ||
= value[:arch] | ||
- else | ||
= link_to(value[:arch], package_live_build_log_path(package: name, | ||
repository: value[:repository], | ||
project: project, | ||
arch: value[:arch])) | ||
= render partial: 'problems_item', locals: { project: project, index: 1..(max_problems - 1) } | ||
|
||
%span.collapse{ 'id': item_project_class } | ||
= render partial: 'problems_item', locals: { project: project, index: max_problems..-1 } | ||
|
||
- length = project.problems.length | ||
- if project.problems.length > max_problems | ||
- number = length - max_problems | ||
%li.list-group-item.table-list-group-item | ||
%a.collapse-link{ 'data-toggle': 'collapse', href: "##{item_project_class}", 'aria-expanded': 'false' } | ||
%span.more See #{number} more | ||
%span.less See #{number} less |
16 changes: 16 additions & 0 deletions
16
src/api/app/views/webui2/webui/staging/workflows/_problems_item.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- project.problems[index].each do |name, states| | ||
%li.list-group-item.table-list-group-item | ||
= link_to("#{name}:", package_show_path(package: name, project: project)) | ||
- states.each do |state, values| | ||
= state | ||
= surround '(', ')' do | ||
- values.each do |value| | ||
- coma = ', ' unless values.last == value | ||
= succeed coma do | ||
- if state == 'unresolvable' | ||
= value[:arch] | ||
- else | ||
= link_to(value[:arch], package_live_build_log_path(package: name, | ||
repository: value[:repository], | ||
project: project, | ||
arch: value[:arch])) |