261001_01_ENH: 문자 템플릿 JPG 첨부 및 MMS 이미지 미리보기 추가
This commit is contained in:
@@ -12,6 +12,7 @@ import { useSelectedProject } from '@/hooks/useSelectedProject'
|
||||
import {
|
||||
useMainTemplateIdxQuery,
|
||||
useSendBulkMessageMutation,
|
||||
useTemplateAttachmentImagesQuery,
|
||||
useTemplateListQuery,
|
||||
useTemplateQuery,
|
||||
} from '@/query/message'
|
||||
@@ -28,7 +29,7 @@ import { normalizeQrCodeForEditor, renderQrCodePreviewHtml } from '@/components/
|
||||
import { sanitizeEmailHtml } from '@/components/message-template/emailHtmlPolicy'
|
||||
import { applyLinkPreviewClass } from '@/components/kri-editor/utils/linkPreview'
|
||||
import TemplateAttachmentList from '@/components/message-template/TemplateAttachmentList'
|
||||
import type { TemplateEmailWithAttachments, TemplateSummaryWithPurpose } from '@/types/message'
|
||||
import type { TemplateEmailWithAttachments, TemplateSmsWithAttachments, TemplateSummaryWithPurpose } from '@/types/message'
|
||||
import { TEMPLATE_PURPOSE } from '@/const/messageTemplateConst'
|
||||
|
||||
export type MessageSendMode = 'email' | 'sms'
|
||||
@@ -86,6 +87,11 @@ const MessageSendDialog = ({
|
||||
)
|
||||
const templateDetailQuery = useTemplateQuery(templateIdx ?? 0, enabled && !!templateIdx)
|
||||
const selectedTemplate = templateDetailQuery.data ?? null
|
||||
const smsAttachmentNames =
|
||||
chnnlTy === ChannelType.SMS
|
||||
? ((selectedTemplate as TemplateSmsWithAttachments | null)?.atchFl?.split('|').filter(Boolean) ?? [])
|
||||
: []
|
||||
const smsAttachmentImages = useTemplateAttachmentImagesQuery(selectedTemplate?.tmplatIdx ?? 0, smsAttachmentNames, enabled)
|
||||
const mainTemplateQuery = useMainTemplateIdxQuery(prjctIdx, chnnlTy, enabled)
|
||||
const mainTemplateIdx = mainTemplateQuery.data ?? null
|
||||
const selectedSids = useMemo(
|
||||
@@ -342,6 +348,8 @@ const MessageSendDialog = ({
|
||||
className="max-w-80 mx-0"
|
||||
debounceMs={600}
|
||||
smsTitle={(selectedTemplate as TemplateSms).tmplatTitle}
|
||||
smsHasAttachment={smsAttachmentNames.length > 0}
|
||||
smsImages={smsAttachmentImages}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useDialog } from '@/hooks/useDialog'
|
||||
import {
|
||||
useMainTemplateIdxQuery,
|
||||
useSendSingleMessageMutation,
|
||||
useTemplateAttachmentImagesQuery,
|
||||
useTemplateListQuery,
|
||||
useTemplateQuery,
|
||||
} from '@/query/message'
|
||||
@@ -20,7 +21,12 @@ import { sanitizeEmailHtml } from '@/components/message-template/emailHtmlPolicy
|
||||
import { getNearestFutureDateTime } from '@/lib/datetime'
|
||||
import { escapeHtml, substituteVariables } from '@/lib/variableSubstitution'
|
||||
import type { DialogId } from '@/store/jotai/dialog'
|
||||
import type { MessageSendChannel, PhoneVerificationSendData, TemplateEmailWithAttachments } from '@/types/message'
|
||||
import type {
|
||||
MessageSendChannel,
|
||||
PhoneVerificationSendData,
|
||||
TemplateEmailWithAttachments,
|
||||
TemplateSmsWithAttachments,
|
||||
} from '@/types/message'
|
||||
import TemplateAttachmentList from '@/components/message-template/TemplateAttachmentList'
|
||||
import {PHONE_VERIFICATION_PREVIEW_SUFFIX, TEMPLATE_PURPOSE} from '@/const/messageTemplateConst'
|
||||
|
||||
@@ -69,6 +75,11 @@ const SingleMessageSendDialog = ({
|
||||
const templateList: TemplateSummary[] = templateListQuery.data ?? []
|
||||
const templateDetailQuery = useTemplateQuery(templateIdx ?? 0, enabled && !!templateIdx)
|
||||
const selectedTemplate = templateDetailQuery.data ?? null
|
||||
const smsAttachmentNames =
|
||||
chnnlTy === ChannelType.SMS
|
||||
? ((selectedTemplate as TemplateSmsWithAttachments | null)?.atchFl?.split('|').filter(Boolean) ?? [])
|
||||
: []
|
||||
const smsAttachmentImages = useTemplateAttachmentImagesQuery(selectedTemplate?.tmplatIdx ?? 0, smsAttachmentNames, enabled)
|
||||
const mainTemplateQuery = useMainTemplateIdxQuery(prjctIdx, chnnlTy, enabled)
|
||||
const mainTemplateIdx = mainTemplateQuery.data ?? null
|
||||
|
||||
@@ -248,6 +259,8 @@ const SingleMessageSendDialog = ({
|
||||
className="max-w-80 mx-0"
|
||||
debounceMs={600}
|
||||
smsTitle={resolvedTitle}
|
||||
smsHasAttachment={smsAttachmentNames.length > 0}
|
||||
smsImages={smsAttachmentImages}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -27,6 +27,8 @@ export function KriEditorSms({
|
||||
smsMaxBytes = 90,
|
||||
lmsMaxBytes = 2000,
|
||||
smsPreviewSuffix = '',
|
||||
smsHasAttachment = false,
|
||||
smsImages = [],
|
||||
}: SmsEditorProps) {
|
||||
const [text, setText] = React.useState(value || '')
|
||||
const textareaRef = React.useRef<HTMLTextAreaElement | null>(null)
|
||||
@@ -36,7 +38,7 @@ export function KriEditorSms({
|
||||
const textareaInsert = useTextareaInsert(textareaRef)
|
||||
const previewText = smsPreviewSuffix ? `${text}\n${smsPreviewSuffix}` : text
|
||||
const byteSize = React.useMemo(() => calculateBytes(previewText), [previewText])
|
||||
const messageType: 'SMS' | 'LMS' = byteSize > smsMaxBytes || Boolean(smsTitle) ? 'LMS' : 'SMS'
|
||||
const messageType: 'SMS' | 'LMS' = byteSize > smsMaxBytes || Boolean(smsTitle) || smsHasAttachment ? 'LMS' : 'SMS'
|
||||
const maxBytes = messageType === 'SMS' ? smsMaxBytes : lmsMaxBytes
|
||||
|
||||
const commitText = React.useCallback((next: string, immediate = false) => {
|
||||
@@ -88,11 +90,19 @@ export function KriEditorSms({
|
||||
<div className="mb-3 flex items-center justify-between px-2">
|
||||
<span className="text-xs font-medium text-gray-600">{byteSize}/{maxBytes}byte</span>
|
||||
<span className={cn('rounded-md px-3 py-1 text-xs font-bold text-white', messageType === 'LMS' ? 'bg-blue-500' : 'bg-red-500')}>
|
||||
{messageType}
|
||||
{messageType === 'LMS' ? 'LMS/MMS' : 'SMS'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col overflow-hidden rounded-2xl bg-white shadow-sm">
|
||||
<div className={cn('flex flex-1 flex-col rounded-2xl bg-white shadow-sm', smsImages.length > 0 ? 'overflow-y-auto' : 'overflow-hidden')}>
|
||||
{smsTitle ? <div className="px-4 pt-3 pb-2 text-sm font-bold text-gray-800">{smsTitle}</div> : null}
|
||||
{smsImages.length > 0 ? (
|
||||
<div className="flex shrink-0 flex-col gap-2 px-4 pt-3">
|
||||
{smsImages.map((image) => (
|
||||
// eslint-disable-next-line @next/next/no-img-element -- data/Object URL 미리보기라 next/image 최적화 대상이 아님
|
||||
<img key={image.fileName} src={image.src} alt={image.fileName} title={image.fileName} className="w-full rounded-md object-contain" />
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
<textarea
|
||||
ref={textareaRef}
|
||||
className="w-full flex-1 resize-none bg-transparent p-4 text-sm leading-relaxed text-gray-700 outline-none"
|
||||
@@ -105,7 +115,7 @@ export function KriEditorSms({
|
||||
onBlur={() => flushChange(latestTextRef.current)}
|
||||
placeholder={placeholder}
|
||||
readOnly={isSmsReadOnly}
|
||||
style={{ minHeight: smsTitle ? '320px' : '360px' }}
|
||||
style={{ minHeight: smsImages.length > 0 ? '160px' : smsTitle ? '320px' : '360px' }}
|
||||
{...textareaInsert.bindSelectionHandlers}
|
||||
/>
|
||||
{smsPreviewSuffix ? (
|
||||
|
||||
@@ -50,6 +50,11 @@ export type KriEditorFontFamilyOption = {
|
||||
value: string
|
||||
}
|
||||
|
||||
export type KriEditorSmsImage = {
|
||||
fileName: string
|
||||
src: string
|
||||
}
|
||||
|
||||
export type KriEditorProps = {
|
||||
onEditorReady?: (editor: Editor | HTMLTextAreaElement | null) => void
|
||||
onCommandReady?: (command: KriEditorCommand | null) => void
|
||||
@@ -80,6 +85,10 @@ export type KriEditorProps = {
|
||||
smsMaxBytes?: number
|
||||
lmsMaxBytes?: number
|
||||
smsPreviewSuffix?: string
|
||||
/** 첨부파일이 있으면 길이·제목과 무관하게 LMS/MMS로 판정한다. */
|
||||
smsHasAttachment?: boolean
|
||||
/** 문자 미리보기의 제목과 본문 사이에 표시할 첨부 이미지 */
|
||||
smsImages?: KriEditorSmsImage[]
|
||||
toolbar?: KriEditorToolbarConfig | false
|
||||
fontFamilyOptions?: KriEditorFontFamilyOption[]
|
||||
renderToolbarEnd?: (context: KriEditorToolbarContext) => ReactNode
|
||||
|
||||
@@ -13,9 +13,13 @@ import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
||||
import {Label} from "@/components/ui/label";
|
||||
import {KriSingleSelect} from "@/components/common/KriAutoComplete";
|
||||
import {
|
||||
EMAIL_TEMPLATE_ATTACHMENT_MAX_BYTES,
|
||||
EMAIL_TEMPLATE_ATTACHMENT_MAX_COUNT,
|
||||
PHONE_VERIFICATION_PREVIEW_SUFFIX,
|
||||
TEMPLATE_ATTACHMENT_MAX_BYTES,
|
||||
TEMPLATE_ATTACHMENT_MAX_COUNT,
|
||||
SMS_TEMPLATE_ATTACHMENT_EXTENSION,
|
||||
SMS_TEMPLATE_ATTACHMENT_MAX_BYTES,
|
||||
SMS_TEMPLATE_ATTACHMENT_MAX_COUNT,
|
||||
SMS_TEMPLATE_ATTACHMENT_MIME_TYPE,
|
||||
TEMPLATE_PURPOSE,
|
||||
TEMPLATE_PURPOSE_OPTIONS,
|
||||
} from "@/const/messageTemplateConst";
|
||||
@@ -32,7 +36,9 @@ import type { DataVerification } from "@kri/common";
|
||||
import {COMMON_TEXT_REGEX} from "@/const/validationConst";
|
||||
import {formatKoreanPhoneNumber} from "@/utils/phone";
|
||||
import type {
|
||||
TemplateAttachmentImage,
|
||||
TemplateEmailWithAttachments,
|
||||
TemplateSmsWithAttachments,
|
||||
TemplateSummaryWithPurpose,
|
||||
TemplateWithPurpose,
|
||||
} from "@/types/message";
|
||||
@@ -44,6 +50,7 @@ import {
|
||||
useUpdateMainTemplateMutation,
|
||||
useUploadTemplateBodyImageMutation,
|
||||
useDownloadTemplateAttachmentMutation,
|
||||
useTemplateAttachmentImagesQuery,
|
||||
} from "@/query/message";
|
||||
import {listHeader} from "@/types/list";
|
||||
import {useListHeaderQuery} from "@/query/list";
|
||||
@@ -71,6 +78,12 @@ interface MessageTemplateProps {
|
||||
|
||||
const MESSAGE_EDITOR_EXTENSIONS = [QrCode];
|
||||
|
||||
// 서버는 첨부 파일명 중복을 대소문자 구분 없이 판단한다.
|
||||
const isSameFileName = (a: string, b: string) => a.toLowerCase() === b.toLowerCase();
|
||||
|
||||
const isJpgFile = (file: File) =>
|
||||
file.name.toLowerCase().endsWith(SMS_TEMPLATE_ATTACHMENT_EXTENSION) && file.type === SMS_TEMPLATE_ATTACHMENT_MIME_TYPE;
|
||||
|
||||
const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) => {
|
||||
const { selectedProject } = useSelectedProject();
|
||||
|
||||
@@ -90,6 +103,8 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
|
||||
const isSms = isSmsTemplate(defaultTemplate);
|
||||
const chnnlTy: ChannelType = isSms ? ChannelType.SMS : ChannelType.EMAIL;
|
||||
const attachmentMaxCount = isSms ? SMS_TEMPLATE_ATTACHMENT_MAX_COUNT : EMAIL_TEMPLATE_ATTACHMENT_MAX_COUNT;
|
||||
const attachmentMaxBytes = isSms ? SMS_TEMPLATE_ATTACHMENT_MAX_BYTES : EMAIL_TEMPLATE_ATTACHMENT_MAX_BYTES;
|
||||
|
||||
// 유니온의 키를 합집합으로 뽑기
|
||||
type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
||||
@@ -113,13 +128,16 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
const listHderList = useMemo<listHeader[]>(() => listHeaderQuery.data ?? [], [listHeaderQuery.data])
|
||||
const surveys = useMemo<ProjectSurvey[]>(() => projectInfoQuery.data?.surveys ?? [], [projectInfoQuery.data?.surveys])
|
||||
|
||||
// 서버에 저장된 첨부파일명 목록 (파이프(|) 구분, 이메일 템플릿만 해당)
|
||||
// 서버에 저장된 첨부파일명 목록 (파이프(|) 구분, 이메일·문자 템플릿 공통)
|
||||
const existingAttachmentNames = useMemo<string[]>(() => {
|
||||
if (isSmsTemplate(selectedTemplate)) return [];
|
||||
const atchFl = (selectedTemplate as TemplateEmailWithAttachments).atchFl;
|
||||
const atchFl = (selectedTemplate as TemplateEmailWithAttachments | TemplateSmsWithAttachments).atchFl;
|
||||
return atchFl ? atchFl.split("|").filter(Boolean) : [];
|
||||
}, [selectedTemplate]);
|
||||
|
||||
// 교체 대상(같은 이름의 새 파일)도 삭제 예정에 들어가 있으므로 여기서 제외된다.
|
||||
const keptAttachmentNames = existingAttachmentNames.filter((name) => !deletedAttachmentNames.includes(name));
|
||||
const attachmentCount = keptAttachmentNames.length + newAttachmentFiles.length;
|
||||
|
||||
const resetAttachmentDraft = () => {
|
||||
setNewAttachmentFiles([]);
|
||||
setDeletedAttachmentNames([]);
|
||||
@@ -131,6 +149,21 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
const updateMainTemplateMutation = useUpdateMainTemplateMutation(prjctIdx, chnnlTy);
|
||||
const uploadBodyImageMutation = useUploadTemplateBodyImageMutation(itrntPrjctCd);
|
||||
|
||||
// 문자 미리보기 첨부 이미지: 유지되는 기존 첨부는 서버에서, 새 파일은 로컬 Object URL로 표시한다.
|
||||
const keptAttachmentImages = useTemplateAttachmentImagesQuery(
|
||||
selectedTemplate.tmplatIdx ?? 0,
|
||||
isSms ? keptAttachmentNames : [],
|
||||
enabled,
|
||||
);
|
||||
const [newAttachmentImages, setNewAttachmentImages] = useState<TemplateAttachmentImage[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSms) return;
|
||||
const images = newAttachmentFiles.map((file) => ({ fileName: file.name, src: URL.createObjectURL(file) }));
|
||||
setNewAttachmentImages(images);
|
||||
return () => images.forEach((image) => URL.revokeObjectURL(image.src));
|
||||
}, [isSms, newAttachmentFiles]);
|
||||
|
||||
// 대표 템플릿 체크 상태(사용자 의도)
|
||||
const [mainDesired, setMainDesired] = useState(false);
|
||||
|
||||
@@ -308,34 +341,40 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
const nextDeleted = [...deletedAttachmentNames];
|
||||
|
||||
for (const file of picked) {
|
||||
if (isSms && !isJpgFile(file)) {
|
||||
alert(`${file.name}: JPG(.jpg) 파일만 첨부할 수 있습니다.`);
|
||||
continue;
|
||||
}
|
||||
if (file.size === 0) {
|
||||
alert(`${file.name}: 빈 파일은 첨부할 수 없습니다.`);
|
||||
continue;
|
||||
}
|
||||
if (file.size >= TEMPLATE_ATTACHMENT_MAX_BYTES) {
|
||||
const alertFileSize = TEMPLATE_ATTACHMENT_MAX_BYTES / 1_000_000;
|
||||
alert(`${file.name}: 파일 크기는 ${alertFileSize.toLocaleString()}MB 미만이어야 합니다.`);
|
||||
if (file.size > attachmentMaxBytes) {
|
||||
const sizeLimitText = isSms
|
||||
? `${(SMS_TEMPLATE_ATTACHMENT_MAX_BYTES / 1024).toLocaleString()}KB 이하`
|
||||
: `${(EMAIL_TEMPLATE_ATTACHMENT_MAX_BYTES / 1_000_000).toLocaleString()}MB 미만`;
|
||||
alert(`${file.name}: 파일 크기는 ${sizeLimitText}여야 합니다.`);
|
||||
continue;
|
||||
}
|
||||
if (nextFiles.some((f) => f.name === file.name)) {
|
||||
if (nextFiles.some((f) => isSameFileName(f.name, file.name))) {
|
||||
alert(`${file.name}: 이미 추가된 파일명입니다.`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 기존 첨부와 같은 이름이면 "교체"로 처리 (deleteFileNames에도 같은 이름을 포함해야 함)
|
||||
const isReplacingExisting = existingAttachmentNames.includes(file.name) && !nextDeleted.includes(file.name);
|
||||
// 기존 첨부와 같은 이름(대소문자 무시)이면 "교체"로 처리 (deleteFileNames에 기존 파일명을 포함해야 함)
|
||||
const replacedExistingName = existingAttachmentNames.find((name) => isSameFileName(name, file.name));
|
||||
const isReplacingExisting = !!replacedExistingName && !nextDeleted.includes(replacedExistingName);
|
||||
|
||||
const finalNames = new Set([
|
||||
...existingAttachmentNames.filter((name) => !nextDeleted.includes(name) && name !== file.name),
|
||||
...nextFiles.map((f) => f.name),
|
||||
file.name,
|
||||
]);
|
||||
if (finalNames.size > TEMPLATE_ATTACHMENT_MAX_COUNT) {
|
||||
alert(`첨부파일은 최대 ${TEMPLATE_ATTACHMENT_MAX_COUNT}개까지 가능합니다.`);
|
||||
const finalCount =
|
||||
existingAttachmentNames.filter((name) => !nextDeleted.includes(name) && name !== replacedExistingName).length
|
||||
+ nextFiles.length
|
||||
+ 1;
|
||||
if (finalCount > attachmentMaxCount) {
|
||||
alert(`첨부파일은 최대 ${attachmentMaxCount}개까지 가능합니다.`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isReplacingExisting) nextDeleted.push(file.name);
|
||||
if (isReplacingExisting) nextDeleted.push(replacedExistingName);
|
||||
nextFiles.push(file);
|
||||
}
|
||||
|
||||
@@ -346,8 +385,9 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
const handleRemoveNewAttachmentFile = (fileName: string) => {
|
||||
setNewAttachmentFiles((prev) => prev.filter((f) => f.name !== fileName));
|
||||
// 교체 목적으로 같은 이름을 삭제 예정에 넣었던 것이라면, 새 파일을 취소했으니 삭제 예정도 취소한다.
|
||||
if (existingAttachmentNames.includes(fileName)) {
|
||||
setDeletedAttachmentNames((prev) => prev.filter((name) => name !== fileName));
|
||||
const replacedExistingName = existingAttachmentNames.find((name) => isSameFileName(name, fileName));
|
||||
if (replacedExistingName) {
|
||||
setDeletedAttachmentNames((prev) => prev.filter((name) => name !== replacedExistingName));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -530,7 +570,7 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
/>
|
||||
{isSmsTemplate(selectedTemplate) &&
|
||||
<p className="text-sm text-red-600 font-medium">
|
||||
⚠️ 제목이 있으면 본문 길이와 상관없이 LMS로 발송 됩니다.
|
||||
⚠️ 제목이 있으면 본문 길이와 상관없이 LMS/MMS로 발송 됩니다.
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
@@ -619,12 +659,13 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
⚠️ <map>, <area> 가 사용된 경우 해당 영역이 반투명하게 보여집니다.
|
||||
</p>
|
||||
)}
|
||||
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="text-base">
|
||||
첨부파일 ({existingAttachmentNames.filter((name) => !deletedAttachmentNames.includes(name)).length + newAttachmentFiles.length}/{TEMPLATE_ATTACHMENT_MAX_COUNT})
|
||||
{isSms ? "이미지 첨부" : "첨부파일"} ({attachmentCount}/{attachmentMaxCount})
|
||||
</Label>
|
||||
<Button type="button" variant="outline" size="sm" className="gap-2" onClick={handlePickAttachmentFiles}>
|
||||
<Paperclip className="h-4 w-4" />
|
||||
@@ -636,6 +677,7 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
ref={attachmentInputRef}
|
||||
type="file"
|
||||
multiple
|
||||
accept={isSms ? `${SMS_TEMPLATE_ATTACHMENT_EXTENSION},${SMS_TEMPLATE_ATTACHMENT_MIME_TYPE}` : undefined}
|
||||
className="hidden"
|
||||
onChange={handleAttachmentFilesSelected}
|
||||
/>
|
||||
@@ -644,7 +686,7 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
<ul className="space-y-1 rounded-md border p-2">
|
||||
{existingAttachmentNames.map((name) => {
|
||||
const markedForDelete = deletedAttachmentNames.includes(name);
|
||||
const isReplaced = newAttachmentFiles.some((f) => f.name === name);
|
||||
const isReplaced = newAttachmentFiles.some((f) => isSameFileName(f.name, name));
|
||||
return (
|
||||
<li key={`existing-${name}`} className="flex items-center justify-between gap-2 text-sm">
|
||||
<Button
|
||||
@@ -696,17 +738,26 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
</ul>
|
||||
)}
|
||||
|
||||
<p className="text-xs text-muted-foreground">
|
||||
파일당 {(TEMPLATE_ATTACHMENT_MAX_BYTES / 1000).toLocaleString()}KB 미만, 최대 {TEMPLATE_ATTACHMENT_MAX_COUNT}개까지 첨부할 수 있습니다.
|
||||
</p>
|
||||
{isSms ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
JPG(.jpg) 파일만, 파일당 {(SMS_TEMPLATE_ATTACHMENT_MAX_BYTES / 1024).toLocaleString()}KB 이하, 최대 {SMS_TEMPLATE_ATTACHMENT_MAX_COUNT}개까지 첨부할 수 있습니다.
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
파일당 {(EMAIL_TEMPLATE_ATTACHMENT_MAX_BYTES / 1000).toLocaleString()}KB 미만, 최대 {EMAIL_TEMPLATE_ATTACHMENT_MAX_COUNT}개까지 첨부할 수 있습니다.
|
||||
</p>
|
||||
)}
|
||||
{isSms && attachmentCount > 0 && (
|
||||
<p className="text-xs text-red-600">
|
||||
⚠️ 이미지가 첨부되면 본문 길이와 상관없이 LMS/MMS로 저장됩니다.
|
||||
</p>
|
||||
)}
|
||||
{selectedTemplate.tmplatIdx && (
|
||||
<p className="text-xs text-red-600">
|
||||
⚠️ 복사 후 저장시 첨부파일은 복사 되지 않습니다.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isSms && (
|
||||
@@ -716,7 +767,7 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
</p>
|
||||
<KriEditor
|
||||
mode="sms"
|
||||
label={selectedTemplate.tmplatTy === MessageType.SMS ? "️️* 발송 시 길이에 따라 LMS로 발송 될 수 있음" : undefined}
|
||||
label={selectedTemplate.tmplatTy === MessageType.SMS ? "️️* 발송 시 길이에 따라 LMS/MMS로 발송 될 수 있음" : undefined}
|
||||
value={(selectedTemplate as TemplateSms).tmplatBody ?? ""}
|
||||
onChange={(html: string) => setTemplateBody(html)}
|
||||
placeholder="문자 내용을 입력해 주세요"
|
||||
@@ -732,6 +783,8 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
: undefined
|
||||
}
|
||||
changeSmsType={(smsTypeString) => setSmsType(smsTypeString)}
|
||||
smsHasAttachment={attachmentCount > 0}
|
||||
smsImages={[...keptAttachmentImages, ...newAttachmentImages]}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user