commit
944ce28052
@ -1,2 +1,2 @@ |
||||
https://github.com/heroku/heroku-buildpack-nodejs.git#v162 |
||||
https://github.com/pkgr/heroku-buildpack-ruby.git#v199-1 |
||||
https://github.com/pkgr/heroku-buildpack-ruby.git#v206-1 |
||||
|
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 38 KiB |
@ -0,0 +1,50 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 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-2017 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 docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
module ProjectStatusHelper |
||||
def project_status_css_class(status) |
||||
code = project_status_ensure_default_code(status) |
||||
'-' + code.tr('_', '-') |
||||
end |
||||
|
||||
def project_status_name(status) |
||||
code = project_status_ensure_default_code(status) |
||||
project_status_name_for_code(code) |
||||
end |
||||
|
||||
def project_status_name_for_code(code) |
||||
code ||= 'not_set' |
||||
I18n.t('js.grid.widgets.project_status.' + code) |
||||
end |
||||
|
||||
def project_status_ensure_default_code(status) |
||||
status.try(:code) || 'not_set' |
||||
end |
||||
end |
@ -0,0 +1,65 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 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-2017 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 docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
module Queries |
||||
module Projects |
||||
module Filters |
||||
class ProjectStatusFilter < ::Queries::Projects::Filters::ProjectFilter |
||||
include ProjectStatusHelper |
||||
|
||||
def allowed_values |
||||
@allowed_values ||= Project::Status.codes.map do |code, id| |
||||
[project_status_name_for_code(code), id.to_s] |
||||
end |
||||
end |
||||
|
||||
def left_outer_joins |
||||
:status |
||||
end |
||||
|
||||
def where |
||||
operator_strategy.sql_for_field(values, Project::Status.table_name, :code) |
||||
end |
||||
|
||||
def type |
||||
:list_optional |
||||
end |
||||
|
||||
def self.key |
||||
:project_status_code |
||||
end |
||||
|
||||
def human_name |
||||
I18n.t('js.grid.widgets.project_status.title') |
||||
end |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,49 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 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-2017 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 docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
class Queries::Projects::Orders::ProjectStatusOrder < Queries::BaseOrder |
||||
self.model = Project |
||||
|
||||
def self.key |
||||
:project_status |
||||
end |
||||
|
||||
def left_outer_joins |
||||
:status |
||||
end |
||||
|
||||
private |
||||
|
||||
def order |
||||
with_raise_on_invalid do |
||||
model.order(Arel.sql("project_statuses.code").send(direction)) |
||||
end |
||||
end |
||||
end |
@ -0,0 +1 @@ |
||||
export const dashboardWebsiteUrl = "https://www.openproject.org/collaboration-software-features/dashboards/"; |
@ -1,42 +0,0 @@ |
||||
$gray: #CCCCCC |
||||
$red: #E73E3D |
||||
$orange: #FFB030 |
||||
$green: #00D12D |
||||
|
||||
.bulb |
||||
display: inline-block |
||||
width: 40px |
||||
height: 40px |
||||
border-radius: 50% |
||||
border-width: 10px |
||||
border-style: solid |
||||
margin-right: 7px |
||||
vertical-align: middle |
||||
&.-gray |
||||
border-color: $gray |
||||
background-color: adjust-color($gray, $alpha: -0.7) |
||||
&.-red |
||||
border-color: $red |
||||
background-color: adjust-color($red, $alpha: -0.7) |
||||
&.-orange |
||||
border-color: $orange |
||||
background-color: adjust-color($orange, $alpha: -0.7) |
||||
&.-green |
||||
border-color: $green |
||||
background-color: adjust-color($green, $alpha: -0.7) |
||||
|
||||
.status-name |
||||
text-transform: uppercase |
||||
font-weight: bold |
||||
&.-gray |
||||
color: $gray |
||||
&.-red |
||||
color: $red |
||||
&.-orange |
||||
color: $orange |
||||
&.-green |
||||
color: $green |
||||
|
||||
.explanation |
||||
margin-top: 9px |
||||
|
@ -0,0 +1,33 @@ |
||||
require 'carrierwave' |
||||
|
||||
## |
||||
# Code copied straight from the CarrierWave source. |
||||
# All we did is add `options[:expire_at]`. |
||||
# |
||||
# @todo Upgrade to CarrierWave 2.0.2 to make this patch obsolete. |
||||
class CarrierWave::Storage::Fog::File |
||||
def authenticated_url(options = {}) |
||||
if ['AWS', 'Google', 'Rackspace', 'OpenStack'].include?(@uploader.fog_credentials[:provider]) |
||||
# avoid a get by using local references |
||||
local_directory = connection.directories.new(:key => @uploader.fog_directory) |
||||
local_file = local_directory.files.new(:key => path) |
||||
expire_at = options[:expire_at] || ::Fog::Time.now + @uploader.fog_authenticated_url_expiration |
||||
case @uploader.fog_credentials[:provider] |
||||
when 'AWS', 'Google' |
||||
# Older versions of fog-google do not support options as a parameter |
||||
if url_options_supported?(local_file) |
||||
local_file.url(expire_at, options) |
||||
else |
||||
warn "Options hash not supported in #{local_file.class}. You may need to upgrade your Fog provider." |
||||
local_file.url(expire_at) |
||||
end |
||||
when 'Rackspace' |
||||
connection.get_object_https_url(@uploader.fog_directory, path, expire_at, options) |
||||
when 'OpenStack' |
||||
connection.get_object_https_url(@uploader.fog_directory, path, expire_at) |
||||
else |
||||
local_file.url(expire_at) |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,50 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 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-2017 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 docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
require 'spec_helper' |
||||
|
||||
describe Queries::Projects::Filters::ProjectStatusFilter, type: :model do |
||||
it_behaves_like 'basic query filter' do |
||||
let(:class_key) { :project_status_code } |
||||
let(:type) { :list_optional } |
||||
let(:model) { Project } |
||||
let(:attribute) { :project_status_code } |
||||
let(:values) { ['On track'] } |
||||
let(:human_name) { 'Project status' } |
||||
let(:admin) { FactoryBot.build_stubbed(:admin) } |
||||
let(:user) { FactoryBot.build_stubbed(:user) } |
||||
|
||||
describe '#allowed_values' do |
||||
it 'is a list of the possible values' do |
||||
expect(instance.allowed_values).to match_array([["At risk", "1"], ["Off track", "2"], ["On track", "0"]]) |
||||
end |
||||
end |
||||
end |
||||
end |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue