make trigger build on branches work
This commit is contained in:
parent
26fe355e40
commit
ceba450eb2
|
@ -49,15 +49,27 @@ BranchRowComponent = Ember.Component.extend
|
|||
lastBuilds
|
||||
).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:
|
||||
tiggerBuild: (branch) ->
|
||||
console.log('trigger build')
|
||||
@triggerBuild()
|
||||
|
||||
viewAllBuilds: (branch) ->
|
||||
console.log('view all builds')
|
||||
@transitionToRoute('builds')
|
||||
# updateFilter: (value) ->
|
||||
# @set('_lastFilterValue', value)
|
||||
# Ember.run.throttle this, @updateFilter, [], 200, false
|
||||
|
||||
`export default BranchRowComponent`
|
||||
|
|
|
@ -15,8 +15,19 @@ BranchesController = Ember.Controller.extend
|
|||
repos = repos.filter (item, index) ->
|
||||
item if item.exists_on_github == true
|
||||
.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')
|
||||
|
||||
inactiveBranches: (->
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
right: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
width: 2rem
|
||||
height: 2rem
|
||||
width: 2rem !important
|
||||
height: 2rem !important
|
||||
margin: auto !important
|
||||
background-color: transparent
|
||||
.is-rotating
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
font-weight: 400
|
||||
& span:hover + .tooltip
|
||||
display: block
|
||||
ul
|
||||
padding: 0
|
||||
margin: 0
|
||||
|
||||
.repo-main-commit
|
||||
position: relative
|
||||
|
|
Loading…
Reference in New Issue
Block a user