Add ember-cli version of the Ember.js app

This commit is contained in:
Piotr Sarnacki 2015-02-03 09:48:22 +01:00
parent 3a09a0da9a
commit b0bd24a129
188 changed files with 594 additions and 576 deletions

View File

@ -1,4 +1,5 @@
config = ENV.config
`import DS from 'ember-data'`
`import config from 'travis/config/environment'`
Adapter = DS.ActiveModelAdapter.extend
host: config.api_endpoint
@ -15,5 +16,4 @@ Adapter = DS.ActiveModelAdapter.extend
hash
Travis.ApplicationAdapter = Adapter
`export default Adapter`

View File

@ -1,4 +1,5 @@
ApplicationAdapter = Travis.ApplicationAdapter
`import Ember from 'ember'`
`import ApplicationAdapter from 'adapters/application'`
Adapter = ApplicationAdapter.extend
namespace: 'settings'
@ -22,4 +23,4 @@ Adapter = ApplicationAdapter.extend
this.ajax(this.buildURL(type.typeKey, id, record), "PATCH", { data: data })
Travis.EnvVarAdapter = Adapter
`export default Adapter`

View File

@ -1,6 +1,5 @@
get = Ember.get
ApplicationAdapter = Travis.ApplicationAdapter
`import Ember from 'ember'`
`import ApplicationAdapter from 'adapters/application'`
Adapter = ApplicationAdapter.extend
namespace: 'settings'
@ -12,4 +11,4 @@ Adapter = ApplicationAdapter.extend
this.ajax(this.buildURL(type.typeKey, null, record), "POST", { data: data })
Travis.SshKeyAdapter = Adapter
`export default Adapter`

View File

@ -1,4 +1,9 @@
config = ENV.config
`import Ember from 'ember'`
`import Resolver from 'ember/resolver'`
`import loadInitializers from 'ember/load-initializers'`
`import config from './config/environment'`
Ember.MODEL_FACTORY_INJECTIONS = true
App = Ember.Application.extend(Ember.Evented,
LOG_TRANSITIONS: true
@ -8,6 +13,10 @@ App = Ember.Application.extend(Ember.Evented,
LOG_VIEW_LOOKUPS: true
#LOG_RESOLVER: true
modulePrefix: config.modulePrefix
podModulePrefix: config.podModulePrefix
Resolver: Resolver
lookup: ->
@__container__.lookup.apply @__container__, arguments
@ -118,5 +127,6 @@ App = Ember.Application.extend(Ember.Evented,
created_at: (Date.parse(user.created_at) / 1000) || null
login: user.login
)
loadInitializers(App, config.modulePrefix)
window.App = App unless window.App
`export default App`

0
app/components/.gitkeep Normal file
View File

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Component = Ember.Component.extend
tagName: 'a'
classNames: ['travis-switch']
@ -20,4 +22,4 @@ Component = Ember.Component.extend
Ember.run.next this, ->
@sendAction('action', target)
Travis.TravisSwitchComponent = Component
`export default Component`

0
app/controllers/.gitkeep Normal file
View File

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ObjectController.extend
allHooks: []
needs: ['currentUser']
@ -45,4 +47,4 @@ Controller = Ember.ObjectController.extend
@config.show_repos_hint == 'public'
) .property()
Travis.AccountController = Controller
`export default Controller`

View File

@ -1,4 +1,6 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
tab: 'accounts'
Travis.AccountsController = Controller
`export default Controller`

View File

@ -1,5 +1,7 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend
needs: ['currentUser', 'repos']
userBinding: 'controllers.currentUser'
Travis.AccountsInfoController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend()
Travis.AuthController = Controller
`export default Controller`

View File

@ -1,6 +1,8 @@
gravatarImage = Travis.Urls.gravatarImage
`import Ember from 'ember'`
`import { gravatarImage } from 'travis/utils/urls'`
`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'`
Controller = Ember.Controller.extend Travis.GithubUrlProperties,
Controller = Ember.Controller.extend GithubUrlPropertievs,
needs: ['repo']
repoBinding: 'controllers.repo.repo'
commitBinding: 'build.commit'
@ -21,4 +23,4 @@ Controller = Ember.Controller.extend Travis.GithubUrlProperties,
gravatarImage(@get('commit.authorEmail'), 40)
).property('commit.authorEmail')
Travis.BuildController = Controller
`export default Controller`

View File

