diff --git a/assets/scripts/app/app.coffee b/assets/scripts/app/app.coffee index 2f8e01ed..ac98f15c 100644 --- a/assets/scripts/app/app.coffee +++ b/assets/scripts/app/app.coffee @@ -23,7 +23,7 @@ unless window.TravisApplication ).property() modelClasses: (-> - [Travis.User, Travis.Build, Travis.Job, Travis.Repo, Travis.Commit, Travis.Worker, Travis.Account, Travis.Broadcast, Travis.Hook] + [Travis.User, Travis.Build, Travis.Job, Travis.Repo, Travis.Commit, Travis.Worker, Travis.Account, Travis.Broadcast, Travis.Hook, Travis.Annotation] ).property() setup: -> diff --git a/assets/scripts/app/controllers/annotations.coffee b/assets/scripts/app/controllers/annotations.coffee new file mode 100644 index 00000000..e69de29b diff --git a/assets/scripts/app/controllers/job.coffee b/assets/scripts/app/controllers/job.coffee index 7365d06d..193aab42 100644 --- a/assets/scripts/app/controllers/job.coffee +++ b/assets/scripts/app/controllers/job.coffee @@ -4,6 +4,7 @@ Travis.JobController = Em.Controller.extend jobBinding: 'controllers.repo.job' repoBinding: 'controllers.repo.repo' commitBinding: 'job.commit' + annotationsBinding: 'job.annotations' currentUserBinding: 'controllers.repo.currentUser' tabBinding: 'controllers.repo.tab' diff --git a/assets/scripts/app/models.coffee b/assets/scripts/app/models.coffee index 0b9b4c74..6526b5b1 100644 --- a/assets/scripts/app/models.coffee +++ b/assets/scripts/app/models.coffee @@ -8,6 +8,7 @@ require 'models/event' require 'models/hook' require 'models/job' require 'models/log' +require 'models/annotation' require 'models/repo' require 'models/user' require 'models/worker' diff --git a/assets/scripts/app/models/annotation.coffee b/assets/scripts/app/models/annotation.coffee new file mode 100644 index 00000000..471ad76e --- /dev/null +++ b/assets/scripts/app/models/annotation.coffee @@ -0,0 +1,10 @@ +require 'travis/model' + +@Travis.Annotation = Travis.Model.extend + jobId: Ember.attr('number') + description: Ember.attr('string') + url: Ember.attr('string') + status: Ember.attr('string') + providerName: Ember.attr('string') + + job: Ember.belongsTo('Travis.Job') diff --git a/assets/scripts/app/models/job.coffee b/assets/scripts/app/models/job.coffee index aca10ad7..d28eb522 100644 --- a/assets/scripts/app/models/job.coffee +++ b/assets/scripts/app/models/job.coffee @@ -18,6 +18,8 @@ require 'travis/model' build: Ember.belongsTo('Travis.Build') commit: Ember.belongsTo('Travis.Commit') + annotations: Ember.hasMany('Travis.Annotation') + _config: Ember.attr('object', key: 'config') log: ( -> diff --git a/assets/scripts/app/pusher.coffee b/assets/scripts/app/pusher.coffee index fbf01d55..c3b1f825 100644 --- a/assets/scripts/app/pusher.coffee +++ b/assets/scripts/app/pusher.coffee @@ -83,6 +83,8 @@ $.extend Travis.Pusher.prototype, { job: data } when 'worker:added', 'worker:updated', 'worker:removed' { worker: data } + when 'annotation:created', 'annotation:updated' + { annotation: data } warn: (type, warning) -> console.warn(warning) unless @ignoreWarning(warning) diff --git a/assets/scripts/app/store/rest_adapter.coffee b/assets/scripts/app/store/rest_adapter.coffee index af3f092f..939ebaff 100644 --- a/assets/scripts/app/store/rest_adapter.coffee +++ b/assets/scripts/app/store/rest_adapter.coffee @@ -78,6 +78,8 @@ Travis.RestAdapter = DS.RESTAdapter.extend accounts: Travis.Account worker: Travis.Worker workers: Travis.Worker + annotation: Travis.Annotation + annotations: Travis.Annotation plurals: repositories: 'repositories', @@ -89,6 +91,7 @@ Travis.RestAdapter = DS.RESTAdapter.extend job: 'jobs' worker: 'workers' profile: 'profile' + annotation: 'annotations' ajax: -> Travis.ajax.ajax.apply(this, arguments) @@ -139,6 +142,7 @@ Travis.RestAdapter.map 'Travis.Job', { repoId: { key: 'repository_id' } repo: { key: 'repository_id' } _config: { key: 'config' } + annotations: { key: 'annotation_ids' } } Travis.RestAdapter.map 'Travis.User', { diff --git a/assets/scripts/app/templates/annotations/list.hbs b/assets/scripts/app/templates/annotations/list.hbs new file mode 100644 index 00000000..d80843b5 --- /dev/null +++ b/assets/scripts/app/templates/annotations/list.hbs @@ -0,0 +1,10 @@ +
+ {{#each annotation in view.annotations}} +
+ + {{annotation.status}} {{annotation.providerName}} + : + {{annotation.description}} +
+ {{/each}} +
diff --git a/assets/scripts/app/templates/builds/show.hbs b/assets/scripts/app/templates/builds/show.hbs index 290ea0e1..be71c066 100644 --- a/assets/scripts/app/templates/builds/show.hbs +++ b/assets/scripts/app/templates/builds/show.hbs @@ -49,6 +49,10 @@
{{formatMessage build.commit.message repoBinding=build.repo}}
+ {{#unless build.isMatrix}} + {{view Travis.AnnotationsView annotationsBinding="build.jobs.firstObject.annotations"}} + {{/unless}} + {{#if build.isMatrix}} {{view Travis.JobsView jobsBinding="build.requiredJobs" required="true"}} {{view Travis.JobsView jobsBinding="build.allowedFailureJobs"}} diff --git a/assets/scripts/app/templates/jobs/show.hbs b/assets/scripts/app/templates/jobs/show.hbs index 0a7e17a1..6b0ae420 100644 --- a/assets/scripts/app/templates/jobs/show.hbs +++ b/assets/scripts/app/templates/jobs/show.hbs @@ -46,6 +46,8 @@
{{formatMessage job.commit.message repoBinding=job.repo}}
+ {{view Travis.AnnotationsView annotationsBinding="view.annotations"}} + {{view Travis.LogView jobBinding="job"}} {{else}} diff --git a/assets/scripts/app/views.coffee b/assets/scripts/app/views.coffee index 7ddf2bc8..c03a0b65 100644 --- a/assets/scripts/app/views.coffee +++ b/assets/scripts/app/views.coffee @@ -46,6 +46,7 @@ Travis.FirstSyncView = Travis.View.extend , Travis.config.syncingPageRedirectionTime require 'views/accounts' +require 'views/annotation' require 'views/application' require 'views/build' require 'views/events' diff --git a/assets/scripts/app/views/annotation.coffee b/assets/scripts/app/views/annotation.coffee new file mode 100644 index 00000000..712f10a0 --- /dev/null +++ b/assets/scripts/app/views/annotation.coffee @@ -0,0 +1,4 @@ +Travis.reopen + AnnotationsView: Travis.View.extend + templateName: 'annotations/list' + diff --git a/assets/scripts/app/views/annotations.coffee b/assets/scripts/app/views/annotations.coffee new file mode 100644 index 00000000..556ee80f --- /dev/null +++ b/assets/scripts/app/views/annotations.coffee @@ -0,0 +1,2 @@ +Travis.reopen + AnnotationsView: Travis.View.extend diff --git a/assets/scripts/app/views/job.coffee b/assets/scripts/app/views/job.coffee index 1edaf375..b32d5e06 100644 --- a/assets/scripts/app/views/job.coffee +++ b/assets/scripts/app/views/job.coffee @@ -19,6 +19,7 @@ Travis.reopen repoBinding: 'controller.repo' jobBinding: 'controller.job' commitBinding: 'job.commit' + annotationsBinding: 'job.annotations' currentItemBinding: 'job' diff --git a/assets/styles/main/annotations.sass b/assets/styles/main/annotations.sass new file mode 100644 index 00000000..f5db4109 --- /dev/null +++ b/assets/styles/main/annotations.sass @@ -0,0 +1,19 @@ +@import "_mixins/all" + +#annotations + margin: 0 0 0 12px + padding: 12px 0 0 0 + border-top: 1px solid $gray-dark-3 + @include clearfix + + a + text-decoration: underline + + img + border: none + + .annotation + float: left + min-height: 25px + margin: 0 +