Skip to content

Commit

Permalink
Release OpenProject 10.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed May 6, 2020
2 parents cf77662 + 01b6d7b commit 749df5f
Show file tree
Hide file tree
Showing 276 changed files with 3,884 additions and 2,396 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/content/_notifications.sass
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)

> p
margin-bottom: 0
@include varprop(color, body-font-color)

progress[value]
@extend %progress-styles
Expand Down
5 changes: 2 additions & 3 deletions app/assets/stylesheets/content/_wiki.sass
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ h1:hover, h2:hover, h3:hover
@include styled-scroll-bar

.wiki--content--attribute
.form--field-container
max-width: 100%
.form--field-container,
.form--text-area-container
overflow: hidden
max-width: 100%

#wiki_page_parent_id
overflow: auto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@mixin timeline-label
display: flex
align-items: center
height: 16px
min-width: 20px
width: max-content
font-size: 14px
display: inline-block
white-space: nowrap
vertical-align: middle
pointer-events: none
Expand Down Expand Up @@ -33,7 +35,7 @@
left: 0px
top: 0px
// Then translate by its own width + some margin
transform: translateX(calc(-100% - 10px))
transform: translateX(calc(-100% - 15px))
// Ensure line-height is normal
line-height: 1

Expand Down
91 changes: 38 additions & 53 deletions app/assets/stylesheets/layout/_main_menu.sass
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,21 @@ a.main-menu--parent-node
padding-left: $hierarchy-span-width
font-size: 0.7rem

#main-menu ul ul.main-menu--children ul.pages-hierarchy
.tree-menu--hierarchy-indicator
@include varprop(color, main-menu-font-color)
.tree-menu--item
&.-selected
@include varprop(background, main-menu-bg-selected-background)
.tree-menu--title
@include varprop(color, main-menu-selected-font-color)
&:hover
@include varprop(background, main-menu-bg-hover-background)
.tree-menu--title
@include varprop(color, main-menu-hover-font-color)
text-decoration: none