@ -1,5 +1,6 @@
colorForState = Travis.Helpers.colorForState
GithubUrlProperties = Travis.GithubUrlProperties
`import Ember from 'ember'`
`import { colorForState } from 'travis/utils/helpers'`
`import GithubUrlProperties from 'travis/mixins/github-url-properties'`
Controller = Ember.ObjectController.extend(GithubUrlProperties,
needs: ['builds']
@ -11,4 +12,4 @@ Controller = Ember.ObjectController.extend(GithubUrlProperties,
).property('build.state')
)
Travis.BuildsItemController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
isPullRequestsList: false
@ -27,4 +29,4 @@ Controller = Ember.ArrayController.extend
@store.find('build', options)
Travis.BuildsController = Controller
`export default Controller`

View File

@ -1,4 +1,5 @@
Ajax = Travis.ajax
`import Ember from 'ember'`
`import Ajax from 'travis/utils/ajax'`
Controller = Ember.ObjectController.extend
isDeleting: false
@ -22,3 +23,4 @@ Controller = Ember.ObjectController.extend
@get('controllers.caches').removeObject(model)
Travis.CachesByBranchController = Controller
`export default Controller`

View File

@ -1,4 +1,5 @@
Ajax = Travis.ajax
`import Ember from 'ember'`
`import Ajax from 'travis/utils/ajax'`
Controller = Ember.ObjectController.extend
isDeleting: false
@ -23,4 +24,4 @@ Controller = Ember.ObjectController.extend
if @get('parent.caches.length') == 0
@get('controllers.caches').removeObject(@get('parent'))
Travis.CacheItemController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
isDeleting: false
needs: ['repo']
@ -16,4 +18,4 @@ Controller = Ember.ArrayController.extend
Travis.ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE").then(deletingDone, deletingDone).then =>
@clear()
Travis.CachesController = Controller
`export default Controller`

View File

@ -10,4 +10,4 @@ Controller = Ember.ObjectController.extend
@container.lookup('router:main').send('renderFirstSync')
).observes('isSyncing', 'auth.currentUser')
Travis.CurrentUserController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend
#queryParams: ['filter']
filter: null
@ -24,4 +26,4 @@ Controller = Ember.Controller.extend
@set('_lastFilterValue', value)
Ember.run.throttle this, @updateFilter, [], 200, false
Travis.DashboardRepositoriesController = Controller
`export default Controller`

View File

@ -1,7 +1,4 @@
require 'utils/validations'
Validations = Travis.Validations
EnvVar = Travis.EnvVar
`import Validations from 'travis/utils/validations'`
Controller = Ember.Controller.extend Validations,
needs: ['repo']
@ -44,3 +41,4 @@ Controller = Ember.Controller.extend Validations,
@set('isSaving', false)
Travis.EnvVarsNewController = Controller
`export default Controller`

View File

@ -1,6 +1,5 @@
require 'utils/validations'
Validations = Travis.Validations
`import Ember from 'ember'`
`import Validations from 'travis/utils/validations'`
Controller = Ember.ObjectController.extend Validations,
isEditing: false
@ -46,4 +45,4 @@ Controller = Ember.ObjectController.extend Validations,
env_var.save().then =>
@set('isEditing', false)
Travis.EnvVarController = Controller
`export default Controller`

View File

@ -1,4 +1,6 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
vars: Ember.computed.filterBy('model', 'isNew', false)
Travis.EnvVarsController = Controller
`export default Controller`

View File

@ -1,7 +1,9 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend
needs: ['currentUser']
user: Ember.computed.alias('controllers.currentUser')
isSyncing: Ember.computed.alias('user.isSyncing')
Travis.FirstSyncController = Controller
`export default Controller`

View File

@ -1,7 +1,6 @@
require 'utils/limited-array'
LimitedArray = Travis.LimitedArray
Broadcast = Travis.Broadcast
`import Ember from 'ember'`
`import LimitedArray from 'travis/utils/limited-array'`
`import Broadcast from 'travis/models/broadcast'`
Controller = Ember.ArrayController.extend
needs: ['currentUser']
@ -46,4 +45,4 @@ Controller = Ember.ArrayController.extend
close: (msg) ->
@close(msg)
Travis.FlashController = Controller
`export default Controller`

View File

