Skip to content

Commit 87a8cdc

Browse files
Release OpenProject 17.0.2
2 parents f01b62f + 72e93b1 commit 87a8cdc

File tree

234 files changed

+1816
-1044
lines changed

Some content is hidden

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

234 files changed

+1816
-1044
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
./docker/prod/setup/precompile-assets.sh
104104
# public/assets will be saved as artifact, so temporarily copying config file there as well
105105
cp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json
106-
- uses: actions/upload-artifact@v5
106+
- uses: actions/upload-artifact@v6
107107
with:
108108
path: public/
109109
name: public-assets-${{ inputs.tag }}-${{ github.sha }}
@@ -163,7 +163,7 @@ jobs:
163163
run: |
164164
cp ./docker/prod/Dockerfile ./Dockerfile
165165
- name: Download precompiled public assets
166-
uses: actions/download-artifact@v6
166+
uses: actions/download-artifact@v7
167167
with:
168168
name: public-assets-${{ inputs.tag }}-${{ github.sha }}
169169
path: public/
@@ -208,7 +208,7 @@ jobs:
208208
${{ needs.setup.outputs.registry_image }}
209209
- name: Restore vendor/bundle
210210
id: restore-vendor-bundle
211-
uses: actions/cache/restore@v4
211+
uses: actions/cache/restore@v5
212212
with:
213213
path: |
214214
vendor/bundle
@@ -243,7 +243,7 @@ jobs:
243243
docker rm bundle
244244
- name: Save vendor/bundle
245245
id: save-vendor-bundle
246-
uses: actions/cache/save@v4
246+
uses: actions/cache/save@v5
247247
with:
248248
path: |
249249
vendor/bundle
@@ -292,9 +292,9 @@ jobs:
292292
digest="${{ steps.push.outputs.digest }}"
293293
touch "/tmp/digests/${digest#sha256:}"
294294
- name: Upload digest
295-
uses: actions/upload-artifact@v5
295+
uses: actions/upload-artifact@v6
296296
with:
297-
name: digests-${{ inputs.tag }}-${{ matrix.target }}-${{ matrix.digest }}
297+
name: digests-${{ inputs.tag }}-${{ matrix.target }}--${{ matrix.digest }}
298298
path: /tmp/digests/*
299299
if-no-files-found: error
300300
retention-days: 1
@@ -308,13 +308,13 @@ jobs:
308308
- build
309309
steps:
310310
- name: Merge digests
311-
uses: actions/upload-artifact/merge@v5
311+
uses: actions/upload-artifact/merge@v6
312312
with:
313-
pattern: "digests-${{ inputs.tag }}-${{ matrix.target }}-${{ matrix.digest }}*"
313+
pattern: "digests-${{ inputs.tag }}-${{ matrix.target }}--*"
314314
overwrite: true
315315
name: "merged-digests-${{ inputs.tag }}-${{ matrix.target }}-${{ github.run_number }}-${{ github.run_attempt }}"
316316
- name: Download digests
317-
uses: actions/download-artifact@v6
317+
uses: actions/download-artifact@v7
318318
with:
319319
name: "merged-digests-${{ inputs.tag }}-${{ matrix.target }}-${{ github.run_number }}-${{ github.run_attempt }}"
320320
path: /tmp/digests

app/components/open_project/common/main_menu_toggle_component.rb

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,31 @@
3131
module OpenProject
3232
module Common
3333
class MainMenuToggleComponent < ApplicationComponent
34-
def initialize(expanded:)
34+
include Primer::AttributesHelper
35+
36+
def initialize(expanded:, **system_arguments)
3537
super()
3638

37-
@expanded = expanded
39+
@system_arguments = system_arguments
40+
@system_arguments[:scheme] = :invisible
41+
@system_arguments[:icon] = expanded ? :"sidebar-expand" : :"sidebar-collapse"
42+
@system_arguments[:size] = expanded ? :medium : :small
43+
@system_arguments[:id] = "menu-toggle--#{expanded ? 'collapse-button' : 'expand-button'}"
44+
@system_arguments[:data] = merge_data(
45+
@system_arguments,
46+
data: { action: "click->menus--main-toggle#toggleNavigation" }
47+
)
48+
@system_arguments[:aria] = merge_aria(
49+
@system_arguments,
50+
aria: {
51+
expanded:,
52+
label: expanded ? I18n.t("js.label_hide_project_menu") : I18n.t("js.label_expand_project_menu")
53+
}
54+
)
3855
end
3956

4057
def call
41-
render(Primer::Beta::IconButton.new(icon:,
42-
id:,
43-
aria: { label: aria_label },
44-
scheme:,
45-
size:,
46-
data:))
47-
end
48-
49-
private
50-
51-
def icon
52-
@expanded ? "sidebar-expand" : :"sidebar-collapse"
53-
end
54-
55-
def id
56-
"menu-toggle--#{@expanded ? 'collapse-button' : 'expand-button'}"
57-
end
58-
59-
def aria_label
60-
@expanded ? I18n.t("js.label_hide_project_menu") : I18n.t("js.label_expand_project_menu")
61-
end
62-
63-
def scheme
64-
:invisible
65-
end
66-
67-
def size
68-
@expanded ? :medium : :small
69-
end
70-
71-
def data
72-
{
73-
action: "click->menus--main-toggle#toggleNavigation"
74-
}
58+
render(Primer::Beta::IconButton.new(**@system_arguments))
7559
end
7660
end
7761
end

app/components/projects/project_creation_footer_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def submit_button_args
7676
end
7777

7878
def total_steps
79-
template.nil? && project.available_custom_fields.required.any? ? 3 : 2
79+
template.nil? && project.available_custom_fields.for_all.required.any? ? 3 : 2
8080
end
8181
end
8282
end

app/components/users/row_component.rb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,25 @@ def button_links
7979
end
8080

8181
def status_link
82-
# Don't show for current user
83-
return if user.id == table.current_user.id
84-
85-
# Don't show if non-admin
86-
return unless table.current_user.admin?
82+
return if user_is_current_user?
83+
return unless current_user_allowed_to_manage_users?
84+
return if user_is_admin_and_current_user_is_no_admin?
8785

8886
helpers.change_user_status_links user
8987
end
9088

89+
def user_is_current_user?
90+
user.id == table.current_user.id
91+
end
92+
93+
def current_user_allowed_to_manage_users?
94+
table.current_user.allowed_globally?(:manage_user)
95+
end
96+
97+
def user_is_admin_and_current_user_is_no_admin?
98+
user.admin? && !table.current_user.admin?
99+
end
100+
91101
def column_css_class(column)
92102
if column == :mail
93103
"email"

app/controllers/repositories_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def diff
233233
end
234234

235235
filename = "changeset_r#{@rev}"
236-
filename << "_r#{@rev_to}" if @rev_to
236+
filename += "_r#{@rev_to}" if @rev_to
237237
send_data @diff.join,
238238
filename: "#{filename}.diff",
239239
type: "text/x-patch",

app/controllers/users_controller.rb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ def change_status_info
157157
def change_status # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
158158
if @user.id == current_user.id
159159
# user is not allowed to change own status
160+
flash[:error] = I18n.t("user.error_status_change_self")
161+
redirect_back_or_default({ action: "edit", id: @user })
162+
return
163+
end
164+
165+
if @user.admin? && !current_user.admin?
166+
# non-admin users are not allowed to change admin status
167+
flash[:error] = I18n.t("user.error_admin_change_on_non_admin")
160168
redirect_back_or_default({ action: "edit", id: @user })
161169
return
162170
end
@@ -167,23 +175,28 @@ def change_status # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
167175
return redirect_back_or_default({ action: "edit", id: @user })
168176
end
169177

178+
activated_account = false
179+
170180
if params[:unlock]
171181
@user.failed_login_count = 0
172182
@user.activate
183+
activated_account = true
173184
elsif params[:lock]
174185
@user.lock
175186
elsif params[:activate]
176187
@user.activate
188+
activated_account = true
177189
end
190+
178191
# Was the account activated? (do it before User#save clears the change)
179-
was_activated = (@user.status_change == %w[registered active])
192+
should_deliver_activation_mail = (@user.status_change == %w[registered active])
180193

181-
if params[:activate] && @user.missing_authentication_method?
194+
if activated_account && @user.missing_authentication_method?
182195
flash[:error] = I18n.t("user.error_status_change_failed",
183196
errors: I18n.t(:notice_user_missing_authentication_method))
184197
elsif @user.save
185198
flash[:notice] = I18n.t(:notice_successful_update)
186-
if was_activated
199+
if should_deliver_activation_mail
187200
UserMailer.account_activated(@user).deliver_later
188201
end
189202
else

0 commit comments

Comments
 (0)