Skip to content

Commit 4772199

Browse files
Release OpenProject 12.2.1
2 parents b31b7e8 + 67bb9e0 commit 4772199

File tree

202 files changed

+1209
-1087
lines changed

Some content is hidden

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

202 files changed

+1209
-1087
lines changed

.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Frontend rules
2+
*.js @opf/frontend
3+
*.ts @opf/frontend
4+
5+
# Backend rules
6+
*.rb @opf/backend
7+
8+
# docs rules
9+
/docs/ @opf/doc-writers
10+
11+
# Tech doc rules
12+
/docs/development @opf/tech-writers
13+
/docs/installation-and-operations @opf/tech-writers
14+
/docs/system-admin-guide @opf/tech-writers
15+
/docs/api @opf/tech-writers @opf/backend

app/helpers/static_links_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,13 @@ def static_link_to(key, label: nil)
3737
class: 'openproject--static-link',
3838
target: '_blank', rel: 'noopener'
3939
end
40+
41+
##
42+
# Link to the correct installation guides for the current selected method
43+
def installation_guide_link
44+
val = OpenProject::Configuration.installation_type
45+
link = OpenProject::Static::Links.links[:"#{val}_installation"] || OpenProject::Static::Links.links[:installation_guides]
46+
47+
link[:href]
48+
end
4049
end

app/helpers/warning_bar_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def render_host_and_protocol_mismatch?
4040
end
4141

4242
def setting_protocol_mismatched?
43-
request.ssl? != OpenProject::Configuration.secure_connection?
43+
request.ssl? != OpenProject::Configuration.https?
4444
end
4545

4646
def setting_hostname_mismatched?

app/models/journal.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ def previous
101101
predecessor
102102
end
103103

104+
def successor
105+
@successor ||= self.class
106+
.where(journable_type:, journable_id:)
107+
.where("#{self.class.table_name}.version > ?", version)
108+
.order(version: :asc)
109+
.first
110+
end
111+
104112
def noop?
105113
(!notes || notes&.empty?) && get_changes.empty?
106114
end

app/models/setting/aliases.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Aliases
3333
##
3434
# Restore the previous Setting.protocol now replaced by https?
3535
def protocol
36-
if OpenProject::Configuration.secure_connection?
36+
if OpenProject::Configuration.https?
3737
'https'
3838
else
3939
'http'

app/services/journals/create_service.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,22 +177,25 @@ def create_journal_sql(predecessor, notes)
177177
def cleanup_predecessor_data(predecessor)
178178
cleanup_predecessor(predecessor,
179179
data_table_name,
180-
:id)
180+
:id,
181+
:data_id)
181182
end
182183

183184
def cleanup_predecessor_attachable(predecessor)
184185
cleanup_predecessor(predecessor,
185186
'attachable_journals',
186-
:journal_id)
187+
:journal_id,
188+
:id)
187189
end
188190

189191
def cleanup_predecessor_customizable(predecessor)
190192
cleanup_predecessor(predecessor,
191193
'customizable_journals',
192-
:journal_id)
194+
:journal_id,
195+
:id)
193196
end
194197

195-
def cleanup_predecessor(predecessor, table_name, column)
198+
def cleanup_predecessor(predecessor, table_name, column, referenced_id)
196199
return "SELECT 1" unless predecessor
197200

198201
sql = <<~SQL
@@ -204,7 +207,7 @@ def cleanup_predecessor(predecessor, table_name, column)
204207
SQL
205208

206209
sanitize sql,
207-
column => predecessor.id
210+
column => predecessor.send(referenced_id)
208211
end
209212

210213
def update_or_insert_journal_sql(predecessor, notes)

app/views/warning_bar/_host_and_protocol_mismatch.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33

44
<% if setting_protocol_mismatched? %>
55
<p>
6-
<strong><%= t 'warning_bar.protocol_mismatch.title' %></strong>
6+
<strong><%= t 'warning_bar.https_mismatch.title' %></strong>
77
<br/>
8-
<%= t 'warning_bar.protocol_mismatch.text_html',
8+
<%= t 'warning_bar.https_mismatch.text_html',
99
set_protocol: Setting.protocol,
1010
actual_protocol: request.ssl? ? 'https' : 'http',
11-
setting_path: admin_settings_general_path
11+
setting_value: request.ssl? ? 'OPENPROJECT_HTTPS=true' : 'OPENPROJECT_HTTPS=false',
12+
more_info_path: installation_guide_link
1213
%>
1314
</p>
1415
<% end %>

config/configuration.yml.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ default:
208208
#
209209
# rails_relative_url_root: ""
210210

211-
# whether to force ssl in production
212-
rails_force_ssl: false
213-
214211
# Absolute path to the directory where attachments are stored.
215212
# The default is the 'files' directory in your OpenProject instance.
216213
# Your OpenProject instance needs to have write permission on this

