# Pull Request Template ## Description 1. This PR is an enhancement to https://github.com/chatwoot/chatwoot/pull/13045 It strips unsupported formatting from **message signatures** based on each channel’s formatting capabilities defined in the `FORMATTING` config 2. Remove usage of plain editor in Compose new conversation modal Only the following signature elements are considered: <strong>bold (<code inline="">strong</code>), italic (<code inline="">em</code>), links (<code inline="">link</code>), images (<code inline="">image</code>)</strong>.</p> Any formatting not supported by the target channel is automatically removed before the signature is appended. <h3>Channel-wise Signature Formatting Support</h3> Channel | Keeps in Signature | Strips from Signature -- | -- | -- Email | bold, italic, links, images | — WebWidget | bold, italic, links, images | — API | bold, italic | links, images WhatsApp | bold, italic | links, images Telegram | bold, italic, links | images Facebook | bold, italic | links, images Instagram | bold, italic | links, images Line | bold, italic | links, images SMS | — | everything Twilio SMS | — | everything Twitter/X | — | everything <hr> <h3>📝 Note</h3> <blockquote> <p>Message signatures only support <strong>bold, italic, links, and images</strong>.<br> Other formatting options available in the editor (lists, code blocks, strike-through, etc.) do <strong>not apply</strong> to signatures and are ignored.</p> </blockquote> ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Loom video https://www.loom.com/share/d325ab86ca514c6d8f90dfe72a8928dd ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
46 lines
1.3 KiB
Vue
46 lines
1.3 KiB
Vue
<script setup>
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
import Editor from 'dashboard/components-next/Editor/Editor.vue';
|
|
|
|
defineProps({
|
|
hasErrors: { type: Boolean, default: false },
|
|
hasAttachments: { type: Boolean, default: false },
|
|
sendWithSignature: { type: Boolean, default: false },
|
|
messageSignature: { type: String, default: '' },
|
|
channelType: { type: String, default: '' },
|
|
medium: { type: String, default: '' },
|
|
});
|
|
|
|
const { t } = useI18n();
|
|
|
|
const modelValue = defineModel({
|
|
type: String,
|
|
default: '',
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex-1 h-full" :class="[!hasAttachments && 'min-h-[200px]']">
|
|
<Editor
|
|
v-model="modelValue"
|
|
:placeholder="
|
|
t('COMPOSE_NEW_CONVERSATION.FORM.MESSAGE_EDITOR.PLACEHOLDER')
|
|
"
|
|
class="[&>div]:!border-transparent [&>div]:px-4 [&>div]:py-4 [&>div]:!bg-transparent h-full [&_.ProseMirror-woot-style]:!max-h-[200px]"
|
|
:class="
|
|
hasErrors
|
|
? '[&_.empty-node]:before:!text-n-ruby-9 [&_.empty-node]:dark:before:!text-n-ruby-9'
|
|
: ''
|
|
"
|
|
enable-variables
|
|
:show-character-count="false"
|
|
:signature="messageSignature"
|
|
allow-signature
|
|
:send-with-signature="sendWithSignature"
|
|
:channel-type="channelType"
|
|
:medium="medium"
|
|
/>
|
|
</div>
|
|
</template>
|