// Resizer & toggle styles
.main-menu--resizer
background: none
height: 100vh
Expand All @@ -345,73 +360,43 @@ a.main-menu--parent-node
border-left-width: 2px
border-left-style: solid
border-left-color: transparent
left: calc(#{$main-menu-width} - 2px)
left: calc(var(--main-menu-width) - 2px)
vertical-align: middle
z-index: 1
cursor: col-resize
&:hover
@include varprop(border-left-color, main-menu-resizer-color)
.main-menu--navigation-toggler
opacity: 1
i:before
@include varprop(color, main-menu-navigation-toggler-font-hover-color)

i:before
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
&.show
left: $main-menu-folded-width

.main-menu--navigation-toggler
.hidden-navigation &
text-align: right
opacity: 0
cursor: col-resize
&:hover
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
i:before
@include icon-mixin-arrow-right2
i:before
@include icon-mixin-arrow-right2

position: absolute
top: 0
height: 40px
text-align: left
.resizer-toggle-container
margin-top: 50vh
margin-left: -14px
padding: 0
// Center toggle icon vertically. The element is higher than it looks like.
line-height: 38px
i
display: inline-block
width: 30px
margin-left: -25px
display: inline-block
.main-menu--navigation-toggler
cursor: pointer
line-height: 40px
&:before
color: $light-gray
padding-right: 0
padding-left: 2px
@include icon-common
font-size: 11px
font-weight: 400
&:not(.open):before
@include icon-mixin-arrow-right2
position: absolute
right: 0
&:hover
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
font-size: 11px
i:before
padding-left: 0
@include icon-mixin-arrow-left2

#main-menu ul ul.main-menu--children ul.pages-hierarchy
.tree-menu--hierarchy-indicator
@include varprop(color, main-menu-font-color)
.tree-menu--item
&.-selected
@include varprop(background, main-menu-bg-selected-background)
.tree-menu--title
@include varprop(color, main-menu-selected-font-color)
&:hover
@include varprop(background, main-menu-bg-hover-background)
.tree-menu--title
@include varprop(color, main-menu-hover-font-color)
text-decoration: none


.main-menu--navigation-toggler
background-color: var(--main-menu-bg-color)
&.open:before
@include icon-mixin-arrow-left2
i
display: inline-block
width: 12px
&:before
vertical-align: middle
color: $light-gray

// Badges for menu items such as "EXPERIMENTAL" or "BETA"
$badge_offset: 4px
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/openproject/_generic.sass
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@

.-no-z-index
z-index: 0 !important

.-error-font
color: $content-form-error-color !important
94 changes: 94 additions & 0 deletions app/models/journal/notification_configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#-- encoding: UTF-8

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# 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 Journal::NotificationConfiguration
class << self
# Allows controlling whether notifications are sent out for created journals.
# After the block is executed, the setting is returned to its original state which is true by default.
# In case the method is called multiple times within itself, the first setting prevails.
# This allows to control the setting globally without having to pass the setting down the call stack in
# order to ensure all subsequent code follows the provided setting.
def with(send_notifications, &block)
if already_set?
log_warning(send_notifications)
yield
else
with_first(send_notifications, &block)
end
end

def active?
active.value
end

protected

def with_first(send_notifications)
old_value = active?
self.already_set = true

self.active = send_notifications

yield
ensure
self.active = old_value
self.already_set = false
end

def log_warning(send_notifications)
return if active == send_notifications

message = <<~MSG
Ignoring setting journal notifications to '#{send_notifications}' as a parent block already set it to #{active}"
MSG
Rails.logger.debug message
end

def active
@active ||= Concurrent::ThreadLocalVar.new(true)
end

def already_set
@already_set ||= Concurrent::ThreadLocalVar.new(false)
end

def already_set?
already_set.value
end

def active=(value)
@active.value = value
end

def already_set=(value)
@already_set.value = value
end
end
end
20 changes: 0 additions & 20 deletions app/models/journal_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

class JournalManager
class << self
attr_accessor :send_notification

def changes_on_association(current, predecessor, association, key, value)
merged_journals = merge_reference_journals_by_id(current, predecessor, key.to_s, value.to_s)

Expand All @@ -41,10 +39,6 @@ def changes_on_association(current, predecessor, association, key, value)
to_changes_format(changes, association.to_s)
end

def reset_notification
@send_notification = true
end

private

def merge_reference_journals_by_id(new_journals, old_journals, id_key, value)
Expand Down Expand Up @@ -152,8 +146,6 @@ def select_and_combine(journals, id, key, value)
end
end

self.send_notification = true

def self.journalized?(obj)
not obj.nil? and obj.respond_to? :journals
end
Expand Down Expand Up @@ -349,16 +341,4 @@ def self.normalize_newlines(data)
h[e[0]] = (e[1].is_a?(String) ? e[1].gsub(/\r\n/, "\n") : e[1])
end
end

def self.with_send_notifications(send_notifications, &block)
old_value = send_notification

self.send_notification = send_notifications

result = block.call
ensure
self.send_notification = old_value

result
end
end
45 changes: 45 additions & 0 deletions app/models/queries/operators/concerns/contains_all_values.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#-- encoding: UTF-8

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# 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::Operators::Concerns
module ContainsAllValues
extend ActiveSupport::Concern

class_methods do
def sql_for_field(values, db_table, db_field)
values
.first
.split(/\s+/)
.map { |substr| "#{db_table}.#{db_field} ILIKE '%#{connection.quote_string(substr)}%'" }
.join(' AND ')
end
end
end
end
13 changes: 3 additions & 10 deletions app/models/queries/operators/contains.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#-- encoding: UTF-8

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
Expand Down Expand Up @@ -29,17 +30,9 @@

module Queries::Operators
class Contains < Base
include Concerns::ContainsAllValues

label 'contains'
set_symbol '~'

def self.sql_for_field(values, db_table, db_field)
like_query =
values.first.split(/\s+/)
.map { |substr| connection.quote_string(substr.downcase) }
.join("%")

"COALESCE(LOWER(#{db_table}.#{db_field}), '') LIKE " +
"'%#{like_query}%'"
end
end
end
Loading

0 comments on commit 749df5f

Please sign in to comment.