config/constants/settings/definition.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ def load_yaml(source)
381381
def cast(value)
382382
return nil if value.nil?
383383

384+
value = value.call if value.respond_to?(:call)
385+
384386
case format
385387
when :integer
386388
value.to_i
@@ -391,11 +393,7 @@ def cast(value)
391393
when :symbol
392394
value.to_sym
393395
else
394-
if value.respond_to?(:call)
395-
value.call
396-
else
397-
value
398-
end
396+
value
399397
end
400398
end
401399

config/constants/settings/definitions.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,16 @@
666666
writable: false
667667

668668
# Assume we're running in an TLS terminated connection.
669-
# This does not affect HSTS, use +rails_force_ssl+ for that.
670669
add :https,
671670
format: :boolean,
672-
default: Rails.env.production?,
671+
default: -> { Rails.env.production? },
673672
writable: false
674673

675-
# Enable HTTPS and HSTS
676-
add :rails_force_ssl,
674+
# Allow disabling of HSTS headers and http -> https redirects
675+
# for non-localhost hosts
676+
add :hsts,
677677
format: :boolean,
678-
default: Rails.env.production?,
678+
default: true,
679679
writable: false
680680

681681
add :registration_footer,

config/environments/production.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,30 @@
7474
# Store uploaded files on the local file system (see config/storage.yml for options)
7575
# config.active_storage.service = :local
7676

77-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
78-
config.force_ssl = ActiveModel::Type::Boolean.new.cast(OpenProject::Configuration['rails_force_ssl'])
77+
# When https is configured, Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
78+
# Allow disabling HSTS redirect by using OPENPROJECT_HSTS=false
79+
config.force_ssl = OpenProject::Configuration.https?
7980
config.ssl_options = {
8081
# Disable redirect on the internal SYS API
8182
redirect: {
83+
hsts: OpenProject::Configuration.hsts_enabled?,
8284
exclude: ->(request) do
85+
# Disable redirects when hsts is disabled
86+
return true unless OpenProject::Configuration.hsts_enabled?
87+
8388
# Respect the relative URL
8489
relative_url = Regexp.escape(OpenProject::Configuration['rails_relative_url_root'])
90+
8591
# When we match SYS controller API, allow non-https access
86-
request.path =~ /#{relative_url}\/sys\// || request.path =~ /#{relative_url}\/health_checks/
92+
return true if request.path =~ /#{relative_url}\/sys\//
93+
94+
# When we match health checks
95+
return true if request.path =~ /#{relative_url}\/health_checks/
96+
97+
false
8798
end
8899
},
89-
secure_cookies: true
100+
secure_cookies: OpenProject::Configuration.https?
90101
}
91102

92103
# Set to :debug to see everything in the log.

config/initializers/session_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def update_entry_ttl?(session, options)
7979
session_options = {
8080
key: config['session_cookie_name'],
8181
httponly: true,
82-
secure: config.secure_connection?,
82+
secure: config.https?,
8383
path: relative_url_root
8484
}
8585

