From 0f5114cd32c662b0668f995c76c612c237c92410 Mon Sep 17 00:00:00 2001 From: Andreas Pfohl Date: Wed, 23 Oct 2024 14:18:28 +0200 Subject: [PATCH] [58467] Changed add hierarchical item behavior When adding a new item in the hierarchy the item form will stay open for the next entry. --- .../admin/custom_fields/hierarchy/items_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb b/app/controllers/admin/custom_fields/hierarchy/items_controller.rb index 542b2c80563d..91ba61b0c380 100644 --- a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb +++ b/app/controllers/admin/custom_fields/hierarchy/items_controller.rb @@ -58,7 +58,10 @@ def create .new .insert_item(**item_input) .either( - ->(_) { update_via_turbo_stream(component: ItemsComponent.new(custom_field: @custom_field)) }, + ->(_) do + update_via_turbo_stream(component: ItemsComponent.new(custom_field: @custom_field, + new_item_form_data: { show: true })) + end, ->(validation_result) { add_errors_to_form(validation_result) } )