diff --git a/app/javascript/dashboard/components/widgets/conversation/PriorityMark.vue b/app/javascript/dashboard/components/widgets/conversation/PriorityMark.vue index 9f8237397..a9fba98f0 100644 --- a/app/javascript/dashboard/components/widgets/conversation/PriorityMark.vue +++ b/app/javascript/dashboard/components/widgets/conversation/PriorityMark.vue @@ -48,15 +48,17 @@ export default { diff --git a/app/models/conversation.rb b/app/models/conversation.rb index 299a7f2a5..fa59e8d24 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -221,14 +221,14 @@ class Conversation < ApplicationRecord end def notify_conversation_updation - return unless previous_changes.keys.present? && whitelisted_keys? + return unless previous_changes.keys.present? && allowed_keys? dispatcher_dispatch(CONVERSATION_UPDATED, previous_changes) end - def whitelisted_keys? + def allowed_keys? ( - (previous_changes.keys & %w[team_id assignee_id status snoozed_until custom_attributes label_list first_reply_created_at]).present? || + (previous_changes.keys & %w[team_id assignee_id status snoozed_until custom_attributes label_list first_reply_created_at priority]).present? || (previous_changes['additional_attributes'].present? && (previous_changes['additional_attributes'][1].keys & %w[conversation_language]).present?) ) end diff --git a/app/presenters/conversations/event_data_presenter.rb b/app/presenters/conversations/event_data_presenter.rb index f3d9cdfe7..0eabad899 100644 --- a/app/presenters/conversations/event_data_presenter.rb +++ b/app/presenters/conversations/event_data_presenter.rb @@ -15,6 +15,7 @@ class Conversations::EventDataPresenter < SimpleDelegator snoozed_until: snoozed_until, unread_count: unread_incoming_messages.count, first_reply_created_at: first_reply_created_at, + priority: priority, **push_timestamps } end diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb index bf7031cc3..514fb80c5 100644 --- a/spec/models/conversation_spec.rb +++ b/spec/models/conversation_spec.rb @@ -518,6 +518,7 @@ RSpec.describe Conversation, type: :model do contact_last_seen_at: conversation.contact_last_seen_at.to_i, agent_last_seen_at: conversation.agent_last_seen_at.to_i, created_at: conversation.created_at.to_i, + priority: nil, unread_count: 0 } end diff --git a/spec/presenters/conversations/event_data_presenter_spec.rb b/spec/presenters/conversations/event_data_presenter_spec.rb index 874ed54bf..15ada3e32 100644 --- a/spec/presenters/conversations/event_data_presenter_spec.rb +++ b/spec/presenters/conversations/event_data_presenter_spec.rb @@ -31,6 +31,7 @@ RSpec.describe Conversations::EventDataPresenter do contact_last_seen_at: conversation.contact_last_seen_at.to_i, agent_last_seen_at: conversation.agent_last_seen_at.to_i, created_at: conversation.created_at.to_i, + priority: nil, unread_count: 0 } end