config/locales/crowdin/af.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,13 @@ af:
267267
deletion_info:
268268
heading: "Delete placeholder user %{name}"
269269
data_consequences: >
270-
All occurrences of the placeholder user (e.g., as assignee, responsible or other user values) will be reassigned to an account called "Deleted user".
271-
As the data of every deleted account is reassigned to this account it will not be possible to distinguish the data the user created from the data of another deleted account.
270+
All occurrences of the placeholder user (e.g., as assignee, responsible or other user values) will be reassigned to an account called "Deleted user". As the data of every deleted account is reassigned to this account it will not be possible to distinguish the data the user created from the data of another deleted account.
272271
irreversible: "This action is irreversible"
273272
confirmation: "Enter the placeholder user name %{name} to confirm the deletion."
274273
upsale:
275274
title: Placeholder users
276275
description: >
277-
Placeholder users are a way to assign work packages to users who are not part of your project. They can be useful in a range of scenarios; for example, if you need to track tasks for a resource that is not yet named or available, or if you don’t want to give that person access to OpenProject but still want track tasks assigned to them.
276+
Placeholder users are a way to assign work packages to users who are not part of your project. They can be useful in a range of scenarios; for example, if you need to track tasks for a resource that is not yet named or available, or if you don’t want to give that person access to OpenProject but still want to track tasks assigned to them.
278277
prioritiies:
279278
edit:
280279
priority_color_text: |
@@ -1248,7 +1247,7 @@ af:
12481247
error_enterprise_activation_user_limit: "Your account could not be activated (user limit reached). Please contact your administrator to gain access."
12491248
error_enterprise_token_invalid_domain: "The Enterprise Edition is not active. Your Enterprise token's domain (%{actual}) does not match the system's host name (%{expected})."
12501249
error_failed_to_delete_entry: 'Failed to delete this entry.'
1251-
error_in_dependent: "Error attempting to alter dependent object: %{dependent_class} #%{related_id} - %{related_subject}: %{error}"
1250+
error_in_dependent: "Error attempting to alter dependent object: %{dependent_class} #%{related_id} - %{related_subject}: %{error}" #%{related_id} - %{related_subject}: %{error}"
12521251
error_in_new_dependent: "Error attempting to create dependent object: %{dependent_class} - %{related_subject}: %{error}"
12531252
error_invalid_selected_value: "Invalid selected value."
12541253
error_journal_attribute_not_present: "Journal does not contain attribute %{attribute}."
@@ -1387,17 +1386,11 @@ af:
13871386
update_info_mail:
13881387
body: >
13891388
We are excited to announce the release of OpenProject 12.0. It's a major release that will hopefully significantly improve the way you use OpenProject.
1390-
13911389
Starting with this release, we are introducing in-app notifications. From now on, you will receive notifications for updates to work packages directly in OpenProject. You can mark these notifications as read, reply to a comment or even directly modify work package attributes without leaving the notification center.
1392-
13931390
This also means that we will no longer be using emails for notifications. We think the new notification center is a better place to view and act upon these updates. Nevertheless, if you would like continue receiving updates via email, you can choose to receive daily email reminders at particular times of your choosing.
1394-
13951391
Please make sure to verify your new default notification settings, and set your preferences for notifications and email reminders via your account settings. You can do this through the “Change email settings” button bellow.
1396-
13971392
We hope you find in-app notifications useful and that they makes you even more productive.
1398-
1399-
Sincerely,
1400-
The OpenProject team
1393+
Sincerely, The OpenProject team
14011394
body_header: 'Version 12.0 with Notification Center'
14021395
body_subheader: 'Nuus'
14031396
subject: 'Important changes to notifications with the release of 12.0'
@@ -1612,6 +1605,7 @@ af:
16121605
label_index_by_title: "Indekseer volgens titel"
16131606
label_information: "Inligting"
16141607
label_information_plural: "Inligting"
1608+
label_installation_guides: 'Installation guides'
16151609
label_integer: "Heelgetal"
16161610
label_internal: "Interne"
16171611
label_introduction_video: "Introduction video"
@@ -2878,10 +2872,10 @@ af:
28782872
warning_protocol_mismatch_html: >
28792873
28802874
warning_bar:
2881-
protocol_mismatch:
2882-
title: 'Protocol setting mismatch'
2875+
https_mismatch:
2876+
title: 'HTTPS mode setup mismatch'
28832877
text_html: >
2884-
Your application is running with its protocol setting set to <code>%{set_protocol}</code>, but the request is an <code>%{actual_protocol}</code> request. This will result in errors! Go to <a href="%{setting_path}">System settings</a> and change the "Protocol" setting to correct this.
2878+
Your application is running with HTTPS mode set to <code>%{set_protocol}</code>, but the request is an <code>%{actual_protocol}</code> request. This will result in errors! You will need to set the following configuration value: <code>%{setting_value}</code>. Please see <a href="%{more_info_path}">the installation documentation</a> on how to set this configuration.
28852879
hostname_mismatch:
28862880
title: 'Hostname setting mismatch'
28872881
text_html: >

