diff --git a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue
index 168f2448a..e4ab0b41d 100644
--- a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue
+++ b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue
@@ -116,29 +116,27 @@ export default {
setup() {
const { setSignatureFlagForInbox, fetchSignatureFlagFromUISettings } =
useUISettings();
+
const uploadRef = ref(null);
// TODO: This is really hacky, we need to replace the file picker component with
// a custom one, where the logic and the component markup is isolated.
// Once we have the custom component, we can remove the hacky logic below.
- const uploadTriggerButton = computed(() => {
- if (uploadRef.value) {
- return uploadRef.value.$children[1].$el;
- }
-
- return null;
- });
+ const uploadRefElem = computed(() => uploadRef.value?.$el);
const keyboardEvents = {
'Alt+KeyA': {
action: () => {
- uploadTriggerButton.value.click();
+ const uploadTriggerButton = document.querySelector(
+ '#conversationAttachment'
+ );
+ uploadTriggerButton.click();
},
allowOnFocusedInput: true,
},
};
watchEffect(() => {
- useKeyboardEvents(keyboardEvents, uploadTriggerButton);
+ useKeyboardEvents(keyboardEvents, uploadRefElem);
});
return {
diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
index 27994fc17..0685ebc53 100644
--- a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
@@ -1,8 +1,8 @@
+import { ref, computed } from 'vue';
+import { useStore, useStoreGetters } from 'dashboard/composables/store';
+import { useAlert } from 'dashboard/composables';
+import { useI18n } from 'dashboard/composables/useI18n';
+import { useEmitter } from 'dashboard/composables/emitter';
+import { getUnixTime } from 'date-fns';
+import { findSnoozeTime } from 'dashboard/helper/snoozeHelpers';
+import { CMD_SNOOZE_CONVERSATION } from 'dashboard/routes/dashboard/commands/commandBarBusEvents';
+import wootConstants from 'dashboard/constants/globals';
+import CustomSnoozeModal from 'dashboard/components/CustomSnoozeModal.vue';
+
+const store = useStore();
+const getters = useStoreGetters();
+const { t } = useI18n();
+const showCustomSnoozeModal = ref(false);
+
+const selectedChat = computed(() => getters.getSelectedChat.value);
+const contextMenuChatId = computed(() => getters.getContextMenuChatId.value);
+
+const toggleStatus = async (status, snoozedUntil) => {
+ await store.dispatch('toggleStatus', {
+ conversationId: selectedChat.value?.id || contextMenuChatId.value,
+ status,
+ snoozedUntil,
+ });
+ store.dispatch('setContextMenuChatId', null);
+ useAlert(t('CONVERSATION.CHANGE_STATUS'));
+};
+
+const onCmdSnoozeConversation = snoozeType => {
+ if (snoozeType === wootConstants.SNOOZE_OPTIONS.UNTIL_CUSTOM_TIME) {
+ showCustomSnoozeModal.value = true;
+ } else {
+ toggleStatus(
+ wootConstants.STATUS_TYPE.SNOOZED,
+ findSnoozeTime(snoozeType) || null
+ );
+ }
+};
+
+const chooseSnoozeTime = customSnoozeTime => {
+ showCustomSnoozeModal.value = false;
+ if (customSnoozeTime) {
+ toggleStatus(
+ wootConstants.STATUS_TYPE.SNOOZED,
+ getUnixTime(customSnoozeTime)
+ );
+ }
+};
+
+const hideCustomSnoozeModal = () => {
+ // if we select custom snooze and the custom snooze modal is open
+ // Then if the custom snooze modal is closed then set the context menu chat id to null
+ store.dispatch('setContextMenuChatId', null);
+ showCustomSnoozeModal.value = false;
+};
+
+useEmitter(CMD_SNOOZE_CONVERSATION, onCmdSnoozeConversation);
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue b/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
index dcc25e223..d639696ba 100644
--- a/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
+++ b/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsTable.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsTable.vue
index 3486f6f96..2c5b4b538 100644
--- a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsTable.vue
+++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsTable.vue
@@ -1,4 +1,5 @@