fix: Update missing features in unattended / mentions view (#6009)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
a08099bbcc
commit
c8ec397c79
4 changed files with 47 additions and 13 deletions
|
@ -187,6 +187,10 @@ import {
|
|||
hasPressedAltAndKKey,
|
||||
} from 'shared/helpers/KeyboardHelpers';
|
||||
import { conversationListPageURL } from '../helper/URLHelper';
|
||||
import {
|
||||
isOnMentionsView,
|
||||
isOnUnattendedView,
|
||||
} from '../store/modules/conversations/helpers/actionHelpers';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -649,10 +653,16 @@ export default {
|
|||
params: { accountId, inbox_id: inboxId, label, teamId },
|
||||
name,
|
||||
} = this.$route;
|
||||
let conversationType = '';
|
||||
if (isOnMentionsView({ route: { name } })) {
|
||||
conversationType = 'mention';
|
||||
} else if (isOnUnattendedView({ route: { name } })) {
|
||||
conversationType = 'unattended';
|
||||
}
|
||||
this.$router.push(
|
||||
conversationListPageURL({
|
||||
accountId,
|
||||
conversationType: name === 'conversation_mentions' ? 'mention' : '',
|
||||
conversationType: conversationType,
|
||||
customViewId: this.foldersId,
|
||||
inboxId,
|
||||
label,
|
||||
|
|
|
@ -87,6 +87,10 @@ import {
|
|||
} from 'dashboard/helper/inbox';
|
||||
|
||||
import SecondaryChildNavItem from './SecondaryChildNavItem';
|
||||
import {
|
||||
isOnMentionsView,
|
||||
isOnUnattendedView,
|
||||
} from '../../../store/modules/conversations/helpers/actionHelpers';
|
||||
|
||||
export default {
|
||||
components: { SecondaryChildNavItem },
|
||||
|
@ -115,19 +119,31 @@ export default {
|
|||
this.menuItem.featureFlag
|
||||
);
|
||||
},
|
||||
isInboxConversation() {
|
||||
isAllConversations() {
|
||||
return (
|
||||
this.$store.state.route.name === 'inbox_conversation' &&
|
||||
this.menuItem.toStateName === 'home'
|
||||
);
|
||||
},
|
||||
isMentions() {
|
||||
return (
|
||||
isOnMentionsView({ route: this.$route }) &&
|
||||
this.menuItem.toStateName === 'conversation_mentions'
|
||||
);
|
||||
},
|
||||
isUnattended() {
|
||||
return (
|
||||
isOnUnattendedView({ route: this.$route }) &&
|
||||
this.menuItem.toStateName === 'conversation_unattended'
|
||||
);
|
||||
},
|
||||
isTeamsSettings() {
|
||||
return (
|
||||
this.$store.state.route.name === 'settings_teams_edit' &&
|
||||
this.menuItem.toStateName === 'settings_teams_list'
|
||||
);
|
||||
},
|
||||
isInboxsSettings() {
|
||||
isInboxSettings() {
|
||||
return (
|
||||
this.$store.state.route.name === 'settings_inbox_show' &&
|
||||
this.menuItem.toStateName === 'settings_inbox_list'
|
||||
|
@ -150,14 +166,20 @@ export default {
|
|||
},
|
||||
|
||||
computedClass() {
|
||||
// If active Inbox is present
|
||||
// donot highlight conversations
|
||||
// If active inbox is present, do not highlight conversations
|
||||
if (this.activeInbox) return ' ';
|
||||
if (
|
||||
this.isAllConversations ||
|
||||
this.isMentions ||
|
||||
this.isUnattended ||
|
||||
this.isCurrentRoute
|
||||
) {
|
||||
return 'is-active';
|
||||
}
|
||||
if (this.hasSubMenu) {
|
||||
if (
|
||||
this.isInboxConversation ||
|
||||
this.isTeamsSettings ||
|
||||
this.isInboxsSettings ||
|
||||
this.isInboxSettings ||
|
||||
this.isIntegrationsSettings ||
|
||||
this.isApplicationsSettings
|
||||
) {
|
||||
|
@ -166,10 +188,6 @@ export default {
|
|||
return ' ';
|
||||
}
|
||||
|
||||
if (this.isCurrentRoute) {
|
||||
return 'is-active';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
},
|
||||
|
|
|
@ -75,12 +75,16 @@ export const conversationListPageURL = ({
|
|||
url = `accounts/${accountId}/label/${label}`;
|
||||
} else if (teamId) {
|
||||
url = `accounts/${accountId}/team/${teamId}`;
|
||||
} else if (conversationType === 'mention') {
|
||||
url = `accounts/${accountId}/mentions/conversations`;
|
||||
} else if (inboxId) {
|
||||
url = `accounts/${accountId}/inbox/${inboxId}`;
|
||||
} else if (customViewId) {
|
||||
url = `accounts/${accountId}/custom_view/${customViewId}`;
|
||||
} else if (conversationType) {
|
||||
const urlMap = {
|
||||
mention: 'mentions/conversations',
|
||||
unattended: 'unattended/conversations',
|
||||
};
|
||||
url = `accounts/${accountId}/${urlMap[conversationType]}`;
|
||||
}
|
||||
return frontendURL(url);
|
||||
};
|
||||
|
|
|
@ -99,6 +99,8 @@ const MUTE_ACTION = {
|
|||
export const isAConversationRoute = routeName =>
|
||||
[
|
||||
'inbox_conversation',
|
||||
'conversation_through_mentions',
|
||||
'conversation_through_unattended',
|
||||
'conversation_through_inbox',
|
||||
'conversations_through_label',
|
||||
'conversations_through_team',
|
||||
|
|
Loading…
Reference in a new issue