diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue
index 54ddbfb6e..7c4c4daaa 100644
--- a/app/javascript/dashboard/components/buttons/ResolveAction.vue
+++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue
@@ -54,7 +54,7 @@ const showAdditionalActions = computed(
);
const showOpenButton = computed(() => {
- return isResolved.value || isSnoozed.value;
+ return isPending.value || isSnoozed.value;
});
const getConversationParams = () => {
@@ -208,7 +208,7 @@ useEmitter(CMD_RESOLVE_CONVERSATION, onCmdResolveConversation);
color-scheme="secondary"
size="small"
icon="book-clock"
- @click="() => toggleStatus(STATUS_TYPE.PENDING)"
+ @click="() => toggleStatus(wootConstants.STATUS_TYPE.PENDING)"
>
{{ t('CONVERSATION.RESOLVE_DROPDOWN.MARK_PENDING') }}
diff --git a/app/javascript/dashboard/routes/dashboard/commands/CmdBarConversationSnooze.vue b/app/javascript/dashboard/routes/dashboard/commands/CmdBarConversationSnooze.vue
new file mode 100644
index 000000000..529b624b0
--- /dev/null
+++ b/app/javascript/dashboard/routes/dashboard/commands/CmdBarConversationSnooze.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue b/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
index dcc25e223..dff1f53f4 100644
--- a/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
+++ b/app/javascript/dashboard/routes/dashboard/commands/commandbar.vue
@@ -1,4 +1,3 @@
-
+
import { mapGetters } from 'vuex';
-import { useAlert } from 'dashboard/composables';
import { useUISettings } from 'dashboard/composables/useUISettings';
-import { getUnixTime } from 'date-fns';
import ChatList from '../../../components/ChatList.vue';
import ConversationBox from '../../../components/widgets/conversation/ConversationBox.vue';
import PopOverSearch from './search/PopOverSearch.vue';
-import CustomSnoozeModal from 'dashboard/components/CustomSnoozeModal.vue';
import wootConstants from 'dashboard/constants/globals';
import { BUS_EVENTS } from 'shared/constants/busEvents';
-import { CMD_SNOOZE_CONVERSATION } from 'dashboard/routes/dashboard/commands/commandBarBusEvents';
-import { findSnoozeTime } from 'dashboard/helper/snoozeHelpers';
+import CmdBarConversationSnooze from 'dashboard/routes/dashboard/commands/CmdBarConversationSnooze.vue';
export default {
components: {
ChatList,
ConversationBox,
PopOverSearch,
- CustomSnoozeModal,
+ CmdBarConversationSnooze,
},
props: {
inboxId: {
@@ -56,14 +52,12 @@ export default {
data() {
return {
showSearchModal: false,
- showCustomSnoozeModal: false,
};
},
computed: {
...mapGetters({
chatList: 'getAllConversations',
currentChat: 'getSelectedChat',
- contextMenuChatId: 'getContextMenuChatId',
}),
showConversationList() {
return this.isOnExpandedLayout ? !this.conversationId : true;
@@ -100,10 +94,6 @@ export default {
this.$watch('chatList.length', () => {
this.setActiveChat();
});
- this.$emitter.on(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
- },
- beforeDestroy() {
- this.$emitter.off(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
},
methods: {
@@ -178,43 +168,6 @@ export default {
closeSearch() {
this.showSearchModal = false;
},
- onCmdSnoozeConversation(snoozeType) {
- if (snoozeType === wootConstants.SNOOZE_OPTIONS.UNTIL_CUSTOM_TIME) {
- this.showCustomSnoozeModal = true;
- } else {
- this.toggleStatus(
- wootConstants.STATUS_TYPE.SNOOZED,
- findSnoozeTime(snoozeType) || null
- );
- }
- },
- chooseSnoozeTime(customSnoozeTime) {
- this.showCustomSnoozeModal = false;
- if (customSnoozeTime) {
- this.toggleStatus(
- wootConstants.STATUS_TYPE.SNOOZED,
- getUnixTime(customSnoozeTime)
- );
- }
- },
- toggleStatus(status, snoozedUntil) {
- this.$store
- .dispatch('toggleStatus', {
- conversationId: this.currentChat?.id || this.contextMenuChatId,
- status,
- snoozedUntil,
- })
- .then(() => {
- this.$store.dispatch('setContextMenuChatId', null);
- useAlert(this.$t('CONVERSATION.CHANGE_STATUS'));
- });
- },
- 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
- this.$store.dispatch('setContextMenuChatId', null);
- this.showCustomSnoozeModal = false;
- },
},
};
@@ -243,15 +196,7 @@ export default {
:is-on-expanded-layout="isOnExpandedLayout"
@contactPanelToggle="onToggleContactPanel"
/>
-
-
-
+
diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
index fe025ff8d..2093d6b05 100644
--- a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
+++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
@@ -8,12 +8,14 @@ import InboxCard from './components/InboxCard.vue';
import InboxListHeader from './components/InboxListHeader.vue';
import { INBOX_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
import IntersectionObserver from 'dashboard/components/IntersectionObserver.vue';
+import CmdBarConversationSnooze from 'dashboard/routes/dashboard/commands/CmdBarConversationSnooze.vue';
export default {
components: {
InboxCard,
InboxListHeader,
IntersectionObserver,
+ CmdBarConversationSnooze,
},
setup() {
const { uiSettings } = useUISettings();
@@ -209,5 +211,6 @@ export default {
+