feat: remove feature flag checks for message reply to (#8352)

This commit is contained in:
Shivam Mishra
2023-11-15 13:05:58 +05:30
committed by GitHub
parent cd217a3f86
commit b411b6ca21
8 changed files with 3 additions and 33 deletions

View File

@@ -114,7 +114,6 @@ import { LocalStorage } from 'shared/helpers/localStorage';
// constants // constants
import { BUS_EVENTS } from 'shared/constants/busEvents'; import { BUS_EVENTS } from 'shared/constants/busEvents';
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
import { REPLY_POLICY } from 'shared/constants/links'; import { REPLY_POLICY } from 'shared/constants/links';
import wootConstants from 'dashboard/constants/globals'; import wootConstants from 'dashboard/constants/globals';
import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage'; import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage';
@@ -285,14 +284,6 @@ export default {
return this.currentChat.unread_count || 0; return this.currentChat.unread_count || 0;
}, },
inboxSupportsReplyTo() { inboxSupportsReplyTo() {
if (
!this.isFeatureEnabledonAccount(
this.accountId,
FEATURE_FLAGS.MESSAGE_REPLY_TO
)
) {
return {};
}
return { return {
incoming: this.inboxHasFeature(INBOX_FEATURES.REPLY_TO), incoming: this.inboxHasFeature(INBOX_FEATURES.REPLY_TO),
outgoing: this.inboxHasFeature(INBOX_FEATURES.REPLY_TO_OUTGOING), outgoing: this.inboxHasFeature(INBOX_FEATURES.REPLY_TO_OUTGOING),

View File

@@ -194,7 +194,6 @@ import {
replaceSignature, replaceSignature,
extractTextFromMarkdown, extractTextFromMarkdown,
} from 'dashboard/helper/editorHelper'; } from 'dashboard/helper/editorHelper';
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage'; import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage';
import { LocalStorage } from 'shared/helpers/localStorage'; import { LocalStorage } from 'shared/helpers/localStorage';
@@ -276,11 +275,7 @@ export default {
return ( return (
this.inReplyTo?.id && this.inReplyTo?.id &&
!this.isPrivate && !this.isPrivate &&
this.inboxHasFeature(INBOX_FEATURES.REPLY_TO) && this.inboxHasFeature(INBOX_FEATURES.REPLY_TO)
this.isFeatureEnabledonAccount(
this.accountId,
FEATURE_FLAGS.MESSAGE_REPLY_TO
)
); );
}, },
showRichContentEditor() { showRichContentEditor() {

View File

@@ -16,6 +16,5 @@ export const FEATURE_FLAGS = {
TEAM_MANAGEMENT: 'team_management', TEAM_MANAGEMENT: 'team_management',
VOICE_RECORDER: 'voice_recorder', VOICE_RECORDER: 'voice_recorder',
AUDIT_LOGS: 'audit_logs', AUDIT_LOGS: 'audit_logs',
MESSAGE_REPLY_TO: 'message_reply_to',
INSERT_ARTICLE_IN_REPLY: 'insert_article_in_reply', INSERT_ARTICLE_IN_REPLY: 'insert_article_in_reply',
}; };

View File

@@ -22,7 +22,6 @@
<drag-wrapper <drag-wrapper
class="space-y-2" class="space-y-2"
direction="right" direction="right"
:disabled="!allowReplyTo"
@dragged="toggleReply" @dragged="toggleReply"
> >
<AgentMessageBubble <AgentMessageBubble
@@ -58,7 +57,6 @@
</drag-wrapper> </drag-wrapper>
<div class="flex flex-col justify-end"> <div class="flex flex-col justify-end">
<message-reply-button <message-reply-button
v-if="allowReplyTo"
class="transition-opacity delay-75 opacity-0 group-hover:opacity-100 sm:opacity-0" class="transition-opacity delay-75 opacity-0 group-hover:opacity-100 sm:opacity-0"
@click="toggleReply" @click="toggleReply"
/> />
@@ -127,7 +125,6 @@ export default {
data() { data() {
return { return {
hasImageError: false, hasImageError: false,
allowReplyTo: window.chatwootWebChannel.allowReplyTo || false,
}; };
}, },
computed: { computed: {
@@ -217,7 +214,6 @@ export default {
}; };
}, },
hasReplyTo() { hasReplyTo() {
if (!this.allowReplyTo) return false;
return this.replyTo && (this.replyTo.content || this.replyTo.attachments); return this.replyTo && (this.replyTo.content || this.replyTo.attachments);
}, },
}, },

View File

@@ -68,7 +68,6 @@ export default {
data() { data() {
return { return {
inReplyTo: null, inReplyTo: null,
allowReplyTo: window.chatwootWebChannel.allowReplyTo || false,
}; };
}, },
computed: { computed: {
@@ -91,8 +90,6 @@ export default {
return this.currentUser && this.currentUser.email; return this.currentUser && this.currentUser.email;
}, },
hasReplyTo() { hasReplyTo() {
if (!this.allowReplyTo) return false;
return ( return (
this.inReplyTo && (this.inReplyTo.content || this.inReplyTo.attachments) this.inReplyTo && (this.inReplyTo.content || this.inReplyTo.attachments)
); );

View File

@@ -11,16 +11,12 @@
<div class="flex justify-end gap-1"> <div class="flex justify-end gap-1">
<div class="flex flex-col justify-end"> <div class="flex flex-col justify-end">
<message-reply-button <message-reply-button
v-if="!isInProgress && !isFailed && allowReplyTo" v-if="!isInProgress && !isFailed"
class="transition-opacity delay-75 opacity-0 group-hover:opacity-100 sm:opacity-0" class="transition-opacity delay-75 opacity-0 group-hover:opacity-100 sm:opacity-0"
@click="toggleReply" @click="toggleReply"
/> />
</div> </div>
<drag-wrapper <drag-wrapper direction="left" @dragged="toggleReply">
direction="left"
:disabled="!allowReplyTo"
@dragged="toggleReply"
>
<user-message-bubble <user-message-bubble
v-if="showTextBubble" v-if="showTextBubble"
:message="message.content" :message="message.content"
@@ -111,7 +107,6 @@ export default {
data() { data() {
return { return {
hasImageError: false, hasImageError: false,
allowReplyTo: window.chatwootWebChannel.allowReplyTo || false,
}; };
}, },
computed: { computed: {
@@ -142,7 +137,6 @@ export default {
: this.$t('COMPONENTS.MESSAGE_BUBBLE.ERROR_MESSAGE'); : this.$t('COMPONENTS.MESSAGE_BUBBLE.ERROR_MESSAGE');
}, },
hasReplyTo() { hasReplyTo() {
if (!this.allowReplyTo) return false;
return this.replyTo && (this.replyTo.content || this.replyTo.attachments); return this.replyTo && (this.replyTo.content || this.replyTo.attachments);
}, },
}, },

View File

@@ -1,6 +1,5 @@
json.website_channel_config do json.website_channel_config do
json.allow_messages_after_resolved @web_widget.inbox.allow_messages_after_resolved json.allow_messages_after_resolved @web_widget.inbox.allow_messages_after_resolved
json.allow_reply_to @web_widget.inbox.account.feature_enabled?('message_reply_to')
json.api_host ENV.fetch('FRONTEND_URL', nil) json.api_host ENV.fetch('FRONTEND_URL', nil)
json.auth_token @token json.auth_token @token
json.avatar_url @web_widget.inbox.avatar_url json.avatar_url @web_widget.inbox.avatar_url

View File

@@ -28,7 +28,6 @@
timezone: '<%= @web_widget.inbox.timezone %>', timezone: '<%= @web_widget.inbox.timezone %>',
allowMessagesAfterResolved: <%= @web_widget.inbox.allow_messages_after_resolved %>, allowMessagesAfterResolved: <%= @web_widget.inbox.allow_messages_after_resolved %>,
disableBranding: <%= @web_widget.inbox.account.feature_enabled?('disable_branding') %>, disableBranding: <%= @web_widget.inbox.account.feature_enabled?('disable_branding') %>,
allowReplyTo: <%= @web_widget.inbox.account.feature_enabled?('message_reply_to') %>
} }
window.chatwootPubsubToken = '<%= @contact_inbox.pubsub_token %>' window.chatwootPubsubToken = '<%= @contact_inbox.pubsub_token %>'
window.authToken = '<%= @token %>' window.authToken = '<%= @token %>'