make trigger build on branches work
This commit is contained in:
parent
26fe355e40
commit
ceba450eb2
|
@ -49,15 +49,27 @@ BranchRowComponent = Ember.Component.extend
|
||||||
lastBuilds
|
lastBuilds
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
|
triggerBuild: (->
|
||||||
|
apiEndpoint = config.apiEndpoint
|
||||||
|
repoId = @get('build.repository.id')
|
||||||
|
|
||||||
|
options = {
|
||||||
|
type: 'POST'
|
||||||
|
}
|
||||||
|
if @get('auth.signedIn')
|
||||||
|
options.headers = { Authorization: "token #{@auth.token()}" }
|
||||||
|
|
||||||
|
$.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) ->
|
||||||
|
console.log(response);
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
tiggerBuild: (branch) ->
|
tiggerBuild: (branch) ->
|
||||||
console.log('trigger build')
|
console.log('trigger build')
|
||||||
|
@triggerBuild()
|
||||||
|
|
||||||
viewAllBuilds: (branch) ->
|
viewAllBuilds: (branch) ->
|
||||||
console.log('view all builds')
|
console.log('view all builds')
|
||||||
@transitionToRoute('builds')
|
|
||||||
# updateFilter: (value) ->
|
|
||||||
# @set('_lastFilterValue', value)
|
|
||||||
# Ember.run.throttle this, @updateFilter, [], 200, false
|
|
||||||
|
|
||||||
`export default BranchRowComponent`
|
`export default BranchRowComponent`
|
||||||
|
|
|
@ -15,8 +15,19 @@ BranchesController = Ember.Controller.extend
|
||||||
repos = repos.filter (item, index) ->
|
repos = repos.filter (item, index) ->
|
||||||
item if item.exists_on_github == true
|
item if item.exists_on_github == true
|
||||||
.sort (a, b) ->
|
.sort (a, b) ->
|
||||||
return 0
|
# if a.last_build && b.last_build
|
||||||
|
|
||||||
|
# if a.last_build.finished_at == null
|
||||||
|
# return 1
|
||||||
|
# else
|
||||||
|
# if a.last_build.finished_at > b.last_build.finished_at
|
||||||
|
# return -1
|
||||||
|
# else if a.last_build.finished_at < b.last_build.finished_at
|
||||||
|
# return 1
|
||||||
|
# else
|
||||||
|
# return 0
|
||||||
|
# else
|
||||||
|
# return -1
|
||||||
).property('model')
|
).property('model')
|
||||||
|
|
||||||
inactiveBranches: (->
|
inactiveBranches: (->
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
left: 0
|
left: 0
|
||||||
width: 2rem
|
width: 2rem !important
|
||||||
height: 2rem
|
height: 2rem !important
|
||||||
margin: auto !important
|
margin: auto !important
|
||||||
background-color: transparent
|
background-color: transparent
|
||||||
.is-rotating
|
.is-rotating
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
font-weight: 400
|
font-weight: 400
|
||||||
& span:hover + .tooltip
|
& span:hover + .tooltip
|
||||||
display: block
|
display: block
|
||||||
|
ul
|
||||||
|
padding: 0
|
||||||
|
margin: 0
|
||||||
|
|
||||||
.repo-main-commit
|
.repo-main-commit
|
||||||
position: relative
|
position: relative
|
||||||
|
|
Loading…
Reference in New Issue
Block a user