From 9601d53ad6672cc780eb048bc3cac017782f0c33 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 14:14:59 +0100 Subject: [PATCH 1/6] We can use @pusher directly, no need for @get --- app/routes/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/main.coffee b/app/routes/main.coffee index 3b9c8e60..923166dd 100644 --- a/app/routes/main.coffee +++ b/app/routes/main.coffee @@ -20,6 +20,6 @@ Route = TravisRoute.extend activate: -> # subscribe to pusher only if we're at a main route unless config.pro - @get('pusher').subscribeAll(['common']) + @pusher.subscribeAll(['common']) `export default Route` From 9559d55400bb67940284e693aff44196b88dae25 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 14:15:36 +0100 Subject: [PATCH 2/6] Don't subscribe to pusher if there's no instance --- app/routes/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/main.coffee b/app/routes/main.coffee index 923166dd..44376f91 100644 --- a/app/routes/main.coffee +++ b/app/routes/main.coffee @@ -19,7 +19,7 @@ Route = TravisRoute.extend activate: -> # subscribe to pusher only if we're at a main route - unless config.pro + if !config.pro && @pusher @pusher.subscribeAll(['common']) `export default Route` From 0e86df8da0abf75e4ad6f27a4f1d0a7a0cc0cd6d Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 14:41:13 +0100 Subject: [PATCH 3/6] Set default avatar url properly --- app/utils/urls.coffee | 2 +- config/environment.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/utils/urls.coffee b/app/utils/urls.coffee index a6088527..76fe7901 100644 --- a/app/utils/urls.coffee +++ b/app/utils/urls.coffee @@ -39,6 +39,6 @@ email = (email) -> "mailto:#{email}" gravatarImage = (email, size) -> - "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(config.avatar_default_url)}" + "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(config.avatarDefaultUrl)}" `export { plainTextLog, githubPullRequest, githubCommit, githubRepo, githubWatchers, githubNetwork, githubAdmin, statusImage, ccXml, email, gravatarImage }` diff --git a/config/environment.js b/config/environment.js index 2b873c01..e099cd8b 100644 --- a/config/environment.js +++ b/config/environment.js @@ -28,7 +28,8 @@ module.exports = function(environment) { pro: false, enterprise: false, endpoints: {}, - intervals: { updateTimes: 1000 } + intervals: { updateTimes: 1000 }, + avatarDefaultUrl: 'https://travis-ci.org/images/ui/default-avatar.png' }; if (typeof process !== 'undefined') { From 0578af0c4ce5fd8ebdc3a266888bc9c09117e8bf Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 14:59:40 +0100 Subject: [PATCH 4/6] Don't set default avatar url on ENV Fingerprinting filter that Brocolli uses to add checksums to filenames apparently is very greedy. When a URL that has a valid image is present in ENV, fingerprint filter will going to wipe out the entire config's meta tag value with fingerprinted url with an asset host. --- app/utils/urls.coffee | 3 ++- config/environment.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/urls.coffee b/app/utils/urls.coffee index 76fe7901..6f91752e 100644 --- a/app/utils/urls.coffee +++ b/app/utils/urls.coffee @@ -39,6 +39,7 @@ email = (email) -> "mailto:#{email}" gravatarImage = (email, size) -> - "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(config.avatarDefaultUrl)}" + avatarDefaultUrl = 'https://travis-ci.org/images/ui/default-avatar.png' + "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(avatarDefaultUrl)}" `export { plainTextLog, githubPullRequest, githubCommit, githubRepo, githubWatchers, githubNetwork, githubAdmin, statusImage, ccXml, email, gravatarImage }` diff --git a/config/environment.js b/config/environment.js index e099cd8b..2b873c01 100644 --- a/config/environment.js +++ b/config/environment.js @@ -28,8 +28,7 @@ module.exports = function(environment) { pro: false, enterprise: false, endpoints: {}, - intervals: { updateTimes: 1000 }, - avatarDefaultUrl: 'https://travis-ci.org/images/ui/default-avatar.png' + intervals: { updateTimes: 1000 } }; if (typeof process !== 'undefined') { From 8f63e3f827a0ac8b2e8eebe23b407302c690ffe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B0?= =?UTF-8?q?=D1=86=D1=83=D1=80=D0=B0?= Date: Mon, 16 Feb 2015 22:38:11 +0800 Subject: [PATCH 5/6] Fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72e477a0..9da26c89 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/travis-ci/travis-web.png?branch=master)](https://travis-ci.org/travis-ci/travis-web) ### Running the app -The app is developed using [http://ember-cli.com](Ember CLI). It requires nodejs +The app is developed using [Ember CLI](http://ember-cli.com). It requires nodejs with npm installed. In order to run the app you need to install dependencies with: From 5bb419ef7b9cfbfea4de673ec3efa08dbbc3d6ad Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 15:54:38 +0100 Subject: [PATCH 6/6] Sort repos explicitly on dashboard --- app/routes/dashboard/repositories.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/routes/dashboard/repositories.coffee b/app/routes/dashboard/repositories.coffee index e679cf18..762b7c8a 100644 --- a/app/routes/dashboard/repositories.coffee +++ b/app/routes/dashboard/repositories.coffee @@ -14,6 +14,13 @@ Route = TravisRoute.extend }).then (response) -> response.repositories.sortBy('last_build.finished_at').filter( (repo) -> repo.last_build + ).sort( (a, b) -> + if !a.last_build.finished_at || a.last_build.finished_at > b.last_build.finished_at + return -1 + else if !b.last_build.finished_at || b.last_build.finished_at > a.last_build.finished_at + return 1 + else + return 0 ).map( (repo) -> Ember.Object.create(repo) )