From 9b93d45ed0107ce9a9d552f6602d117ed7f38904 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 10 Aug 2026 11:57:44 +0900 Subject: [PATCH] =?UTF-8?q?260810=5F04=5FENH:=20=EC=BB=A8=ED=83=9D=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20ui=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B0=9C=EB=B3=84=20=EB=B0=9C=EC=86=A1=EC=8B=9C=20=EB=AF=B8?= =?UTF-8?q?=EB=A6=AC=EB=B3=B4=EA=B8=B0=EC=97=90=20=EC=B9=98=ED=99=98=20?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=20=EC=B9=98=ED=99=98=20=EB=8F=BC?= =?UTF-8?q?=EC=84=9C=20=EB=B3=B4=EC=97=AC=EC=A7=80=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(pages)/(main)/list/contact/page.tsx | 10 +++++++ src/app/(pages)/(main)/list/manage/page.tsx | 1 + .../dialog/SingleMessageSendDialog.tsx | 21 ++++++++++--- .../list-contact/ListContactEventPanel.tsx | 17 ++--------- .../list-contact/ListContactInfoPanel.tsx | 30 ++++++++++++------- .../list-contact/ListUpdateHistoryPanel.tsx | 2 +- .../{surveyUrl.ts => variableSubstitution.ts} | 13 ++++++++ 7 files changed, 64 insertions(+), 30 deletions(-) rename src/lib/{surveyUrl.ts => variableSubstitution.ts} (56%) 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 }) => (