fix: Allow ending the conversation if snoozed or pending (#5793)
This commit is contained in:
@@ -10,6 +10,13 @@ export const MESSAGE_TYPE = {
|
|||||||
ACTIVITY: 2,
|
ACTIVITY: 2,
|
||||||
TEMPLATE: 3,
|
TEMPLATE: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const CONVERSATION_STATUS = {
|
||||||
|
OPEN: 'open',
|
||||||
|
RESOLVED: 'resolved',
|
||||||
|
PENDING: 'pending',
|
||||||
|
SNOOZED: 'snoozed',
|
||||||
|
};
|
||||||
// Size in mega bytes
|
// Size in mega bytes
|
||||||
export const MAXIMUM_FILE_UPLOAD_SIZE = 40;
|
export const MAXIMUM_FILE_UPLOAD_SIZE = 40;
|
||||||
export const MAXIMUM_FILE_UPLOAD_SIZE_TWILIO_SMS_CHANNEL = 5;
|
export const MAXIMUM_FILE_UPLOAD_SIZE_TWILIO_SMS_CHANNEL = 5;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="showHeaderActions" class="actions flex items-center">
|
<div v-if="showHeaderActions" class="actions flex items-center">
|
||||||
<button
|
<button
|
||||||
v-if="conversationStatus === 'open' && hasEndConversationEnabled"
|
v-if="canLeaveConversation && hasEndConversationEnabled"
|
||||||
class="button transparent compact"
|
class="button transparent compact"
|
||||||
:title="$t('END_CONVERSATION')"
|
:title="$t('END_CONVERSATION')"
|
||||||
@click="resolveConversation"
|
@click="resolveConversation"
|
||||||
@@ -45,6 +45,7 @@ import { popoutChatWindow } from '../helpers/popoutHelper';
|
|||||||
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
||||||
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
||||||
import configMixin from 'widget/mixins/configMixin';
|
import configMixin from 'widget/mixins/configMixin';
|
||||||
|
import { CONVERSATION_STATUS } from 'shared/constants/messages';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HeaderActions',
|
name: 'HeaderActions',
|
||||||
@@ -60,6 +61,13 @@ export default {
|
|||||||
...mapGetters({
|
...mapGetters({
|
||||||
conversationAttributes: 'conversationAttributes/getConversationParams',
|
conversationAttributes: 'conversationAttributes/getConversationParams',
|
||||||
}),
|
}),
|
||||||
|
canLeaveConversation() {
|
||||||
|
return [
|
||||||
|
CONVERSATION_STATUS.OPEN,
|
||||||
|
CONVERSATION_STATUS.SNOOZED,
|
||||||
|
CONVERSATION_STATUS.PENDING,
|
||||||
|
].includes(this.conversationStatus);
|
||||||
|
},
|
||||||
isIframe() {
|
isIframe() {
|
||||||
return IFrameHelper.isIFrame();
|
return IFrameHelper.isIFrame();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user