feat: Add agent_reply_time_window in API channels (#4857)
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
@click="toggleMessageSignature"
|
||||
/>
|
||||
<woot-button
|
||||
v-if="showWhatsappTemplatesButton"
|
||||
v-if="hasWhatsappTemplates"
|
||||
v-tooltip.top-end="'Whatsapp Templates'"
|
||||
icon="whatsapp"
|
||||
color-scheme="secondary"
|
||||
@@ -275,9 +275,6 @@ export default {
|
||||
showMessageSignatureButton() {
|
||||
return !this.isPrivate && this.isAnEmailChannel;
|
||||
},
|
||||
showWhatsappTemplatesButton() {
|
||||
return !this.isOnPrivateNote && this.hasWhatsappTemplates;
|
||||
},
|
||||
sendWithSignature() {
|
||||
const { send_with_signature: isEnabled } = this.uiSettings;
|
||||
return isEnabled;
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
<template>
|
||||
<div class="view-box fill-height">
|
||||
<banner
|
||||
v-if="!currentChat.can_reply && !isAWhatsappChannel"
|
||||
v-if="!currentChat.can_reply"
|
||||
color-scheme="alert"
|
||||
:banner-message="$t('CONVERSATION.CANNOT_REPLY')"
|
||||
:href-link="facebookReplyPolicy"
|
||||
:href-link-text="$t('CONVERSATION.24_HOURS_WINDOW')"
|
||||
/>
|
||||
|
||||
<banner
|
||||
v-if="!currentChat.can_reply && isAWhatsappChannel"
|
||||
color-scheme="alert"
|
||||
:banner-message="$t('CONVERSATION.TWILIO_WHATSAPP_CAN_REPLY')"
|
||||
:href-link="twilioWhatsAppReplyPolicy"
|
||||
:href-link-text="$t('CONVERSATION.TWILIO_WHATSAPP_24_HOURS_WINDOW')"
|
||||
:banner-message="replyWindowBannerMessage"
|
||||
:href-link="replyWindowLink"
|
||||
:href-link-text="replyWindowLinkText"
|
||||
/>
|
||||
|
||||
<banner
|
||||
@@ -159,7 +151,6 @@ export default {
|
||||
hasSelectedTweetId() {
|
||||
return !!this.selectedTweetId;
|
||||
},
|
||||
|
||||
tweetBannerText() {
|
||||
return !this.selectedTweetId
|
||||
? this.$t('CONVERSATION.SELECT_A_TWEET_TO_REPLY')
|
||||
@@ -237,12 +228,6 @@ export default {
|
||||
}
|
||||
return '';
|
||||
},
|
||||
facebookReplyPolicy() {
|
||||
return REPLY_POLICY.FACEBOOK;
|
||||
},
|
||||
twilioWhatsAppReplyPolicy() {
|
||||
return REPLY_POLICY.TWILIO_WHATSAPP;
|
||||
},
|
||||
isRightOrLeftIcon() {
|
||||
if (this.isContactPanelOpen) {
|
||||
return 'arrow-chevron-right';
|
||||
@@ -254,6 +239,41 @@ export default {
|
||||
const { contact_last_seen_at: contactLastSeenAt } = this.currentChat;
|
||||
return contactLastSeenAt;
|
||||
},
|
||||
|
||||
replyWindowBannerMessage() {
|
||||
if (this.isAWhatsappChannel) {
|
||||
return this.$t('CONVERSATION.TWILIO_WHATSAPP_CAN_REPLY');
|
||||
}
|
||||
if (this.isAPIInbox) {
|
||||
const { additional_attributes: additionalAttributes = {} } = this.inbox;
|
||||
if (additionalAttributes) {
|
||||
const {
|
||||
agent_reply_time_window_message: agentReplyTimeWindowMessage,
|
||||
} = additionalAttributes;
|
||||
return agentReplyTimeWindowMessage;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
return this.$t('CONVERSATION.CANNOT_REPLY');
|
||||
},
|
||||
replyWindowLink() {
|
||||
if (this.isAWhatsappChannel) {
|
||||
return REPLY_POLICY.FACEBOOK;
|
||||
}
|
||||
if (!this.isAPIInbox) {
|
||||
return REPLY_POLICY.TWILIO_WHATSAPP;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
replyWindowLinkText() {
|
||||
if (this.isAWhatsappChannel) {
|
||||
return this.$t('CONVERSATION.24_HOURS_WINDOW');
|
||||
}
|
||||
if (!this.isAPIInbox) {
|
||||
return this.$t('CONVERSATION.TWILIO_WHATSAPP_24_HOURS_WINDOW');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user