From 290196d43bca76941297855f3e57260e86d17cca Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 13 Jan 2022 21:38:10 -0800 Subject: [PATCH 01/10] 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 From 4398734bdfd8e59df33a5e75896c8b4aa0062dd9 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 17 Jan 2022 09:18:54 +0530 Subject: [PATCH 02/10] feat: Adds the ability to have custom view for conversations (#3666) * feat: Adds the ability to save custom filters and display folders on the sidebar * Minor fixes * Review fixes * Review fixes * i18n fixes * Shows conversations when the user click on the folder sidebar item * Spacing fixes * Review fixes Co-authored-by: Muhsin Keloth --- app/javascript/dashboard/api/customViews.js | 14 ++ .../dashboard/components/ChatList.vue | 122 +++++++++++++++--- .../dashboard/components/layout/Sidebar.vue | 3 + .../config/sidebarItems/conversations.js | 2 + .../layout/sidebarComponents/Secondary.vue | 28 ++++ .../sidebarComponents/SecondaryNavItem.vue | 2 +- .../widgets/conversation/ConversationCard.vue | 5 + app/javascript/dashboard/helper/URLHelper.js | 3 + .../i18n/locale/en/advancedFilters.json | 14 ++ .../dashboard/i18n/locale/en/settings.json | 7 +- .../conversation/ConversationView.vue | 5 + .../conversation/conversation.routes.js | 19 +++ .../dashboard/customviews/AddCustomViews.vue | 97 ++++++++++++++ app/javascript/dashboard/store/index.js | 2 + .../dashboard/store/modules/customViews.js | 79 ++++++++++++ .../modules/specs/customViews/actions.spec.js | 72 +++++++++++ .../modules/specs/customViews/fixtures.js | 42 ++++++ .../modules/specs/customViews/getters.spec.js | 65 ++++++++++ .../specs/customViews/mutations.spec.js | 29 +++++ .../dashboard/store/mutation-types.js | 6 + .../FluentIcon/dashboard-icons.json | 1 + 21 files changed, 594 insertions(+), 23 deletions(-) create mode 100644 app/javascript/dashboard/api/customViews.js create mode 100644 app/javascript/dashboard/routes/dashboard/customviews/AddCustomViews.vue create mode 100644 app/javascript/dashboard/store/modules/customViews.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/actions.spec.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/fixtures.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/getters.spec.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/mutations.spec.js diff --git a/app/javascript/dashboard/api/customViews.js b/app/javascript/dashboard/api/customViews.js new file mode 100644 index 000000000..bb09047ba --- /dev/null +++ b/app/javascript/dashboard/api/customViews.js @@ -0,0 +1,14 @@ +/* global axios */ +import ApiClient from './ApiClient'; + +class CustomViewsAPI extends ApiClient { + constructor() { + super('custom_filters', { accountScoped: true }); + } + + getCustomViews() { + return axios.get(this.url); + } +} + +export default new CustomViewsAPI(); diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index bb7858e6c..8affb6066 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -1,26 +1,39 @@ -l