From 76672e76ca1a01ba93881679bce0f845a3406942 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 6 Feb 2015 15:04:59 +0100 Subject: [PATCH 1/3] Fix pusher auth on pro --- app/utils/pusher.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/pusher.coffee b/app/utils/pusher.coffee index 1b741b9e..05c97e5b 100644 --- a/app/utils/pusher.coffee +++ b/app/utils/pusher.coffee @@ -1,4 +1,5 @@ `import ENV from 'travis/config/environment'` +`import Ajax from 'travis/utils/ajax'` TravisPusher = (config) -> @init(config) @@ -117,7 +118,7 @@ if ENV.pro unless channels.fetching channels.fetching = true - Travis.ajax.post Pusher.channel_auth_endpoint, { socket_id: socketId, channels: names }, (data) -> + Ajax.post Pusher.channel_auth_endpoint, { socket_id: socketId, channels: names }, (data) -> channels.fetching = false callback(data.channels) for callback in channels.callbacks From a6b9c2b0d9eae1571d711e90448db17f3b315aaf Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 6 Feb 2015 15:07:29 +0100 Subject: [PATCH 2/3] Properly check for caches and ssKey on pro --- app/templates/repos/show/tools.hbs | 2 +- app/templates/settings.hbs | 3 ++- config/environment.js | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/repos/show/tools.hbs b/app/templates/repos/show/tools.hbs index 1d96253b..b6f1ac04 100644 --- a/app/templates/repos/show/tools.hbs +++ b/app/templates/repos/show/tools.hbs @@ -10,7 +10,7 @@
  • {{#link-to "requests" view.repo}}Requests{{/link-to}}
  • - {{#if config.caches_enabled}} + {{#if config.endpoints.caches}}
  • {{#link-to "caches" view.repo}}Caches{{/link-to}}
  • diff --git a/app/templates/settings.hbs b/app/templates/settings.hbs index ec0f6259..ad5a438d 100644 --- a/app/templates/settings.hbs +++ b/app/templates/settings.hbs @@ -1,7 +1,8 @@ diff --git a/config/environment.js b/config/environment.js index 47f5277a..2b873c01 100644 --- a/config/environment.js +++ b/config/environment.js @@ -46,8 +46,7 @@ module.exports = function(environment) { ENV.endpoints = { sshKey: true, caches: true - } - + }; } } From 705fe69208c0e89c2fccaedbe70a2ec79f502a1c Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 6 Feb 2015 15:11:02 +0100 Subject: [PATCH 3/3] Fix ssh-key route --- app/routes/ssh-key.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/ssh-key.coffee b/app/routes/ssh-key.coffee index a8e46251..8274d512 100644 --- a/app/routes/ssh-key.coffee +++ b/app/routes/ssh-key.coffee @@ -6,7 +6,7 @@ Route = TravisRoute.extend model: (params) -> repo = @modelFor('repo') self = this - SshKey.fetch(repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) -> + @store.find('sshKey', repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) -> if xhr.status == 404 # if there is no model, just return null. I'm not sure if this is the # best answer, maybe we should just redirect to different route, like