From 89046e978712cfcba6026deb3a3c0b487e20b09e Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 29 May 2018 12:54:41 +0200 Subject: [PATCH] fixes items assign flash message [fixes SCI-2395] --- app/controllers/my_modules_controller.rb | 16 +++++++++------- config/locales/en.yml | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index d326ba7d4..0587c6891 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -418,6 +418,7 @@ class MyModulesController < ApplicationController repository_row: record, assigned_by: current_user ) + records_names << record.name end end @@ -428,16 +429,17 @@ class MyModulesController < ApplicationController experiment: @experiment, my_module: @my_module, user: current_user, - message: I18n.t( - 'activities.assign_repository_records', - user: current_user.full_name, - task: @my_module.name, - repository: @repository.name, - records: records_names.join(', ') - ) + message: I18n.t('activities.assign_repository_records', + user: current_user.full_name, + task: @my_module.name, + repository: @repository.name, + records: records_names.join(', ') + ) ) flash = I18n.t('repositories.assigned_records_flash', records: records_names.join(', ')) + flash = I18n.t('repositories.assigned_records_downstream_flash', + records: records_names.join(', ')) if downstream respond_to do |format| format.json { render json: { flash: flash }, status: :ok } end diff --git a/config/locales/en.yml b/config/locales/en.yml index 594af44f4..c7179c087 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1016,6 +1016,7 @@ en: no_records_selected_flash: "There were no selected items." no_deleted_records_flash: "No items were deleted. %{other_records_number} of the selected items were created by other users and were not deleted." assigned_records_flash: "Successfully assigned item(s) %{records} to task" + assigned_records_downstream_flash: "Successfully assigned item(s) %{records} to task and downstream tasks" unassigned_records_flash: "Successfully unassigned item(s) %{records} from task" no_records_assigned_flash: "No items were assigned to task" no_records_unassigned_flash: "No items were unassigned from task"