Update assignee field to custom field of type user

This commit is contained in:
Mir Bhatia
2025-11-17 11:18:48 +01:00
parent 9f8333e68f
commit c2857596dc
3 changed files with 14 additions and 14 deletions
@@ -124,7 +124,7 @@ class Projects::Settings::CreationWizardController < Projects::SettingsControlle
submission_status_when_submitted_id
submission_send_confirmation_email
submission_notification_text
submission_assignee_ids]
submission_assignee_id]
)
end
end
@@ -81,24 +81,24 @@ module Projects
)
f.autocompleter(
name: :submission_assignee_ids,
name: :submission_assignee_id,
label: I18n.t("settings.project_initiation_request.submission.assignee"),
caption: I18n.t("settings.project_initiation_request.submission.assignee_caption"),
required: true,
input_width: :large,
autocomplete_options: {
component: "opce-user-autocompleter",
hideSelected: true,
defaultData: true,
placeholder: I18n.t(:label_user_search),
url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals,
filters: [
{ name: "type", operator: "=", values: ["User"] }
],
searchKey: "any_name_attribute",
multiple: true
component: "opce-autocompleter",
decorated: true
}
)
) do |list|
model.available_custom_fields.where(field_format: "user").order(:name).each do |custom_field|
list.option(
value: custom_field.id,
label: custom_field.name,
selected: custom_field.id == model.submission_assignee_id
)
end
end
f.rich_text_area(
name: :submission_notification_text,
+1 -1
View File
@@ -37,7 +37,7 @@ module Projects::CreationWizard
store_attribute :settings, :submission_work_package_type_id, :integer
store_attribute :settings, :submission_status_when_submitted_id, :integer
store_attribute :settings, :submission_send_confirmation_email, :boolean
store_attribute :settings, :submission_assignee_ids, :json
store_attribute :settings, :submission_assignee_id, :integer
store_attribute :settings, :submission_notification_text, :string
end
end