1 App.CommitsViewerComponent = Ember.Component.extend({
5 commitsChanged: function ()
7 var revisionInfo = this.get('revisionInfo');
9 var to = revisionInfo.get('currentRevision');
10 var from = revisionInfo.get('previousRevision');
11 var repository = this.get('repository');
12 if (!from || !repository || !repository.get('hasReportedCommits'))
16 CommitLogs.fetchForTimeRange(repository.get('id'), from, to).then(function (commits) {
19 self.set('commits', commits.map(function (commit) {
20 return Ember.Object.create({
21 repository: repository,
22 revision: commit.revision,
23 url: repository.urlForRevision(commit.revision),
24 author: commit.authorName || commit.authorEmail,
25 message: commit.message ? commit.message.substr(0, 75) : null,
29 if (!self.isDestroyed)
30 self.set('commits', []);
32 }.observes('repository').observes('revisionInfo').on('init'),