From 243bd4aed5e640b704a9c8b846350e4031e39353 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 2 Feb 2016 15:22:03 +0100 Subject: [PATCH] update according to comments --- app/routes/home-pro.js | 8 +------- app/templates/account.hbs | 17 +++++++---------- app/utils/location.js | 4 ++-- config/environment.js | 2 +- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/app/routes/home-pro.js b/app/routes/home-pro.js index 276abd22..3444fd40 100644 --- a/app/routes/home-pro.js +++ b/app/routes/home-pro.js @@ -2,11 +2,5 @@ import TravisRoute from 'travis/routes/basic'; import config from 'travis/config/environment'; export default TravisRoute.extend({ - needsAuth: false, - - activate: function() { - if (config.enterprise) { - return this.transitionTo('auth'); - } - } + needsAuth: false }); diff --git a/app/templates/account.hbs b/app/templates/account.hbs index 4d56874e..b1f83d6c 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -1,22 +1,19 @@ {{#if allHooks.isLoaded}}
- - {{#unless config.enterprise}} {{#if config.billingEndpoint}}
- {{#if subscribeButtonInfo.subscribed}} - Subscription active! - {{else}} - {{#if subscribeButtonInfo.education}} - Educational account! + {{#if subscribeButtonInfo.subscribed}} + Subscription active! {{else}} - Sign up this account! + {{#if subscribeButtonInfo.education}} + Educational account! + {{else}} + Sign up this account! + {{/if}} {{/if}} - {{/if}}
{{/if}} - {{/unless}}

{{accountName}}

diff --git a/app/utils/location.js b/app/utils/location.js index 7b8e1037..43318c97 100644 --- a/app/utils/location.js +++ b/app/utils/location.js @@ -19,7 +19,7 @@ export default Ember.HistoryLocation.extend({ getURL: function() { var url; url = this._super.apply(this, arguments); - if (location.pathname === '/') { + if (location.pathname === '/' && !config.enterprise) { if (this.get('auth.signedIn')) { return '/repositories'; } else { @@ -34,7 +34,7 @@ export default Ember.HistoryLocation.extend({ }, formatURL: function(logicalPath) { - if (logicalPath === '/repositories' || logicalPath === '/home' || logicalPath === '/home-pro') { + if (!config.enterprise && (logicalPath === '/repositories' || logicalPath === '/home' || logicalPath === '/home-pro')) { return '/'; } else { return this._super(...arguments); diff --git a/config/environment.js b/config/environment.js index e88cd3bc..ef8846f0 100644 --- a/config/environment.js +++ b/config/environment.js @@ -37,7 +37,7 @@ module.exports = function(environment) { }; if (typeof process !== 'undefined') { - if (process.env.TRAVIS_PRO) { + if (process.env.TRAVIS_PRO && !process.env.TRAVIS_ENTERPRISE) { // set defaults for pro if it's used // TODO: we have the same defaults also in ruby process, // it would be nice to move it to one place. In theory