From 16da227dd96bd79d6c246d9d488e4f93d8c191d5 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:26:09 +0100 Subject: [PATCH 01/24] [deprecations] Use LinkComponent instead of LinkView --- app/app.js | 2 +- config/deprecation-workflow.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/app.js b/app/app.js index e4aed0e2..f56a9fcf 100644 --- a/app/app.js +++ b/app/app.js @@ -5,7 +5,7 @@ import config from './config/environment'; Ember.MODEL_FACTORY_INJECTIONS = true; -Ember.LinkView.reopen({ +Ember.LinkComponent.reopen({ attributeBindings: ['alt'] }); diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 3757f4a7..cc0c3e59 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -1,7 +1,10 @@ window.deprecationWorkflow = window.deprecationWorkflow || {}; window.deprecationWorkflow.config = { workflow: [ - { handler: "silence", matchMessage: "Ember.LinkView is deprecated. Please use Ember.LinkComponent." }, + // DONE + { handler: "log", matchMessage: "Ember.LinkView is deprecated. Please use Ember.LinkComponent." }, + + // TODO { handler: "silence", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "Ember.arrayComputed is deprecated. Replace it with plain array methods" }, From 03332a86545770798052b25d96aefceb01f4d750 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:26:57 +0100 Subject: [PATCH 02/24] [deprecations] Don't run Ember.set directly in didInsertElement --- app/components/job-log.js | 4 ++-- app/components/log-content.js | 6 +++--- config/deprecation-workflow.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/components/job-log.js b/app/components/job-log.js index 37f31999..4ce88a27 100644 --- a/app/components/job-log.js +++ b/app/components/job-log.js @@ -4,7 +4,7 @@ export default Ember.Component.extend({ logBinding: 'job.log', didInsertElement() { - return this.setupLog(); + Ember.run.scheduleOnce('afterRender', this, 'setupLog'); }, logDidChange: function() { @@ -16,7 +16,7 @@ export default Ember.Component.extend({ }.observesBefore('log'), willDestroyElement() { - return this.teardownLog(); + Ember.run.scheduleOnce('afterRender', this, 'teardownLog'); }, teardownLog() { diff --git a/app/components/log-content.js b/app/components/log-content.js index 0fd30781..0c0f58f5 100644 --- a/app/components/log-content.js +++ b/app/components/log-content.js @@ -68,14 +68,14 @@ export default Ember.Component.extend({ console.log('log view: did insert'); } this._super.apply(this, arguments); - return this.createEngine(); + Ember.run.scheduleOnce('afterRender', this, 'createEngine'); }, willDestroyElement() { if (Log.DEBUG) { console.log('log view: will destroy'); } - return this.teardownLog(); + Ember.run.scheduleOnce('afterRender', this, 'teardownLog'); }, teardownLog(log) { @@ -121,7 +121,7 @@ export default Ember.Component.extend({ this.engine.limit = this.limit; this.logFolder = new LogFolder(this.$('#log')); this.lineSelector = new LinesSelector(this.$('#log'), this.scroll, this.logFolder); - return this.observeParts(log); + this.observeParts(log); } }, diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index cc0c3e59..ecba7192 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -3,6 +3,7 @@ window.deprecationWorkflow.config = { workflow: [ // DONE { handler: "log", matchMessage: "Ember.LinkView is deprecated. Please use Ember.LinkComponent." }, + { handler: "log", matchMessage: new RegExp("A property of .*? was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.") }, // TODO { handler: "silence", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, @@ -18,7 +19,6 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, { handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "silence", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, - { handler: "silence", matchMessage: "A property of was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, { handler: "silence", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." } ] From f5823669b2347c128d6c63d97c005e8fec73eac7 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:28:08 +0100 Subject: [PATCH 03/24] [deprecations] Use regular computed property instead of arrayComputed --- app/controllers/repos.js | 1 - app/utils/computed-limit.js | 30 ++++++------------------------ config/deprecation-workflow.js | 2 +- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/app/controllers/repos.js b/app/controllers/repos.js index 33d7cd2c..2af67045 100644 --- a/app/controllers/repos.js +++ b/app/controllers/repos.js @@ -1,5 +1,4 @@ import Ember from 'ember'; -import limit from 'travis/utils/computed-limit'; import Repo from 'travis/models/repo'; import Config from 'travis/config/environment'; diff --git a/app/utils/computed-limit.js b/app/utils/computed-limit.js index e594acef..72f9a601 100644 --- a/app/utils/computed-limit.js +++ b/app/utils/computed-limit.js @@ -1,30 +1,12 @@ import Ember from 'ember'; var limit = function(dependentKey, limitKey) { - var options = { - addedItem: function(array, item, changeMeta) { - var limit = Ember.get(this, limitKey); - if (changeMeta.index < limit) { - array.insertAt(changeMeta.index, item); - if (Ember.get(array, "length") > limit) { - array.popObject(); - } - } - return array; - }, - removedItem: function(array, item, changeMeta) { - var limit = Ember.get(this, limitKey); - if (changeMeta.index < limit && changeMeta.index < Ember.get(array, 'length')) { - array.removeAt(changeMeta.index, 1); - var toPush = changeMeta.arrayChanged.objectAt(limit); - if (toPush) { - array.pushObject(toPush); - } - } - return array; - } - }; - return Ember.arrayComputed(dependentKey, limitKey, options); + return Ember.computed(dependentKey, dependentKey + ".[]", function() { + var limit = Ember.get(this, limitKey), + array = this.get(dependentKey); + + return array.toArray().slice(0, limit); + }); }; export default limit; diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index ecba7192..4d6b3387 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -4,11 +4,11 @@ window.deprecationWorkflow.config = { // DONE { handler: "log", matchMessage: "Ember.LinkView is deprecated. Please use Ember.LinkComponent." }, { handler: "log", matchMessage: new RegExp("A property of .*? was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.") }, + { handler: "log", matchMessage: "Ember.arrayComputed is deprecated. Replace it with plain array methods" }, // TODO { handler: "silence", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, - { handler: "silence", matchMessage: "Ember.arrayComputed is deprecated. Replace it with plain array methods" }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, { handler: "silence", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, { handler: "silence", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, From 131a09c9c5b3953c1e811a6b9c4c0ef854615a95 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:29:08 +0100 Subject: [PATCH 04/24] [deprecations] Use store.query instead of store.find where appropriate --- app/models/repo.js | 6 +++--- config/deprecation-workflow.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/repo.js b/app/models/repo.js index 89ead250..3a9ba036 100644 --- a/app/models/repo.js +++ b/app/models/repo.js @@ -220,7 +220,7 @@ Repo.reopenClass({ return promise; } else { login = reposIdsOrlogin; - return store.find('repo', { + return store.query('repo', { member: login, orderBy: 'name' }); @@ -253,7 +253,7 @@ Repo.reopenClass({ }); }); } else { - return store.find('repo', { + return store.query('repo', { search: query, orderBy: 'name' }); @@ -299,7 +299,7 @@ Repo.reopenClass({ return repo; }); } else { - promise = store.find('repo', { + promise = store.query('repo', { slug: slug }).then(function(repos) { return repos.get('firstObject') || (function() { diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 4d6b3387..829f563b 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -3,11 +3,11 @@ window.deprecationWorkflow.config = { workflow: [ // DONE { handler: "log", matchMessage: "Ember.LinkView is deprecated. Please use Ember.LinkComponent." }, + { handler: "log", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, { handler: "log", matchMessage: new RegExp("A property of .*? was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.") }, { handler: "log", matchMessage: "Ember.arrayComputed is deprecated. Replace it with plain array methods" }, // TODO - { handler: "silence", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, { handler: "silence", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, From a6087d4fcdf61688765e5303c2165234d56533db Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:53:02 +0100 Subject: [PATCH 05/24] [deprecations] Use Component#_state instead of Component#state --- app/components/log-content.js | 2 +- config/deprecation-workflow.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/log-content.js b/app/components/log-content.js index 0c0f58f5..b21cfe6c 100644 --- a/app/components/log-content.js +++ b/app/components/log-content.js @@ -158,7 +158,7 @@ export default Ember.Component.extend({ if (Log.DEBUG) { console.log('log view: parts did change'); } - if (this.get('state') !== 'inDOM') { + if (this.get('_state') !== 'inDOM') { return; } ref = parts.slice(start, start + added); diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 829f563b..6758ed1b 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -6,11 +6,14 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Calling store.find() with a query object is deprecated. Use store.query() instead." }, { handler: "log", matchMessage: new RegExp("A property of .*? was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.") }, { handler: "log", matchMessage: "Ember.arrayComputed is deprecated. Replace it with plain array methods" }, + // this will still emit deprecations, because we use state property in + // request-icon compoenent, that makes Ember.js think that we're using + // internal component's state + { handler: "log", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, - { handler: "silence", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, { handler: "silence", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "`Ember.ArrayController` is deprecated." }, From 4e3a7559089dbc668f1773a64d3d25a8699b1989 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 10:54:09 +0100 Subject: [PATCH 06/24] [deprecations] Use Adapter#findRecord instead of Adapter#find --- app/adapters/ssh-key.js | 2 +- config/deprecation-workflow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/adapters/ssh-key.js b/app/adapters/ssh-key.js index 25e9113a..2d27f0ba 100644 --- a/app/adapters/ssh-key.js +++ b/app/adapters/ssh-key.js @@ -4,7 +4,7 @@ import ApplicationAdapter from 'travis/adapters/application'; export default ApplicationAdapter.extend({ namespace: 'settings', - find(store, type, id, record) { + findRecord(store, type, id, record) { return this.ajax(this.urlPrefix() + '/ssh_key/' + id, 'GET'); }, diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 6758ed1b..0b20489e 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -10,6 +10,7 @@ window.deprecationWorkflow.config = { // request-icon compoenent, that makes Ember.js think that we're using // internal component's state { handler: "log", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, + { handler: "log", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, @@ -19,7 +20,6 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "`Ember.ArrayController` is deprecated." }, { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, - { handler: "silence", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, { handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "silence", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, From a920ae9cd72c60a1e9cafe94d551df93afc0d79b Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:06:23 +0100 Subject: [PATCH 07/24] [deprecations] Use modelName instead of typeKey --- app/adapters/env-var.js | 4 ++-- app/adapters/ssh-key.js | 2 +- app/utils/test-auth.js | 2 +- config/deprecation-workflow.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/adapters/env-var.js b/app/adapters/env-var.js index 4aaca486..c11aa424 100644 --- a/app/adapters/env-var.js +++ b/app/adapters/env-var.js @@ -17,10 +17,10 @@ export default ApplicationAdapter.extend({ updateRecord(store, type, record) { var data, id, serializer; data = {}; - serializer = store.serializerFor(type.typeKey); + serializer = store.serializerFor(type.modelName); serializer.serializeIntoHash(data, type, record); id = Ember.get(record, 'id'); - return this.ajax(this.buildURL(type.typeKey, id, record), "PATCH", { + return this.ajax(this.buildURL(type.modelName, id, record), "PATCH", { data: data }); } diff --git a/app/adapters/ssh-key.js b/app/adapters/ssh-key.js index 2d27f0ba..165c5a2b 100644 --- a/app/adapters/ssh-key.js +++ b/app/adapters/ssh-key.js @@ -17,7 +17,7 @@ export default ApplicationAdapter.extend({ createRecord(store, type, record) { var data, id, serializer; data = {}; - serializer = store.serializerFor(type.typeKey); + serializer = store.serializerFor(type.modelName); serializer.serializeIntoHash(data, type, record, { includeId: true }); diff --git a/app/utils/test-auth.js b/app/utils/test-auth.js index 5d616a31..860bfa06 100644 --- a/app/utils/test-auth.js +++ b/app/utils/test-auth.js @@ -13,7 +13,7 @@ export default Ember.Object.extend({ signInForTests(user) { this.set('state', 'signed-in'); - if ((user.constructor.typeKey != null) !== 'user') { + if ((user.constructor.modelName != null) !== 'user') { this.store.push({ data: { type: 'user', diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 0b20489e..82f2a2d2 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -11,6 +11,7 @@ window.deprecationWorkflow.config = { // internal component's state { handler: "log", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, { handler: "log", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, + { handler: "log", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, @@ -23,6 +24,5 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "silence", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, - { handler: "silence", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." } ] }; From e7ca2c8bfe4ce86aa1a20b0436aaae7174353e13 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:12:33 +0100 Subject: [PATCH 08/24] [deprecations] Use Store#unloadRecord instaed of Store#dematerializeRecord --- app/components/add-ssh-key.js | 2 +- config/deprecation-workflow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/add-ssh-key.js b/app/components/add-ssh-key.js index 648ed32d..fce4371d 100644 --- a/app/components/add-ssh-key.js +++ b/app/components/add-ssh-key.js @@ -11,7 +11,7 @@ export default Ember.Component.extend({ var model = this.get('store').recordForId('ssh_key', id); if (model) { - this.get('store').dematerializeRecord(model._internalModel); + this.get('store').unloadRecord(model); var typeMap = this.get('store').typeMapFor(model.constructor); var idToRecord = typeMap.idToRecord; delete idToRecord[id]; diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 82f2a2d2..8be959a8 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -12,6 +12,7 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Usage of `state` is deprecated, use `_state` instead." }, { handler: "log", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, { handler: "log", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." }, + { handler: "log", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, @@ -22,7 +23,6 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, { handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." }, - { handler: "silence", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, ] }; From 4b71704b1cde5aefca01fee4c6f425f0ba68186b Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:16:13 +0100 Subject: [PATCH 09/24] [deprecations] Don't use second argument in a property This makes Ember.js think that we're trying to use the property as setter and it's deprecated --- app/components/env-var.js | 2 +- config/deprecation-workflow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/env-var.js b/app/components/env-var.js index 92f935a6..6442130b 100644 --- a/app/components/env-var.js +++ b/app/components/env-var.js @@ -8,7 +8,7 @@ export default Ember.Component.extend({ actionType: 'Save', showValueField: Ember.computed.alias('public'), - value: function(key, value) { + value: function(key) { if (this.get('envVar.public')) { return this.get('envVar.value'); } else { diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 8be959a8..0a30bccf 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -13,6 +13,7 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." }, { handler: "log", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." }, { handler: "log", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, + { handler: "log", matchMessage: "Using the same function as getter and setter is deprecated." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, @@ -22,7 +23,6 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "`Ember.ArrayController` is deprecated." }, { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, - { handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, ] }; From 39cf0b304436bb93a1dc488b27c1505a7ca226a2 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:22:40 +0100 Subject: [PATCH 10/24] [deprecations] Don't use ArrayController --- app/controllers/accounts.js | 2 +- app/controllers/builds.js | 8 ++++---- app/controllers/requests.js | 2 +- app/templates/builds.hbs | 4 ++-- config/deprecation-workflow.js | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/accounts.js b/app/controllers/accounts.js index 6f6fd118..38e5364f 100644 --- a/app/controllers/accounts.js +++ b/app/controllers/accounts.js @@ -1,3 +1,3 @@ import Ember from 'ember'; -export default Ember.ArrayController.extend(); +export default Ember.Controller.extend(); diff --git a/app/controllers/builds.js b/app/controllers/builds.js index dff591ff..17dc4f00 100644 --- a/app/controllers/builds.js +++ b/app/controllers/builds.js @@ -1,20 +1,20 @@ import Ember from 'ember'; -export default Ember.ArrayController.extend({ +export default Ember.Controller.extend({ sortAscending: false, sortProperties: ['number'], repoController: Ember.inject.controller('repo'), repoBinding: 'repoController.repo', tabBinding: 'repoController.tab', - isLoadedBinding: 'content.isLoaded', - isLoadingBinding: 'content.isLoading', + isLoadedBinding: 'model.isLoaded', + isLoadingBinding: 'model.isLoading', showMore() { var id, number, type; id = this.get('repo.id'); number = this.get('lastObject.number'); type = this.get('tab') === "builds" ? 'push' : 'pull_request'; - return this.get('content').load(this.olderThanNumber(id, number, type)); + return this.get('model').load(this.olderThanNumber(id, number, type)); }, displayShowMoreButton: function() { diff --git a/app/controllers/requests.js b/app/controllers/requests.js index 816c3f35..e1f16b96 100644 --- a/app/controllers/requests.js +++ b/app/controllers/requests.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -export default Ember.ArrayController.extend({ +export default Ember.Controller.extend({ repoController: Ember.inject.controller('repo'), lintUrl: function() { diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index 06990ad0..fe9fbfe1 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,6 +1,6 @@ -{{#if content.isLoaded}} +{{#if model.isLoaded}}
    - {{#each controller as |build|}} + {{#each model as |build|}} {{builds-item build=build}} {{else}} {{no-builds repo=noticeData isPR=displayPullRequests isBranch=displayBranches}} diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 0a30bccf..dae3a1a7 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -14,13 +14,13 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." }, { handler: "log", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, { handler: "log", matchMessage: "Using the same function as getter and setter is deprecated." }, + { handler: "log", matchMessage: "`Ember.ArrayController` is deprecated." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, { handler: "silence", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, - { handler: "silence", matchMessage: "`Ember.ArrayController` is deprecated." }, { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, From 85b2837c5211e17730e3298a988831dbf43b58ee Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:28:52 +0100 Subject: [PATCH 11/24] [deprecations] Disable fetching records in the background by Ember Data --- app/adapters/application.js | 10 ++++++++++ config/deprecation-workflow.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/adapters/application.js b/app/adapters/application.js index 77427849..033ecc5a 100644 --- a/app/adapters/application.js +++ b/app/adapters/application.js @@ -7,6 +7,16 @@ export default DS.ActiveModelAdapter.extend({ host: config.apiEndpoint, coalesceFindRequests: true, + // Before Ember Data 2.0 the default behaviour of running `findAll` was to get + // new records only when there're no records in the store. This will change + // to a different strategy in 2.0: when you run `findAll` it will not get any + // new data initially, but it will try loading new data in the background. + // + // I'm disabling the new behaviour for now. + shouldBackgroundReloadRecord() { + return false; + }, + ajaxOptions(url, type, options) { var base, hash, token; diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index dae3a1a7..2115b7ec 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -15,6 +15,7 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." }, { handler: "log", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "log", matchMessage: "`Ember.ArrayController` is deprecated." }, + { handler: "log", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, @@ -22,7 +23,6 @@ window.deprecationWorkflow.config = { { handler: "silence", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, - { handler: "silence", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, ] }; From f9df4b18966b16a9a013a68cccc5c139bbf024c0 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 7 Jan 2016 11:58:13 +0100 Subject: [PATCH 12/24] [deprecations] Don't use before observer --- app/mixins/polling.js | 35 +++++++++++++++++++++------------- config/deprecation-workflow.js | 6 +++--- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/app/mixins/polling.js b/app/mixins/polling.js index 0213671e..001b9edb 100644 --- a/app/mixins/polling.js +++ b/app/mixins/polling.js @@ -3,6 +3,12 @@ import Ember from 'ember'; export default Ember.Mixin.create({ polling: Ember.inject.service(), + init() { + this.set('currentPollModels', {}); + + return this._super(...arguments); + }, + didInsertElement() { this._super.apply(this, arguments); return this.startPolling(); @@ -17,16 +23,20 @@ export default Ember.Mixin.create({ return this.pollModel(key); }, - pollModelWillChange(sender, key, value) { - return this.stopPollingModel(key); - }, - pollModel(property) { - var addToPolling, model; - addToPolling = () => { + var model = this.get(property), + currentPollModels = this.get('currentPollModels'); + + if(currentPollModels[property]) { + this.get('polling').stopPolling(currentPollModels[property]); + } + currentPollModels[property] = model; + + var addToPolling = () => { return this.get('polling').startPolling(model); }; - if (model = this.get(property)) { + + if (model) { if (model.then) { return model.then(function(resolved) { return addToPolling(resolved); @@ -38,8 +48,8 @@ export default Ember.Mixin.create({ }, stopPollingModel(property) { - var model; - if (model = this.get(property)) { + var model = this.get(property); + if (model) { return this.get('polling').stopPolling(model); } }, @@ -54,7 +64,6 @@ export default Ember.Mixin.create({ pollModels.forEach( (property) => { this.pollModel(property); this.addObserver(property, this, 'pollModelDidChange'); - return Ember.addBeforeObserver(this, property, this, 'pollModelWillChange'); }); } if (this.pollHook) { @@ -63,15 +72,15 @@ export default Ember.Mixin.create({ }, stopPolling() { - var pollModels; - if (pollModels = this.get('pollModels')) { + var pollModels = this.get('pollModels'); + + if (pollModels) { if (!Ember.isArray(pollModels)) { pollModels = [pollModels]; } pollModels.forEach( (property) => { this.stopPollingModel(property); this.removeObserver(property, this, 'pollModelDidChange'); - return Ember.removeBeforeObserver(this, property, this, 'pollModelWillChange'); }); } return this.get('polling').stopPollingHook(this); diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index 2115b7ec..f033e5cb 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -16,13 +16,13 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Using the same function as getter and setter is deprecated." }, { handler: "log", matchMessage: "`Ember.ArrayController` is deprecated." }, { handler: "log", matchMessage: "The default behavior of `shouldBackgroundReloadRecord` will change in Ember Data 2.0 to always return true. If you would like to preserve the current behavior please override `shouldBackgroundReloadRecord` in your adapter:application and return false." }, + { handler: "log", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, + { handler: "log", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, + { handler: "log", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, - { handler: "silence", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, - { handler: "silence", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, - { handler: "silence", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, ] }; From 253a56f47d99db28f3adc7cd8144078fb6f78be8 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 7 Jan 2016 14:22:39 +0100 Subject: [PATCH 13/24] not use view in accounts --- app/templates/account.hbs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/templates/account.hbs b/app/templates/account.hbs index c68f5a7b..d6443d21 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -1,14 +1,15 @@ {{#if allHooks.isLoaded}}
    + {{#if config.billingEndpoint}}
    - {{#if view.subscribed}} + {{#if subscribeButtonInfo.subscribed}} Subscription active! {{else}} - {{#if view.education}} + {{#if subscribeButtonInfo.education}} Educational account! From b8f8071f980f3279e272f07b2992977df10f7e87 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 7 Jan 2016 14:33:34 +0100 Subject: [PATCH 14/24] add image descriptions --- app/templates/account.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/account.hbs b/app/templates/account.hbs index d6443d21..19bdae4a 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -43,19 +43,19 @@
    1. - + Flick the repo switch
      Flick the repository switch on
    2. - + Add .travis.yml file
      Add .travis.yml file to your repository
    3. - + Do a git push
      Trigger your first build with a git push
    4. From 1c33475ff6a0f9772c06c1cde517a0fd04c838e6 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 11 Jan 2016 13:26:43 +0100 Subject: [PATCH 15/24] [deprecations] Don't use snapshot.get() --- app/adapters/env-var.js | 6 +++--- app/adapters/ssh-key.js | 8 ++++---- config/deprecation-workflow.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/adapters/env-var.js b/app/adapters/env-var.js index c11aa424..2c688d13 100644 --- a/app/adapters/env-var.js +++ b/app/adapters/env-var.js @@ -7,7 +7,7 @@ export default ApplicationAdapter.extend({ buildURL(type, id, record) { var delimiter, repoId, url; url = this._super.apply(this, arguments); - if (record && (repoId = Ember.get(record, 'repo.id'))) { + if (record && record.belongsTo('repo') && (repoId = record.belongsTo('repo').id)) { delimiter = url.indexOf('?') !== -1 ? '&' : '?'; url = "" + url + delimiter + "repository_id=" + repoId; } @@ -15,11 +15,11 @@ export default ApplicationAdapter.extend({ }, updateRecord(store, type, record) { - var data, id, serializer; + var data, serializer; data = {}; serializer = store.serializerFor(type.modelName); serializer.serializeIntoHash(data, type, record); - id = Ember.get(record, 'id'); + var id = record.id; return this.ajax(this.buildURL(type.modelName, id, record), "PATCH", { data: data }); diff --git a/app/adapters/ssh-key.js b/app/adapters/ssh-key.js index 165c5a2b..749040f4 100644 --- a/app/adapters/ssh-key.js +++ b/app/adapters/ssh-key.js @@ -9,19 +9,19 @@ export default ApplicationAdapter.extend({ }, deleteRecord(store, type, record) { - var id; - id = Ember.get(record, 'id'); + var id = record.id; return this.ajax(this.urlPrefix() + '/ssh_key/' + id, "DELETE"); }, createRecord(store, type, record) { - var data, id, serializer; + var data, serializer; data = {}; serializer = store.serializerFor(type.modelName); serializer.serializeIntoHash(data, type, record, { includeId: true }); - id = Ember.get(record, 'id'); + + var id = record.id; return this.ajax(this.urlPrefix() + '/ssh_key/' + id, "PATCH", { data: data }); diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index f033e5cb..e2bc0454 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -19,10 +19,10 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Function#observesBefore is deprecated and will be removed in the near future." }, { handler: "log", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, { handler: "log", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, + { handler: "log", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, - { handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, ] }; From becde631d5e41a86389af8c14b3200c188642c9d Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 11 Jan 2016 17:22:16 +0100 Subject: [PATCH 16/24] [deprecations] Use ember-data-filter plugin At some point we may try to refactor places where we use store.filter(), but at the moment it would result with an overly complicated code, so I'd prefer to use a plugin. --- config/deprecation-workflow.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js index e2bc0454..54202abc 100644 --- a/config/deprecation-workflow.js +++ b/config/deprecation-workflow.js @@ -20,9 +20,9 @@ window.deprecationWorkflow.config = { { handler: "log", matchMessage: "Ember.addBeforeObserver is deprecated and will be removed in the near future." }, { handler: "log", matchMessage: "Ember.removeBeforeObserver is deprecated and will be removed in the near future." }, { handler: "log", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." }, + { handler: "log", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, // TODO { handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." }, - { handler: "silence", matchMessage: "The filter API will be moved into a plugin soon. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page" }, ] }; diff --git a/package.json b/package.json index ad4ffb6f..b3933424 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "ember-cli-sauce": "^1.1.0", "ember-cli-uglify": "1.2.0", "ember-data": "1.13.15", + "ember-data-filter": "1.13.0", "ember-disable-proxy-controllers": "^1.0.1", "ember-export-application-global": "^1.0.4", "ember-try": "0.0.7" From c3ef9ac5d9c647004c3de32f1328fb88854a2262 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 12 Jan 2016 14:06:19 +0100 Subject: [PATCH 17/24] [deprecations] Remove all of the views we use just for layouts --- app/components/travis-layout.js | 3 +++ app/controllers/error.js | 14 +++++++++++++- app/controllers/loading.js | 14 +++++++++++++- app/templates/auth/signin.hbs | 2 ++ app/templates/dashboard.hbs | 4 +++- app/templates/error404.hbs | 2 ++ app/templates/first-sync.hbs | 2 ++ app/templates/home-pro.hbs | 2 ++ app/templates/home.hbs | 2 ++ app/templates/insufficient-oauth-permissions.hbs | 2 ++ app/templates/loading.hbs | 4 +++- app/templates/logo.hbs | 4 +++- app/templates/main.hbs | 4 +++- app/templates/not-found.hbs | 4 +++- app/templates/owner.hbs | 2 ++ app/templates/plans.hbs | 2 ++ app/templates/profile.hbs | 4 +++- app/templates/team.hbs | 4 +++- app/views/auth/signin.js | 5 ----- app/views/dashboard.js | 6 ------ app/views/error.js | 10 ---------- app/views/error404.js | 6 ------ app/views/first-sync.js | 5 ----- app/views/home-pro.js | 6 ------ app/views/home.js | 5 ----- app/views/insufficient-oauth-permissions.js | 5 ----- app/views/loading.js | 10 ---------- app/views/logo.js | 6 ------ app/views/main.js | 6 ------ app/views/not-found.js | 5 ----- app/views/owner.js | 6 ------ app/views/plans.js | 6 ------ app/views/profile.js | 12 ------------ app/views/team.js | 6 ------ 34 files changed, 66 insertions(+), 114 deletions(-) create mode 100644 app/components/travis-layout.js delete mode 100644 app/views/auth/signin.js delete mode 100644 app/views/dashboard.js delete mode 100644 app/views/error.js delete mode 100644 app/views/error404.js delete mode 100644 app/views/first-sync.js delete mode 100644 app/views/home-pro.js delete mode 100644 app/views/home.js delete mode 100644 app/views/insufficient-oauth-permissions.js delete mode 100644 app/views/loading.js delete mode 100644 app/views/logo.js delete mode 100644 app/views/main.js delete mode 100644 app/views/not-found.js delete mode 100644 app/views/owner.js delete mode 100644 app/views/plans.js delete mode 100644 app/views/profile.js delete mode 100644 app/views/team.js diff --git a/app/components/travis-layout.js b/app/components/travis-layout.js new file mode 100644 index 00000000..6e705e67 --- /dev/null +++ b/app/components/travis-layout.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({}); diff --git a/app/controllers/error.js b/app/controllers/error.js index 38e5364f..344c515b 100644 --- a/app/controllers/error.js +++ b/app/controllers/error.js @@ -1,3 +1,15 @@ import Ember from 'ember'; -export default Ember.Controller.extend(); +export default Ember.Controller.extend({ + layoutName: Ember.computed({ + get(key) { + if(this._layoutName) { + return 'layouts/' + this._layoutName; + } + }, + + set(key, value) { + return this._layoutName = value; + } + }) +}); diff --git a/app/controllers/loading.js b/app/controllers/loading.js index 38e5364f..344c515b 100644 --- a/app/controllers/loading.js +++ b/app/controllers/loading.js @@ -1,3 +1,15 @@ import Ember from 'ember'; -export default Ember.Controller.extend(); +export default Ember.Controller.extend({ + layoutName: Ember.computed({ + get(key) { + if(this._layoutName) { + return 'layouts/' + this._layoutName; + } + }, + + set(key, value) { + return this._layoutName = value; + } + }) +}); diff --git a/app/templates/auth/signin.hbs b/app/templates/auth/signin.hbs index c5af9b3d..fda0bb4e 100644 --- a/app/templates/auth/signin.hbs +++ b/app/templates/auth/signin.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}} {{#if redirected}} {{/if}} @@ -14,3 +15,4 @@ {{/if}}

      +{{/travis-layout}} diff --git a/app/templates/dashboard.hbs b/app/templates/dashboard.hbs index c24cd689..70454b53 100644 --- a/app/templates/dashboard.hbs +++ b/app/templates/dashboard.hbs @@ -1 +1,3 @@ -{{outlet}} +{{#travis-layout layoutName="layouts/dashboard" class="dashboard"}} + {{outlet}} +{{/travis-layout}} diff --git a/app/templates/error404.hbs b/app/templates/error404.hbs index cc397661..fb95f1fe 100644 --- a/app/templates/error404.hbs +++ b/app/templates/error404.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/error" class="error error404"}}
      @@ -8,3 +9,4 @@

      404: Something's Missing

      We're sorry! It seems like this page cannot be found.

      +{{/travis-layout}} diff --git a/app/templates/first-sync.hbs b/app/templates/first-sync.hbs index d72e62d3..3cff22a1 100644 --- a/app/templates/first-sync.hbs +++ b/app/templates/first-sync.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}}
      {{#if isSyncing}} @@ -23,3 +24,4 @@ {{/unless}}
      +{{/travis-layout}} diff --git a/app/templates/home-pro.hbs b/app/templates/home-pro.hbs index 45319ab5..c3cdc5bb 100644 --- a/app/templates/home-pro.hbs +++ b/app/templates/home-pro.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
      @@ -89,3 +90,4 @@
      +{{/travis-layout}} diff --git a/app/templates/home.hbs b/app/templates/home.hbs index cc41929d..89ba15ce 100644 --- a/app/templates/home.hbs +++ b/app/templates/home.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page"}}
      @@ -248,3 +249,4 @@
      +{{/travis-layout}} diff --git a/app/templates/insufficient-oauth-permissions.hbs b/app/templates/insufficient-oauth-permissions.hbs index 5403a743..78073a0b 100644 --- a/app/templates/insufficient-oauth-permissions.hbs +++ b/app/templates/insufficient-oauth-permissions.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}}
      @@ -23,3 +24,4 @@ {{/if}}
    +{{/travis-layout}} diff --git a/app/templates/loading.hbs b/app/templates/loading.hbs index 18503769..6350bd7a 100644 --- a/app/templates/loading.hbs +++ b/app/templates/loading.hbs @@ -1 +1,3 @@ -{{loading-indicator}} \ No newline at end of file +{{#travis-layout layoutName=layoutName}} + {{loading-indicator}} +{{/travis-layout}} diff --git a/app/templates/logo.hbs b/app/templates/logo.hbs index f37a6e5e..10b99210 100644 --- a/app/templates/logo.hbs +++ b/app/templates/logo.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
    @@ -142,4 +143,5 @@
    - \ No newline at end of file + +{{/travis-layout}} diff --git a/app/templates/main.hbs b/app/templates/main.hbs index c24cd689..25a79202 100644 --- a/app/templates/main.hbs +++ b/app/templates/main.hbs @@ -1 +1,3 @@ -{{outlet}} +{{#travis-layout layoutName="layouts/home" class="main"}} + {{outlet}} +{{/travis-layout}} diff --git a/app/templates/not-found.hbs b/app/templates/not-found.hbs index 2f69fa59..a233a312 100644 --- a/app/templates/not-found.hbs +++ b/app/templates/not-found.hbs @@ -1 +1,3 @@ -The requested page was not found. +{{#travis-layout layoutName="layouts/simple"}} + The requested page was not found. +{{/travis-layout}} diff --git a/app/templates/owner.hbs b/app/templates/owner.hbs index 8cebd903..8a2ae6ed 100644 --- a/app/templates/owner.hbs +++ b/app/templates/owner.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/profile" class="owner"}}
    @@ -36,3 +37,4 @@ --}}
    +{{/travis-layout}} diff --git a/app/templates/plans.hbs b/app/templates/plans.hbs index 54bf849c..7c9ba25b 100644 --- a/app/templates/plans.hbs +++ b/app/templates/plans.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
    @@ -133,3 +134,4 @@
    +{{/layout-name}} diff --git a/app/templates/profile.hbs b/app/templates/profile.hbs index f5977610..6fcedf7e 100644 --- a/app/templates/profile.hbs +++ b/app/templates/profile.hbs @@ -1,3 +1,5 @@ +{{#travis-layout layoutName="layouts/profile" class="profile-view"}}
    {{outlet}} -
    \ No newline at end of file + +{{/travis-layout}} diff --git a/app/templates/team.hbs b/app/templates/team.hbs index e80237ab..76af68ff 100644 --- a/app/templates/team.hbs +++ b/app/templates/team.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
    @@ -13,4 +14,5 @@
- \ No newline at end of file + +{{/travis-layout}} diff --git a/app/views/auth/signin.js b/app/views/auth/signin.js deleted file mode 100644 index 09f8180b..00000000 --- a/app/views/auth/signin.js +++ /dev/null @@ -1,5 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/dashboard.js b/app/views/dashboard.js deleted file mode 100644 index a76fc0df..00000000 --- a/app/views/dashboard.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/dashboard', - classNames: ['dashboard'] -}); diff --git a/app/views/error.js b/app/views/error.js deleted file mode 100644 index a742a7ce..00000000 --- a/app/views/error.js +++ /dev/null @@ -1,10 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: function() { - var name; - if (name = this.get('controller.layoutName')) { - return 'layouts/' + name; - } - }.property('controller.layoutName') -}); diff --git a/app/views/error404.js b/app/views/error404.js deleted file mode 100644 index 27e2da03..00000000 --- a/app/views/error404.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/error', - classNames: ['error error404'] -}); diff --git a/app/views/first-sync.js b/app/views/first-sync.js deleted file mode 100644 index 9f2f62c1..00000000 --- a/app/views/first-sync.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/home-pro.js b/app/views/home-pro.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/home-pro.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/home.js b/app/views/home.js deleted file mode 100644 index 9c3fb90a..00000000 --- a/app/views/home.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/insufficient-oauth-permissions.js b/app/views/insufficient-oauth-permissions.js deleted file mode 100644 index 9f2f62c1..00000000 --- a/app/views/insufficient-oauth-permissions.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/loading.js b/app/views/loading.js deleted file mode 100644 index 44f7ec9b..00000000 --- a/app/views/loading.js +++ /dev/null @@ -1,10 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: (function() { - var name; - if (name = this.get('controller.layoutName')) { - return 'layouts/' + name; - } - }).property('controller.layoutName') -}); diff --git a/app/views/logo.js b/app/views/logo.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/logo.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/main.js b/app/views/main.js deleted file mode 100644 index 7d576766..00000000 --- a/app/views/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/home', - classNames: ['main'] -}); diff --git a/app/views/not-found.js b/app/views/not-found.js deleted file mode 100644 index 09f8180b..00000000 --- a/app/views/not-found.js +++ /dev/null @@ -1,5 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/owner.js b/app/views/owner.js deleted file mode 100644 index 93d95f46..00000000 --- a/app/views/owner.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/profile', - classNames: ['owner'] -}); diff --git a/app/views/plans.js b/app/views/plans.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/plans.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/profile.js b/app/views/profile.js deleted file mode 100644 index 8e701730..00000000 --- a/app/views/profile.js +++ /dev/null @@ -1,12 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - templateName: 'profile/show', - layoutName: 'layouts/profile', - classNames: ['profile-view'], - accountBinding: 'controller.account', - - name: function() { - return this.get('account.name') || this.get('account.login'); - }.property('account.name', 'account.login') -}); diff --git a/app/views/team.js b/app/views/team.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/team.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); From 21f25cd2bf7cb32d98f3ac4fb754f6bed8569b98 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 12 Jan 2016 14:49:06 +0100 Subject: [PATCH 18/24] [deprecations] Remove all of the views from the app --- .../build.js => components/build-wrapper.js} | 7 +-- .../builds-wrapper.js} | 13 +++-- .../job.js => components/job-wrapper.js} | 8 +-- .../popup-click-handler.js} | 9 ++- app/components/profile-accounts-wrapper.js | 6 ++ app/components/repo-wrapper.js | 7 +++ app/{views => components}/repos-list-tabs.js | 11 ++-- .../status-image-input.js | 0 app/components/status-images.js | 24 ++++++++ app/controllers/repo.js | 22 +++++++- app/controllers/top.js | 14 ++++- app/routes/auth.js | 2 +- app/services/popup.js | 5 -- app/templates/application.hbs | 4 +- app/templates/build.hbs | 2 + app/templates/builds.hbs | 2 + app/templates/components/repos-empty.hbs | 2 +- .../repos-list-tabs.hbs} | 10 ++-- app/templates/components/status-images.hbs | 25 +++++++++ app/templates/job.hbs | 2 + app/templates/plans.hbs | 2 +- .../accounts.hbs => profile-accounts.hbs} | 2 + app/templates/repo.hbs | 12 ++-- app/templates/repos.hbs | 2 +- app/templates/{auth => }/signin.hbs | 0 app/templates/status-images.hbs | 14 ----- app/templates/top.hbs | 2 +- app/utils/status-image-formats.js | 1 + app/views/.gitkeep | 0 app/views/accounts-info.js | 10 ---- app/views/application/loading.js | 3 - app/views/basic.js | 3 - app/views/dashboard/loading.js | 3 - app/views/hooks.js | 11 ---- app/views/profile-accounts.js | 8 --- app/views/profile-tabs.js | 21 ------- app/views/repo-show-tabs.js | 56 ------------------- app/views/repo.js | 39 ------------- app/views/repos-list.js | 39 ------------- app/views/signin.js | 5 -- app/views/status-images.js | 43 -------------- app/views/top.js | 36 ------------ config/deprecation-workflow.js | 4 +- package.json | 3 +- tests/.jshintrc | 1 + tests/test-helper.js | 2 + 46 files changed, 156 insertions(+), 341 deletions(-) rename app/{views/build.js => components/build-wrapper.js} (60%) rename app/{views/builds.js => components/builds-wrapper.js} (70%) rename app/{views/job.js => components/job-wrapper.js} (70%) rename app/{views/application.js => components/popup-click-handler.js} (61%) create mode 100644 app/components/profile-accounts-wrapper.js create mode 100644 app/components/repo-wrapper.js rename app/{views => components}/repos-list-tabs.js (78%) rename app/{views => components}/status-image-input.js (100%) create mode 100644 app/components/status-images.js rename app/templates/{repos/list/tabs.hbs => components/repos-list-tabs.hbs} (50%) create mode 100644 app/templates/components/status-images.hbs rename app/templates/{profile/accounts.hbs => profile-accounts.hbs} (91%) rename app/templates/{auth => }/signin.hbs (100%) delete mode 100644 app/templates/status-images.hbs delete mode 100644 app/views/.gitkeep delete mode 100644 app/views/accounts-info.js delete mode 100644 app/views/application/loading.js delete mode 100644 app/views/basic.js delete mode 100644 app/views/dashboard/loading.js delete mode 100644 app/views/hooks.js delete mode 100644 app/views/profile-accounts.js delete mode 100644 app/views/profile-tabs.js delete mode 100644 app/views/repo-show-tabs.js delete mode 100644 app/views/repo.js delete mode 100644 app/views/repos-list.js delete mode 100644 app/views/signin.js delete mode 100644 app/views/status-images.js delete mode 100644 app/views/top.js diff --git a/app/views/build.js b/app/components/build-wrapper.js similarity index 60% rename from app/views/build.js rename to app/components/build-wrapper.js index 0e981f04..9ea0f843 100644 --- a/app/views/build.js +++ b/app/components/build-wrapper.js @@ -1,11 +1,10 @@ +import Ember from 'ember'; import { colorForState } from 'travis/utils/helpers'; -import BasicView from 'travis/views/basic'; import Polling from 'travis/mixins/polling'; -export default BasicView.extend(Polling, { +export default Ember.Component.extend({ classNameBindings: ['color'], - buildBinding: 'controller.build', - pollModels: 'controller.build', + pollModels: 'build', color: function() { return colorForState(this.get('build.state')); diff --git a/app/views/builds.js b/app/components/builds-wrapper.js similarity index 70% rename from app/views/builds.js rename to app/components/builds-wrapper.js index eca5f332..b3a1ecb3 100644 --- a/app/views/builds.js +++ b/app/components/builds-wrapper.js @@ -1,12 +1,15 @@ -import BasicView from 'travis/views/basic'; +import Ember from 'ember'; import Polling from 'travis/mixins/polling'; -export default BasicView.extend(Polling, { +export default Ember.Component.extend({ + store: Ember.inject.service('store'), + pollHook: function(store) { var contentType, repositoryId; - contentType = this.get('controller.contentType'); - repositoryId = this.get('controller.repo.id'); - store = this.get('controller.store'); + contentType = this.get('contentType'); + repositoryId = this.get('repo.id'); + store = this.get('store'); + if (contentType === 'builds') { return store.query('build', { event_type: 'push', diff --git a/app/views/job.js b/app/components/job-wrapper.js similarity index 70% rename from app/views/job.js rename to app/components/job-wrapper.js index 032e5161..5b190528 100644 --- a/app/views/job.js +++ b/app/components/job-wrapper.js @@ -3,10 +3,8 @@ import { colorForState } from 'travis/utils/helpers'; import { githubCommit } from 'travis/utils/urls'; import Polling from 'travis/mixins/polling'; -export default Ember.View.extend(Polling, { - pollModels: 'controller.job.build', - repoBinding: 'controller.repo', - jobBinding: 'controller.job', +export default Ember.Component.extend({ + pollModels: 'job.build', commitBinding: 'job.commit', currentItemBinding: 'job', @@ -16,5 +14,5 @@ export default Ember.View.extend(Polling, { urlGithubCommit: function() { return githubCommit(this.get('repo.slug'), this.get('commit.sha')); - }.property('repo.slug', 'commit.sha'), + }.property('repo.slug', 'commit.sha') }); diff --git a/app/views/application.js b/app/components/popup-click-handler.js similarity index 61% rename from app/views/application.js rename to app/components/popup-click-handler.js index f706832f..c810b87b 100644 --- a/app/views/application.js +++ b/app/components/popup-click-handler.js @@ -1,18 +1,17 @@ -import BasicView from 'travis/views/basic'; import Ember from 'ember'; -export default BasicView.extend({ +export default Ember.Component.extend({ popup: Ember.inject.service(), classNames: ['application'], click(event) { - var targetAndParents; - targetAndParents = $(event.target).parents().andSelf(); + var targetAndParents = $(event.target).parents().andSelf(); + if (!(targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup'))) { this.get('popup').close(); } if (!targetAndParents.hasClass('menu') && !targetAndParents.is('#tools > a')) { - return $('.menu').removeClass('display'); + $('.menu').removeClass('display'); } } }); diff --git a/app/components/profile-accounts-wrapper.js b/app/components/profile-accounts-wrapper.js new file mode 100644 index 00000000..83423d73 --- /dev/null +++ b/app/components/profile-accounts-wrapper.js @@ -0,0 +1,6 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + classNames: ['profile-orglist', 'columns', 'medium-4'], + tagName: 'aside', +}); diff --git a/app/components/repo-wrapper.js b/app/components/repo-wrapper.js new file mode 100644 index 00000000..1ca2bd7f --- /dev/null +++ b/app/components/repo-wrapper.js @@ -0,0 +1,7 @@ +import Polling from 'travis/mixins/polling'; +import Ember from 'ember'; + +export default Ember.Component.extend(Polling, { + pollModels: 'repo', + classNameBindings: ['isLoading:loading'] +}); diff --git a/app/views/repos-list-tabs.js b/app/components/repos-list-tabs.js similarity index 78% rename from app/views/repos-list-tabs.js rename to app/components/repos-list-tabs.js index c24cc7f5..3524e1fc 100644 --- a/app/views/repos-list-tabs.js +++ b/app/components/repos-list-tabs.js @@ -1,13 +1,14 @@ import Ember from 'ember'; -export default Ember.View.extend({ - templateName: 'repos/list/tabs', - tabBinding: 'controller.tab', - currentUserBinding: 'controller.currentUser.model', +export default Ember.Component.extend({ + auth: Ember.inject.service(), + + currentUserBinding: 'auth.currentUser', + classRecent: function() { if (this.get('tab') === 'recent') { return 'active'; - } else if (this.get('tab') === 'search' && this.get('controller').auth.get('signedIn')) { + } else if (this.get('tab') === 'search' && this.get('auth.signedIn')) { return 'hidden'; } }.property('tab'), diff --git a/app/views/status-image-input.js b/app/components/status-image-input.js similarity index 100% rename from app/views/status-image-input.js rename to app/components/status-image-input.js diff --git a/app/components/status-images.js b/app/components/status-images.js new file mode 100644 index 00000000..7ced75f0 --- /dev/null +++ b/app/components/status-images.js @@ -0,0 +1,24 @@ +import Ember from 'ember'; +import { format as formatStatusImage } from 'travis/utils/status-image-formats'; + +export default Ember.Component.extend({ + popup: Ember.inject.service(), + + id: 'status-images', + attributeBindings: ['id'], + classNames: ['popup', 'status-images'], + formats: ['Image URL', 'Markdown', 'Textile', 'Rdoc', 'AsciiDoc', 'RST', 'Pod', 'CCTray'], + + actions: { + close() { + return this.get('popup').close(); + } + }, + + statusString: function() { + let format = this.get('format') || this.get('formats.firstObject'), + branch = this.get('branch') || 'master'; + + return formatStatusImage(format, this.get('repo.slug'), branch); + }.property('format', 'repo.slug', 'branch') +}); diff --git a/app/controllers/repo.js b/app/controllers/repo.js index bdda7a44..2e03d10c 100644 --- a/app/controllers/repo.js +++ b/app/controllers/repo.js @@ -1,11 +1,16 @@ import Ember from 'ember'; -import { githubRepo } from 'travis/utils/urls'; +import { githubRepo, statusImage } from 'travis/utils/urls'; +import config from 'travis/config/environment'; + export default Ember.Controller.extend({ + popup: Ember.inject.service(), + jobController: Ember.inject.controller('job'), buildController: Ember.inject.controller('build'), buildsController: Ember.inject.controller('builds'), reposController: Ember.inject.controller('repos'), + reposBinding: 'reposController.repos', currentUserBinding: 'auth.currentUser', classNames: ['repo'], @@ -14,6 +19,21 @@ export default Ember.Controller.extend({ builds: Ember.computed.alias('buildsController.content'), job: Ember.computed.alias('jobController.job'), + isEmpty: function() { + return this.get('repos.isLoaded') && this.get('repos.length') === 0; + }.property('repos.isLoaded', 'repos.length'), + + statusImageUrl: function() { + return statusImage(this.get('repo.slug')); + }.property('repo.slug'), + + actions: { + statusImages() { + this.get('popup').open('status-images'); + return false; + } + }, + slug: function() { return this.get('repo.slug'); }.property('repo.slug'), diff --git a/app/controllers/top.js b/app/controllers/top.js index 27cc673d..de6962d5 100644 --- a/app/controllers/top.js +++ b/app/controllers/top.js @@ -102,5 +102,17 @@ export default Ember.Controller.extend({ }, showCta: function() { return !this.get('auth.signedIn') && !this.get('config.pro') && !this.get('landingPage'); - }.property('auth.signedIn', 'landingPage') + }.property('auth.signedIn', 'landingPage'), + + classProfile: function() { + var classes = ['profile menu']; + + if (this.get('tab') === 'profile') { + classes.push('active'); + } + + classes.push(this.get('controller.auth.state') || 'signed-out'); + + return classes.join(' '); + }.property('tab', 'auth.state') }); diff --git a/app/routes/auth.js b/app/routes/auth.js index 42b86f76..f0707b5c 100644 --- a/app/routes/auth.js +++ b/app/routes/auth.js @@ -5,7 +5,7 @@ export default TravisRoute.extend({ renderTemplate() { $('body').attr('id', 'auth'); - return this.render('auth.signin'); + return this.render('signin'); }, deactivate() { diff --git a/app/services/popup.js b/app/services/popup.js index 89c51b97..2a866c97 100644 --- a/app/services/popup.js +++ b/app/services/popup.js @@ -9,11 +9,6 @@ export default Ember.Service.extend({ }, close() { - var view; - if (view = Ember.View.currentPopupView) { - view.destroy(); - Ember.View.currentPopupView = null; - } return $('.popup').removeClass('display'); } }); diff --git a/app/templates/application.hbs b/app/templates/application.hbs index c24cd689..47326c47 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1 +1,3 @@ -{{outlet}} +{{#popup-click-handler}} + {{outlet}} +{{/popup-click-handler}} diff --git a/app/templates/build.hbs b/app/templates/build.hbs index 5ae9f8fb..02804d4e 100644 --- a/app/templates/build.hbs +++ b/app/templates/build.hbs @@ -1,3 +1,4 @@ +{{#build-wrapper build=build}} {{#if loading}} {{loading-indicator}} {{else}} @@ -16,3 +17,4 @@ {{/if}} {{/if}} +{{/build-wrapper}} diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index fe9fbfe1..87829b57 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,3 +1,4 @@ +{{#builds-wrapper contentType=contentType repo=repo}} {{#if model.isLoaded}}
    {{#each model as |build|}} @@ -18,3 +19,4 @@ {{else}} {{loading-indicator}} {{/if}} +{{/builds-wrapper}} diff --git a/app/templates/components/repos-empty.hbs b/app/templates/components/repos-empty.hbs index d537537e..24601341 100644 --- a/app/templates/components/repos-empty.hbs +++ b/app/templates/components/repos-empty.hbs @@ -6,7 +6,7 @@

    You're only two steps away from using Travis:

      -
    • Hook up {{#link-to "profile.index" class="signed-in"}}one or more of your GitHub repositories{{/link-to}} with Travis.
    • +
    • Hook up {{#link-to "profile" class="signed-in"}}one or more of your GitHub repositories{{/link-to}} with Travis.
    • Push some code!
    diff --git a/app/templates/repos/list/tabs.hbs b/app/templates/components/repos-list-tabs.hbs similarity index 50% rename from app/templates/repos/list/tabs.hbs rename to app/templates/components/repos-list-tabs.hbs index fc8723a8..b7a2d294 100644 --- a/app/templates/repos/list/tabs.hbs +++ b/app/templates/components/repos-list-tabs.hbs @@ -1,16 +1,16 @@
      -
    • - My Repositories +
    • + My Repositories
    • {{#if config.pro}} -
    • - Running ({{startedJobsCount}}/{{allJobsCount}}) +
    • + Running ({{startedJobsCount}}/{{allJobsCount}})
    • {{/if}} -
    • +
    • {{#link-to "profile" trackEvent="add-repository-from-list" title="Add New Repository"}} {{/link-to}} diff --git a/app/templates/components/status-images.hbs b/app/templates/components/status-images.hbs new file mode 100644 index 00000000..24bcf4cd --- /dev/null +++ b/app/templates/components/status-images.hbs @@ -0,0 +1,25 @@ + +

      + + {{#if branches.isLoaded}} + {{#x-select value=branch}} + {{#each branches as |branch|}} + {{#x-option value=branch.commit.branch}}{{branch.commit.branch}}{{/x-option}} + {{/each}} + {{/x-select}} + {{else}} + {{loading-indicator}} + {{/if}} +

      + +

      + + {{status-image-input value=statusString class="url" rows=3}} +

      diff --git a/app/templates/job.hbs b/app/templates/job.hbs index 11a6a833..86cf7b02 100644 --- a/app/templates/job.hbs +++ b/app/templates/job.hbs @@ -1,3 +1,4 @@ +{{#job-wrapper repo=repo job=job}} {{#if job.isLoaded}} {{build-header item=job user=auth.currentUser commit=job.commit repo=repo}} @@ -9,3 +10,4 @@ {{loading-indicator}}
    {{/if}} +{{/job-wrapper}} diff --git a/app/templates/plans.hbs b/app/templates/plans.hbs index 7c9ba25b..c9084cb7 100644 --- a/app/templates/plans.hbs +++ b/app/templates/plans.hbs @@ -134,4 +134,4 @@ -{{/layout-name}} +{{/travis-layout}} diff --git a/app/templates/profile/accounts.hbs b/app/templates/profile-accounts.hbs similarity index 91% rename from app/templates/profile/accounts.hbs rename to app/templates/profile-accounts.hbs index 03b7513b..dbd2d495 100644 --- a/app/templates/profile/accounts.hbs +++ b/app/templates/profile-accounts.hbs @@ -1,3 +1,4 @@ +{{#profile-accounts-wrapper}}
      {{org-item account=user}} @@ -18,3 +19,4 @@ Review and add your authorized organizations.

    {{/if}} +{{/profile-accounts-wrapper}} diff --git a/app/templates/repo.hbs b/app/templates/repo.hbs index 5c0141a1..c135e7ed 100644 --- a/app/templates/repo.hbs +++ b/app/templates/repo.hbs @@ -1,4 +1,5 @@ -{{#if view.isEmpty}} +{{#repo-wrapper repo=repo isLoading=isLoading}} +{{#if isEmpty}} {{repos-empty}} {{else}} @@ -10,8 +11,8 @@ {{repo.name}} on Github @@ -38,4 +39,7 @@ {{else}} {{loading-indicator}} {{/if}} -{{/if}} \ No newline at end of file +{{/if}} +{{/repo-wrapper}} + +{{status-images repo=repo branches=repo.branches}} diff --git a/app/templates/repos.hbs b/app/templates/repos.hbs index 0451b2af..49946e5d 100644 --- a/app/templates/repos.hbs +++ b/app/templates/repos.hbs @@ -4,7 +4,7 @@ -{{view 'repos-list-tabs'}} +{{repos-list-tabs tab=tab showMyRepositories=(action "showMyRepositories") showRunningJobs=(action "showRunningJobs")}} {{#if showRunningJobs}}