Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2075 from mschnitzer/fix_icon_bug_5
[webui] add titles/popovers for build states
- Loading branch information
Showing
8 changed files
with
112 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Webui::BuildresultHelper | ||
def arch_repo_table_cell(repo, arch, package_name) | ||
status = @statushash[repo][arch][package_name] || { 'package' => package_name } | ||
status_id = valid_xml_id("id-#{package_name}_#{repo}_#{arch}") | ||
link_title = status['details'] | ||
if status['code'] | ||
code = status['code'] | ||
theclass = 'status_' + code.gsub(/[- ]/, '_') | ||
else | ||
code = '' | ||
theclass = ' ' | ||
end | ||
|
||
result = content_tag(:td, class: [theclass, "buildstatus", "nowrap"]) do | ||
if %w(- unresolvable blocked excluded scheduled).include?(code) | ||
concat link_to(code, '#', title: link_title, id: status_id, class: code) | ||
else | ||
concat link_to(code.gsub(/\s/, ' '), | ||
{ | ||
action: :live_build_log, package: package_name, project: @project.to_s, | ||
arch: arch, controller: 'package', repository: repo | ||
}, | ||
{ title: link_title, rel: 'nofollow' } | ||
) | ||
end | ||
|
||
if status['code'] | ||
concat " " | ||
concat sprite_tag('help', title: Buildresult.status_description(status['code'])) | ||
end | ||
end | ||
|
||
result | ||
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
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,13 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Buildresult do | ||
describe '#status_description' do | ||
it "returns a message when a status code is unknown" do | ||
expect(Buildresult.status_description("unknown_status")).to eq("status explanation not found") | ||
end | ||
|
||
it "returns an explanation for a status" do | ||
expect(Buildresult.status_description("succeeded")).not_to eq("status explanation not found") | ||
end | ||
end | ||
end |