Skip to content

Commit 151cb3d

Browse files
authored
Merge pull request #21340 from opf/merge-release/17.0-20251204132109
Merge release/17.0 into dev
2 parents 1ed7d4f + 6be07a8 commit 151cb3d

14 files changed

Lines changed: 170 additions & 139 deletions

File tree

app/components/wiki_pages/show_page_header_component.html.erb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,25 @@ See COPYRIGHT and LICENSE files for more details.
162162
item.with_leading_visual_icon(icon: "op-printer")
163163
end
164164
if User.current.allowed_in_project?(:export_wiki_pages, @project)
165-
menu.with_item(
165+
menu.with_sub_menu_item(
166166
tag: :a,
167167
label: t("js.label_export"),
168-
size: :medium,
169-
href: "",
170168
title: t("js.label_export"),
171-
classes: "modal-delivery-element--activation-link"
169+
size: :auto,
170+
test_selector: "export-button"
172171
) do |item|
173172
item.with_leading_visual_icon(icon: :download)
173+
if show_atom_link?
174+
item.with_item(label: t("export.format.atom"), tag: :a, href: export_atom_link) do |subitem|
175+
subitem.with_leading_visual_icon(icon: :"op-file-atom")
176+
end
177+
end
178+
item.with_item(
179+
label: t("text_formatting.markdown"), tag: :a, href: export_markdown_link,
180+
test_selector: "markdown-export"
181+
) do |subitem|
182+
subitem.with_leading_visual_icon(icon: :file)
183+
end
174184
end
175185
end
176186
menu.with_item(
@@ -185,12 +195,3 @@ See COPYRIGHT and LICENSE files for more details.
185195
end
186196
end
187197
%>
188-
189-
<section data-augmented-model-wrapper
190-
data-modal-class-name="wiki-export---modal">
191-
<%= link_to t("js.label_export"),
192-
"",
193-
title: t("js.label_export"),
194-
style: "display: none;" %>
195-
<%= render partial: "wiki/wiki_export_modal" %>
196-
</section>

app/components/wiki_pages/show_page_header_component.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,29 @@ def show_edit?
5555
def show_rollback?
5656
User.current.allowed_in_project?(:edit_wiki_pages, @project) && !@page.current_version?
5757
end
58+
59+
def show_atom_link?
60+
@project.present? && @project.module_enabled?("activity")
61+
end
62+
63+
def export_atom_link
64+
url_for(
65+
controller: "/activities",
66+
action: "index",
67+
id: @project,
68+
show_wiki_edits: 1,
69+
apply: true,
70+
key: User.current.rss_key,
71+
format: "atom"
72+
)
73+
end
74+
75+
def export_markdown_link
76+
url_for(
77+
version: @page.version,
78+
id: @page,
79+
format: "markdown"
80+
)
81+
end
5882
end
5983
end

app/forms/admin/settings/general_settings/welcome_block_form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Settings
3333
module GeneralSettings
3434
class WelcomeBlockForm < ApplicationForm
3535
settings_form do |sf|
36-
sf.text_field(name: :welcome_title)
36+
sf.text_field(name: :welcome_title, input_width: :medium)
3737

3838
sf.rich_text_area(
3939
name: :welcome_text,

app/forms/admin/settings/general_settings_form.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class GeneralSettingsForm < ApplicationForm
3737

3838
settings_form do |sf|
3939
sf.text_field(
40-
name: :app_title
40+
name: :app_title,
41+
input_width: :medium
4142
)
4243

4344
sf.text_field(

app/forms/custom_fields/inputs/date.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ class CustomFields::Inputs::Date < CustomFields::Inputs::Base::Input
3434
end
3535

3636
def input_attributes
37-
super.merge({ type: "date" })
37+
super.merge({ input_width: :xsmall, type: "date" })
3838
end
3939
end

app/models/work_packages/scopes/allowed_to.rb

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -88,54 +88,34 @@ def logged_in_non_admin_allowed_to(user, permissions)
8888
WHERE entity_id IS NULL
8989
SQL
9090

91-
# Remove those entries from before that are
92-
# * entity (WorkPackage) specific AND
93-
# * have the same project as a non-entity specific entry.
94-
# That is the case if a work package is shared with a user
95-
# while the user is already a member in the project.
96-
# Since the allowed_to filtering is already specific to the permissions, that removal is safe.
97-
entity_member_projects_without_duplicates = Arel.sql(<<~SQL.squish)
98-
SELECT * FROM entity_member_projects
99-
WHERE NOT EXISTS (
100-
SELECT 1 FROM project_member_projects
101-
WHERE project_member_projects.id = entity_member_projects.id
102-
)
103-
SQL
104-
10591
# Take all work packages allowed by either project-wide or entity-specific membership.
106-
# But now remove all those that are in a project for which an entity-specific membership exists that is not
107-
# for that entity (work package).
108-
# An alternative way of formulating this would be by comparing
109-
# * That the project_id matches AND
110-
# * the entity_id matches OR the entity_id is null
111-
# ```
112-
# SELECT * from work_packages
113-
# WHERE EXISTS (
114-
# SELECT 1 FROM allowed_projects projects
115-
# WHERE projects.id = work_packages.project_id
116-
# AND (projects.entity_id = work_packages.id OR projects.entity_id IS NULL)
117-
# )
118-
# ```
119-
# Postgresql however sometimes turns to a sequential scan with the query above.
92+
# PostgreSQL however sometimes turns to a sequential scan with the query above.
12093
#
121-
# Index scans can still happen in the combination of the CTE with the check outside of the
122-
# CTEs for the existence of any record.
123-
# This is particularly likely in case AR.exists? is used which adds a LIMIT 1
94+
# It is currently unclear if index scans can still happen in the combination of the CTE with the check
95+
# outside of the CTEs for the existence of any record.
96+
# This happened in the past, before changing this CTE to a UNION, in case AR.exists? is used which adds a LIMIT 1
12497
# to the query. In this case, there is a known shortcoming that PostgreSQL's query planner
12598
# will make poor choices
12699
# (https://www.postgresql.org/message-id/flat/CA%2BU5nMLbXfUT9cWDHJ3tpxjC3bTWqizBKqTwDgzebCB5bAGCgg%40mail.gmail.com).
127100
#
128101
# Once AR supports adding materialization hints (https://github.com/rails/rails/pull/54322), the inner
129102
# `allowed` CTE can be abandoned as it is only used for being able to provide such a hint.
103+
# Having the inner materialized CTE has no known negative side effects which is why it is kept.
130104
allowed_by_projects_and_work_packages = Arel.sql(<<~SQL.squish)
131105
WITH allowed AS MATERIALIZED (
132-
SELECT id from work_packages
133-
WHERE project_id in (SELECT id FROM member_projects)
134-
AND NOT EXISTS (
135-
SELECT 1 FROM entity_member_projects_without_duplicates
136-
WHERE entity_member_projects_without_duplicates.id = work_packages.project_id
137-
AND entity_member_projects_without_duplicates.entity_id != work_packages.id
138-
)
106+
SELECT
107+
work_packages.id
108+
FROM
109+
work_packages
110+
JOIN project_member_projects ON project_member_projects.id = work_packages.project_id
111+
112+
UNION
113+
114+
SELECT
115+
work_packages.id
116+
FROM
117+
work_packages
118+
JOIN entity_member_projects ON entity_member_projects.entity_id = work_packages.id
139119
)
140120
141121
SELECT * from allowed
@@ -144,7 +124,6 @@ def logged_in_non_admin_allowed_to(user, permissions)
144124
with(member_projects: Arel.sql(allowed_via_project_or_work_package_membership.to_sql),
145125
entity_member_projects:,
146126
project_member_projects:,
147-
entity_member_projects_without_duplicates:,
148127
allowed_by_projects_and_work_packages:)
149128
.where(<<~SQL.squish)
150129
EXISTS (

app/views/wiki/_wiki_export_modal.html.erb

Lines changed: 0 additions & 66 deletions
This file was deleted.

config/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ en:
26112611
title: "Write internal comments only a small group can see"
26122612
description: " "
26132613
portfolio_management:
2614-
description: Organize your work effectively by creating portfolios and programs with the portfolio management module.
2614+
description: Align your projects to your strategic goals by organizing them into portfolios and programs.
26152615
teaser:
26162616
title:
26172617
one: "One day left of %{trial_plan} trial token"

docs/release-notes/17-0-0/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ In these Release Notes, we will give an overview of important feature changes. A
2222

2323
<!-- Remove this section if empty, add to it in pull requests linking to tickets and provide information -->
2424

25+
### Removal of special semver
26+
27+
We removed the `special` fragment of the semantic version of OpenProject. This has not been in use.
28+
Unless you are relying on this value in one of your plugins, you can ignore this change.
29+
30+
Reference: \[[#67036](https://community.openproject.org/wp/67036)\]
31+
2532
<!--more-->
2633

2734
## Bug fixes and changes

frontend/src/global_styles/common/export-options/export-options.sass

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,3 @@
2424
&-label
2525
display: block
2626
padding: 10px 0 0 0
27-
28-
&.op-export-options-grid
29-
display: grid
30-
grid-template-columns: 1fr 1fr 1fr
31-
32-
@media screen and (max-width: 480px)
33-
grid-template-columns: 1fr 1fr
34-
35-
@media screen and (max-width: 320px)
36-
grid-template-columns: 1fr
37-

0 commit comments

Comments
 (0)