From a7af49754299ab55f9255dd5eb0e71e1cdc7e144 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Thu, 23 Jul 2026 16:03:33 +0900 Subject: [PATCH] =?UTF-8?q?260723=5F01=5FENH:=20=EC=84=A4=EB=AC=B8=20URL?= =?UTF-8?q?=20=EC=B9=98=ED=99=98=EC=8B=9C=20=EB=AA=A8=EB=93=A0=20=ED=97=A4?= =?UTF-8?q?=EB=8D=94=20=EC=A0=95=EB=B3=B4=EC=97=90=20=EB=8C=80=ED=95=B4?= =?UTF-8?q?=EC=84=9C=20=EC=B9=98=ED=99=98=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/.gitignore | 8 -- .idea/IntelliLang.xml | 87 ------------------- .idea/claudeCodeEditorTabs.xml | 21 ----- .idea/codeStyles/codeStyleConfig.xml | 5 -- .idea/dictionaries/project.xml | 8 -- .idea/git_toolbox_prj.xml | 15 ---- .idea/inspectionProfiles/Project_Default.xml | 9 -- .idea/material_theme_project_new.xml | 12 --- .idea/misc.xml | 5 -- .idea/modules.xml | 8 -- .idea/vcs.xml | 6 -- .../list-contact/ListContactInfoPanel.tsx | 32 +++++-- src/components/list/ListSearchTable.tsx | 6 +- src/lib/surveyUrl.ts | 6 +- src/utils/listAccess.ts | 7 +- 16 files changed, 36 insertions(+), 200 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/IntelliLang.xml delete mode 100644 .idea/claudeCodeEditorTabs.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/dictionaries/project.xml delete mode 100644 .idea/git_toolbox_prj.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/material_theme_project_new.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index e03c9fb..ad799c2 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ # misc .DS_Store *.pem +/.idea/ # debug npm-debug.log* diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index c3f502a..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# 디폴트 무시된 파일 -/shelf/ -/workspace.xml -# 에디터 기반 HTTP 클라이언트 요청 -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/IntelliLang.xml b/.idea/IntelliLang.xml deleted file mode 100644 index 993cf38..0000000 --- a/.idea/IntelliLang.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Spring @Cacheable and @CacheEvict - - - - - - - - - - - - Spring HttpHeaders (org.springframework.http) - - - - - - - Spring Integration/Messaging - - - - - - - Spring JDBC (org.springframework.jdbc.core.JdbcOperations) - - - - - - - - - - - - - - - - Spring JDBC (org.springframework.jdbc.core.PreparedStatementCreatorFactory) - - - - - - - Spring JDBC (org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator) - - - - - - - - Spring Security @PostAuthorize/@PostFilter/@PreAuthorize/@PreFilter/@AuthenticationPrincipal - - - - - - - - - - Spring State Machine - - - - - - - - SpEL for Spring Cache - - - - - - - \ No newline at end of file diff --git a/.idea/claudeCodeEditorTabs.xml b/.idea/claudeCodeEditorTabs.xml deleted file mode 100644 index 58da843..0000000 --- a/.idea/claudeCodeEditorTabs.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml deleted file mode 100644 index 57f93e8..0000000 --- a/.idea/dictionaries/project.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Hder - prjct - - - \ No newline at end of file diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml deleted file mode 100644 index 02b915b..0000000 --- a/.idea/git_toolbox_prj.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 3e84b06..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml deleted file mode 100644 index 609166c..0000000 --- a/.idea/material_theme_project_new.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 6e86672..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 930d15c..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/components/list-contact/ListContactInfoPanel.tsx b/src/components/list-contact/ListContactInfoPanel.tsx index e2c753b..b450c99 100644 --- a/src/components/list-contact/ListContactInfoPanel.tsx +++ b/src/components/list-contact/ListContactInfoPanel.tsx @@ -9,11 +9,12 @@ import { KriSingleSelect } from '@/components/common/KriAutoComplete' import { useDialog } from '@/hooks/useDialog' import { useDownloadListItemFileByHeaderMutation, useUploadListItemFileMutation } from '@/query/list' import { ListHeaderConst } from '@/const/listConst' +import { LIST_IS_USE_LABEL } from '@/components/table-column/ListTableColumn' import type { listHeader, ListSearchWithFullResult } from '@/types/list' import type { MessageSendChannel } from '@/types/message' import { type ProjectSurvey, type ResultCode, ResultCodeType } from '@/types/project' import { formatKst } from '@kri/common' -import { isListFieldEditableForContact, isListFieldVisibleForContact } from '@/utils/listAccess' +import { isAssignHeaderType, isListFieldEditableForContact, isListFieldVisibleForContact } from '@/utils/listAccess' import { substituteSurveyUrl } from '@/lib/surveyUrl' import { formatKoreanPhoneNumber } from '@/utils/phone' import SurveyQrDialog from '@/components/dialog/SurveyQrDialog' @@ -41,17 +42,24 @@ export type ListContactInfoPanelProps = { onSaved?: () => void } +const resolveHeaderValue = (header: listHeader, detail?: ListSearchWithFullResult): string => { + if (header.listHderTy === ListHeaderConst.MEMO) return detail?.memo ?? '' + if (header.listHderTy === ListHeaderConst.IS_USE) { + return detail?.use != null ? (LIST_IS_USE_LABEL[detail.use] ?? '') : '' + } + if (isAssignHeaderType(header.listHderTy)) { + return detail?.assignList?.[header.listHderTy] ?? '' + } + return detail?.itemList?.[header.listHderId] ?? '' +} + export const buildInitialValues = (listHeaders: listHeader[], detail?: ListSearchWithFullResult) => { const values: Record = {} for (const header of listHeaders) { if (header.listHderTy === ListHeaderConst.SID) continue if (!isListFieldVisibleForContact(header)) continue - if (header.listHderTy === ListHeaderConst.MEMO) { - values[header.listHderId] = detail?.memo ?? '' - continue - } - values[header.listHderId] = detail?.itemList?.[header.listHderId] ?? '' + values[header.listHderId] = resolveHeaderValue(header, detail) } return values @@ -115,14 +123,22 @@ const ListContactInfoPanel = ({ const surveyResultByIdx = new Map((detail?.surveyResults ?? []).map((result) => [result.prjctSurveyIdx, result])) + // 설문 URL 치환은 화면 노출(면접원 노출) 여부와 무관하게 전체 헤더 값을 대상으로 한다. + const surveyUrlValues: Record = {} + for (const header of listHeaders) { + if (header.listHderTy === ListHeaderConst.SID) continue + surveyUrlValues[header.listHderNm] = resolveHeaderValue(header, detail) + } + surveyUrlValues.SID = sid // 예약 토큰: 헤더명이 'SID'인 커스텀 헤더가 있어도 항상 실제 sid로 치환한다. + const handleStartSurvey = (survey: ProjectSurvey) => { if (!survey.surveyUrl) return - window.open(substituteSurveyUrl(survey.surveyUrl, sid), '_blank', 'noopener,noreferrer') + window.open(substituteSurveyUrl(survey.surveyUrl, surveyUrlValues), '_blank', 'noopener,noreferrer') } const handleShowQr = (survey: ProjectSurvey) => { if (!survey.surveyUrl) return - setQrTargetUrl(substituteSurveyUrl(survey.surveyUrl, sid)) + setQrTargetUrl(substituteSurveyUrl(survey.surveyUrl, surveyUrlValues)) showDialog('surveyQrDialog') } diff --git a/src/components/list/ListSearchTable.tsx b/src/components/list/ListSearchTable.tsx index bc251ba..3a7f822 100644 --- a/src/components/list/ListSearchTable.tsx +++ b/src/components/list/ListSearchTable.tsx @@ -36,6 +36,7 @@ import { type ProjectSurvey, type ResultCode, ResultCodeType } from '@/types/pro import { applyListAccessFilter, getLockedListFilterHeaderTypes, + isAssignHeaderType, isListFilterVisibleByAccess, isListHeaderVisibleByAccess, } from '@/utils/listAccess' @@ -127,11 +128,6 @@ const toFilterCondition = (row: FilterRow, usesListValue: boolean): Omit - value === ListHeaderAssignConst.OUTSOURCE || - value === ListHeaderAssignConst.CONTACT_INTERVIEWER || - value === ListHeaderAssignConst.FIELD_INTERVIEWER - const TEXT_LIKE_OPERATORS: FilterOperator[] = ['eq', 'neq', 'contains', 'notContains', 'empty', 'notEmpty'] const ASSIGN_LIKE_OPERATORS: FilterOperator[] = ['eq', 'neq', 'empty', 'notEmpty'] const IS_USE_OPERATORS: FilterOperator[] = ['eq', 'neq'] diff --git a/src/lib/surveyUrl.ts b/src/lib/surveyUrl.ts index 5e5fe07..f92f379 100644 --- a/src/lib/surveyUrl.ts +++ b/src/lib/surveyUrl.ts @@ -1,3 +1,5 @@ -// project.surveyUrl에 들어있는 [$SID] 치환 토큰을 실제 sid로 바꾼다. +// project.surveyUrl에 들어있는 [$SID], [$헤더명] 치환 토큰을 values에 있는 값으로 바꾼다. +// 값이 없는 토큰은 빈 문자열로 치환한다(URL에 인코딩되지 않은 대괄호가 남지 않도록). // 참고: src/app/(pages)/(main)/project/info/page.tsx의 sidParam = 'sid=[$SID]'와 동일한 토큰. -export const substituteSurveyUrl = (surveyUrl: string, sid: string) => surveyUrl.replaceAll("[$SID]", sid); +export const substituteSurveyUrl = (surveyUrl: string, values: Record) => + surveyUrl.replace(/\[\$([^\]]+)\]/g, (_, key: string) => values[key] ?? ""); diff --git a/src/utils/listAccess.ts b/src/utils/listAccess.ts index 9850ea2..20bb8f0 100644 --- a/src/utils/listAccess.ts +++ b/src/utils/listAccess.ts @@ -1,8 +1,13 @@ import { ListHeaderAssignConst, ListHeaderConst } from "@/const/listConst"; import { CONTACT_INTERVIEWER_ROLE, FIELD_INTERVIEWER_ROLE } from "@/const/userConst"; -import { ListIsUse, type ListFilter, type listHeader } from "@/types/list"; +import { ListIsUse, type ListFilter, type listHeader, type ListHeaderAssignType } from "@/types/list"; import {isExternalManager, isFieldWorkUser, isInternalManager, isManager} from "@/utils/userRole"; +export const isAssignHeaderType = (value: number): value is ListHeaderAssignType => + value === ListHeaderAssignConst.OUTSOURCE || + value === ListHeaderAssignConst.CONTACT_INTERVIEWER || + value === ListHeaderAssignConst.FIELD_INTERVIEWER; + type ListAccessUser = { userRole?: number | null; userId?: string | null; -- 2.49.0.windows.1