Fix queue and running jobs controllers for ED
This commit is contained in:
parent
6b177d2238
commit
15a4ba045d
|
@ -3,7 +3,8 @@ Job = Travis.Job
|
|||
|
||||
Controller = Em.ArrayController.extend
|
||||
content: (->
|
||||
Job.queued()
|
||||
@store.filter 'job', {}, (job) ->
|
||||
['created', 'queued'].indexOf(job.get('state')) != -1
|
||||
).property()
|
||||
|
||||
Travis.QueueController = Controller
|
||||
|
|
|
@ -3,7 +3,8 @@ Job = Travis.Job
|
|||
|
||||
Controller = Em.ArrayController.extend
|
||||
content: (->
|
||||
Job.running()
|
||||
@store.filter 'job', { state: 'started' }, (job) ->
|
||||
['started', 'received'].indexOf(job.get('state')) != -1
|
||||
).property()
|
||||
|
||||
Travis.RunningJobsController = Controller
|
||||
|
|
|
@ -143,34 +143,3 @@ Ajax = Travis.ajax
|
|||
slug: (->
|
||||
"#{@get('repo.slug')} ##{@get('number')}"
|
||||
).property()
|
||||
|
||||
@Travis.Job.reopenClass
|
||||
queued: ->
|
||||
filtered = Ember.FilteredRecordArray.create(
|
||||
modelClass: Travis.Job
|
||||
filterFunction: (job) ->
|
||||
['created', 'queued'].indexOf(job.get('state')) != -1
|
||||
filterProperties: ['state', 'queue']
|
||||
)
|
||||
|
||||
@fetch().then (array) ->
|
||||
filtered.updateFilter()
|
||||
filtered.set('isLoaded', true)
|
||||
|
||||
filtered
|
||||
|
||||
running: ->
|
||||
filtered = Ember.FilteredRecordArray.create(
|
||||
modelClass: Travis.Job
|
||||
filterFunction: (job) ->
|
||||
['started', 'received'].indexOf(job.get('state')) != -1
|
||||
filterProperties: ['state']
|
||||
)
|
||||
|
||||
@fetch(state: 'started').then (array) ->
|
||||
filtered.updateFilter()
|
||||
filtered.set('isLoaded', true)
|
||||
|
||||
filtered
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user