diff --git a/src/app/(pages)/(main)/list/contact/page.tsx b/src/app/(pages)/(main)/list/contact/page.tsx index 7187f95..f734027 100644 --- a/src/app/(pages)/(main)/list/contact/page.tsx +++ b/src/app/(pages)/(main)/list/contact/page.tsx @@ -159,6 +159,11 @@ const ListContactPageContent = () => { setFormValues((prev) => ({ ...prev, [listHderId]: value })); }; + const handleCancelEdit = () => { + setFormValues(initialFormValues); + setIsEditing(false); + }; + const handleToggleEdit = async () => { if (!isEditing) { setIsEditing(true); @@ -205,6 +210,11 @@ const ListContactPageContent = () => { 예약리스트 조회 + {isEditing ? ( + + ) : null} diff --git a/src/app/(pages)/(main)/list/manage/page.tsx b/src/app/(pages)/(main)/list/manage/page.tsx index 7035280..0bd2ffa 100644 --- a/src/app/(pages)/(main)/list/manage/page.tsx +++ b/src/app/(pages)/(main)/list/manage/page.tsx @@ -285,6 +285,7 @@ const ListManagePage = () => { surveys={surveyArray} listHeaders={headerManageRows} enableBatchEdit={canManageList} + selectMode={canManageList ? 'multi' : 'click-event'} refreshKey={listRefreshKey} onCurrentFilterChange={setCurrentListFilter} onFilterSummaryChange={setFilterSummary} diff --git a/src/components/dialog/SingleMessageSendDialog.tsx b/src/components/dialog/SingleMessageSendDialog.tsx index 55664c5..a4909e8 100644 --- a/src/components/dialog/SingleMessageSendDialog.tsx +++ b/src/components/dialog/SingleMessageSendDialog.tsx @@ -18,6 +18,7 @@ import { ChannelType, type TemplateSms, type TemplateSummary } from '@kri/common import { sanitizeHtmlForPreview } from '@/components/kri-editor/utils/sanitizeHtml' import { KriEditor } from '@/components/kri-editor' import { getNearestFutureDateTime } from '@/lib/datetime' +import { escapeHtml, substituteVariables } from '@/lib/variableSubstitution' import type { DialogId } from '@/store/jotai/dialog' import type { MessageSendChannel, TemplateEmailWithAttachments } from '@/types/message' import TemplateAttachmentList from '@/components/message-template/TemplateAttachmentList' @@ -36,6 +37,7 @@ export type SingleMessageSendDialogProps = { itrntPrjctCd: string sid: string destHeaderId: number + variableValues?: Record onSent?: () => void } @@ -48,6 +50,7 @@ const SingleMessageSendDialog = ({ itrntPrjctCd, sid, destHeaderId, + variableValues, onSent, }: SingleMessageSendDialogProps) => { const { isDialogOpen, showDialog, hideDialog } = useDialog() @@ -68,6 +71,9 @@ const SingleMessageSendDialog = ({ const mainTemplateQuery = useMainTemplateIdxQuery(prjctIdx, chnnlTy, enabled) const mainTemplateIdx = mainTemplateQuery.data ?? null + const previewValues = variableValues ?? {} + const resolvedTitle = selectedTemplate ? substituteVariables(selectedTemplate.tmplatTitle ?? '', previewValues) : '' + const sendSingleMutation = useSendSingleMessageMutation(channel, prjctIdx) const mainTemplateAppliedRef = useRef(false) @@ -199,26 +205,33 @@ const SingleMessageSendDialog = ({ {selectedTemplate && ( <> {chnnlTy !== ChannelType.SMS && ( -
{`제목: ${selectedTemplate.tmplatTitle}` || '(제목 없음)'}
+
{resolvedTitle ? `제목: ${resolvedTitle}` : '(제목 없음)'}
)} {chnnlTy === ChannelType.SMS ? (
{}} isSmsReadOnly placeholder="문자 내용을 입력해 주세요" className="max-w-80 mx-0" debounceMs={600} - smsTitle={(selectedTemplate as TemplateSms).tmplatTitle} + smsTitle={resolvedTitle} />
) : ( <>
[key, escapeHtml(val)])), + ), + ), + }} /> - value.replace( - /[&<>"']/g, - (character) => - ({ - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - })[character] ?? character, - ) - const RefreshIconButton = ({ onRefresh, isFetching }: { onRefresh: () => void; isFetching: boolean }) => (