fix(ui): Numeric ID instead of semantic one on the error message on bulk edit (WP #74928)

This commit is contained in:
Tomas Hykel
2026-05-26 22:52:38 +02:00
parent b8cd556e32
commit 2ad4ea078a
2 changed files with 27 additions and 2 deletions
@@ -31,10 +31,12 @@
<ul>
<% erroneous_results.each do |call| %>
<% wp_id = call.state.copied_from_work_package_id || call.result.id %>
<% source_id = call.state.copied_from_work_package_id %>
<% wp = source_id ? WorkPackage.find_by(id: source_id) : call.result %>
<% wp_id = wp&.id || call.result.id %>
<li>
<%= link_to "##{wp_id}", work_package_path(wp_id) %><%= selected_work_packages.map(&:id).include?(wp_id) ? "" : " (#{I18n.t('work_packages.bulk.descendant')})" %>:
<%= link_to wp&.formatted_id || "##{wp_id}", work_package_path(wp_id) %><%= selected_work_packages.map(&:id).include?(wp_id) ? "" : " (#{I18n.t('work_packages.bulk.descendant')})" %>:
<%= safe_join call.errors.full_messages, " " %>
</li>
<% end %>
@@ -583,6 +583,29 @@ RSpec.describe WorkPackages::BulkController, with_settings: { journal_aggregatio
end
end
context "with semantic identifiers",
with_settings: { work_packages_identifier: "semantic" } do
before do
work_package1.update_columns(identifier: "PROJ-1", sequence_number: 1)
work_package2.update_columns(identifier: "PROJ-2", sequence_number: 2)
put :update,
params: {
ids: work_package_ids,
work_package: { done_ratio: 150 }
}
end
it "shows semantic identifiers in the error flash" do
expect(flash[:error]).to include("PROJ-1")
expect(flash[:error]).to include("PROJ-2")
end
it "does not show bare numeric ids in the error flash" do
expect(flash[:error]).not_to include("##{work_package1.id}")
expect(flash[:error]).not_to include("##{work_package2.id}")
end
end
describe "updating two children with dates to a new parent (Regression #28670)" do
let(:task1) do
create(:work_package,