@ -1,4 +1,5 @@
githubCommit = Travis.Urls.githubCommit
`import Ember from 'ember'`
`import { githubCommit } from 'travis/utils/urls'`
Controller = Ember.Controller.extend
needs: ['repo']
@ -15,4 +16,4 @@ Controller = Ember.Controller.extend
githubCommit(@get('repo.slug'), @get('commit.sha'))
).property('repo.slug', 'commit.sha')
Travis.JobController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend()
Travis.MainErrorController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend
name: 'profile'
@ -23,4 +25,4 @@ Controller = Ember.Controller.extend
"#{@get('config').billing_endpoint}/subscriptions/#{id}"
).property('account.login', 'account.type')
Travis.ProfileController = Controller
`export default Controller`

View File

@ -1,7 +1,9 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
content: (->
@store.filter 'job', {}, (job) ->
['created', 'queued'].indexOf(job.get('state')) != -1
).property()
Travis.QueueController = Controller
`export default Controller`

View File

@ -1,4 +1,5 @@
githubRepo = Travis.Urls.githubRepo
`import Ember from 'ember'`
`import { githubRepo } from 'travis/utils/urls'`
Controller = Ember.Controller.extend
needs: ['repos', 'currentUser', 'build', 'request', 'job']
@ -93,4 +94,4 @@ Controller = Ember.Controller.extend
githubRepo(@get('repo.slug'))
).property('repo.slug')
Travis.RepoController = Controller
`export default Controller`

View File

@ -1,7 +1,6 @@
require 'utils/limited-array'
Repo = Travis.Repo
limit = Ember.computed.limit
`import Ember from 'ember'`
`import limit from 'travis/utils/computed-limit'`
`import Repo from 'travis/models/repo'`
Controller = Ember.ArrayController.extend
actions:
@ -92,4 +91,4 @@ Controller = Ember.ArrayController.extend
'Could not find any repos'
).property('tab')
Travis.ReposController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ObjectController.extend
requestClass: (->
if @get('content.isAccepted')
@ -28,4 +30,4 @@ Controller = Ember.ObjectController.extend
message
).property('model.message')
Travis.RequestController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
needs: ['repo']
repo: Ember.computed.alias('controllers.repo.repo')
@ -7,4 +9,4 @@ Controller = Ember.ArrayController.extend
"https://lint.travis-ci.org/#{slug}"
).property('repo.slug')
Travis.RequestsController = Controller
`export default Controller`

View File

@ -1,7 +1,9 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
content: (->
@store.filter 'job', { state: 'started' }, (job) ->
['started', 'received'].indexOf(job.get('state')) != -1
).property()
Travis.RunningJobsController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ObjectController.extend
settings: Ember.computed.alias('model.settings')
@ -17,4 +19,4 @@ Controller = Ember.ObjectController.extend
@get('model').saveSettings(@get('settings')).then null, ->
Travis.flash(error: 'There was an error while saving settings. Please try again.')
Travis.SettingsIndexController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.ArrayController.extend
init: ->
@_super.apply this, arguments
@ -14,4 +16,4 @@ Controller = Ember.ArrayController.extend
tips[Math.floor(Math.random()*tips.length)]
).property().volatile()
Travis.SidebarController = Controller
`export default Controller`

View File

@ -1,6 +1,5 @@
require 'utils/validations'
Validations = Travis.Validations
`import Ember from 'ember'`
`import Validations from 'travis/utils/validations'`
Controller = Ember.ObjectController.extend Validations,
isEditing: false
@ -60,4 +59,4 @@ Controller = Ember.ObjectController.extend Validations,
edit: ->
@set('isEditing', true)
Travis.SshKeyController = Controller
`export default Controller`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Controller = Ember.Controller.extend
needs: ['currentUser']
userBinding: 'controllers.currentUser'
@ -10,4 +12,4 @@ Controller = Ember.Controller.extend
"#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=48&d=mm"
).property('user.gravatarId')
Travis.TopController = Controller
`export default Controller`

0
app/helpers/.gitkeep Normal file
View File

View File

