From 346d89ecc003708dc9f5f39b3b738a50c5fca787 Mon Sep 17 00:00:00 2001 From: Sojan Date: Mon, 17 Jan 2022 23:33:47 -0800 Subject: [PATCH 1/2] Bump version to 2.1.1 --- config/app.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/app.yml b/config/app.yml index 6e9b9760e..91cbf9784 100644 --- a/config/app.yml +++ b/config/app.yml @@ -1,5 +1,5 @@ shared: &shared - version: '2.1.0' + version: '2.1.1' development: <<: *shared diff --git a/package.json b/package.json index 90b5f297a..878302c80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chatwoot/chatwoot", - "version": "2.1.0", + "version": "2.1.1", "license": "MIT", "scripts": { "eslint": "eslint app/**/*.{js,vue} --fix", From 1749b4eb618b2ba00b1fd4dc744f732a7db1456d Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 13 Jan 2022 21:38:10 -0800 Subject: [PATCH 2/2] chore: Clean up assignment logic (#3763) --- app/models/concerns/assignment_handler.rb | 2 +- app/models/notification.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/assignment_handler.rb b/app/models/concerns/assignment_handler.rb index 4fd778d45..76ff47aca 100644 --- a/app/models/concerns/assignment_handler.rb +++ b/app/models/concerns/assignment_handler.rb @@ -4,7 +4,7 @@ module AssignmentHandler included do before_save :ensure_assignee_is_from_team - after_update :notify_assignment_change, :process_assignment_activities + after_commit :notify_assignment_change, :process_assignment_activities end private diff --git a/app/models/notification.rb b/app/models/notification.rb index 1577f8dda..7599d4d6e 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -71,6 +71,7 @@ class Notification < ApplicationRecord end # TODO: move to a data presenter + # rubocop:disable Metrics/CyclomaticComplexity def push_message_title case notification_type when 'conversation_creation' @@ -81,14 +82,15 @@ class Notification < ApplicationRecord I18n.t( 'notifications.notification_title.assigned_conversation_new_message', display_id: conversation.display_id, - content: primary_actor.content&.truncate_words(10) + content: primary_actor&.content&.truncate_words(10) ) when 'conversation_mention' - "[##{conversation.display_id}] #{transform_user_mention_content primary_actor.content}" + "[##{conversation&.display_id}] #{transform_user_mention_content primary_actor&.content}" else '' end end + # rubocop:enable Metrics/CyclomaticComplexity def conversation return primary_actor.conversation if %w[assigned_conversation_new_message conversation_mention].include? notification_type