]> source.dussan.org Git - redmine.git/commitdiff
Fix that mentions not working after issue status is changed (#36909).
authorMarius Balteanu <marius.balteanu@zitec.com>
Wed, 11 May 2022 20:29:14 +0000 (20:29 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Wed, 11 May 2022 20:29:14 +0000 (20:29 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@21569 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/system/inline_autocomplete_test.rb

index 1dfa26cb26dc4c053bce870ae40cd31c1e297c22..031273d445cb9227cca0078654de922372772763 100644 (file)
@@ -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
 
index 514e6b796d34b3203a4f6e029e1ce602a3ae14e3..0490c69471e6d35cc3537129e79234f85f036282 100644 (file)
@@ -165,4 +165,26 @@ class InlineAutocompleteSystemTest < ApplicationSystemTestCase
       assert page.has_text? "Bug ##{issue.id}: This issue has a <select> element"
     end
   end
+
+  def test_inline_autocomplete_for_users_should_work_after_status_change
+    log_user('jsmith', 'jsmith')
+    visit '/issues/1/edit'
+
+    find('#issue_notes').click
+    fill_in 'issue[notes]', :with => '@lopper'
+
+    within('.tribute-container') do
+      assert page.has_text? "Dave Lopper"
+    end
+
+    page.find('#issue_status_id').select('Feedback')
+
+    find('#issue_notes').click
+    fill_in 'issue[notes]', :with => '@lopper'
+
+    within('.tribute-container') do
+      assert page.has_text? "Dave Lopper"
+    end
+
+  end
 end