mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-25 00:03:27 +08:00
Fix step update activities [SCI-6980] (#4250)
This commit is contained in:
parent
2ec93cef43
commit
c707a3aac6
1 changed files with 22 additions and 2 deletions
|
@ -210,9 +210,16 @@ class StepsController < ApplicationController
|
|||
if @step.update(step_params)
|
||||
# Generate activity
|
||||
if @protocol.in_module?
|
||||
log_activity(:edit_step, @my_module.experiment.project, my_module: @my_module.id)
|
||||
log_activity(
|
||||
:edit_step, @my_module.experiment.project,
|
||||
{ my_module: @my_module.id }.merge(step_message_items)
|
||||
)
|
||||
else
|
||||
log_activity(:edit_step_in_protocol_repository, nil, protocol: @protocol.id)
|
||||
log_activity(
|
||||
:edit_step_in_protocol_repository,
|
||||
nil,
|
||||
{ protocol: @protocol.id }.merge(step_message_items)
|
||||
)
|
||||
end
|
||||
render json: @step, serializer: StepSerializer, user: current_user
|
||||
else
|
||||
|
@ -653,4 +660,17 @@ class StepsController < ApplicationController
|
|||
project: project,
|
||||
message_items: message_items)
|
||||
end
|
||||
|
||||
def step_message_items
|
||||
{
|
||||
step: {
|
||||
id: @step.id,
|
||||
value_for: 'name'
|
||||
},
|
||||
step_position: {
|
||||
id: @step.id,
|
||||
value_for: 'position_plus_one'
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue