From c5e2a3a6dbbaf137cfb9ed202321668b7c9f3549 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 21 Sep 2026 14:04:37 +0900 Subject: [PATCH] =?UTF-8?q?260921=5F03=5FENH:=20survey=20short=20url=20?= =?UTF-8?q?=EC=93=B8=EB=AA=A8=EA=B0=80=20=EC=97=86=EC=96=B4=EC=84=9C=20?= =?UTF-8?q?=ED=8F=90=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(pages)/(main)/project/info/page.tsx | 78 ++++++++++++------- .../message-template/QrCodeToolbar.tsx | 1 - src/types/project.ts | 1 - 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/src/app/(pages)/(main)/project/info/page.tsx b/src/app/(pages)/(main)/project/info/page.tsx index 3df368c..a28ffd2 100644 --- a/src/app/(pages)/(main)/project/info/page.tsx +++ b/src/app/(pages)/(main)/project/info/page.tsx @@ -13,7 +13,7 @@ import {useDialog} from '@/hooks/useDialog' import ResultCodeDialog from '@/components/dialog/ResultCodeDialog' import { useDebouncedValue, useMounted } from "@kri/common/hooks"; import { LoadingOverlayAdapter } from '@/components/app-shell/LoadingOverlayAdapter' -import { X } from 'lucide-react' +import { X, Copy, Check } from 'lucide-react' import { ProjectInfo, ProjectSurvey, ProjectUpdateRequest, ResultCode, ProjectStatus, ResultCodeType, SurveyType @@ -123,7 +123,6 @@ const createSurveyDraft = (surveyOrder: number): SurveyDraft => ({ surveyPrjctCd: '', surveyUrl: '', surveyFullUrl: null, - surveyShortUrl: null, surveyDashboardUrl: '', }) @@ -168,7 +167,6 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg surveyPrjctCd: '', surveyUrl: '', surveyFullUrl: null, - surveyShortUrl: null, surveyDashboardUrl: '', }) } @@ -178,7 +176,6 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg surveyPrjctCd: value, surveyUrl: buildKonKiwiSurveyUrl(survey.surveyTy), surveyFullUrl: null, - surveyShortUrl: null, }) } @@ -198,10 +195,22 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg onChange(survey.uiKey, { surveyUrl: `${konKiwiPlaceholderPrefix}?${query}`, surveyFullUrl: null, - surveyShortUrl: null, }) } + const [urlCopied, setUrlCopied] = useState(false) + const handleCopyUrl = async () => { + const url = survey.surveyUrl?.trim() ?? '' + if (!url) return + try { + await navigator.clipboard.writeText(url) + setUrlCopied(true) + setTimeout(() => setUrlCopied(false), 1500) + } catch { + // 클립보드 접근 실패 시 무시 + } + } + return (
@@ -268,34 +277,45 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
- {isKonKiwi ? ( -
- - {konKiwiDisplayPrefix}? - +
+ {isKonKiwi ? ( +
+ + {konKiwiDisplayPrefix}? + + handleKonKiwiQueryChange(e.target.value)} + placeholder="sid=[$SID]" + className="h-9 rounded-l-none" + aria-invalid={invalidField === 'surveyUrl'} + /> +
+ ) : ( handleKonKiwiQueryChange(e.target.value)} - placeholder="sid=[$SID]" - className="h-9 rounded-l-none" + value={survey.surveyUrl || ''} + onChange={(e) => onChange(survey.uiKey, { + surveyUrl: e.target.value, + surveyFullUrl: null, + })} + placeholder="https://" + className="h-9 flex-1" aria-invalid={invalidField === 'surveyUrl'} /> -
- ) : ( - onChange(survey.uiKey, { - surveyUrl: e.target.value, - surveyFullUrl: null, - surveyShortUrl: null, - })} - placeholder="https://" - className="h-9" - aria-invalid={invalidField === 'surveyUrl'} - /> - )} + )} + +
{survey.surveyTy === SurveyType.EXTERNAL && ( diff --git a/src/components/message-template/QrCodeToolbar.tsx b/src/components/message-template/QrCodeToolbar.tsx index 8a82f6f..013e1d0 100644 --- a/src/components/message-template/QrCodeToolbar.tsx +++ b/src/components/message-template/QrCodeToolbar.tsx @@ -41,7 +41,6 @@ export const QrCodeToolbar = ({ editor, surveys }: QrCodeToolbarProps) => { .map((survey, index) => { const value = survey.surveyUrl?.trim() || - survey.surveyShortUrl?.trim() || survey.surveyFullUrl?.trim() || '' diff --git a/src/types/project.ts b/src/types/project.ts index c3b7a55..769079c 100644 --- a/src/types/project.ts +++ b/src/types/project.ts @@ -35,7 +35,6 @@ export type ProjectSurvey = { surveyPrjctCd?: string | null; surveyUrl?: string | null; surveyFullUrl?: string | null; - surveyShortUrl?: string | null; surveyDashboardUrl?: string | null; };