260907_01_ENH: 에디터 이미지맵 보존 및 SMS 미리보기 문구 지원
This commit is contained in:
@@ -57,6 +57,11 @@ import {
|
||||
QrCode,
|
||||
renderQrCodePreviewHtml,
|
||||
} from "@/components/message-template/qrcode";
|
||||
import {
|
||||
getEmailHtmlPolicyIssues,
|
||||
getEmailWysiwygCompatibility,
|
||||
sanitizeEmailHtml,
|
||||
} from "@/components/message-template/emailHtmlPolicy";
|
||||
|
||||
interface MessageTemplateProps {
|
||||
pageTitle: string;
|
||||
@@ -368,13 +373,25 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isSmsTemplate(selectedTemplate)) {
|
||||
const policyIssues = getEmailHtmlPolicyIssues(selectedTemplate.tmplatBody);
|
||||
if (policyIssues.length > 0) {
|
||||
const issueSummary = policyIssues.slice(0, 5).join("\n- ");
|
||||
const remaining = policyIssues.length > 5 ? `\n외 ${policyIssues.length - 5}개` : "";
|
||||
const shouldContinue = window.confirm(
|
||||
`백엔드 허용 목록에 없는 항목은 제거되어 저장됩니다.\n\n- ${issueSummary}${remaining}\n\n계속 저장하시겠습니까?`,
|
||||
);
|
||||
if (!shouldContinue) return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const templateToSave = isSmsTemplate(selectedTemplate)
|
||||
? { ...selectedTemplate, tmplatPurpose: selectedTemplate.tmplatPurpose ?? TEMPLATE_PURPOSE.NORMAL }
|
||||
: {
|
||||
...selectedTemplate,
|
||||
tmplatPurpose: TEMPLATE_PURPOSE.NORMAL,
|
||||
tmplatBody: normalizeQrCodeForStorage(selectedTemplate.tmplatBody),
|
||||
tmplatBody: normalizeQrCodeForStorage(sanitizeEmailHtml(selectedTemplate.tmplatBody)),
|
||||
};
|
||||
|
||||
const res = await saveTemplateMutation.mutateAsync({
|
||||
@@ -581,6 +598,9 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
toolbar={{ strike: false, table: false, bulletList: false, orderedList: false }}
|
||||
editorExtensions={MESSAGE_EDITOR_EXTENSIONS}
|
||||
allowedCustomHtml={QR_CODE_ALLOWED_HTML}
|
||||
enableImageMap
|
||||
htmlSanitizer={sanitizeEmailHtml}
|
||||
getWysiwygCompatibility={getEmailWysiwygCompatibility}
|
||||
previewClassName="kri-editor-preview"
|
||||
transformPreviewHtml={renderQrCodePreviewHtml}
|
||||
renderToolbarEnd={({editor}) => (
|
||||
|
||||
Reference in New Issue
Block a user