diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue index e7219cdf0..819ca9097 100644 --- a/app/javascript/dashboard/components/buttons/ResolveAction.vue +++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue @@ -175,6 +175,9 @@ export default { const allConversations = document.querySelectorAll( '.conversations-list .conversation' ); + if (hasPressedAltAndMKey(e)) { + this.$refs.arrowDownButton.$el.click(); + } if (hasPressedAltAndEKey(e)) { const activeConversation = document.querySelector( 'div.conversations-list div.conversation.active' diff --git a/app/javascript/dashboard/components/layout/Sidebar.vue b/app/javascript/dashboard/components/layout/Sidebar.vue index 61405f6cd..5db8e704d 100644 --- a/app/javascript/dashboard/components/layout/Sidebar.vue +++ b/app/javascript/dashboard/components/layout/Sidebar.vue @@ -50,10 +50,17 @@ :show="showOptionsMenu" @toggle-accounts="toggleAccountModal" @show-support-chat-window="toggleSupportChatWindow" + @key-shortcut-modal="toggleKeyShortcutModal" @close="toggleOptions" /> + + + + + {{ $t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS') }} + + ({ + props: Object.keys(argTypes), + components: { WootKeyboardShortcutModal }, + template: + '', +}); + +export const KeyboardShortcut = Template.bind({}); +KeyboardShortcut.args = {}; diff --git a/app/javascript/dashboard/components/widgets/modal/WootKeyShortcutModal.vue b/app/javascript/dashboard/components/widgets/modal/WootKeyShortcutModal.vue new file mode 100644 index 000000000..fb4bef960 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/modal/WootKeyShortcutModal.vue @@ -0,0 +1,182 @@ + + + + + + + + {{ $t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS') }} + + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.COMMAND_KEY') }} + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.FORWARD_SLASH_KEY') }} + + + + + + + + + + {{ $t('KEYBOARD_SHORTCUTS.TITLE.OPEN_CONVERSATION') }} + + + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.ALT_OR_OPTION_KEY') }} + + + J + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.FORWARD_SLASH_KEY') }} + + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.ALT_OR_OPTION_KEY') }} + + + K + + + + + + + {{ $t('KEYBOARD_SHORTCUTS.TITLE.RESOLVE_AND_NEXT') }} + + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.COMMAND_KEY') }} + + + {{ $t('KEYBOARD_SHORTCUTS.KEYS.ALT_OR_OPTION_KEY') }} + + + E + + + + + + {{ title(shortcutKey) }} + + + + {{ shortcutKey.firstkey }} + + + {{ shortcutKey.secondKey }} + + + + + + + + + + + + diff --git a/app/javascript/dashboard/components/widgets/modal/constants.js b/app/javascript/dashboard/components/widgets/modal/constants.js new file mode 100644 index 000000000..faec60dc1 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/modal/constants.js @@ -0,0 +1,86 @@ +export const SHORTCUT_KEYS = [ + { + id: 1, + label: 'NAVIGATE_DROPDOWN', + firstkey: 'Up', + secondKey: 'Down', + }, + { + id: 2, + label: 'RESOLVE_CONVERSATION', + firstkey: 'Alt / ⌥', + secondKey: 'E', + }, + { + id: 3, + label: 'GO_TO_CONVERSATION_DASHBOARD', + firstkey: 'Alt / ⌥', + secondKey: 'C', + }, + { + id: 4, + label: 'ADD_ATTACHMENT', + firstkey: 'Alt / ⌥', + secondKey: 'A', + }, + { + id: 5, + label: 'GO_TO_CONTACTS_DASHBOARD', + firstkey: 'Alt / ⌥', + secondKey: 'V', + }, + { + id: 6, + label: 'TOGGLE_SIDEBAR', + firstkey: 'Alt / ⌥', + secondKey: 'O', + }, + { + id: 7, + label: 'GO_TO_REPORTS_SIDEBAR', + firstkey: 'Alt / ⌥', + secondKey: 'R', + }, + { + id: 8, + label: 'MOVE_TO_NEXT_TAB', + firstkey: 'Alt / ⌥', + secondKey: 'N', + }, + { + id: 9, + label: 'GO_TO_SETTINGS', + firstkey: 'Alt / ⌥', + secondKey: 'S', + }, + { + id: 10, + label: 'SWITCH_CONVERSATION_STATUS', + firstkey: 'Alt / ⌥', + secondKey: 'B', + }, + { + id: 11, + label: 'SWITCH_TO_PRIVATE_NOTE', + firstkey: 'Alt / ⌥', + secondKey: 'P', + }, + { + id: 12, + label: 'TOGGLE_RICH_CONTENT_EDITOR', + firstkey: 'Alt / ⌥', + secondKey: 'W', + }, + { + id: 13, + label: 'SWITCH_TO_REPLY', + firstkey: 'Alt / ⌥', + secondKey: 'L', + }, + { + id: 14, + label: 'TOGGLE_SNOOZE_DROPDOWN', + firstkey: 'Alt / ⌥', + secondKey: 'M', + }, +]; diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index a5405bd63..34ce3e4d4 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -98,6 +98,7 @@ "CHANGE_ACCOUNTS": "Switch Account", "SELECTOR_SUBTITLE": "Select an account from the following list", "PROFILE_SETTINGS": "Profile Settings", + "KEYBOARD_SHORTCUTS": "Keyboard Shortcuts", "LOGOUT": "Logout" }, "APP_GLOBAL": { @@ -159,5 +160,30 @@ }, "SUBMIT": "Submit" } + }, + "KEYBOARD_SHORTCUTS": { + "TITLE": { + "OPEN_CONVERSATION": "Open conversation", + "RESOLVE_AND_NEXT": "Resolve and move to next", + "NAVIGATE_DROPDOWN": "Navigate dropdown items", + "RESOLVE_CONVERSATION": "Resolve Conversation", + "GO_TO_CONVERSATION_DASHBOARD": "Go to Conversation Dashboard", + "ADD_ATTACHMENT": "Add Attachment", + "GO_TO_CONTACTS_DASHBOARD": "Go to Contacts Dashboard", + "TOGGLE_SIDEBAR": "Toggle Sidebar", + "GO_TO_REPORTS_SIDEBAR": "Go to Reports sidebar", + "MOVE_TO_NEXT_TAB": "Move to next tab in conversation list", + "GO_TO_SETTINGS": "Go to Settings", + "SWITCH_CONVERSATION_STATUS": "Switch Conversation status", + "SWITCH_TO_PRIVATE_NOTE": "Switch to Private Note", + "TOGGLE_RICH_CONTENT_EDITOR": "Toggle Rich Content editor", + "SWITCH_TO_REPLY": "Switch to Reply", + "TOGGLE_SNOOZE_DROPDOWN": "Toggle snooze dropdown" + }, + "KEYS": { + "COMMAND_KEY": "⌘", + "ALT_OR_OPTION_KEY": "Alt / ⌥", + "FORWARD_SLASH_KEY": "/" + } } } diff --git a/app/javascript/shared/helpers/KeyboardHelpers.js b/app/javascript/shared/helpers/KeyboardHelpers.js index 6671eaff6..f5ff556c6 100644 --- a/app/javascript/shared/helpers/KeyboardHelpers.js +++ b/app/javascript/shared/helpers/KeyboardHelpers.js @@ -10,6 +10,10 @@ export const hasPressedShift = e => { return e.shiftKey; }; +export const hasPressedCommandAndForwardSlash = e => { + return e.metaKey && e.keyCode === 191; +}; + export const hasPressedAltAndCKey = e => { return e.altKey && e.keyCode === 67; };
+ {{ $t('KEYBOARD_SHORTCUTS.KEYS.COMMAND_KEY') }} +
+ {{ $t('KEYBOARD_SHORTCUTS.KEYS.FORWARD_SLASH_KEY') }} +