Browse Source

Follow-up bd52b4e - Fixes #4591 - Default Agent Notification Settings

Mantas Masalskis 1 year ago
parent
commit
268b521a74

+ 1 - 1
app/assets/javascripts/app/controllers/_manage/ticket_notification.coffee

@@ -40,7 +40,7 @@ class App.SettingTicketNotifications extends App.ControllerSubContent
     e.preventDefault()
 
     @applyDefaultNotificationsToAllModal = new App.ControllerConfirmDelete(
-      fieldDisplay:      __('Are you sure? Default notifications settings will be applied to all agents.')
+      fieldDisplay:      __('Are you sure? Default notifications settings will be applied to all active agents. This operation may take some time.')
       safeWord:          __('Confirm')
       head:              __('Confirmation')
       buttonSubmit:      __('Yes')

+ 2 - 4
app/jobs/reset_notifications_preferences_job.rb

@@ -5,10 +5,8 @@ class ResetNotificationsPreferencesJob < ApplicationJob
 
   # @param send_to_when_done [Integer] ID of user to notify after job is done
   def perform(send_to_when_done: nil)
-    User.without_callback :commit, :after, :search_index_update do
-      users_scope.find_each do |user|
-        User.reset_notifications_preferences! user
-      end
+    users_scope.find_each do |user|
+      User.reset_notifications_preferences! user
     end
 
     return if !send_to_when_done

+ 1 - 1
i18n/zammad.pot

@@ -1243,7 +1243,7 @@ msgid "Are you sure?"
 msgstr ""
 
 #: app/assets/javascripts/app/controllers/_manage/ticket_notification.coffee
-msgid "Are you sure? Default notifications settings will be applied to all agents."
+msgid "Are you sure? Default notifications settings will be applied to all active agents. This operation may take some time."
 msgstr ""
 
 #: app/assets/javascripts/app/controllers/_manage/ticket_notification.coffee

+ 0 - 12
spec/jobs/reset_notifications_preferences_job_spec.rb

@@ -16,18 +16,6 @@ RSpec.describe ResetNotificationsPreferencesJob do
       expect(User).to have_received(:reset_notifications_preferences!).with(agent)
     end
 
-    it 'does not trigger ES index update' do
-      log = []
-
-      allow_any_instance_of(User).to receive(:search_index_update) do
-        log << :search_index_update
-      end
-
-      described_class.perform_now
-
-      expect(log).to be_empty
-    end
-
     it 'broadcasts message when operation is done' do
       allow(Sessions).to receive(:send_to)