Merge branch 'master' into insufficient-oauth-permissions
Conflicts: assets/scripts/app/routes.coffee
This commit is contained in:
commit
06d90dbc9b
2
Gemfile
2
Gemfile
|
@ -17,12 +17,12 @@ group :assets do
|
||||||
gem 'tilt'
|
gem 'tilt'
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
gem 'yui-compressor'
|
gem 'yui-compressor'
|
||||||
|
gem 'libv8', '~> 3.16.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'localeapp'
|
gem 'localeapp'
|
||||||
gem 'handlebars'
|
|
||||||
gem 'localeapp-handlebars_i18n'
|
gem 'localeapp-handlebars_i18n'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -29,7 +29,6 @@ GEM
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.5.0)
|
coffee-script-source (1.5.0)
|
||||||
commonjs (0.2.6)
|
|
||||||
compass (0.12.2)
|
compass (0.12.2)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
|
@ -48,12 +47,9 @@ GEM
|
||||||
pry (>= 0.9.10)
|
pry (>= 0.9.10)
|
||||||
terminal-table (>= 1.4.3)
|
terminal-table (>= 1.4.3)
|
||||||
thor (>= 0.14.6)
|
thor (>= 0.14.6)
|
||||||
handlebars (0.4.0)
|
|
||||||
commonjs (~> 0.2.3)
|
|
||||||
therubyracer (~> 0.11.1)
|
|
||||||
i18n (0.6.3)
|
i18n (0.6.3)
|
||||||
json (1.7.7)
|
json (1.7.7)
|
||||||
libv8 (3.11.8.13)
|
libv8 (3.16.14.3)
|
||||||
listen (0.7.3)
|
listen (0.7.3)
|
||||||
localeapp (0.6.9)
|
localeapp (0.6.9)
|
||||||
gli
|
gli
|
||||||
|
@ -89,7 +85,6 @@ GEM
|
||||||
rake-pipeline-i18n-filters (0.0.5)
|
rake-pipeline-i18n-filters (0.0.5)
|
||||||
rake-pipeline (~> 0.6)
|
rake-pipeline (~> 0.6)
|
||||||
rb-fsevent (0.9.3)
|
rb-fsevent (0.9.3)
|
||||||
ref (1.0.2)
|
|
||||||
rerun (0.8.0)
|
rerun (0.8.0)
|
||||||
listen
|
listen
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
|
@ -116,9 +111,6 @@ GEM
|
||||||
tilt (~> 1.3)
|
tilt (~> 1.3)
|
||||||
slop (3.4.3)
|
slop (3.4.3)
|
||||||
terminal-table (1.4.5)
|
terminal-table (1.4.5)
|
||||||
therubyracer (0.11.4)
|
|
||||||
libv8 (~> 3.11.8.12)
|
|
||||||
ref
|
|
||||||
thor (0.17.0)
|
thor (0.17.0)
|
||||||
tilt (1.3.3)
|
tilt (1.3.3)
|
||||||
uglifier (1.3.0)
|
uglifier (1.3.0)
|
||||||
|
@ -136,7 +128,7 @@ DEPENDENCIES
|
||||||
compass
|
compass
|
||||||
foreman
|
foreman
|
||||||
guard
|
guard
|
||||||
handlebars
|
libv8 (~> 3.16.0)
|
||||||
localeapp
|
localeapp
|
||||||
localeapp-handlebars_i18n
|
localeapp-handlebars_i18n
|
||||||
puma
|
puma
|
||||||
|
|
|
@ -48,6 +48,14 @@ Travis.FirstSyncController = Em.Controller.extend
|
||||||
|
|
||||||
isSyncing: Ember.computed.alias('user.isSyncing')
|
isSyncing: Ember.computed.alias('user.isSyncing')
|
||||||
|
|
||||||
|
Travis.BuildNotFoundController = Em.Controller.extend
|
||||||
|
needs: ['repo', 'currentUser']
|
||||||
|
ownedAndActive: (->
|
||||||
|
if permissions = @get('controllers.currentUser.permissions')
|
||||||
|
if repo = @get('controllers.repo.repo')
|
||||||
|
repo.get('active') && permissions.contains(parseInt(repo.get('id')))
|
||||||
|
).property('controllers.repo.repo', 'controllers.currentUser.permissions')
|
||||||
|
|
||||||
require 'controllers/accounts'
|
require 'controllers/accounts'
|
||||||
require 'controllers/build'
|
require 'controllers/build'
|
||||||
require 'controllers/builds'
|
require 'controllers/builds'
|
||||||
|
|
|
@ -6,7 +6,7 @@ Travis.ReposController = Ember.ArrayController.extend
|
||||||
'owned'
|
'owned'
|
||||||
else
|
else
|
||||||
'recent'
|
'recent'
|
||||||
).property('currentUser')
|
).property('currentUser.id')
|
||||||
|
|
||||||
currentUserIdDidChange: (->
|
currentUserIdDidChange: (->
|
||||||
if @get('currentUser.id')
|
if @get('currentUser.id')
|
||||||
|
@ -16,10 +16,10 @@ Travis.ReposController = Ember.ArrayController.extend
|
||||||
).observes('currentUser.id')
|
).observes('currentUser.id')
|
||||||
|
|
||||||
tabOrIsLoadedDidChange: (->
|
tabOrIsLoadedDidChange: (->
|
||||||
|
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
||||||
if @get('tab') == 'owned' && @get('isLoaded') && @get('length') == 0
|
if @get('tab') == 'owned' && @get('isLoaded') && @get('length') == 0
|
||||||
|
|
||||||
@container.lookup('router:main').send('renderNoOwnedRepos')
|
@container.lookup('router:main').send('renderNoOwnedRepos')
|
||||||
).observes('isLoaded', 'tab')
|
).observes('isLoaded', 'tab', 'length')
|
||||||
|
|
||||||
isLoadedBinding: 'content.isLoaded'
|
isLoadedBinding: 'content.isLoaded'
|
||||||
needs: ['currentUser', 'repo']
|
needs: ['currentUser', 'repo']
|
||||||
|
|
|
@ -12,6 +12,7 @@ require 'travis/model'
|
||||||
lastBuildFinishedAt: Ember.attr('string')
|
lastBuildFinishedAt: Ember.attr('string')
|
||||||
githubLanguage: Ember.attr('string')
|
githubLanguage: Ember.attr('string')
|
||||||
_lastBuildDuration: Ember.attr(Number, key: 'last_build_duration')
|
_lastBuildDuration: Ember.attr(Number, key: 'last_build_duration')
|
||||||
|
active: Ember.attr('boolean')
|
||||||
|
|
||||||
lastBuild: Ember.belongsTo('Travis.Build', key: 'last_build_id')
|
lastBuild: Ember.belongsTo('Travis.Build', key: 'last_build_id')
|
||||||
|
|
||||||
|
@ -113,7 +114,7 @@ require 'travis/model'
|
||||||
@find(owner_name: login, orderBy: 'name')
|
@find(owner_name: login, orderBy: 'name')
|
||||||
|
|
||||||
accessibleBy: (login) ->
|
accessibleBy: (login) ->
|
||||||
@find(member: login, orderBy: 'name')
|
@find(member: login, active: true)
|
||||||
|
|
||||||
search: (query) ->
|
search: (query) ->
|
||||||
@find(search: query, orderBy: 'name')
|
@find(search: query, orderBy: 'name')
|
||||||
|
|
|
@ -125,7 +125,8 @@ Travis.SetupLastBuild = Ember.Mixin.create
|
||||||
# TODO: it would be nicer to do it with promises
|
# TODO: it would be nicer to do it with promises
|
||||||
repo = @controllerFor('repo').get('repo')
|
repo = @controllerFor('repo').get('repo')
|
||||||
if repo && repo.get('isLoaded') && !repo.get('lastBuild')
|
if repo && repo.get('isLoaded') && !repo.get('lastBuild')
|
||||||
@render('builds/not_found', outlet: 'pane', into: 'repo')
|
Ember.run.next =>
|
||||||
|
@render('builds/not_found', outlet: 'pane', into: 'repo', controller: 'buildNotFound')
|
||||||
|
|
||||||
Travis.GettingStartedRoute = Ember.Route.extend
|
Travis.GettingStartedRoute = Ember.Route.extend
|
||||||
setupController: ->
|
setupController: ->
|
||||||
|
@ -150,7 +151,12 @@ Travis.SimpleLayoutRoute = Ember.Route.extend
|
||||||
@render 'top', outlet: 'top'
|
@render 'top', outlet: 'top'
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
Travis.FirstSyncRoute = Travis.SimpleLayoutRoute.extend()
|
Travis.FirstSyncRoute = Travis.SimpleLayoutRoute.extend
|
||||||
|
events:
|
||||||
|
# do nothing, we are showing first sync, so it's normal that there is
|
||||||
|
# no owned repos
|
||||||
|
renderNoOwnedRepos: (->)
|
||||||
|
|
||||||
Travis.InsufficientOauthPermissionsRoute = Travis.SimpleLayoutRoute.extend
|
Travis.InsufficientOauthPermissionsRoute = Travis.SimpleLayoutRoute.extend
|
||||||
setupController: (controller) ->
|
setupController: (controller) ->
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
|
@ -289,6 +295,7 @@ Travis.RepoRoute = Ember.Route.extend
|
||||||
proxy.set 'isLoading', false
|
proxy.set 'isLoading', false
|
||||||
|
|
||||||
if repos.get('length') == 0
|
if repos.get('length') == 0
|
||||||
|
Ember.run.next ->
|
||||||
self.render('repos/not_found', outlet: 'main')
|
self.render('repos/not_found', outlet: 'main')
|
||||||
else
|
else
|
||||||
proxy.set 'content', repos.objectAt(0)
|
proxy.set 'content', repos.objectAt(0)
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
|
{{#if ownedAndActive}}
|
||||||
|
This repository is active, but there are no builds yet. Builds will appear here after you push new commits to the repository.
|
||||||
|
{{else}}
|
||||||
There are no builds for this repository.
|
There are no builds for this repository.
|
||||||
|
{{/if}}
|
||||||
|
|
|
@ -14,11 +14,14 @@
|
||||||
{{#linkTo "repo" this class="slug"}}{{slug}}{{/linkTo}}
|
{{#linkTo "repo" this class="slug"}}{{slug}}{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#if lastBuildHash.number}}
|
||||||
{{#with lastBuildHash}}
|
{{#with lastBuildHash}}
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#linkTo "build" repo id class="last_build"}}{{number}}{{/linkTo}}
|
{{#linkTo "build" repo id class="last_build"}}{{number}}{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="duration-icon"></span><span class="duration_label">{{t repositories.duration}}:</span>
|
<span class="duration-icon"></span><span class="duration_label">{{t repositories.duration}}:</span>
|
||||||
|
|
|
@ -43,7 +43,7 @@ Travis.FirstSyncView = Travis.View.extend
|
||||||
).then(null, (e) ->
|
).then(null, (e) ->
|
||||||
console.log('There was a problem while redirecting from first sync', e)
|
console.log('There was a problem while redirecting from first sync', e)
|
||||||
)
|
)
|
||||||
, 5000
|
, Travis.config.syncingPageRedirectionTime
|
||||||
|
|
||||||
require 'views/accounts'
|
require 'views/accounts'
|
||||||
require 'views/application'
|
require 'views/application'
|
||||||
|
|
|
@ -5,7 +5,6 @@ module "My repos",
|
||||||
Ember.run -> Travis.reset()
|
Ember.run -> Travis.reset()
|
||||||
|
|
||||||
test "my repos is active by default when user is signed in", ->
|
test "my repos is active by default when user is signed in", ->
|
||||||
|
|
||||||
Ember.run -> signInUser()
|
Ember.run -> signInUser()
|
||||||
visit('/').then ->
|
visit('/').then ->
|
||||||
wait().then ->
|
wait().then ->
|
||||||
|
|
26
assets/scripts/spec/integration/sync.coffee
Normal file
26
assets/scripts/spec/integration/sync.coffee
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module "Sync",
|
||||||
|
setup: ->
|
||||||
|
Ember.run -> Travis.advanceReadiness()
|
||||||
|
teardown: ->
|
||||||
|
Ember.run -> Travis.reset()
|
||||||
|
|
||||||
|
test "first sync page is show when user just signed up and is syncing", ->
|
||||||
|
Ember.run ->
|
||||||
|
signInUser(
|
||||||
|
is_syncing: true
|
||||||
|
synced_at: null
|
||||||
|
login: 'new-user'
|
||||||
|
)
|
||||||
|
|
||||||
|
Travis.config.syncingPageRedirectionTime = 100
|
||||||
|
|
||||||
|
wait().then ->
|
||||||
|
ok $('#first_sync').text().match(/Just a few more seconds as we talk to GitHub to find out which repositories belong to you./)
|
||||||
|
|
||||||
|
stop()
|
||||||
|
Travis.__container__.lookup('controller:currentUser').get('content').set('isSyncing', false)
|
||||||
|
setTimeout ->
|
||||||
|
start()
|
||||||
|
visit('/').then ->
|
||||||
|
ok $('#getting-started').text().match(/Welcome to Travis CI!/)
|
||||||
|
, 120
|
|
@ -16,15 +16,19 @@ Ember.Container.prototype.stub = (fullName, instance) ->
|
||||||
instance.destroy = instance.destroy || (->)
|
instance.destroy = instance.destroy || (->)
|
||||||
this.cache.dict[fullName] = instance
|
this.cache.dict[fullName] = instance
|
||||||
|
|
||||||
window.signInUser = ->
|
window.signInUser = (data) ->
|
||||||
# for now let's just use harcoded data to log in the user,
|
data ||= {}
|
||||||
# we may extend it in the future to pass specific user data
|
userData = {
|
||||||
Travis.auth.signIn
|
|
||||||
user:
|
|
||||||
id: 1
|
id: 1
|
||||||
email: 'tyrion@example.org'
|
email: 'tyrion@example.org'
|
||||||
login: 'tyrion'
|
login: 'tyrion'
|
||||||
token: 'abcdef'
|
token: 'abcdef'
|
||||||
|
}
|
||||||
|
userData = Ember.merge(userData, data)
|
||||||
|
# for now let's just use harcoded data to log in the user,
|
||||||
|
# we may extend it in the future to pass specific user data
|
||||||
|
Travis.auth.signIn
|
||||||
|
user: userData
|
||||||
token: 'abcdef'
|
token: 'abcdef'
|
||||||
|
|
||||||
#@app = (url, options = {}) ->
|
#@app = (url, options = {}) ->
|
||||||
|
|
|
@ -71,6 +71,7 @@ $.extend Travis,
|
||||||
Travis.advanceReadiness() # bc, remove once merged to master
|
Travis.advanceReadiness() # bc, remove once merged to master
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
syncingPageRedirectionTime: 5000
|
||||||
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
||||||
pusher_key: $('meta[name="travis.pusher_key"]').attr('value')
|
pusher_key: $('meta[name="travis.pusher_key"]').attr('value')
|
||||||
ga_code: $('meta[name="travis.ga_code"]').attr('value')
|
ga_code: $('meta[name="travis.ga_code"]').attr('value')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user