feat(inboxes): add inbox disable toggle

This commit is contained in:
Muhsin
2026-06-09 21:07:05 +04:00
parent 8a3b129292
commit cbd24dbdb2
49 changed files with 239 additions and 19 deletions
@@ -10,10 +10,16 @@ defineProps({
</script>
<template>
<div :title="inbox.name" class="flex items-center gap-0.5 min-w-0">
<div :title="inbox.name" class="flex items-center gap-1 min-w-0">
<ChannelIcon :inbox="inbox" class="size-4 flex-shrink-0 text-n-slate-11" />
<span class="truncate text-label-small text-n-slate-11">
{{ inbox.name }}
</span>
<span
v-if="inbox.active === false"
class="shrink-0 rounded-md bg-n-ruby-3 px-1 py-0.5 text-xs font-medium text-n-ruby-11"
>
{{ $t('INBOX_MGMT.DISABLED') }}
</span>
</div>
</template>
@@ -170,8 +170,14 @@ export default {
instagramInbox
);
},
isInboxDisabled() {
return this.inbox.active === false;
},
replyWindowBannerMessage() {
if (this.isInboxDisabled) {
return this.$t('CONVERSATION.INBOX_DISABLED');
}
if (this.isAWhatsAppChannel) {
return this.$t('CONVERSATION.TWILIO_WHATSAPP_CAN_REPLY');
}
@@ -194,6 +200,9 @@ export default {
return this.$t('CONVERSATION.CANNOT_REPLY');
},
replyWindowLink() {
if (this.isInboxDisabled) {
return '';
}
if (this.isAFacebookInbox || this.isAnInstagramChannel) {
return REPLY_POLICY.FACEBOOK;
}
@@ -209,6 +218,9 @@ export default {
return '';
},
replyWindowLinkText() {
if (this.isInboxDisabled) {
return '';
}
if (
this.isAWhatsAppChannel ||
this.isAFacebookInbox ||
@@ -455,7 +467,7 @@ export default {
>
<div ref="topBannerRef">
<Banner
v-if="!currentChat.can_reply"
v-if="isInboxDisabled || !currentChat.can_reply"
color-scheme="alert"
class="mx-2 mt-2 overflow-hidden rounded-lg"
:banner-message="replyWindowBannerMessage"
@@ -208,6 +208,9 @@ export default {
},
messagePlaceHolder() {
if (this.isEditorDisabled) {
if (this.inbox.active === false) {
return this.$t('CONVERSATION.FOOTER.MESSAGING_RESTRICTED_INBOX');
}
if (this.isAWhatsAppChannel) {
return this.$t('CONVERSATION.FOOTER.MESSAGING_RESTRICTED_WHATSAPP');
}
@@ -438,6 +441,10 @@ export default {
return !this.showAudioRecorderEditor && !this.copilot.isActive.value;
},
isEditorDisabled() {
if (this.inbox.active === false) {
return true;
}
return (
(this.isAWhatsAppChannel || this.isAPIInbox) &&
!this.isOnPrivateNote &&