mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
Fix activity creation for editing wopi file in protocol repository [SCI-3281]
This commit is contained in:
parent
05963eb245
commit
14978f7c1f
1 changed files with 7 additions and 3 deletions
|
@ -79,24 +79,28 @@ module WopiUtil
|
|||
t('activities.wupi_file_editing.finished')
|
||||
end
|
||||
if @assoc.class == Step
|
||||
type_of = :edit_wopi_file_on_step_in_repository
|
||||
default_step_items =
|
||||
{ step: @asset.step.id,
|
||||
step_position: { id: @asset.step.id, value_for: 'position' },
|
||||
asset_name: { id: @asset.id, value_for: 'file_file_name' },
|
||||
action: action }
|
||||
message_items = { protocol: @protocol.id }
|
||||
if @protocol.in_module?
|
||||
project = @protocol.my_module.experiment.project
|
||||
team = project.team
|
||||
type_of = :edit_wopi_file_on_step
|
||||
message_items = { my_module: @protocol.my_module.id }
|
||||
else
|
||||
type_of = :edit_wopi_file_on_step_in_repository
|
||||
project = nil
|
||||
team = @protocol.team
|
||||
message_items = { protocol: @protocol.id }
|
||||
end
|
||||
message_items = default_step_items.merge(message_items)
|
||||
Activities::CreateActivityService
|
||||
.call(activity_type: type_of,
|
||||
owner: current_user,
|
||||
subject: @protocol,
|
||||
team: @protocol.my_module.experiment.project.team,
|
||||
team: team,
|
||||
project: project,
|
||||
message_items: message_items)
|
||||
elsif @assoc.class == Result
|
||||
|
|
Loading…
Reference in a new issue