-
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.
Show staging project and its status and checks inside staging workflow. Co-authored-by: David Kang <dkang@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Co-authored-by: Victor Pereira <vpereira@suse.com>
- Loading branch information
1 parent
e69abf8
commit 9a93fbc
Showing
14 changed files
with
121 additions
and
11 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
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
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
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,9 @@ | ||
module Webui::Staging::ProjectHelper | ||
def icon_for_checks(checks, missing_checks) | ||
return 'fa-eye text-info' if missing_checks.present? | ||
return 'fa-check-circle text-primary' if checks.blank? | ||
return 'fa-eye text-info' if checks.any?(&:pending?) | ||
return 'fa-check-circle text-primary' if checks.all?(&:success?) | ||
'fa-exclamation-circle text-danger' | ||
end | ||
end |
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
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
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
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/webui/staging/projects/_breadcrumb_items.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,4 @@ | ||
= render partial: 'webui/staging/workflows/breadcrumb_items' | ||
- if controller_name == 'projects' && action_name == 'show' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
= @staging_project.name |
16 changes: 16 additions & 0 deletions
16
src/api/app/views/webui2/webui/staging/projects/_checks.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 @@ | ||
%td.p-2.w-25.font-weight-bold | ||
%i.mr-2.fas{ class: icon_for_checks(checks, missing_checks) } | ||
Checks | ||
%td.p-2 | ||
- if checks.blank? && missing_checks.blank? | ||
None | ||
- else | ||
%ul | ||
- missing_checks.each do |name| | ||
%li | ||
%span.check-pending | ||
#{name} (Expected - Waiting for status to be reported) | ||
- checks.each do |check| | ||
%li | ||
= link_to "#{check.name} (#{check.state} - #{time_ago_in_words(check.updated_at)} ago)", check.url, | ||
class: "check-#{check.state}", title: "#{check.short_description} (#{check.updated_at})" |
21 changes: 21 additions & 0 deletions
21
src/api/app/views/webui2/webui/staging/projects/_status_items.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,21 @@ | ||
%td.p-2.w-25.font-weight-bold | ||
%i.mr-2.fas{ class: items.empty? ? 'fa-check-circle text-primary' : 'fa-exclamation-triangle text-warning' } | ||
= type.humanize | ||
%td.p-2 | ||
- if items.empty? | ||
None | ||
- else | ||
- items.each_with_index do |item, index| | ||
= succeed "#{',' if index < items.size - 1}" do | ||
:ruby | ||
case type | ||
when 'untracked_requests', 'obsolete_requests' | ||
link_to("##{item.number} (#{item.state})", request_show_path(item.number)) | ||
when 'missing_reviews' | ||
link_to("#{item[:package]} by #{item[:by]}", request_show_path(item[:request])) | ||
when 'building_repositories' | ||
link_to("#{item['repository']}-#{item['arch']} (#{item['state']})", | ||
project_repository_state_path(project: @staging_project.name, repository: item['repository'])) | ||
when 'broken_packages' | ||
link_to("#{item[:package]} (#{item[:state]})", package_show_path(project: item[:project], package: item[:package])) | ||
end |
35 changes: 35 additions & 0 deletions
35
src/api/app/views/webui2/webui/staging/projects/show.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,35 @@ | ||
- @pagetitle = @staging_project.name | ||
|
||
.row | ||
.col-xl-10 | ||
.card.mb-3 | ||
= render(partial: 'webui2/webui/project/tabs', locals: { project: @staging_project }) | ||
.card-body | ||
%h3= @pagetitle | ||
%h4.mt-4 Packages | ||
.card.mb-3 | ||
%h5.card-header Status | ||
.card-body | ||
%table.table.table-striped.table-borderless.table-sm.dt-responsive.w-100 | ||
%tbody | ||
%tr | ||
= render partial: 'status_items', | ||
locals: { staging_project: @staging_project, items: @staging_project.untracked_requests, type: 'untracked_requests' } | ||
%tr | ||
= render partial: 'status_items', | ||
locals: { staging_project: @staging_project, items: @staging_project.staged_requests.obsolete, type: 'obsolete_requests' } | ||
%tr | ||
= render partial: 'status_items', | ||
locals: { staging_project: @staging_project, items: @staging_project.missing_reviews, type: 'missing_reviews' } | ||
%tr | ||
= render partial: 'status_items', | ||
locals: { staging_project: @staging_project, items: @staging_project.building_repositories, type: 'building_repositories' } | ||
%tr | ||
= render partial: 'status_items', | ||
locals: { staging_project: @staging_project, items: @staging_project.broken_packages, type: 'broken_packages' } | ||
%tr | ||
= render partial: 'checks', | ||
locals: { checks: @staging_project.all_checks, | ||
missing_checks: @staging_project.all_missing_checks } | ||
.col-xl-2 | ||
= render partial: 'webui/staging/shared/legend' |
File renamed without changes.
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
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