Initial annotation support
This commit is contained in:
parent
e343161017
commit
1b8ec432dc
|
@ -8,6 +8,7 @@ require 'models/event'
|
||||||
require 'models/hook'
|
require 'models/hook'
|
||||||
require 'models/job'
|
require 'models/job'
|
||||||
require 'models/log'
|
require 'models/log'
|
||||||
|
require 'models/annotation'
|
||||||
require 'models/repo'
|
require 'models/repo'
|
||||||
require 'models/user'
|
require 'models/user'
|
||||||
require 'models/worker'
|
require 'models/worker'
|
||||||
|
|
10
assets/scripts/app/models/annotation.coffee
Normal file
10
assets/scripts/app/models/annotation.coffee
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require 'travis/model'
|
||||||
|
|
||||||
|
@Travis.Annotation = Travis.Model.extend
|
||||||
|
jobId: DS.attr('number')
|
||||||
|
description: DS.attr('string')
|
||||||
|
url: DS.attr('string')
|
||||||
|
image: DS.attr('object')
|
||||||
|
providerName: DS.attr('string')
|
||||||
|
|
||||||
|
job: DS.belongsTo('Travis.Job')
|
|
@ -18,6 +18,8 @@ require 'travis/model'
|
||||||
build: DS.belongsTo('Travis.Build')
|
build: DS.belongsTo('Travis.Build')
|
||||||
commit: DS.belongsTo('Travis.Commit')
|
commit: DS.belongsTo('Travis.Commit')
|
||||||
|
|
||||||
|
annotations: DS.hasMany('Travis.Annotation')
|
||||||
|
|
||||||
# this is a fake relationship just to get rid
|
# this is a fake relationship just to get rid
|
||||||
# of ember data's bug: https://github.com/emberjs/data/issues/758
|
# of ember data's bug: https://github.com/emberjs/data/issues/758
|
||||||
# TODO: remove when this issue is fixed
|
# TODO: remove when this issue is fixed
|
||||||
|
|
|
@ -78,6 +78,8 @@ Travis.RestAdapter = DS.RESTAdapter.extend
|
||||||
accounts: Travis.Account
|
accounts: Travis.Account
|
||||||
worker: Travis.Worker
|
worker: Travis.Worker
|
||||||
workers: Travis.Worker
|
workers: Travis.Worker
|
||||||
|
annotation: Travis.Annotation
|
||||||
|
annotations: Travis.Annotation
|
||||||
|
|
||||||
plurals:
|
plurals:
|
||||||
repositories: 'repositories',
|
repositories: 'repositories',
|
||||||
|
@ -89,6 +91,7 @@ Travis.RestAdapter = DS.RESTAdapter.extend
|
||||||
job: 'jobs'
|
job: 'jobs'
|
||||||
worker: 'workers'
|
worker: 'workers'
|
||||||
profile: 'profile'
|
profile: 'profile'
|
||||||
|
annotation: 'annotations'
|
||||||
|
|
||||||
ajax: ->
|
ajax: ->
|
||||||
Travis.ajax.ajax.apply(this, arguments)
|
Travis.ajax.ajax.apply(this, arguments)
|
||||||
|
@ -139,6 +142,7 @@ Travis.RestAdapter.map 'Travis.Job', {
|
||||||
repoId: { key: 'repository_id' }
|
repoId: { key: 'repository_id' }
|
||||||
repo: { key: 'repository_id' }
|
repo: { key: 'repository_id' }
|
||||||
_config: { key: 'config' }
|
_config: { key: 'config' }
|
||||||
|
annotations: { key: 'annotation_ids' }
|
||||||
}
|
}
|
||||||
|
|
||||||
Travis.RestAdapter.map 'Travis.User', {
|
Travis.RestAdapter.map 'Travis.User', {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user