260921_03_ENH: survey short url 쓸모가 없어서 폐기 #40

Merged
gitadmin merged 1 commits from develop into master 2026-09-21 14:05:44 +09:00
3 changed files with 49 additions and 31 deletions

View File

@@ -13,7 +13,7 @@ import {useDialog} from '@/hooks/useDialog'
import ResultCodeDialog from '@/components/dialog/ResultCodeDialog' import ResultCodeDialog from '@/components/dialog/ResultCodeDialog'
import { useDebouncedValue, useMounted } from "@kri/common/hooks"; import { useDebouncedValue, useMounted } from "@kri/common/hooks";
import { LoadingOverlayAdapter } from '@/components/app-shell/LoadingOverlayAdapter' import { LoadingOverlayAdapter } from '@/components/app-shell/LoadingOverlayAdapter'
import { X } from 'lucide-react' import { X, Copy, Check } from 'lucide-react'
import { import {
ProjectInfo, ProjectSurvey, ProjectUpdateRequest, ResultCode, ProjectInfo, ProjectSurvey, ProjectUpdateRequest, ResultCode,
ProjectStatus, ResultCodeType, SurveyType ProjectStatus, ResultCodeType, SurveyType
@@ -123,7 +123,6 @@ const createSurveyDraft = (surveyOrder: number): SurveyDraft => ({
surveyPrjctCd: '', surveyPrjctCd: '',
surveyUrl: '', surveyUrl: '',
surveyFullUrl: null, surveyFullUrl: null,
surveyShortUrl: null,
surveyDashboardUrl: '', surveyDashboardUrl: '',
}) })
@@ -168,7 +167,6 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
surveyPrjctCd: '', surveyPrjctCd: '',
surveyUrl: '', surveyUrl: '',
surveyFullUrl: null, surveyFullUrl: null,
surveyShortUrl: null,
surveyDashboardUrl: '', surveyDashboardUrl: '',
}) })
} }
@@ -178,7 +176,6 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
surveyPrjctCd: value, surveyPrjctCd: value,
surveyUrl: buildKonKiwiSurveyUrl(survey.surveyTy), surveyUrl: buildKonKiwiSurveyUrl(survey.surveyTy),
surveyFullUrl: null, surveyFullUrl: null,
surveyShortUrl: null,
}) })
} }
@@ -198,10 +195,22 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
onChange(survey.uiKey, { onChange(survey.uiKey, {
surveyUrl: `${konKiwiPlaceholderPrefix}?${query}`, surveyUrl: `${konKiwiPlaceholderPrefix}?${query}`,
surveyFullUrl: null, 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 ( return (
<div className="space-y-3 rounded-lg border p-4"> <div className="space-y-3 rounded-lg border p-4">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
@@ -268,8 +277,9 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
<div className="space-y-2"> <div className="space-y-2">
<Label className="text-base">설문 URL</Label> <Label className="text-base">설문 URL</Label>
<div className="flex items-center gap-2">
{isKonKiwi ? ( {isKonKiwi ? (
<div className="flex items-center"> <div className="flex flex-1 items-center">
<span className="inline-flex h-9 items-center whitespace-nowrap rounded-l-md border border-r-0 bg-gray-100 px-3 text-sm text-muted-foreground"> <span className="inline-flex h-9 items-center whitespace-nowrap rounded-l-md border border-r-0 bg-gray-100 px-3 text-sm text-muted-foreground">
{konKiwiDisplayPrefix}? {konKiwiDisplayPrefix}?
</span> </span>
@@ -289,13 +299,23 @@ const SurveyCard = ({ survey, index, itrntPrjctCd, userTeam, invalidField, onReg
onChange={(e) => onChange(survey.uiKey, { onChange={(e) => onChange(survey.uiKey, {
surveyUrl: e.target.value, surveyUrl: e.target.value,
surveyFullUrl: null, surveyFullUrl: null,
surveyShortUrl: null,
})} })}
placeholder="https://" placeholder="https://"
className="h-9" className="h-9 flex-1"
aria-invalid={invalidField === 'surveyUrl'} aria-invalid={invalidField === 'surveyUrl'}
/> />
)} )}
<Button
type="button"
variant="outline"
onClick={handleCopyUrl}
disabled={!survey.surveyUrl?.trim()}
aria-label="설문 URL 복사"
className="h-9 w-9 shrink-0 p-0"
>
{urlCopied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
</Button>
</div>
</div> </div>
{survey.surveyTy === SurveyType.EXTERNAL && ( {survey.surveyTy === SurveyType.EXTERNAL && (

View File

@@ -41,7 +41,6 @@ export const QrCodeToolbar = ({ editor, surveys }: QrCodeToolbarProps) => {
.map((survey, index) => { .map((survey, index) => {
const value = const value =
survey.surveyUrl?.trim() || survey.surveyUrl?.trim() ||
survey.surveyShortUrl?.trim() ||
survey.surveyFullUrl?.trim() || survey.surveyFullUrl?.trim() ||
'' ''

View File

@@ -35,7 +35,6 @@ export type ProjectSurvey = {
surveyPrjctCd?: string | null; surveyPrjctCd?: string | null;
surveyUrl?: string | null; surveyUrl?: string | null;
surveyFullUrl?: string | null; surveyFullUrl?: string | null;
surveyShortUrl?: string | null;
surveyDashboardUrl?: string | null; surveyDashboardUrl?: string | null;
}; };