Fix sorting on the left sidebar
This commit is contained in:
parent
e1a334678d
commit
a56e4a39c3
|
@ -60,7 +60,8 @@ var ReposListComponent = Ember.Component.extend({
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}.property('repos.[]', 'repos')
|
}.property('repos.[]', 'repos.@each.lastBuildFinishedAt',
|
||||||
|
'repos.@each.lastBuildId')
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ReposListComponent;
|
export default ReposListComponent;
|
||||||
|
|
|
@ -86,13 +86,14 @@ Controller = Ember.Controller.extend
|
||||||
this["view_#{tab}".camelize()](params)
|
this["view_#{tab}".camelize()](params)
|
||||||
|
|
||||||
viewOwned: ->
|
viewOwned: ->
|
||||||
@set('isLoaded', false);
|
@set('isLoaded', false)
|
||||||
@get('currentUser._rawPermissions').then (data) =>
|
if user = @get('currentUser')
|
||||||
repos = Repo.accessibleBy(@store, data.pull).then( (reposRecordArray) =>
|
user.get('_rawPermissions').then (data) =>
|
||||||
@set('isLoaded', true)
|
repos = Repo.accessibleBy(@store, data.pull).then( (reposRecordArray) =>
|
||||||
@set('repos', reposRecordArray)
|
@set('isLoaded', true)
|
||||||
)
|
@set('repos', reposRecordArray)
|
||||||
# TODO: handle error
|
)
|
||||||
|
# TODO: handle error
|
||||||
|
|
||||||
viewRunning: ->
|
viewRunning: ->
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@ Repo = Model.extend
|
||||||
#lastBuild: DS.belongsTo('build')
|
#lastBuild: DS.belongsTo('build')
|
||||||
defaultBranch: DS.belongsTo('branch', async: false)
|
defaultBranch: DS.belongsTo('branch', async: false)
|
||||||
|
|
||||||
|
# just for sorting
|
||||||
|
lastBuildFinishedAt: Ember.computed.oneWay('defaultBranch.lastBuild.finishedAt')
|
||||||
|
lastBuildId: Ember.computed.oneWay('defaultBranch.lastBuild.id')
|
||||||
|
|
||||||
withLastBuild: ->
|
withLastBuild: ->
|
||||||
@filter( (repo) -> repo.get('defaultBranch.lastBuild') )
|
@filter( (repo) -> repo.get('defaultBranch.lastBuild') )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user