From 7531a5a5ad1dc3de7b0423854b9f0878666a3d1f Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Wed, 25 Jun 2025 18:39:42 +0200 Subject: [PATCH 1/2] Fix handling multi_value User Custom Action (#19244) * Adds the multiple flag for handling multi_value inputs * Adds some tests to avoid regressions * Remove extraneous comment --- app/views/custom_actions/_form.html.erb | 1 + .../custom_actions/custom_actions_spec.rb | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/views/custom_actions/_form.html.erb b/app/views/custom_actions/_form.html.erb index 8dc2f99e13a..d467f6392db 100644 --- a/app/views/custom_actions/_form.html.erb +++ b/app/views/custom_actions/_form.html.erb @@ -85,6 +85,7 @@ <% selected = action.value_objects.map { |v| { id: v[:value], name: v[:label] } } %> <%= angular_component_tag "opce-user-autocompleter", inputs: { + multiple: action.multi_value?, hideSelected: true, defaultData: false, placeholder: I18n.t(:label_user_search), diff --git a/spec/features/work_packages/custom_actions/custom_actions_spec.rb b/spec/features/work_packages/custom_actions/custom_actions_spec.rb index 68d081f8e3b..2ec0ce4b9be 100644 --- a/spec/features/work_packages/custom_actions/custom_actions_spec.rb +++ b/spec/features/work_packages/custom_actions/custom_actions_spec.rb @@ -129,6 +129,12 @@ RSpec.describe "Custom actions", :js, with_ee: %i[custom_actions] do cf end + let!(:multi_user_custom_field) do + create(:multi_user_wp_custom_field).tap do |cf| + project.work_package_custom_fields << cf + work_package.type.custom_fields << cf + end + end let(:index_ca_page) { Pages::Admin::CustomActions::Index.new } let(:activity_tab) { Components::WorkPackages::Activities.new(work_package) } @@ -484,7 +490,7 @@ RSpec.describe "Custom actions", :js, with_ee: %i[custom_actions] do end end - it "disables the custom action button and editing other fields when submiting the custom action" do + it "disables the custom action button and editing other fields when submitting the custom action" do # create custom action 'Unassign' index_ca_page.visit! @@ -543,4 +549,24 @@ RSpec.describe "Custom actions", :js, with_ee: %i[custom_actions] do wp_page.click_custom_action("Unassign", expect_success: true) end end + + context "with a multi_user field (Bug#64981)" do + it "saves when a user is assigned to the custom field" do + index_ca_page.visit! + + new_ca_page = index_ca_page.new + new_ca_page.set_name("MultiUser") + new_ca_page.set_description("Multiple User Custom Field Test") + new_ca_page.add_action(multi_user_custom_field.name, other_member_user.name) + new_ca_page.expect_action(multi_user_custom_field.name, [other_member_user.name]) + + new_ca_page.create + + index_ca_page.expect_current_path + index_ca_page.expect_listed("MultiUser") + + edit_ca_page = index_ca_page.edit("MultiUser") + edit_ca_page.expect_action(multi_user_custom_field.name, [other_member_user.name]) + end + end end From e8c702987be89c4301e5518d6e2a255e51961d8c Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Thu, 26 Jun 2025 03:34:20 +0000 Subject: [PATCH 2/2] update locales from crowdin [ci skip] --- config/locales/crowdin/de.yml | 2 +- config/locales/crowdin/js-zh-CN.yml | 6 +++--- config/locales/crowdin/zh-CN.yml | 6 +++--- config/locales/crowdin/zh-TW.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/locales/crowdin/de.yml b/config/locales/crowdin/de.yml index 1b9bbef2731..797206165bb 100644 --- a/config/locales/crowdin/de.yml +++ b/config/locales/crowdin/de.yml @@ -1200,7 +1200,7 @@ de: attributes: content_type: blank: "Der Content-Type der Datei darf nicht leer sein." - not_allowlisted: "The file was rejected by an automatic filter. '%{value}' is not allowed for upload." + not_allowlisted: "Die Datei wurde von einem automatischen Filter abgelehnt. ‚%{value}‘ ist für den Upload nicht zulässig." format: "%{message}" capability: context: diff --git a/config/locales/crowdin/js-zh-CN.yml b/config/locales/crowdin/js-zh-CN.yml index f66527f9113..5c1bb52dcf9 100644 --- a/config/locales/crowdin/js-zh-CN.yml +++ b/config/locales/crowdin/js-zh-CN.yml @@ -275,10 +275,10 @@ zh-CN: change_button: "保存并重新安排" change_title: "更改工作日" removed_title: "您将从非工作日列表中删除以下日期:" - change_description: "Changing which days of the week are considered working days or non-working days can affect the start and finish days of all work packages and life cycles in all projects in this instance." + change_description: "在这种情况下,更改一周中哪几天被视为工作日或非工作日会影响所有项目中所有工作包和生命周期的开始和结束日期。" warning: > - The changes might take some time to take effect. You will be notified when all relevant work packages and project life cycles have been updated. - Are you sure you want to continue? + 更改可能需要一些时间才能生效。所有相关工作包和项目生命周期更新后,您将收到通知。 + 您确定要继续吗? work_packages_settings: warning_progress_calculation_mode_change_from_status_to_field_html: >- 将进度计算模式从基于状态改为基于工时,将使完成 %字段可自由编辑。如果您选择输入工时剩余工时的值,它们也将与完成 %相关联。更改剩余工时就可以更新完成 %。 diff --git a/config/locales/crowdin/zh-CN.yml b/config/locales/crowdin/zh-CN.yml index b1eee6e7952..684a2042faa 100644 --- a/config/locales/crowdin/zh-CN.yml +++ b/config/locales/crowdin/zh-CN.yml @@ -1196,7 +1196,7 @@ zh-CN: attributes: content_type: blank: "文件的内容类型不能为空。" - not_allowlisted: "The file was rejected by an automatic filter. '%{value}' is not allowed for upload." + not_allowlisted: "文件被自动过滤器拒绝。%{value}' 不允许上传。" format: "%{message}" capability: context: @@ -4255,12 +4255,12 @@ zh-CN: message: "与单个用户共享项目列表是一项企业附加功能。" working_days: info: > - Days that are not selected are skipped when scheduling work packages and project life cycles (and not included in the day count). These can be overridden at a work-package level. + 在计划工作包和项目生命周期时,未选择的日期将被跳过(不计入天数)。可以在工作包级别覆盖这些选项。 instance_wide_info: > 添加到以下列表的日期被视为非工作日,在安排工作包时将被跳过。 change_button: "更改工作日" warning: > - Changing which days of the week are considered working days or non-working days can affect the start and finish days of all work packages and life cycles in all projects in this instance. + 在这种情况下,更改一周中哪几天被视为工作日或非工作日会影响所有项目中所有工作包和生命周期的开始和结束日期。 journal_note: changed: _**工作日**已更改(%{changes})。_ days: diff --git a/config/locales/crowdin/zh-TW.yml b/config/locales/crowdin/zh-TW.yml index bafcd23c1dc..c25c24aadbc 100644 --- a/config/locales/crowdin/zh-TW.yml +++ b/config/locales/crowdin/zh-TW.yml @@ -1196,7 +1196,7 @@ zh-TW: attributes: content_type: blank: "文件的內容類型不能為空。" - not_allowlisted: "The file was rejected by an automatic filter. '%{value}' is not allowed for upload." + not_allowlisted: "檔案被自動過濾器拒絕。'%{value}' 不允許上傳。" format: "%{message}" capability: context: