Merge pull request #4038 from aignatov-bio/ai-sci-6746-add-comment-to-stock-activity

Add comment to repository stock activities [SCI-6746]
This commit is contained in:
aignatov-bio 2022-04-20 11:48:53 +02:00 committed by GitHub
commit d96a43506a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -40,7 +40,8 @@ class RepositoryStockValuesController < ApplicationController
params[:operator], params[:operator],
params[:change_amount], params[:change_amount],
@repository_stock_value.repository_stock_unit_item.data, @repository_stock_value.repository_stock_unit_item.data,
@repository_stock_value.amount @repository_stock_value.amount,
params[:repository_stock_value][:comment]
) )
end end
@ -80,7 +81,7 @@ class RepositoryStockValuesController < ApplicationController
params.require(:repository_stock_value).permit(:unit_item_id, :amount, :comment, :low_stock_threshold) params.require(:repository_stock_value).permit(:unit_item_id, :amount, :comment, :low_stock_threshold)
end end
def log_activity(operator, change_amount, unit, new_amount) def log_activity(operator, change_amount, unit, new_amount, comment)
Activities::CreateActivityService Activities::CreateActivityService
.call(activity_type: "inventory_item_stock_#{operator}", .call(activity_type: "inventory_item_stock_#{operator}",
owner: current_user, owner: current_user,
@ -91,7 +92,8 @@ class RepositoryStockValuesController < ApplicationController
repository_row: @repository_row.id, repository_row: @repository_row.id,
change_amount: change_amount, change_amount: change_amount,
unit: unit, unit: unit,
new_amount: new_amount new_amount: new_amount,
comment: comment
}) })
end end
end end

View file

@ -205,9 +205,9 @@ en:
register_molecule_on_step_html: "%{user} registered molecule %{asset_name} on protocol's step %{step_position} %{step} on task %{my_module}." register_molecule_on_step_html: "%{user} registered molecule %{asset_name} on protocol's step %{step_position} %{step} on task %{my_module}."
register_molecule_on_result_html: "%{user} registered molecule %{asset_name} on result %{result}." register_molecule_on_result_html: "%{user} registered molecule %{asset_name} on result %{result}."
register_molecule_on_step_in_repository_html: "%{user} registered molecule %{asset_name} on protocol %{protocol}'s step %{step_position} %{step}." register_molecule_on_step_in_repository_html: "%{user} registered molecule %{asset_name} on protocol %{protocol}'s step %{step_position} %{step}."
inventory_item_stock_set_html: "%{user} set total stock for %{repository_row} to %{new_amount} %{unit} in %{repository}" inventory_item_stock_set_html: "%{user} set total stock for %{repository_row} to %{new_amount} %{unit} in %{repository} \n%{comment}"
inventory_item_stock_add_html: "%{user} added %{change_amount} %{unit} of stock to a total of %{new_amount} %{unit} for %{repository_row} in %{repository}" inventory_item_stock_add_html: "%{user} added %{change_amount} %{unit} of stock to a total of %{new_amount} %{unit} for %{repository_row} in %{repository} \n%{comment}"
inventory_item_stock_remove_html: "%{user} removed %{change_amount} %{unit} of stock to a total of %{new_amount} %{unit} for %{repository_row} in %{repository}" inventory_item_stock_remove_html: "%{user} removed %{change_amount} %{unit} of stock to a total of %{new_amount} %{unit} for %{repository_row} in %{repository} \n%{comment}"
task_inventory_item_stock_consumed_html: "%{user} changed consumption of %{repository_row} from %{stock_consumption_was} %{unit} to %{stock_consumption} %{unit} in %{my_module} \n%{comment}" task_inventory_item_stock_consumed_html: "%{user} changed consumption of %{repository_row} from %{stock_consumption_was} %{unit} to %{stock_consumption} %{unit} in %{my_module} \n%{comment}"
activity_name: activity_name: