diff --git a/.env.example b/.env.example
index 2b4ba9795..55b998f19 100644
--- a/.env.example
+++ b/.env.example
@@ -249,9 +249,6 @@ AZURE_APP_SECRET=
## OpenAI key
# OPENAI_API_KEY=
-# Sentiment analysis model file path
-SENTIMENT_FILE_PATH=
-
# Housekeeping/Performance related configurations
# Set to true if you want to remove stale contact inboxes
# contact_inboxes with no conversation older than 90 days will be removed
diff --git a/Gemfile b/Gemfile
index 0dac6e95f..65cb4de6b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -175,9 +175,6 @@ gem 'pgvector'
# Convert Website HTML to Markdown
gem 'reverse_markdown'
-# Sentiment analysis
-gem 'informers'
-
### Gems required only in specific deployment environments ###
##############################################################
diff --git a/Gemfile.lock b/Gemfile.lock
index 55021a04b..542910f5d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -151,7 +151,6 @@ GEM
base64 (0.1.1)
bcrypt (3.1.20)
bindex (0.8.1)
- blingfire (0.1.8)
bootsnap (1.16.0)
msgpack (~> 1.2)
brakeman (5.4.1)
@@ -316,15 +315,15 @@ GEM
google-cloud-translate-v3 (0.6.0)
gapic-common (>= 0.17.1, < 2.a)
google-cloud-errors (~> 1.0)
- google-protobuf (3.25.2)
- google-protobuf (3.25.2-arm64-darwin)
- google-protobuf (3.25.2-x86_64-darwin)
- google-protobuf (3.25.2-x86_64-linux)
+ google-protobuf (3.25.3)
+ google-protobuf (3.25.3-arm64-darwin)
+ google-protobuf (3.25.3-x86_64-darwin)
+ google-protobuf (3.25.3-x86_64-linux)
googleapis-common-protos (1.4.0)
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
- googleapis-common-protos-types (1.11.0)
+ googleapis-common-protos-types (1.14.0)
google-protobuf (~> 3.18)
googleauth (1.5.2)
faraday (>= 0.17.3, < 3.a)
@@ -335,14 +334,17 @@ GEM
signet (>= 0.16, < 2.a)
groupdate (6.2.1)
activesupport (>= 5.2)
- grpc (1.54.3)
- google-protobuf (~> 3.21)
+ grpc (1.62.0)
+ google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
- grpc (1.54.3-x86_64-darwin)
- google-protobuf (~> 3.21)
+ grpc (1.62.0-arm64-darwin)
+ google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
- grpc (1.54.3-x86_64-linux)
- google-protobuf (~> 3.21)
+ grpc (1.62.0-x86_64-darwin)
+ google-protobuf (~> 3.25)
+ googleapis-common-protos-types (~> 1.0)
+ grpc (1.62.0-x86_64-linux)
+ google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
haikunator (1.1.1)
hairtrigger (1.0.0)
@@ -371,10 +373,6 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
- informers (0.2.0)
- blingfire (>= 0.1.7)
- numo-narray
- onnxruntime (>= 0.5.1)
io-console (0.6.0)
irb (1.7.2)
reline (>= 0.3.6)
@@ -500,7 +498,6 @@ GEM
racc (~> 1.4)
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
- numo-narray (0.9.2.1)
oauth (1.1.0)
oauth-tty (~> 1.0, >= 1.0.1)
snaky_hash (~> 2.0)
@@ -529,14 +526,6 @@ GEM
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
- onnxruntime (0.7.6)
- ffi
- onnxruntime (0.7.6-arm64-darwin)
- ffi
- onnxruntime (0.7.6-x86_64-darwin)
- ffi
- onnxruntime (0.7.6-x86_64-linux)
- ffi
openssl (3.1.0)
orm_adapter (0.5.0)
os (1.1.4)
@@ -892,7 +881,6 @@ DEPENDENCIES
hashie
html2text!
image_processing
- informers
jbuilder
json_refs
json_schemer
diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue
index 26c057f98..e7fae6e01 100644
--- a/app/javascript/dashboard/components/ChatList.vue
+++ b/app/javascript/dashboard/components/ChatList.vue
@@ -185,7 +185,7 @@ import ConversationBasicFilter from './widgets/conversation/ConversationBasicFil
import ChatTypeTabs from './widgets/ChatTypeTabs.vue';
import ConversationItem from './ConversationItem.vue';
import timeMixin from '../mixins/time';
-import eventListenerMixins from 'shared/mixins/eventListenerMixins';
+import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins';
import conversationMixin from '../mixins/conversations';
import wootConstants from 'dashboard/constants/globals';
import advancedFilterTypes from './widgets/conversation/advancedFilterItems';
@@ -199,11 +199,6 @@ import uiSettingsMixin from 'dashboard/mixins/uiSettings';
import languages from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
import countries from 'shared/constants/countries';
import { generateValuesForEditCustomViews } from 'dashboard/helper/customViewsHelper';
-
-import {
- hasPressedAltAndJKey,
- hasPressedAltAndKKey,
-} from 'shared/helpers/KeyboardHelpers';
import { conversationListPageURL } from '../helper/URLHelper';
import {
isOnMentionsView,
@@ -228,7 +223,7 @@ export default {
mixins: [
timeMixin,
conversationMixin,
- eventListenerMixins,
+ keyboardEventListenerMixins,
alertMixin,
filterMixin,
uiSettingsMixin,
@@ -691,30 +686,40 @@ export default {
lastConversationIndex,
};
},
- handleKeyEvents(e) {
- if (hasPressedAltAndJKey(e)) {
- const { allConversations, activeConversationIndex } =
- this.getKeyboardListenerParams();
- if (activeConversationIndex === -1) {
- allConversations[0].click();
- }
- if (activeConversationIndex >= 1) {
- allConversations[activeConversationIndex - 1].click();
- }
+ handlePreviousConversation() {
+ const { allConversations, activeConversationIndex } =
+ this.getKeyboardListenerParams();
+ if (activeConversationIndex === -1) {
+ allConversations[0].click();
}
- if (hasPressedAltAndKKey(e)) {
- const {
- allConversations,
- activeConversationIndex,
- lastConversationIndex,
- } = this.getKeyboardListenerParams();
- if (activeConversationIndex === -1) {
- allConversations[lastConversationIndex].click();
- } else if (activeConversationIndex < lastConversationIndex) {
- allConversations[activeConversationIndex + 1].click();
- }
+ if (activeConversationIndex >= 1) {
+ allConversations[activeConversationIndex - 1].click();
}
},
+ handleNextConversation() {
+ const {
+ allConversations,
+ activeConversationIndex,
+ lastConversationIndex,
+ } = this.getKeyboardListenerParams();
+ if (activeConversationIndex === -1) {
+ allConversations[lastConversationIndex].click();
+ } else if (activeConversationIndex < lastConversationIndex) {
+ allConversations[activeConversationIndex + 1].click();
+ }
+ },
+ getKeyboardEvents() {
+ return {
+ 'Alt+KeyJ': {
+ action: () => this.handlePreviousConversation(),
+ allowOnFocusedInput: true,
+ },
+ 'Alt+KeyK': {
+ action: () => this.handleNextConversation(),
+ allowOnFocusedInput: true,
+ },
+ };
+ },
resetAndFetchData() {
this.appliedFilter = [];
this.resetBulkActions();
diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue
index 84e33cc42..9a70a7f19 100644
--- a/app/javascript/dashboard/components/buttons/ResolveAction.vue
+++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue
@@ -91,12 +91,7 @@ import { mapGetters } from 'vuex';
import { mixin as clickaway } from 'vue-clickaway';
import alertMixin from 'shared/mixins/alertMixin';
import CustomSnoozeModal from 'dashboard/components/CustomSnoozeModal.vue';
-import eventListenerMixins from 'shared/mixins/eventListenerMixins';
-import {
- hasPressedAltAndEKey,
- hasPressedCommandPlusAltAndEKey,
- hasPressedAltAndMKey,
-} from 'shared/helpers/KeyboardHelpers';
+import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins';
import { findSnoozeTime } from 'dashboard/helper/snoozeHelpers';
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
@@ -114,7 +109,7 @@ export default {
WootDropdownMenu,
CustomSnoozeModal,
},
- mixins: [clickaway, alertMixin, eventListenerMixins],
+ mixins: [clickaway, alertMixin, keyboardEventListenerMixins],
props: { conversationId: { type: [String, Number], required: true } },
data() {
return {
@@ -159,37 +154,52 @@ export default {
bus.$off(CMD_RESOLVE_CONVERSATION, this.onCmdResolveConversation);
},
methods: {
- async handleKeyEvents(e) {
+ getKeyboardEvents() {
+ return {
+ 'Alt+KeyM': {
+ action: () => this.$refs.arrowDownButton?.$el.click(),
+ allowOnFocusedInput: true,
+ },
+ 'Alt+KeyE': this.resolveOrToast,
+ '$mod+Alt+KeyE': async event => {
+ const { all, activeIndex, lastIndex } = this.getConversationParams();
+ await this.resolveOrToast();
+
+ if (activeIndex < lastIndex) {
+ all[activeIndex + 1].click();
+ } else if (all.length > 1) {
+ all[0].click();
+ document.querySelector('.conversations-list').scrollTop = 0;
+ }
+
+ event.preventDefault();
+ },
+ };
+ },
+ getConversationParams() {
const allConversations = document.querySelectorAll(
'.conversations-list .conversation'
);
- if (hasPressedAltAndMKey(e)) {
- if (this.$refs.arrowDownButton) {
- this.$refs.arrowDownButton.$el.click();
- }
- }
- if (hasPressedAltAndEKey(e)) {
- const activeConversation = document.querySelector(
- 'div.conversations-list div.conversation.active'
- );
- const activeConversationIndex = [...allConversations].indexOf(
- activeConversation
- );
- const lastConversationIndex = allConversations.length - 1;
- try {
- await this.toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
- } catch (error) {
- // error
- }
- if (hasPressedCommandPlusAltAndEKey(e)) {
- if (activeConversationIndex < lastConversationIndex) {
- allConversations[activeConversationIndex + 1].click();
- } else if (allConversations.length > 1) {
- allConversations[0].click();
- document.querySelector('.conversations-list').scrollTop = 0;
- }
- e.preventDefault();
- }
+
+ const activeConversation = document.querySelector(
+ 'div.conversations-list div.conversation.active'
+ );
+ const activeConversationIndex = [...allConversations].indexOf(
+ activeConversation
+ );
+ const lastConversationIndex = allConversations.length - 1;
+
+ return {
+ all: allConversations,
+ activeIndex: activeConversationIndex,
+ lastIndex: lastConversationIndex,
+ };
+ },
+ async resolveOrToast() {
+ try {
+ await this.toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
+ } catch (error) {
+ // error
}
},
onCmdSnoozeConversation(snoozeType) {
diff --git a/app/javascript/dashboard/components/layout/Sidebar.vue b/app/javascript/dashboard/components/layout/Sidebar.vue
index 1290ea602..0f3a1a857 100644
--- a/app/javascript/dashboard/components/layout/Sidebar.vue
+++ b/app/javascript/dashboard/components/layout/Sidebar.vue
@@ -1,5 +1,5 @@
-