From 88d033f7f666385263a256b15b78374c81a68bd7 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Thu, 12 May 2022 05:47:01 +0000 Subject: Merged r21569 to 5.0-stable (#36909). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21571 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 +--- test/system/inline_autocomplete_test.rb | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1dfa26cb2..031273d44 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1831,9 +1831,7 @@ module ApplicationHelper def update_data_sources_for_auto_complete(data_sources) javascript_tag( - "const currentDataSources = rm.AutoComplete.dataSources;" \ - "const newDataSources = JSON.parse('#{data_sources.to_json}'); " \ - "rm.AutoComplete.dataSources = Object.assign(currentDataSources, newDataSources);" + "rm.AutoComplete.dataSources = Object.assign(rm.AutoComplete.dataSources, JSON.parse('#{data_sources.to_json}'));" ) end diff --git a/test/system/inline_autocomplete_test.rb b/test/system/inline_autocomplete_test.rb index 9a7d8f787..26a89b85d 100644 --- a/test/system/inline_autocomplete_test.rb +++ b/test/system/inline_autocomplete_test.rb @@ -164,4 +164,26 @@ class InlineAutocompleteSystemTest < ApplicationSystemTestCase assert page.has_text? "Bug ##{issue.id}: This issue has a