Skip to content

Commit 749df5f

Browse files
Release OpenProject 10.5.1
2 parents cf77662 + 01b6d7b commit 749df5f

File tree

276 files changed

+3884
-2396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+3884
-2396
lines changed

app/assets/stylesheets/content/_notifications.sass

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
231231

232232
> p
233233
margin-bottom: 0
234+
@include varprop(color, body-font-color)
234235

235236
progress[value]
236237
@extend %progress-styles

app/assets/stylesheets/content/_wiki.sass

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ h1:hover, h2:hover, h3:hover
155155
@include styled-scroll-bar
156156

157157
.wiki--content--attribute
158-
.form--field-container
159-
max-width: 100%
158+
.form--field-container,
160159
.form--text-area-container
161-
overflow: hidden
160+
max-width: 100%
162161

163162
#wiki_page_parent_id
164163
overflow: auto

app/assets/stylesheets/content/work_packages/timelines/elements/_labels.sass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@mixin timeline-label
2+
display: flex
3+
align-items: center
24
height: 16px
35
min-width: 20px
6+
width: max-content
47
font-size: 14px
5-
display: inline-block
68
white-space: nowrap
79
vertical-align: middle
810
pointer-events: none
@@ -33,7 +35,7 @@
3335
left: 0px
3436
top: 0px
3537
// Then translate by its own width + some margin
36-
transform: translateX(calc(-100% - 10px))
38+
transform: translateX(calc(-100% - 15px))
3739
// Ensure line-height is normal
3840
line-height: 1
3941

app/assets/stylesheets/layout/_main_menu.sass

Lines changed: 38 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@ a.main-menu--parent-node
336336
padding-left: $hierarchy-span-width
337337
font-size: 0.7rem
338338

339+
#main-menu ul ul.main-menu--children ul.pages-hierarchy
340+
.tree-menu--hierarchy-indicator
341+
@include varprop(color, main-menu-font-color)
342+
.tree-menu--item
343+
&.-selected
344+
@include varprop(background, main-menu-bg-selected-background)
345+
.tree-menu--title
346+
@include varprop(color, main-menu-selected-font-color)
347+
&:hover
348+
@include varprop(background, main-menu-bg-hover-background)
349+
.tree-menu--title
350+
@include varprop(color, main-menu-hover-font-color)
351+
text-decoration: none
352+
353+
// Resizer & toggle styles
339354
.main-menu--resizer
340355
background: none
341356
height: 100vh
@@ -345,73 +360,43 @@ a.main-menu--parent-node
345360
border-left-width: 2px
346361
border-left-style: solid
347362
border-left-color: transparent
348-
left: calc(#{$main-menu-width} - 2px)
349363
left: calc(var(--main-menu-width) - 2px)
350364
vertical-align: middle
351365
z-index: 1
352366
cursor: col-resize
353367
&:hover
354368
@include varprop(border-left-color, main-menu-resizer-color)
355-
.main-menu--navigation-toggler
356-
opacity: 1
357-
i:before
358-
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
359-
369+
i:before
370+
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
360371
&.show
361372
left: $main-menu-folded-width
362373

363-
.main-menu--navigation-toggler
364-
.hidden-navigation &
365-
text-align: right
366-
opacity: 0
367-
cursor: col-resize
368-
&:hover
369-
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
370-
i:before
371-
@include icon-mixin-arrow-right2
372-
i:before
373-
@include icon-mixin-arrow-right2
374-
375-
position: absolute
376-
top: 0
377-
height: 40px
378-
text-align: left
374+
.resizer-toggle-container
379375
margin-top: 50vh
380-
margin-left: -14px
381-
padding: 0
382-
// Center toggle icon vertically. The element is higher than it looks like.
383-
line-height: 38px
384-
i
385-
display: inline-block
386-
width: 30px
376+
margin-left: -25px
377+
display: inline-block
378+
.main-menu--navigation-toggler
387379
cursor: pointer
388-
line-height: 40px
389380
&:before
390-
color: $light-gray
391-
padding-right: 0
392-
padding-left: 2px
381+
@include icon-common
382+
font-size: 11px
383+
font-weight: 400
384+
&:not(.open):before
385+
@include icon-mixin-arrow-right2
386+
position: absolute
387+
right: 0
393388
&:hover
394389
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
395-
font-size: 11px
396-
i:before
397-
padding-left: 0
398-
@include icon-mixin-arrow-left2
399-
400-
#main-menu ul ul.main-menu--children ul.pages-hierarchy
401-
.tree-menu--hierarchy-indicator
402-
@include varprop(color, main-menu-font-color)
403-
.tree-menu--item
404-
&.-selected
405-
@include varprop(background, main-menu-bg-selected-background)
406-
.tree-menu--title
407-
@include varprop(color, main-menu-selected-font-color)
408-
&:hover
409-
@include varprop(background, main-menu-bg-hover-background)
410-
.tree-menu--title
411-
@include varprop(color, main-menu-hover-font-color)
412-
text-decoration: none
413-
414-
390+
.main-menu--navigation-toggler
391+
background-color: var(--main-menu-bg-color)
392+
&.open:before
393+
@include icon-mixin-arrow-left2
394+
i
395+
display: inline-block
396+
width: 12px
397+
&:before
398+
vertical-align: middle
399+
color: $light-gray
415400

416401
// Badges for menu items such as "EXPERIMENTAL" or "BETA"
417402
$badge_offset: 4px

app/assets/stylesheets/openproject/_generic.sass

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@
116116

117117
.-no-z-index
118118
z-index: 0 !important
119+
120+
.-error-font
121+
color: $content-form-error-color !important
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#-- encoding: UTF-8
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) 2012-2020 the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2017 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See docs/COPYRIGHT.rdoc for more details.
29+
#++
30+
31+
class Journal::NotificationConfiguration
32+
class << self
33+
# Allows controlling whether notifications are sent out for created journals.
34+
# After the block is executed, the setting is returned to its original state which is true by default.
35+
# In case the method is called multiple times within itself, the first setting prevails.
36+
# This allows to control the setting globally without having to pass the setting down the call stack in
37+
# order to ensure all subsequent code follows the provided setting.
38+
def with(send_notifications, &block)
39+
if already_set?
40+
log_warning(send_notifications)
41+
yield
42+
else
43+
with_first(send_notifications, &block)
44+
end
45+
end
46+
47+
def active?
48+
active.value
49+
end
50+
51+
protected
52+
53+
def with_first(send_notifications)
54+
old_value = active?
55+
self.already_set = true
56+
57+
self.active = send_notifications
58+
59+
yield
60+
ensure
61+
self.active = old_value
62+
self.already_set = false
63+
end
64+
65+
def log_warning(send_notifications)
66+
return if active == send_notifications
67+
68+
message = <<~MSG
69+
Ignoring setting journal notifications to '#{send_notifications}' as a parent block already set it to #{active}"
70+
MSG
71+
Rails.logger.debug message
72+
end
73+
74+
def active
75+
@active ||= Concurrent::ThreadLocalVar.new(true)
76+
end
77+
78+
def already_set
79+
@already_set ||= Concurrent::ThreadLocalVar.new(false)
80+
end
81+
82+
def already_set?
83+
already_set.value
84+
end
85+
86+
def active=(value)
87+
@active.value = value
88+
end
89+
90+
def already_set=(value)
91+
@already_set.value = value
92+
end
93+
end
94+
end