@ -1,9 +1,10 @@
safe = Travis.Helpers.safe
`import { safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
capitalize = (value, options) ->
helper = Ember.Handlebars.makeBoundHelper (value, options) ->
if value?
safe $.capitalize(value)
else
''
Travis.Handlebars.capitalize = capitalize
`export default helper`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
TextField = Ember.TextField.extend
keyUp: (event) ->
@sendAction('action', @get('_value'), event)
@ -13,4 +15,4 @@ fn = (options) ->
options.hash.onEvent = onEvent || 'enter'
return Ember.Handlebars.helpers.view.call(this, TextField, options)
Travis.Handlebars.filterInput = fn
`export default fn`

View File

@ -1,7 +1,6 @@
safe = Travis.Helpers.safe
formatCommitHelper = Travis.Helpers.formatCommit
`import { safe, formatCommit as formatCommitHelper } from 'travis/utils/helpers'`
formatCommit = (commit) ->
helper = Ember.Handlebars.makeBoundHelper (commit) ->
safe formatCommitHelper(commit.get('sha'), commit.get('branch')) if commit
Travis.Handlebars.formatCommit = formatCommit
`export default helper`

View File

@ -1,8 +1,6 @@
formatConfigHelper = Travis.Helpers.formatConfig
safe = Travis.Helpers.safe
`import { safe, formatConfig as formatConfigHelper } from 'travis/utils/helpers'`
formatConfig = (config, options) ->
safe formatConfigHelper(config)
Travis.Handlebars.formatConfig = formatConfig
`export default helper`

View File

@ -1,7 +1,7 @@
timeInWords = Travis.Helpers.timeInWords
safe = Travis.Helpers.safe
`import { timeInWords, safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
formatDuration = (duration, options) ->
helper = Ember.Handlebars.makeBoundHelper (duration, options) ->
safe timeInWords(duration)
Travis.Handlebars.formatDuration = formatDuration
`export default helper`

View File

@ -1,7 +1,7 @@
formatMessageHelper = Travis.Helpers.formatMessage
safe = Travis.Helpers.safe
`import { formatMessage as _formatMessage, safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
formatMessage = (message, options) ->
safe formatMessageHelper(message, options.hash)
helper = Ember.Handlebars.makeBoundHelper (message, options) ->
safe _formatMessage(message, options.hash)
Travis.Handlebars.formatMessage = formatMessage
`export default helper`

View File

@ -1,7 +1,7 @@
formatShaHelper = Travis.Helpers.formatSha
safe = Travis.Helpers.safe
`import { formatSha as _formatSha, safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
formatSha = (sha) ->
safe formatShaHelper(sha)
helper = Ember.Handlebars.makeBoundHelper (sha) ->
safe _formatSha(sha)
Travis.Handlebars.formatSha = formatSha
`export default helper`

View File

@ -1,7 +1,7 @@
timeAgoInWords = Travis.Helpers.timeAgoInWords
safe = Travis.Helpers.safe
`import { timeAgoInWords, safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
formatTime = (value, options) ->
helper = Ember.Handlebars.makeBoundHelper (value, options) ->
safe timeAgoInWords(value) || '-'
Travis.Handlebars.formatTime = formatTime
`export default helper`

View File

@ -1,8 +1,7 @@
formatConfig = Travis.Helpers.formatConfig
githubCommitUrl = Travis.Urls.githubCommit
safe = Travis.Helpers.safe
`import { formatConfig, save } from 'travis/utils/helpers'`
`import { githubCommit as githubCommitUrl } from 'travis/utils/urls'`
githubCommitLink = (slug, commitSha) ->
helper = Ember.Handlebars.makeBoundHelper (slug, commitSha) ->
return '' unless commitSha
sha = Handlebars.Utils.escapeExpression formatCommit(commitSha)
return sha unless slug
@ -10,4 +9,4 @@ githubCommitLink = (slug, commitSha) ->
safe '<a class="github-link only-on-hover" href="' + url + '">' + sha + '</a>'
Travis.Handlebars.githubCommitLink = githubCommitLink
`export default helper`

View File

@ -1,10 +1,10 @@
safe = Travis.Helpers.safe
`import { safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
fn = (state) ->
helper = Ember.Handlebars.makeBoundHelper (state) ->
if state == 'received'
'booting'
else
state
Travis.Handlebars.humanizeState = fn
`export default helper`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
originalInputHelper = Ember.Handlebars.helpers.input
input = (options) ->
@ -25,4 +27,4 @@ input = (options) ->
originalInputHelper.call(this, options)
Travis.Handlebars.input = input
`export default input`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
LabelView = Ember.View.extend(
tagName: 'label'
@ -29,4 +31,4 @@ label = (options) ->
Ember.Handlebars.helpers.view.call(this, view, options)
Travis.Handlebars.label = label
`export default label`

View File

@ -1,5 +1,5 @@
fn = (size) ->
helper = Ember.Handlebars.makeBoundHelper (size) ->
if size
(size / 1024 / 1024).toFixed(2)
Travis.Handlebars.mb = fn
`export default helper`

View File

@ -1,6 +1,7 @@
pathFrom = Travis.Helpers.pathFrom
`import { pathFrom } from 'travis/utils/helpers'`
`import Ember from "ember"`
fn = (url, options) ->
helper = Ember.Handlebars.makeBoundHelper (url, options) ->
path = pathFrom(url)
if path.indexOf('...') >= 0
shas = path.split('...')
@ -8,4 +9,4 @@ fn = (url, options) ->
else
path
Travis.Handlebars.shortCompareShas = fn
`export default helper`

View File

@ -1,6 +1,7 @@
safe = Travis.Helpers.safe
`import { safe } from 'travis/utils/helpers'`
`import Ember from "ember"`
tipsy = (text, tip) ->
helper = Ember.Handlebars.makeBoundHelper (text, tip) ->
safe '<span class="tool-tip" original-title="' + tip + '">' + text + '</span>'
Travis.Handlebars.tipsy = tipsy
`export default helper`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
ErrorsView = Ember.View.extend
tagName: 'span'
template: Ember.Handlebars.compile("{{#each view.errors}}{{message}}{{/each}}")
@ -21,4 +23,4 @@ fn = (name, options) ->
Ember.Handlebars.helpers.view.call(this, view, options)
Travis.Handlebars.travisErrors = fn
`export default fn`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
FormFieldRowView = Ember.View.extend
invalid: Ember.computed.notEmpty('errors.[]')
classNameBindings: ['invalid']
@ -18,4 +20,4 @@ fn = (name, options) ->
Ember.Handlebars.helpers.view.call(this, view, options)
Travis.Handlebars.travisField = fn
`export default fn`

25
app/index.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Travis</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/travis.css">
{{content-for 'head-footer'}}
</head>
<body>
{{content-for 'body'}}
<script src="assets/vendor.js"></script>
<script src="assets/travis.js"></script>
{{content-for 'body-footer'}}
</body>
</html>

View File

@ -1,3 +1,5 @@
`import Auth from 'travis/utils/auth'`
initialize = (container, app) ->
app.register 'auth:main', Auth
@ -11,5 +13,5 @@ AuthInitializer =
name: 'auth'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer AuthInitializer
`export {initialize}`
`export default AuthInitializer`

View File

@ -1,6 +1,4 @@
require 'config/environment'
config = ENV.config
`import config from 'travis/config/environment'`
initialize = (container, application) ->
application.register 'config:main', config, { instantiate: false }
@ -12,5 +10,5 @@ ConfigInitializer =
name: 'config'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer ConfigInitializer
`export {initialize}`
`export default ConfigInitializer`

View File

@ -1,4 +1,4 @@
config = ENV.config
`import config from 'travis/config/environment'`
initialize = (container) ->
if config.ga_code
@ -16,5 +16,5 @@ GAInitializer =
name: 'google-analytics'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer GAInitializer
`export {initialize}`
`export default GAInitializer`

View File

@ -1,7 +1,4 @@
require 'utils/pusher'
config = ENV.config
Pusher = Travis.Pusher
`import config from 'travis/config/environment'`
initialize = (container, application) ->
if config.pusher.key
@ -18,5 +15,5 @@ PusherInitializer =
name: 'pusher'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer PusherInitializer
`export {initialize}`
`export default PusherInitializer`

View File

@ -1,7 +1,7 @@
config = ENV.config
Slider = Travis.Slider
Tailing = Travis.Tailing
ToTop = Travis.ToTop
`import Slider from 'travis/utils/slider'`
`import Tailing from 'travis/utils/tailing'`
`import ToTop from 'travis/utils/to-top'`
`import config from 'travis/config/environment'`
initialize = (container, application) ->
application.slider = new Slider(application.storage)
@ -13,5 +13,5 @@ Initializer =
name: 'services'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer Initializer
`export {initialize}`
`export default Initializer`

View File

@ -1,3 +1,5 @@
`import Ember from 'ember'`
Storage = Em.Object.extend
init: ->
@set('storage', {})
@ -52,5 +54,5 @@ StorageInitializer =
before: 'services'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer StorageInitializer
`export {initialize}`
`export default StorageInitializer`

View File

@ -14,5 +14,5 @@ StylesheetsManagerInitializer =
name: 'inject-stylesheets-manager'
initialize: initialize
Ember.onLoad 'Ember.Application', (Application) ->
Application.initializer StylesheetsManagerInitializer
`export {initialize}`
`export default StylesheetsManagerInitializer`

View File

@ -1,5 +1,4 @@
githubCommit = Travis.Urls.githubCommit
githubPullRequest = Travis.Urls.githubPullRequest
`import { githubCommit, githubPullRequest } from 'travis/utils/urls'`
mixin = Ember.Mixin.create
urlGithubCommit: (->
@ -10,4 +9,4 @@ mixin = Ember.Mixin.create
githubPullRequest(@get('repo.slug'), @get('build.pullRequestNumber'))
).property('repo.slug', 'build.pullRequestNumber')
Travis.GithubUrlProperties = mixin
`export default mixin`

0
app/models/.gitkeep Normal file
View File

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Account = Model.extend
name: DS.attr()
@ -10,4 +9,4 @@ Account = Model.extend
education: DS.attr('boolean')
loginBinding: 'id'
Travis.Account = Account
`export default Account`

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Annotation = Model.extend
jobId: DS.attr('number')
@ -11,4 +10,4 @@ Annotation = Model.extend
job: DS.belongsTo('job')
Travis.Annotation = Annotation
`export default Annotation`

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Branch = Model.extend
repositoryId: DS.attr('number')
@ -24,4 +23,4 @@ Branch = Model.extend
@notifyPropertyChange 'started_at'
@notifyPropertyChange 'finished_at'
Travis.Branch = Branch
`export default Branch`

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Broadcast = Model.extend
message: DS.attr()
@ -27,4 +26,4 @@ Broadcast.reopenClass
# TODO fix or monkey-patch the adapter's url and key lookup/generation crap
# url: 'users/broadcasts'
Travis.Broadcast = Broadcast
`export default Broadcast`

View File

@ -1,13 +1,9 @@
require 'models/model'
require 'utils/duration-calculations'
require 'utils/ajax'
compact = Travis.Helpers.compact
configKeys = Travis.Helpers.configKeys
Ajax = Travis.ajax
configKeysMap = Travis.CONFIG_KEYS_MAP
DurationCalculations = Travis.DurationCalculations
Model = Travis.Model
`import { durationFrom, configKeys, compact } from 'travis/utils/helpers'`
`import Ajax from 'travis/utils/ajax'`
`import configKeysMap from 'travis/utils/keys-map'`
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
`import DurationCalculations from 'travis/utils/duration-calculations'`
Build = Model.extend DurationCalculations,
state: DS.attr()
@ -108,4 +104,4 @@ Build = Model.extend DurationCalculations,
moment(finishedAt).format('lll')
).property('finishedAt')
Travis.Build = Build
`export default Build`

View File

@ -1,6 +1,6 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
`import Build from 'travis/models/build'`
Commit = Model.extend
sha: DS.attr()
@ -32,4 +32,4 @@ Commit = Model.extend
@get('authorEmail') == @get('committerEmail')
).property('authorName', 'authorEmail', 'committerName', 'committerEmail')
Travis.Commit = Commit
`export default Commit`

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
EnvVar = Model.extend
name: DS.attr()
@ -9,4 +8,4 @@ EnvVar = Model.extend
repo: DS.belongsTo('repo', async: true)
Travis.EnvVar = EnvVar
`export default EnvVar`

View File

@ -1,8 +1,5 @@
require 'models/model'
config = ENV.config
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Hook = Model.extend
name: DS.attr()
@ -33,4 +30,4 @@ Hook = Model.extend
@set 'active', !@get('active')
@save()
Travis.Hook = Hook
`export default Hook`

View File

@ -1,12 +1,10 @@
require 'models/model'
require 'models/log'
require 'utils/ajax'
Model = Travis.Model
DurationCalculations = Travis.DurationCalculations
Log = Travis.Log
compact = Travis.Helpers.compact
Ajax = Travis.ajax
`import { durationFrom, configKeys, compact } from 'travis/utils/helpers'`
`import Ajax from 'travis/utils/ajax'`
`import configKeysMap from 'travis/utils/keys-map'`
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
`import Log from 'travis/models/log'`
`import DurationCalculations from 'travis/utils/duration-calculations'`
Job = Model.extend DurationCalculations,
logId: DS.attr()
@ -140,4 +138,4 @@ Job = Model.extend DurationCalculations,
"#{@get('repo.slug')} ##{@get('number')}"
).property()
Travis.Job = Job
`export default Job`

View File

@ -1,7 +1,8 @@
require 'utils/log-chunks'
Ajax = Travis.ajax
config = ENV.config
`import Model from 'travis/models/model'`
`import Ajax from 'travis/utils/ajax'`
`import Job from 'travis/models/job'`
`import Ember from 'ember'`
`import config from 'travis/config/environment'`
Request = Ember.Object.extend
HEADERS:
@ -98,4 +99,4 @@ Log = Ember.Object.extend
@append(number: 1, content: text, final: true)
@set('isLoaded', true)
Travis.Log = Log
`export default Log`

View File

@ -1,3 +1,3 @@
Model = DS.Model.extend()
`import DS from 'ember-data';`
Travis.Model = Model
`export default DS.Model.extend();`

View File

@ -1,15 +1,10 @@
require 'utils/expandable-record-array'
require 'models/model'
Model = Travis.Model
ExpandableRecordArray = Travis.ExpandableRecordArray
EnvVar = Travis.EnvVar
Build = Travis.Build
SshKey = Travis.SshKey
Event = Travis.Event
durationFromHelper = Travis.Helpers.durationFrom
Ajax = Travis.ajax
`import ExpandableRecordArray from 'travis/utils/expandable-record-array'`
`import Model from 'travis/models/model'`
`import Ajax from 'travis/utils/ajax'`
# TODO: Investigate for some weird reason if I use durationFrom here not durationFromHelper,
# the function stops being visible inside computed properties.
`import { durationFrom as durationFromHelper } from 'travis/utils/helpers'`
`import Build from 'travis/models/build'`
Repo = Model.extend
slug: DS.attr()
description: DS.attr()
@ -184,4 +179,4 @@ Repo.reopenClass
# buildURL: (slug) ->
# if slug then slug else 'repos'
Travis.Repo = Repo
`export default Repo`

View File

@ -1,6 +1,5 @@
require 'models/model'
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
Request = Model.extend
created_at: DS.attr()
@ -30,4 +29,4 @@ Request = Model.extend
@get('event_type') == 'pull_request'
).property('event_type')
Travis.Request = Request
`export default Request`

