Show pull request number on the list
This commit is contained in:
parent
7c97317df6
commit
6fb15c4a97
|
@ -17,6 +17,9 @@
|
||||||
job: (slug, id) ->
|
job: (slug, id) ->
|
||||||
"/#{slug}/jobs/#{id}"
|
"/#{slug}/jobs/#{id}"
|
||||||
|
|
||||||
|
githubPullRequest: (slug, pullRequestNumber) ->
|
||||||
|
"http://github.com/#{slug}/pull/#{pullRequestNumber}"
|
||||||
|
|
||||||
githubCommit: (slug, sha) ->
|
githubCommit: (slug, sha) ->
|
||||||
"http://github.com/#{slug}/commit/#{sha}"
|
"http://github.com/#{slug}/commit/#{sha}"
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
require 'travis/model'
|
require 'travis/model'
|
||||||
|
|
||||||
@Travis.Commit = Travis.Model.extend
|
@Travis.Commit = Travis.Model.extend
|
||||||
buildId: DS.attr('number')
|
buildId: DS.attr('number')
|
||||||
sha: DS.attr('string')
|
sha: DS.attr('string')
|
||||||
branch: DS.attr('string')
|
branch: DS.attr('string')
|
||||||
message: DS.attr('string')
|
message: DS.attr('string')
|
||||||
compareUrl: DS.attr('string')
|
compareUrl: DS.attr('string')
|
||||||
authorName: DS.attr('string')
|
authorName: DS.attr('string')
|
||||||
authorEmail: DS.attr('string')
|
authorEmail: DS.attr('string')
|
||||||
committerName: DS.attr('string')
|
committerName: DS.attr('string')
|
||||||
committerEmail: DS.attr('string')
|
committerEmail: DS.attr('string')
|
||||||
|
pullRequestNumber: DS.attr('number')
|
||||||
|
|
||||||
build: DS.belongsTo('Travis.Build', key: 'buildId')
|
build: DS.belongsTo('Travis.Build', key: 'buildId')
|
||||||
|
|
|
@ -68,8 +68,6 @@ Travis.Store = DS.Store.extend
|
||||||
{ id: id, clientId: clientId }
|
{ id: id, clientId: clientId }
|
||||||
|
|
||||||
receive: (event, data) ->
|
receive: (event, data) ->
|
||||||
return if event == 'worker:added' || event == 'worker:removed'
|
|
||||||
|
|
||||||
[name, type] = event.split(':')
|
[name, type] = event.split(':')
|
||||||
|
|
||||||
mappings = @adapter.get('mappings')
|
mappings = @adapter.get('mappings')
|
||||||
|
|
|
@ -4,7 +4,14 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{t builds.name}}</th>
|
<th>{{t builds.name}}</th>
|
||||||
<th>{{t builds.message}}</th>
|
<th>{{t builds.message}}</th>
|
||||||
<th>{{t builds.commit}}</th>
|
<th>
|
||||||
|
{{t builds.commit}}
|
||||||
|
</th>
|
||||||
|
{{#if view.isPullRequestsList}}
|
||||||
|
<th>
|
||||||
|
{{t builds.pr}}
|
||||||
|
</th>
|
||||||
|
{{/if}}
|
||||||
<th>{{t builds.duration}}</th>
|
<th>{{t builds.duration}}</th>
|
||||||
<th>{{t builds.finished_at}}</th>
|
<th>{{t builds.finished_at}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -29,6 +36,13 @@
|
||||||
{{formatCommit commit}}
|
{{formatCommit commit}}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
{{#if commit.pullRequestNumber}}
|
||||||
|
<td>
|
||||||
|
<a {{bindAttr href="view.urlGithubPullRequest"}}>
|
||||||
|
#{{commit.pullRequestNumber}}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
{{/if}}
|
||||||
<td class="duration" {{bindAttr title="duration"}}>
|
<td class="duration" {{bindAttr title="duration"}}>
|
||||||
{{formatDuration duration}}
|
{{formatDuration duration}}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
templateName: 'builds/list'
|
templateName: 'builds/list'
|
||||||
buildsBinding: 'controller.builds'
|
buildsBinding: 'controller.builds'
|
||||||
|
|
||||||
|
isPullRequestsList: (->
|
||||||
|
console.log @get('controller.tab')
|
||||||
|
@get('controller.tab') == 'pull_requests'
|
||||||
|
).property('controller.tab')
|
||||||
|
|
||||||
showMore: ->
|
showMore: ->
|
||||||
id = @get('controller.repo.id')
|
id = @get('controller.repo.id')
|
||||||
number = @get('builds.lastObject.number')
|
number = @get('builds.lastObject.number')
|
||||||
|
@ -43,6 +48,10 @@
|
||||||
Travis.Urls.githubCommit(@get('repo.slug'), @get('commit.sha'))
|
Travis.Urls.githubCommit(@get('repo.slug'), @get('commit.sha'))
|
||||||
).property('repo.slug', 'commit.sha')
|
).property('repo.slug', 'commit.sha')
|
||||||
|
|
||||||
|
urlGithubPullRequest: (->
|
||||||
|
Travis.Urls.githubPullRequest(@get('repo.slug'), @get('commit.pullRequestNumber'))
|
||||||
|
).property('repo.slug', 'commit.pullRequestNumber')
|
||||||
|
|
||||||
BuildView: Travis.View.extend
|
BuildView: Travis.View.extend
|
||||||
templateName: 'builds/show'
|
templateName: 'builds/show'
|
||||||
elementId: 'build'
|
elementId: 'build'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user