Revert "Make sorting more in line with what we will do on a server"
This makes the timeline ordering odd when restarting: The repo will be
sorted to be bottom of the timeline while in :created state, and then
pops back up to the top when :started.
One weird thing is that it only seems to behave this way on com
(staging) and enterprise, but not on org (staging).
This reverts commit ce8237b4e7
.
This commit is contained in:
parent
bb034704d2
commit
b348ee0e40
|
@ -108,17 +108,12 @@ require 'travis/model'
|
|||
).property('_lastBuildDuration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
|
||||
|
||||
sortOrder: (->
|
||||
# this is prepared for ascending sort
|
||||
if Ember.isNone(@get('lastBuildFinishedAt')) && @get('lastBuildStartedAt')
|
||||
# if a build is running, it should be at the beginning
|
||||
0
|
||||
else if lastBuildStartedAt = @get('lastBuildStartedAt')
|
||||
# if it's not running, but was already run, put newest builds first
|
||||
new Date('9999').getTime() - Date.parse(lastBuildStartedAt)
|
||||
# cuz sortAscending seems buggy when set to false
|
||||
if lastBuildFinishedAt = @get('lastBuildFinishedAt')
|
||||
- new Date(lastBuildFinishedAt).getTime()
|
||||
else
|
||||
# if it's not started nor it was ran before, sort with newest id first
|
||||
new Date('9999').getTime() - @get('id')
|
||||
).property('lastBuildFinishedAt', 'id', 'lastBuildStartedAt')
|
||||
- new Date('9999').getTime() - parseInt(@get('lastBuildId'))
|
||||
).property('lastBuildFinishedAt', 'lastBuildId')
|
||||
|
||||
stats: (->
|
||||
if @get('slug')
|
||||
|
|
Loading…
Reference in New Issue
Block a user