View File

@ -1,8 +1,9 @@
Model = Travis.Model
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
SshKey = Model.extend
value: DS.attr()
description: DS.attr()
fingerprint: DS.attr()
Travis.SshKey = SshKey
`export default SshKey`

View File

@ -1,10 +1,6 @@
require 'utils/ajax'
require 'models/model'
Model = Travis.Model
Ajax = Travis.ajax
Account = Travis.Account
config = ENV.config
`import Ember from 'ember'`
`import Model from 'travis/models/model'`
`import Ajax from 'travis/utils/ajax'`
User = Model.extend
name: DS.attr()
@ -88,4 +84,4 @@ User = Model.extend
user[$.underscore(name)] = @get(name)
Travis.sessionStorage.setItem('travis.user', JSON.stringify(user))
Travis.User = User
`export default User`

View File

@ -1,9 +1,8 @@
require 'utils/location'
require 'routes/application'
config = ENV.config
`import Ember from 'ember'`
`import config from './config/environment'`
Router = Ember.Router.extend
# TODO: we should use TravisLocation here
location: 'history'
handleURL: (url) ->
@ -54,4 +53,4 @@ Router.map ->
@route 'notFound', path: "/*path"
Travis.Router = Router
`export default Router`

0
app/routes/.gitkeep Normal file
View File

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
renderTemplate: ->
@ -23,4 +21,4 @@ Route = TravisRoute.extend
"repo.#{type.camelize()}"
).property('contentType')
Travis.AbstractBuildsRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
setupController: (controller, account) ->
@ -17,4 +15,4 @@ Route = TravisRoute.extend
else
{}
Travis.AccountRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
model: ->
@ -11,4 +9,4 @@ Route = TravisRoute.extend
@render 'profile_accounts', outlet: 'left', into: 'profile'
Travis.AccountsRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
redirect: ->
@ -11,5 +9,4 @@ Route = TravisRoute.extend
account = accounts.find (account) -> account.get('login') == login
@replaceWith 'account', account
Travis.AccountsIndexRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
setupController: ->
@ -11,4 +9,4 @@ Route = TravisRoute.extend
renderTemplate: ->
@render 'accounts_info'
Travis.AccountsInfoRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
needsAuth: false
@ -45,4 +43,4 @@ Route = TravisRoute.extend
else
@transitionTo('main')
Travis.ApplicationRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
needsAuth: false
@ -22,4 +20,4 @@ Route = TravisRoute.extend
if @signedIn()
@transitionTo('main')
Travis.AuthRoute = Route
`export default Route`

