From f8f0d36636940dd451d6f4a55f458170befbd55c Mon Sep 17 00:00:00 2001 From: Sojan Date: Sat, 6 Mar 2021 16:37:46 +0530 Subject: [PATCH] chore: more fixes --- .../dashboard/components/widgets/conversation/Message.vue | 4 ++-- app/javascript/dashboard/mixins/conversations.js | 2 +- .../dashboard/store/modules/conversations/getters.js | 2 +- app/listeners/notification_listener.rb | 2 +- spec/models/message_spec.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 41d770cf6..9e4e1529b 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -37,7 +37,7 @@ :sender="data.sender" :is-a-tweet="isATweet" :is-email="isEmailContentType" - :is-private="data.private" + :is-private="data.is_private_note" :message-type="data.message_type" :readable-time="readableTime" :source-id="data.source_id" @@ -176,7 +176,7 @@ export default { bubbleClass() { return { bubble: this.isBubble, - 'is-private': this.data.private, + 'is-private': this.data.is_private_note, 'is-image': this.hasImageAttachment, 'is-text': this.hasText, }; diff --git a/app/javascript/dashboard/mixins/conversations.js b/app/javascript/dashboard/mixins/conversations.js index 2242685af..cb9fdd7f1 100644 --- a/app/javascript/dashboard/mixins/conversations.js +++ b/app/javascript/dashboard/mixins/conversations.js @@ -12,7 +12,7 @@ export default { chat => chat.created_at * 1000 > m.agent_last_seen_at * 1000 && chat.message_type === 0 && - chat.private !== true + chat.is_private_note !== true ).length; }, readMessages(m) { diff --git a/app/javascript/dashboard/store/modules/conversations/getters.js b/app/javascript/dashboard/store/modules/conversations/getters.js index 04d7f58c3..c6e61ba39 100644 --- a/app/javascript/dashboard/store/modules/conversations/getters.js +++ b/app/javascript/dashboard/store/modules/conversations/getters.js @@ -51,7 +51,7 @@ const getters = { chatMessage => chatMessage.created_at * 1000 > chat.agent_last_seen_at * 1000 && chatMessage.message_type === 0 && - chatMessage.private !== true + chatMessage.is_private_note !== true ).length; }, getChatStatusFilter: ({ chatStatusFilter }) => chatStatusFilter, diff --git a/app/listeners/notification_listener.rb b/app/listeners/notification_listener.rb index ad7bf2d14..fda68a344 100644 --- a/app/listeners/notification_listener.rb +++ b/app/listeners/notification_listener.rb @@ -54,7 +54,7 @@ class NotificationListener < BaseListener end def generate_notifications_for_mentions(message, account) - return unless message.private? + return unless message.is_private_note? return if message.content.blank? diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index 061c5af9a..a0702b2cb 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -36,7 +36,7 @@ RSpec.describe Message, type: :model do end it 'wont call notify email method for private notes' do - message.private = true + message.is_private_note = true allow(ConversationReplyEmailWorker).to receive(:perform_in).and_return(true) message.save! expect(ConversationReplyEmailWorker).not_to have_received(:perform_in)