Fix storage location item move activity [SCI-11164]

This commit is contained in:
Martin Artnik 2024-10-09 11:44:49 +02:00
parent f3420e33e2
commit ca944f1bf7
2 changed files with 11 additions and 2 deletions

View file

@ -54,6 +54,9 @@ class StorageLocationRepositoryRowsController < ApplicationController
def move
ActiveRecord::Base.transaction do
@original_storage_location = @storage_location_repository_row.storage_location
@original_position = @storage_location_repository_row.human_readable_position
@storage_location_repository_row.discard
@storage_location_repository_row = StorageLocationRepositoryRow.create!(
repository_row: @repository_row,
@ -61,7 +64,13 @@ class StorageLocationRepositoryRowsController < ApplicationController
metadata: storage_location_repository_row_params[:metadata] || {},
created_by: current_user
)
log_activity(:storage_location_repository_row_moved)
log_activity(
:storage_location_repository_row_moved,
{
storage_location_original: @original_storage_location.id,
position_original: @original_position
}
)
render json: @storage_location_repository_row,
serializer: Lists::StorageLocationRepositoryRowSerializer
rescue ActiveRecord::RecordInvalid => e

View file

@ -338,7 +338,7 @@ en:
container_storage_location_sharing_updated_html: "%{user} changed permission of shared box %{storage_location} with team %{team} to %{permission_level}."
storage_location_repository_row_created_html: "%{user} assigned %{repository_row} to box %{storage_location} %{position}."
storage_location_repository_row_deleted_html: "%{user} unassigned %{repository_row} from box %{storage_location} %{position}."
storage_location_repository_row_moved_html: "%{user} moved item %{repository_row} from box %{storage_location_original} %{positions} to box %{storage_location_destination} %{positions}."
storage_location_repository_row_moved_html: "%{user} moved item %{repository_row} from box %{storage_location_original} %{position_original} to box %{storage_location} %{position}."
container_storage_location_imported_html: "%{user} assigned %{assigned_count} item(s) and unassigned %{unassigned_count} item(s) by import to %{storage_location}."
activity_name:
create_project: "Project created"