diff --git a/src/app/(pages)/(main)/project/info/page.tsx b/src/app/(pages)/(main)/project/info/page.tsx index a3d6b0e..3df368c 100644 --- a/src/app/(pages)/(main)/project/info/page.tsx +++ b/src/app/(pages)/(main)/project/info/page.tsx @@ -182,6 +182,26 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg }) } + // KON/KIWI는 호스트 placeholder까지 고정하고 '?' 이후 쿼리스트링만 편집 가능하게 한다. + const konKiwiPlaceholderPrefix = survey.surveyTy === SurveyType.KIWI ? 'https://[$KIWI-URL]' : 'https://[$KON-URL]' + // 저장 후 생성된 실제 URL(surveyFullUrl)이 있으면 placeholder 대신 실제 호스트를 접두어로 노출한다. + const konKiwiDisplayPrefix = survey.surveyUrl?.trim() + ? survey.surveyUrl.split('?')[0] + : konKiwiPlaceholderPrefix + const konKiwiQuery = (() => { + const url = survey.surveyUrl ?? '' + const idx = url.indexOf('?') + return idx >= 0 ? url.slice(idx + 1) : '' + })() + + const handleKonKiwiQueryChange = (query: string) => { + onChange(survey.uiKey, { + surveyUrl: `${konKiwiPlaceholderPrefix}?${query}`, + surveyFullUrl: null, + surveyShortUrl: null, + }) + } + return (
@@ -248,18 +268,34 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
- onChange(survey.uiKey, { - surveyUrl: e.target.value, - surveyFullUrl: null, - surveyShortUrl: null, - })} - placeholder="https://" - className="h-9" - aria-invalid={invalidField === 'surveyUrl'} - /> + {isKonKiwi ? ( +
+ + {konKiwiDisplayPrefix}? + + handleKonKiwiQueryChange(e.target.value)} + placeholder="sid=[$SID]" + className="h-9 rounded-l-none" + 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 && (