app/models/journal_manager.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
class JournalManager
3131
class << self
32-
attr_accessor :send_notification
33-
3432
def changes_on_association(current, predecessor, association, key, value)
3533
merged_journals = merge_reference_journals_by_id(current, predecessor, key.to_s, value.to_s)
3634

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

44-
def reset_notification
45-
@send_notification = true
46-
end
47-
4842
private
4943

5044
def merge_reference_journals_by_id(new_journals, old_journals, id_key, value)
@@ -152,8 +146,6 @@ def select_and_combine(journals, id, key, value)
152146
end
153147
end
154148

155-
self.send_notification = true
156-
157149
def self.journalized?(obj)
158150
not obj.nil? and obj.respond_to? :journals
159151
end
@@ -349,16 +341,4 @@ def self.normalize_newlines(data)
349341
h[e[0]] = (e[1].is_a?(String) ? e[1].gsub(/\r\n/, "\n") : e[1])
350342
end
351343
end
352-
353-
def self.with_send_notifications(send_notifications, &block)
354-
old_value = send_notification
355-
356-
self.send_notification = send_notifications
357-
358-
result = block.call
359-
ensure
360-
self.send_notification = old_value
361-
362-
result
363-
end
364344
end
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#-- encoding: UTF-8
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) 2012-2020 the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2017 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See docs/COPYRIGHT.rdoc for more details.
29+
#++
30+
31+
module Queries::Operators::Concerns
32+
module ContainsAllValues
33+
extend ActiveSupport::Concern
34+
35+
class_methods do
36+
def sql_for_field(values, db_table, db_field)
37+
values
38+
.first
39+
.split(/\s+/)
40+
.map { |substr| "#{db_table}.#{db_field} ILIKE '%#{connection.quote_string(substr)}%'" }
41+
.join(' AND ')
42+
end
43+
end
44+
end
45+
end

app/models/queries/operators/contains.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#-- encoding: UTF-8
2+
23
#-- copyright
34
# OpenProject is an open source project management software.
45
# Copyright (C) 2012-2020 the OpenProject GmbH
@@ -29,17 +30,9 @@
2930

3031
module Queries::Operators
3132
class Contains < Base
33+
include Concerns::ContainsAllValues
34+
3235
label 'contains'
3336
set_symbol '~'
34-
35-
def self.sql_for_field(values, db_table, db_field)
36-
like_query =
37-
values.first.split(/\s+/)
38-
.map { |substr| connection.quote_string(substr.downcase) }
39-
.join("%")
40-
41-
"COALESCE(LOWER(#{db_table}.#{db_field}), '') LIKE " +
42-
"'%#{like_query}%'"
43-
end
4437
end
4538
end

0 commit comments

Comments
 (0)