View File

@ -1,4 +1,5 @@
config = ENV.config
`import config from 'travis/config/environment'`
`import Ember from 'ember'`
Route = Ember.Route.extend
beforeModel: (transition) ->
@ -18,4 +19,4 @@ Route = Ember.Route.extend
config.pro
).property()
Travis.BasicRoute = Route
`export default Route`

View File

@ -1,7 +1,5 @@
require 'routes/basic'
AbstractBuildsRoute = Travis.AbstractBuildsRoute
`import AbstractBuildsRoute from 'travis/routes/abstract-builds'`
Route = AbstractBuildsRoute.extend(contentType: 'branches')
Travis.BranchesRoute = Route
`export default Route`

View File

@ -1,7 +1,4 @@
require 'routes/basic'
require 'models/build'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
serialize: (model, params) ->
@ -25,4 +22,4 @@ Route = TravisRoute.extend
@controllerFor('job').set('job', null)
@controllerFor('build').set('build', null)
Travis.BuildRoute = Route
`export default Route`

View File

@ -1,7 +1,5 @@
require 'routes/basic'
AbstractBuildsRoute = Travis.AbstractBuildsRoute
`import AbstractBuildsRoute from 'travis/routes/abstract-builds'`
Route = AbstractBuildsRoute.extend(contentType: 'builds')
Travis.BuildsRoute = Route
`export default Route`

