feat: Add support for Whatsapp template messages in the UI (#4711)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Fayaz Ahmed 2022-06-07 17:33:33 +05:30 committed by GitHub
parent 56f668db6b
commit bad24f97ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 733 additions and 54 deletions

View file

@ -79,6 +79,16 @@
:title="signatureToggleTooltip"
@click="toggleMessageSignature"
/>
<woot-button
v-if="showWhatsappTemplatesButton"
v-tooltip.top-end="'Whatsapp Templates'"
icon="whatsapp"
color-scheme="secondary"
variant="smooth"
size="small"
:title="'Whatsapp Templates'"
@click="$emit('selectWhatsappTemplate')"
/>
<transition name="modal-fade">
<div
v-show="$refs.upload && $refs.upload.dropActive"
@ -218,6 +228,10 @@ export default {
type: Boolean,
default: true,
},
hasWhatsappTemplates: {
type: Boolean,
default: false,
},
},
computed: {
isNote() {
@ -261,6 +275,9 @@ export default {
showMessageSignatureButton() {
return !this.isPrivate && this.isAnEmailChannel;
},
showWhatsappTemplatesButton() {
return !this.isOnPrivateNote && this.hasWhatsappTemplates;
},
sendWithSignature() {
const { send_with_signature: isEnabled } = this.uiSettings;
return isEnabled;