config/locales/crowdin/ar.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,13 @@ ar:
267267
deletion_info:
268268
heading: "Delete placeholder user %{name}"
269269
data_consequences: >
270-
All occurrences of the placeholder user (e.g., as assignee, responsible or other user values) will be reassigned to an account called "Deleted user".
271-
As the data of every deleted account is reassigned to this account it will not be possible to distinguish the data the user created from the data of another deleted account.
270+
All occurrences of the placeholder user (e.g., as assignee, responsible or other user values) will be reassigned to an account called "Deleted user". As the data of every deleted account is reassigned to this account it will not be possible to distinguish the data the user created from the data of another deleted account.
272271
irreversible: "This action is irreversible"
273272
confirmation: "Enter the placeholder user name %{name} to confirm the deletion."
274273
upsale:
275274
title: Placeholder users
276275
description: >
277-
Placeholder users are a way to assign work packages to users who are not part of your project. They can be useful in a range of scenarios; for example, if you need to track tasks for a resource that is not yet named or available, or if you don’t want to give that person access to OpenProject but still want track tasks assigned to them.
276+
Placeholder users are a way to assign work packages to users who are not part of your project. They can be useful in a range of scenarios; for example, if you need to track tasks for a resource that is not yet named or available, or if you don’t want to give that person access to OpenProject but still want to track tasks assigned to them.
278277
prioritiies:
279278
edit:
280279
priority_color_text: |
@@ -1045,7 +1044,6 @@ ar:
10451044
errors: "خطأ"
10461045
project_custom_fields: 'Custom fields on project'
10471046
x_objects_of_this_type:
1048-
zero: 'No objects of this type'
10491047
one: 'One object of this type'
10501048
other: '%{count} objects of this type'
10511049
text:
@@ -1316,7 +1314,7 @@ ar:
13161314
error_enterprise_activation_user_limit: "Your account could not be activated (user limit reached). Please contact your administrator to gain access."
13171315
error_enterprise_token_invalid_domain: "The Enterprise Edition is not active. Your Enterprise token's domain (%{actual}) does not match the system's host name (%{expected})."
13181316
error_failed_to_delete_entry: 'Failed to delete this entry.'
1319-
error_in_dependent: "Error attempting to alter dependent object: %{dependent_class} #%{related_id} - %{related_subject}: %{error}"
1317+
error_in_dependent: "Error attempting to alter dependent object: %{dependent_class} #%{related_id} - %{related_subject}: %{error}" #%{related_id} - %{related_subject}: %{error}"
13201318
error_in_new_dependent: "Error attempting to create dependent object: %{dependent_class} - %{related_subject}: %{error}"
13211319
error_invalid_selected_value: "Invalid selected value."
13221320
error_journal_attribute_not_present: "Journal does not contain attribute %{attribute}."
@@ -1455,17 +1453,11 @@ ar:
14551453
update_info_mail:
14561454
body: >
14571455
We are excited to announce the release of OpenProject 12.0. It's a major release that will hopefully significantly improve the way you use OpenProject.
1458-
14591456
Starting with this release, we are introducing in-app notifications. From now on, you will receive notifications for updates to work packages directly in OpenProject. You can mark these notifications as read, reply to a comment or even directly modify work package attributes without leaving the notification center.
1460-
14611457
This also means that we will no longer be using emails for notifications. We think the new notification center is a better place to view and act upon these updates. Nevertheless, if you would like continue receiving updates via email, you can choose to receive daily email reminders at particular times of your choosing.
1462-
14631458
Please make sure to verify your new default notification settings, and set your preferences for notifications and email reminders via your account settings. You can do this through the “Change email settings” button bellow.
1464-
14651459
We hope you find in-app notifications useful and that they makes you even more productive.
1466-
1467-
Sincerely,
1468-
The OpenProject team
1460+
Sincerely, The OpenProject team
14691461
body_header: 'Version 12.0 with Notification Center'
14701462
body_subheader: 'الأخبار'
14711463
subject: 'Important changes to notifications with the release of 12.0'
@@ -1680,6 +1672,7 @@ ar:
16801672
label_index_by_title: "فهرسة حسب العنوان"
16811673
label_information: "معلومات"
16821674
label_information_plural: "معلومات"
1675+
label_installation_guides: 'Installation guides'
16831676
label_integer: "عدد صحيح"
16841677
label_internal: "داخلي"
16851678
label_introduction_video: "Introduction video"
@@ -1993,19 +1986,15 @@ ar:
19931986
label_x_closed_work_packages_abbr:
19941987
one: "1 مغلقة"
19951988
other: "%{count} مغلق"
1996-
zero: "0 closed"
19971989
label_x_comments:
19981990
one: "1 comment"
19991991
other: "%{count} تعليقات"
2000-
zero: "no comments"
20011992
label_x_open_work_packages_abbr:
20021993
one: "1 open"
20031994
other: "%{count} مفتوح"
2004-
zero: "0 open"
20051995
label_x_projects:
20061996
one: "1 project"
20071997
other: "%{count} مشاريع"
2008-
zero: "no projects"
20091998
label_yesterday: "الأمس"
20101999
label_role_type: "النّوع"
20112000
label_member_role: "دور المشروع"
@@ -2960,10 +2949,10 @@ ar:
29602949
warning_protocol_mismatch_html: >
29612950
29622951
warning_bar:
2963-
protocol_mismatch:
2964-
title: 'Protocol setting mismatch'
2952+
https_mismatch:
2953+
title: 'HTTPS mode setup mismatch'
29652954
text_html: >
2966-
Your application is running with its protocol setting set to <code>%{set_protocol}</code>, but the request is an <code>%{actual_protocol}</code> request. This will result in errors! Go to <a href="%{setting_path}">System settings</a> and change the "Protocol" setting to correct this.
2955+
Your application is running with HTTPS mode set to <code>%{set_protocol}</code>, but the request is an <code>%{actual_protocol}</code> request. This will result in errors! You will need to set the following configuration value: <code>%{setting_value}</code>. Please see <a href="%{more_info_path}">the installation documentation</a> on how to set this configuration.
29672956
hostname_mismatch:
29682957
title: 'Hostname setting mismatch'
29692958
text_html: >

0 commit comments

Comments
 (0)