View File

@ -1,10 +1,6 @@
require 'routes/basic'
require 'models/request'
require 'utils/ajax'
Request = Travis.Request
Ajax = Travis.ajax
TravisRoute = Travis.BasicRoute
`import Ember from 'ember'`
`import TravisRoute from 'travis/routes/basic'`
`import Ajax from 'travis/utils/ajax'`
Route = TravisRoute.extend
needsAuth: true
@ -32,4 +28,4 @@ Route = TravisRoute.extend
result
)
Travis.CachesRoute = Route
`export default Route`

View File

@ -1,6 +1,4 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
needsAuth: true
@ -12,4 +10,4 @@ Route = TravisRoute.extend
@get('stylesheetsManager').enable('main')
@get('stylesheetsManager').disable('dashboard')
Travis.DashboardRoute = Route
`export default Route`

View File

@ -1,6 +1,5 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import Ember from 'ember'`
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
queryParams:
@ -16,4 +15,4 @@ Route = TravisRoute.extend
Ember.Object.create(repo)
)
Travis.DashboardRepositoriesRoute = Route
`export default Route`

View File

@ -1,10 +1,8 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
model: (params) ->
repo = @modelFor('repo')
repo.get('envVars.promise')
Travis.EnvVarsRoute = Route
`export default Route`

View File

@ -1,9 +1,4 @@
require 'routes/basic'
require 'routes/simple-layout'
require 'models/repo'
SimpleLayoutRoute = Travis.SimpleLayoutRoute
Repo = Travis.Repo
`import SimpleLayoutRoute from 'travis/routes/simple-layout'`
Route = SimpleLayoutRoute.extend
activate: ->
@ -35,4 +30,4 @@ Route = SimpleLayoutRoute.extend
# do nothing, we are showing first sync, so it's normal that there is
# no owned repos
Travis.FirstSyncRoute = Route
`export default Route`

View File

@ -1,7 +1,5 @@
require 'routes/basic'
TravisRoute = Travis.BasicRoute
`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend()
Travis.GettingStartedRoute = Route
`export default Route`

View File

@ -1,7 +1,4 @@
require 'routes/basic'
require 'routes/simple-layout'
SimpleLayoutRoute = Travis.SimpleLayoutRoute
`import SimpleLayoutRoute from 'travis/routes/simple-layout'`
Route = SimpleLayoutRoute.extend
setupController: (controller) ->
@ -9,4 +6,4 @@ Route = SimpleLayoutRoute.extend
existingUser = document.location.hash.match(/#existing[_-]user/)
controller.set('existingUser', existingUser)
Travis.InsufficientOauthPermissionsRoute = Route
`export default Route`

Some files were not shown because too many files have changed in this diff Show More