use states instead of result
This commit is contained in:
parent
f6975e5b02
commit
395918a406
|
@ -9,6 +9,9 @@ Handlebars.registerHelper 'tipsy', (text, tip) ->
|
|||
Handlebars.registerHelper 't', (key) ->
|
||||
safe I18n.t(key)
|
||||
|
||||
Ember.registerBoundHelper 'capitalize', (value, options) ->
|
||||
safe $.capitalize(value)
|
||||
|
||||
Ember.registerBoundHelper 'formatTime', (value, options) ->
|
||||
safe Travis.Helpers.timeAgoInWords(value) || '-'
|
||||
|
||||
|
|
|
@ -2,6 +2,13 @@ require 'travis/log'
|
|||
require 'config/emoij'
|
||||
|
||||
@Travis.Helpers =
|
||||
COLORS:
|
||||
default: 'yellow'
|
||||
passed: 'green'
|
||||
failed: 'red'
|
||||
errored: 'gray'
|
||||
canceled: 'gray'
|
||||
|
||||
compact: (object) ->
|
||||
result = {}
|
||||
(result[key] = value unless $.isEmpty(value)) for key, value of object || {}
|
||||
|
@ -10,8 +17,8 @@ require 'config/emoij'
|
|||
safe: (string) ->
|
||||
new Handlebars.SafeString(string)
|
||||
|
||||
colorForResult: (result) ->
|
||||
(if result is 0 then 'green' else (if result is 1 then 'red' else null))
|
||||
colorForState: (state) ->
|
||||
Travis.Helpers.COLORS[state] || Travis.Helpers.COLORS['default']
|
||||
|
||||
formatCommit: (sha, branch) ->
|
||||
Travis.Helpers.formatSha(sha) + if branch then " (#{branch})" else ''
|
||||
|
|
|
@ -9,7 +9,6 @@ require 'travis/model'
|
|||
number: DS.attr('number')
|
||||
branch: DS.attr('string')
|
||||
message: DS.attr('string')
|
||||
result: DS.attr('number')
|
||||
_duration: DS.attr('number', key: 'duration')
|
||||
startedAt: DS.attr('string', key: 'started_at')
|
||||
finishedAt: DS.attr('string', key: 'finished_at')
|
||||
|
@ -61,7 +60,7 @@ require 'travis/model'
|
|||
Travis.ajax.post '/requests', build_id: @get('id')
|
||||
|
||||
isAttributeLoaded: (key) ->
|
||||
if ['_duration', 'finishedAt', 'result'].contains(key) && !@get('finished')
|
||||
if ['_duration', 'finishedAt', 'state'].contains(key) && !@get('finished')
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
|
|
@ -11,9 +11,9 @@ require 'travis/model'
|
|||
@get('event')
|
||||
).property('event')
|
||||
|
||||
result: (->
|
||||
@get('data.data.result')
|
||||
).property('data.data.result')
|
||||
state: (->
|
||||
@get('data.data.state')
|
||||
).property('data.data.state')
|
||||
|
||||
message: (->
|
||||
@get('data.data.message')
|
||||
|
|
|
@ -9,7 +9,6 @@ require 'travis/model'
|
|||
queue: DS.attr('string')
|
||||
state: DS.attr('string')
|
||||
number: DS.attr('string')
|
||||
result: DS.attr('number')
|
||||
startedAt: DS.attr('string')
|
||||
finishedAt: DS.attr('string')
|
||||
allowFailure: DS.attr('boolean', key: 'allow_failure')
|
||||
|
@ -83,7 +82,7 @@ require 'travis/model'
|
|||
).observes('state')
|
||||
|
||||
isAttributeLoaded: (key) ->
|
||||
if ['finishedAt', 'result'].contains(key) && !@get('finished')
|
||||
if ['finishedAt', 'state'].contains(key) && !@get('finished')
|
||||
return true
|
||||
else if key == 'startedAt' && @get('state') == 'created'
|
||||
return true
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'travis/model'
|
|||
description: DS.attr('string')
|
||||
lastBuildId: DS.attr('number')
|
||||
lastBuildNumber: DS.attr('string')
|
||||
lastBuildResult: DS.attr('number')
|
||||
lastBuildState: DS.attr('string')
|
||||
lastBuildStartedAt: DS.attr('string')
|
||||
lastBuildFinishedAt: DS.attr('string')
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
<a {{action showBuild repo this href=true}}>{{number}}</a>
|
||||
{{/with}}
|
||||
</dd>
|
||||
<dt>{{t builds.state}}</dt>
|
||||
<dd class="state">{{capitalize build.state}}</dd>
|
||||
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime build.finishedAt}}</dd>
|
||||
<dt>{{t builds.duration}}</dt>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<td class="event">
|
||||
{{event.event_}}
|
||||
</td>
|
||||
<td class="result">
|
||||
{{event.result}}
|
||||
<td class="state">
|
||||
{{event.state}}
|
||||
</td>
|
||||
<td class="message">
|
||||
{{event.message}}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<a {{action showJob repo job href=true}}>{{job.number}}</a>
|
||||
{{/if}}
|
||||
</dd>
|
||||
<dt>{{t jobs.state}}</dt>
|
||||
<dd class="state">{{capitalize job.state}}</dd>
|
||||
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime job.finishedAt}}</dd>
|
||||
<dt>{{t jobs.duration}}</dt>
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
commitBinding: 'build.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@get('build.result'))
|
||||
).property('build.result')
|
||||
Travis.Helpers.colorForState(@get('build.state'))
|
||||
).property('build.state')
|
||||
|
||||
urlBuild: (->
|
||||
Travis.Urls.build(@get('repo.slug'), @get('build.id'))
|
||||
|
@ -59,8 +59,8 @@
|
|||
).property('build.isLoaded')
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@get('build.result'))
|
||||
).property('build.result')
|
||||
Travis.Helpers.colorForState(@get('build.state'))
|
||||
).property('build.state')
|
||||
|
||||
urlBuild: (->
|
||||
Travis.Urls.build(@get('repo.slug'), @get('build.id'))
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
jobBinding: 'context'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@get('job.result'))
|
||||
).property('job.result')
|
||||
Travis.Helpers.colorForState(@get('job.state'))
|
||||
).property('job.state')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@get('repo.slug'), @get('job.id'))
|
||||
|
@ -27,8 +27,8 @@
|
|||
currentItemBinding: 'job'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@get('job.result'))
|
||||
).property('job.result')
|
||||
Travis.Helpers.colorForState(@get('job.state'))
|
||||
).property('job.state')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@get('repo.slug'), @get('job.id'))
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
selectedBinding: 'repo.selected'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@get('repo.lastBuildResult'))
|
||||
).property('repo.lastBuildResult')
|
||||
Travis.Helpers.colorForState(@get('repo.lastBuildState'))
|
||||
).property('repo.lastBuildState')
|
||||
|
||||
urlRepo: (->
|
||||
Travis.Urls.repo(@get('repo.slug'))
|
||||
|
|
|
@ -149,9 +149,6 @@
|
|||
).property('hasPermissions')
|
||||
|
||||
canCancelJob: (->
|
||||
console.log @get('isJobTab')
|
||||
console.log @get('job.canCancel')
|
||||
console.log @get('hasPermission')
|
||||
@get('isJobTab') && @get('job.canCancel') && @get('hasPermission')
|
||||
).property('job.state', 'hasPushPermissions', 'tab')
|
||||
|
||||
|
|
|
@ -74,13 +74,6 @@ $color-bg-tools-pane: $slate-blue-3
|
|||
$color-bg-right: $slate-blue-3
|
||||
$color-bg-sidebar-box: $white
|
||||
|
||||
$color-bg-job: $yellow-light-2
|
||||
$color-bg-job-highlight: $yellow-light-1
|
||||
$color-bg-job-passed: $green-light-3
|
||||
$color-bg-job-passed-highlight: $green-light-1
|
||||
$color-bg-job-failed: $red-light-3
|
||||
$color-bg-job-failed-highlight: $red-light-1
|
||||
|
||||
$color-border-normal: $gray-medium-3
|
||||
$color-border-light: $gray-light-1
|
||||
$color-border-log: $gray-light-1
|
||||
|
@ -94,11 +87,22 @@ $color-text-status-failed: $red
|
|||
$color-bg-status-failed: $red-lighter
|
||||
$color-text-status-pending: $color-link
|
||||
$color-bg-status-pending: $yellow-lighter
|
||||
$color-text-status-gray: $color-link
|
||||
$color-bg-status-gray: $gray-medium-2
|
||||
|
||||
$color-bg-status-waiting: $green-lighter
|
||||
$color-bg-status-errored: $red-lighter
|
||||
$color-bg-status-stopped: $gray-medium-1
|
||||
|
||||
$color-bg-job: $yellow-light-2
|
||||
$color-bg-job-highlight: $yellow-light-1
|
||||
$color-bg-job-passed: $green-light-3
|
||||
$color-bg-job-passed-highlight: $green-light-1
|
||||
$color-bg-job-failed: $red-light-3
|
||||
$color-bg-job-failed-highlight: $red-light-1
|
||||
$color-bg-job-gray: $gray-light-4
|
||||
$color-bg-job-gray-highlight: $gray-light-3
|
||||
|
||||
$color-bg-list-info: $yellow-light-2
|
||||
$color-text-list-info: $slate-yellow-1
|
||||
$color-shadow-list-info: $slate-yellow-2
|
||||
|
|
|
@ -30,6 +30,14 @@
|
|||
a
|
||||
color: $color-text-status-failed
|
||||
|
||||
#repos .gray,
|
||||
.gray #summary .number,
|
||||
.list .gray .number
|
||||
.status
|
||||
background-color: $color-bg-status-gray
|
||||
a
|
||||
color: $color-text-status-gray
|
||||
|
||||
table.list
|
||||
tbody
|
||||
td
|
||||
|
@ -54,6 +62,14 @@ table.list
|
|||
.number a
|
||||
color: $color-text-status-failed
|
||||
|
||||
.gray
|
||||
td
|
||||
background-color: $color-bg-job-gray
|
||||
&:hover td
|
||||
background-color: $color-bg-job-gray-highlight
|
||||
.number a
|
||||
color: $color-text-status-gray
|
||||
|
||||
#workers
|
||||
.status
|
||||
background-color: $color-bg-status-waiting
|
||||
|
|
Loading…
Reference in New Issue
Block a user