From 0bda9e9ffeead799a893bc499a8c4aaa854954ed Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Mon, 9 Feb 2015 00:10:15 +0100 Subject: [PATCH 1/7] Add autoprefixer-rails for vendor prefixing CSS User Story # 18530 Signed-off-by: Alex Coles --- Gemfile | 1 + Gemfile.lock | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 0e64277ba5..0e226f300a 100644 --- a/Gemfile +++ b/Gemfile @@ -96,6 +96,7 @@ gem 'sprockets-rails', git: 'https://github.com/finnlabs/sprockets-rails.git', gem 'non-stupid-digest-assets' gem 'sass-rails', git: 'https://github.com/guilleiguaran/sass-rails.git', branch: 'backport' gem 'sass', '~> 3.4.9' +gem 'autoprefixer-rails' gem 'bourbon', '~> 4.1.1' gem 'uglifier', '>= 1.0.3', require: false gem 'livingstyleguide', '~> 1.2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 3ccebfc8ce..34bb030072 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,6 +85,9 @@ GEM activerecord (>= 3.0) addressable (2.3.4) arel (3.0.3) + autoprefixer-rails (5.1.5) + execjs + json awesome_nested_set (2.1.6) activerecord (>= 3.0.0) axiom-types (0.1.1) @@ -447,6 +450,7 @@ DEPENDENCIES activerecord-jdbcpostgresql-adapter activerecord-tableless (~> 1.0) acts_as_list (~> 0.2.0) + autoprefixer-rails awesome_nested_set bourbon (~> 4.1.1) capybara (~> 2.3.0) From 73b5dc6fd7e4470c2d44e02ef8ae66dd01bac2c1 Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Mon, 9 Feb 2015 11:24:39 +0100 Subject: [PATCH 2/7] Specify supported browsers for autoprefixer User Story # 18530 Signed-off-by: Alex Coles --- browserslist | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 browserslist diff --git a/browserslist b/browserslist new file mode 100644 index 0000000000..56d3d08cc4 --- /dev/null +++ b/browserslist @@ -0,0 +1,8 @@ +# OpenProject supported browsers +# https://www.openproject.org/systemrequirements/ +# +> 5% +last 2 Chrome versions +last 2 Safari versions +Firefox >= 31 +IE >= 10 From 1fc7d26f96c1e93ebcc592b56f086f671f57b342 Mon Sep 17 00:00:00 2001 From: Mihail Maxacov <0xf013@gmail.com> Date: Mon, 9 Feb 2015 13:38:15 +0200 Subject: [PATCH 3/7] fix IE11 styling and subject positioning --- app/assets/stylesheets/content/_in_place_editing.sass | 9 +++++---- frontend/app/ui_components/inplace-editor-dispatcher.js | 9 +++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/content/_in_place_editing.sass b/app/assets/stylesheets/content/_in_place_editing.sass index 16d2f8f487..9e353448e0 100644 --- a/app/assets/stylesheets/content/_in_place_editing.sass +++ b/app/assets/stylesheets/content/_in_place_editing.sass @@ -1,6 +1,6 @@ .inplace-editor display: inline - font-size: initial + font-size: medium .ined-input-wrapper-inner display: inline &.busy @@ -58,9 +58,7 @@ .ng-invalid background: lightpink!important .ined-dashboard - padding-left: 29px min-height: 42px - width: 502px .ined-errors float: right display: inline-block @@ -88,6 +86,9 @@ text-decoration: none &:hover background: #f0f0f0 + &.type-text + .ined-dashboard + width: 90% &.type-wiki_textarea textarea min-height: 200px @@ -108,7 +109,7 @@ float: right .ined-dashboard padding-left: 0px - width: 526px + width: 100% .ined-controls left: 0px z-index: 1 diff --git a/frontend/app/ui_components/inplace-editor-dispatcher.js b/frontend/app/ui_components/inplace-editor-dispatcher.js index b63638bdfd..343b7e0fe4 100644 --- a/frontend/app/ui_components/inplace-editor-dispatcher.js +++ b/frontend/app/ui_components/inplace-editor-dispatcher.js @@ -147,6 +147,15 @@ module.exports = function($sce, $http, $timeout, AutoCompleteHelper, TextileServ text: { link: function(scope, element) { enableAutoCompletion(element); + scope.$on('startEditing', function() { + $timeout(function() { + element.find('.ined-dashboard').css({ + 'margin-left': element + .closest('.work-packages--details-content') + .find('.select-type:first').width() + }); + }, 0, false); + }); } }, From b8bbff4ad0e909d8ac019a006476b7af631ed326 Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Fri, 13 Feb 2015 10:52:00 +0100 Subject: [PATCH 4/7] use the accessor method in order to work with arrays in env vars --- config/initializers/module_handler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/module_handler.rb b/config/initializers/module_handler.rb index 418b8051c8..46226fb2e2 100644 --- a/config/initializers/module_handler.rb +++ b/config/initializers/module_handler.rb @@ -27,7 +27,7 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -unless OpenProject::Configuration['disabled_modules'].empty? - to_disable = OpenProject::Configuration['disabled_modules'] +unless OpenProject::Configuration.disabled_modules.empty? + to_disable = OpenProject::Configuration.disabled_modules OpenProject::Plugins::ModuleHandler.disable_modules(to_disable) end From 6d39133aa5b33ad9defb60ee536ddcc248e4af60 Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Fri, 13 Feb 2015 10:52:25 +0100 Subject: [PATCH 5/7] change unless to if --- config/initializers/module_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/module_handler.rb b/config/initializers/module_handler.rb index 46226fb2e2..5de0332b0d 100644 --- a/config/initializers/module_handler.rb +++ b/config/initializers/module_handler.rb @@ -27,7 +27,7 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -unless OpenProject::Configuration.disabled_modules.empty? +if OpenProject::Configuration.disabled_modules.any? to_disable = OpenProject::Configuration.disabled_modules OpenProject::Plugins::ModuleHandler.disable_modules(to_disable) end From 28531c779aa85f1e14f20153f32b3068d85f935e Mon Sep 17 00:00:00 2001 From: kgalli Date: Fri, 13 Feb 2015 11:11:39 +0100 Subject: [PATCH 6/7] Update ruby version to previous stable 2.1.5 --- packaging/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/setup b/packaging/setup index a612f2af58..9aa154d382 100755 --- a/packaging/setup +++ b/packaging/setup @@ -1,5 +1,5 @@ #!/usr/bin/env bash -echo "ruby '2.1.4'" > Gemfile.local +echo "ruby '2.1.5'" > Gemfile.local cp -f packaging/conf/configuration.yml config/configuration.yml sed -i "s|config.serve_static_assets = false|config.serve_static_assets = true|" config/environments/production.rb From c84b80bd8cd85985ca20e2a0ae69f63656c252c5 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Fri, 13 Feb 2015 11:07:10 +0000 Subject: [PATCH 7/7] make array always return an array --- lib/open_project/configuration/helpers.rb | 2 +- .../configuration/helpers_spec.rb | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 spec/lib/open_project/configuration/helpers_spec.rb diff --git a/lib/open_project/configuration/helpers.rb b/lib/open_project/configuration/helpers.rb index e54ee53da0..8b73b05390 100644 --- a/lib/open_project/configuration/helpers.rb +++ b/lib/open_project/configuration/helpers.rb @@ -99,7 +99,7 @@ module OpenProject if value =~ / / value.split ' ' else - value + Array(value) end end diff --git a/spec/lib/open_project/configuration/helpers_spec.rb b/spec/lib/open_project/configuration/helpers_spec.rb new file mode 100644 index 0000000000..dbe9384153 --- /dev/null +++ b/spec/lib/open_project/configuration/helpers_spec.rb @@ -0,0 +1,89 @@ +#-- copyright +# OpenProject is a project management system. +# Copyright (C) 2012-2015 the OpenProject Foundation (OPF) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See doc/COPYRIGHT.rdoc for more details. +#++ + +require 'spec_helper' +require 'open_project/configuration/helpers' + +describe OpenProject::Configuration::Helpers do + let(:config) { + {}.tap do |config| + config.extend OpenProject::Configuration::Helpers + end + } + + describe '#array' do + def array(value) + config.send :array, value + end + + context 'with single string value' do + it 'returns an array containing the value' do + arr = array 'test' + + expect(arr).to eq ['test'] + end + end + + context 'with an array' do + it 'returns the array' do + arr = ['arrgh'] + + expect(array(arr)).to eq arr + end + end + + context 'with a space separated string' do + it 'returns an array of the values' do + value = 'one two three' + + expect(array(value)).to eq ['one', 'two', 'three'] + end + end + end + + describe '#hidden_menu_items' do + before do + items = config['hidden_menu_items'] = {} + items['admin_menu'] = 'users colors' + items['project_menu'] = 'info' + items['top_menu'] = [] + end + + it 'works with arrays' do + expect(config.hidden_menu_items['top_menu']).to eq [] + end + + it 'works with single string values' do + expect(config.hidden_menu_items['project_menu']).to eq ['info'] + end + + it 'work with space separated string values' do + expect(config.hidden_menu_items['admin_menu']).to eq ['users', 'colors'] + end + end +end