feat: Quickly create canned responses (#5563)

This commit is contained in:
Pranav Raj S
2022-10-05 22:00:15 -07:00
committed by GitHub
parent 0a9ea6e272
commit 788b766179
5 changed files with 71 additions and 22 deletions

View File

@@ -100,10 +100,11 @@
v-if="isBubble && !isMessageDeleted"
:is-open="showContextMenu"
:show-copy="hasText"
:show-canned-response-option="isOutgoing"
:menu-position="contextMenuPosition"
:message-content="data.content"
@toggle="handleContextMenuClick"
@delete="handleDelete"
@copy="handleCopy"
/>
</div>
</li>
@@ -126,7 +127,6 @@ import alertMixin from 'shared/mixins/alertMixin';
import contentTypeMixin from 'shared/mixins/contentTypeMixin';
import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages';
import { generateBotMessageContent } from './helpers/botMessageContentHelper';
import { copyTextToClipboard } from 'shared/helpers/clipboard';
export default {
components: {
@@ -408,11 +408,6 @@ export default {
this.showAlert(this.$t('CONVERSATION.FAIL_DELETE_MESSSAGE'));
}
},
async handleCopy() {
await copyTextToClipboard(this.data.content);
this.showAlert(this.$t('CONTACT_PANEL.COPY_SUCCESSFUL'));
this.showContextMenu = false;
},
async retrySendMessage() {
await this.$store.dispatch('sendMessageWithData', this.data);
},