From 53ac186116e2d8eb59f62ff2a1f569db7eb13bed Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 3 Apr 2014 12:28:02 +0200 Subject: [PATCH 1/4] Moved work package loading out of respond_to block. Wasn't getting run for xls requests. --- app/controllers/work_packages_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rb index 59b2df00ce..fbb2d3ef30 100644 --- a/app/controllers/work_packages_controller.rb +++ b/app/controllers/work_packages_controller.rb @@ -200,6 +200,8 @@ class WorkPackagesController < ApplicationController end def index + load_work_packages + respond_to do |format| format.html do render :index, :locals => { :query => @query, @@ -207,7 +209,6 @@ class WorkPackagesController < ApplicationController :layout => !request.xhr? end format.csv do - load_work_packages serialized_work_packages = WorkPackage::Exporter.csv(@work_packages, @project) charset = "charset=#{l(:general_csv_encoding).downcase}" @@ -215,7 +216,6 @@ class WorkPackagesController < ApplicationController :filename => 'export.csv') end format.pdf do - load_work_packages serialized_work_packages = WorkPackage::Exporter.pdf(@work_packages, @project, @query, @@ -227,7 +227,6 @@ class WorkPackagesController < ApplicationController :filename => 'export.pdf') end format.atom do - load_work_packages render_feed(@work_packages, :title => "#{@project || Setting.app_title}: #{l(:label_work_package_plural)}") end From 9ba648a9b8309b9c93dc53f70ed1f262c6491a53 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 3 Apr 2014 14:35:21 +0200 Subject: [PATCH 2/4] Loading work packages except when it's an html request. Plays nice with the patched respond_to method in the plugin. --- app/controllers/work_packages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rb index fbb2d3ef30..f182e85fae 100644 --- a/app/controllers/work_packages_controller.rb +++ b/app/controllers/work_packages_controller.rb @@ -200,7 +200,7 @@ class WorkPackagesController < ApplicationController end def index - load_work_packages + load_work_packages unless request.format.html? respond_to do |format| format.html do From df371bd573095a2c7719e0b685132be3a86a145d Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Thu, 3 Apr 2014 16:40:57 +0200 Subject: [PATCH 3/4] Revert "Attempt to fix ENOTEMPTY on bower install on Travis" This did not resolve the issue. https://www.openproject.org/work_packages/5645 This reverts commit aab77f6c1921d12b4476eaffa124ed60285a01ce. --- .bowerrc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.bowerrc b/.bowerrc index c61b0ba869..69fbc34fab 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,8 +1,3 @@ { - "directory": "vendor/assets/components", - "storage": { - "packages": ".bower-cache", - "registry": ".bower-registry" - }, - "tmp": ".bower-tmp" + "directory": "vendor/assets/components" } From 67f5564e04f48f52517caebcc24bd2e20e7d2e35 Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Thu, 3 Apr 2014 16:47:17 +0200 Subject: [PATCH 4/4] Configure Travis to use @knalli's Bower fork Fork includes a fix for possible race condition when installing/ resolving dependencies. https://github.com/bower/bower/issues/933 https://www.openproject.org/work_packages/5645 Signed-off-by: Alex Coles --- .travis.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1ecfff252..6d61c287f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ script: "bundle exec rake $TEST_SUITE" before_install: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - - "nvm use 0.10 && npm -g install bower && npm install" + - "nvm use 0.10 && npm install && npm -g install knalli/bower#26950e5a4f6ca2c3afe38e00691655f9cc9ee6e6" before_script: - "RAILS_ENV=production bundle exec rake ci:travis:prepare" notifications: diff --git a/package.json b/package.json index 21dc211a9d..4a361b7834 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "OpenProject", "version": "0.1.0", "devDependencies": { - "bower": "~1.3.1", + "bower": "knalli/bower#26950e5a4f6ca2c3afe38e00691655f9cc9ee6e6", "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.8.0", "mocha-phantomjs": "~3.1.6",