Merge pull request #1176 from ZmagoD/zd_SCI_2395

fixes items assign flash message [fixes SCI-2395]
This commit is contained in:
Zmago Devetak 2018-05-29 13:14:52 +02:00 committed by GitHub
commit 6fa0674171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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) <strong>%{records}</strong> to task"
assigned_records_downstream_flash: "Successfully assigned item(s) <strong>%{records}</strong> to task and downstream tasks"
unassigned_records_flash: "Successfully unassigned item(s) <strong>%{records}</strong> from task"
no_records_assigned_flash: "No items were assigned to task"
no_records_unassigned_flash: "No items were unassigned from task"