260716_02_ENH: 프로젝트에 발신 번호추가 및 리다이렉트 url, api 수정
This commit is contained in:
@@ -39,6 +39,8 @@ import {
|
||||
useUploadScenarioImageMutation, useKartProjectListQuery,
|
||||
} from "@/query/project";
|
||||
import { useCmpnListQuery } from "@/query/cmpn";
|
||||
import { useCallerTelNumListQuery } from "@/query/intranet";
|
||||
import { formatKoreanPhoneNumber } from "@/utils/phone";
|
||||
|
||||
const defaultProjectInfo: ProjectInfo = {
|
||||
prjctIdx: 0,
|
||||
@@ -48,6 +50,7 @@ const defaultProjectInfo: ProjectInfo = {
|
||||
prjctStatus: ProjectStatus.WAITING,
|
||||
ownerDept: '',
|
||||
ownerFw: '',
|
||||
callerTelNum: '',
|
||||
surveyTy: SurveyType.NONE,
|
||||
surveyPrjctCd: '',
|
||||
surveyUrl: '',
|
||||
@@ -61,21 +64,22 @@ const defaultProjectInfo: ProjectInfo = {
|
||||
|
||||
type ExternalTab = 'redirect' | 'api'
|
||||
|
||||
const baseUrl = 'https://kcont.kric.com'
|
||||
const baseUrl = 'https://contact.kric.com'
|
||||
const sidParam = 'sid=[$SID]'
|
||||
const externalPidParamBase = 'contact-pid=[$prjctIdx]'
|
||||
const internalPidParamBase = 'pid=[$prjctIdx]'
|
||||
|
||||
const externalUrls = {
|
||||
redirect: {
|
||||
start: `${baseUrl}/redirect/start?${sidParam}`,
|
||||
complete: `${baseUrl}/redirect/complete?${sidParam}`,
|
||||
screen: `${baseUrl}/redirect/screen?${sidParam}`,
|
||||
quota: `${baseUrl}/redirect/quota?${sidParam}`,
|
||||
complete: `${baseUrl}/redirect/complete?${internalPidParamBase}&${sidParam}`,
|
||||
screen: `${baseUrl}/redirect/screen?${internalPidParamBase}&${sidParam}`,
|
||||
quota: `${baseUrl}/redirect/quota?${internalPidParamBase}&${sidParam}`,
|
||||
},
|
||||
api: {
|
||||
start: `${baseUrl}/api/external/start?${sidParam}`,
|
||||
complete: `${baseUrl}/api/external/complete?${sidParam}`,
|
||||
screen: `${baseUrl}/api/external/screen?${sidParam}`,
|
||||
quota: `${baseUrl}/api/external/quota?${sidParam}`,
|
||||
start: `${baseUrl}/api/external/start?${internalPidParamBase}&${sidParam}`,
|
||||
complete: `${baseUrl}/api/external/complete?${internalPidParamBase}&${sidParam}`,
|
||||
screen: `${baseUrl}/api/external/screen?${internalPidParamBase}&${sidParam}`,
|
||||
quota: `${baseUrl}/api/external/quota?${internalPidParamBase}&${sidParam}`,
|
||||
},
|
||||
} as const
|
||||
|
||||
@@ -111,6 +115,7 @@ const ProjectInfoPage = () => {
|
||||
const resultCodesQuery = useResultCodesQuery(prjctIdx, enabled);
|
||||
const cmpnListQuery = useCmpnListQuery();
|
||||
const assignedCmpnQuery = useAssignedCmpnIdsQuery(prjctIdx, enabled);
|
||||
const callerTelNumListQuery = useCallerTelNumListQuery(mounted);
|
||||
|
||||
const kartEnabled =
|
||||
mounted &&
|
||||
@@ -144,6 +149,7 @@ const ProjectInfoPage = () => {
|
||||
|
||||
|
||||
const surveyProjectArray = kartProjectListQuery.data ?? [];
|
||||
const callerTelNumArray = callerTelNumListQuery.data ?? [];
|
||||
|
||||
const deptArray = useMemo(() => {
|
||||
const teams = Array.from(new Set((users ?? []).map((u) => u.userTeam).filter(Boolean)));
|
||||
@@ -245,7 +251,8 @@ const ProjectInfoPage = () => {
|
||||
const next = {...prev, surveyPrjctCd: value};
|
||||
|
||||
if (value && internalSurvey.has(prev.surveyTy || SurveyType.NONE)) {
|
||||
let surveyUrl = `/project/${value}/INDEX.asp?${sidParam}`;
|
||||
const pidParam = externalPidParamBase.replace('[$prjctIdx]', String(prev.prjctIdx));
|
||||
let surveyUrl = `/project/${value}/INDEX.asp?${pidParam}&${sidParam}`;
|
||||
if (prev.surveyTy === SurveyType.KON) {
|
||||
surveyUrl = `https://kon.kric.com` + surveyUrl
|
||||
} else if (prev.surveyTy === SurveyType.KIWI) {
|
||||
@@ -275,6 +282,8 @@ const ProjectInfoPage = () => {
|
||||
}))
|
||||
}
|
||||
|
||||
const replacePrjctIdx = (url: string) => url.replace('[$prjctIdx]', String(projectInfo.prjctIdx));
|
||||
|
||||
if (!mounted) return <LoadingOverlayAdapter force />
|
||||
|
||||
return (
|
||||
@@ -331,7 +340,7 @@ const ProjectInfoPage = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="grid grid-cols-3 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label className="text-base">담당 그룹</Label>
|
||||
<KriSingleSelect
|
||||
@@ -357,6 +366,20 @@ const ProjectInfoPage = () => {
|
||||
widthClassName="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label className="text-base">발신 번호</Label>
|
||||
<KriSingleSelect
|
||||
items={callerTelNumArray}
|
||||
value={projectInfo.callerTelNum || ''}
|
||||
onChange={(value) => handleChange('callerTelNum', value)}
|
||||
getValue={(item) => item.telNum}
|
||||
getLabel={(item) => formatKoreanPhoneNumber(item.telNum)}
|
||||
placeholder="발신 번호를 선택하세요"
|
||||
heightClassName="h-9"
|
||||
widthClassName="w-full"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -451,21 +474,17 @@ const ProjectInfoPage = () => {
|
||||
<div className="font-semibold">리다이렉트 URL</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">시작:</Label>
|
||||
<Input value={externalUrls.redirect.start} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">완료:</Label>
|
||||
<Input value={externalUrls.redirect.complete} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.redirect.complete)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">스크린 아웃:</Label>
|
||||
<Input value={externalUrls.redirect.screen} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.redirect.screen)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">쿼터 풀:</Label>
|
||||
<Input value={externalUrls.redirect.quota} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.redirect.quota)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -478,19 +497,19 @@ const ProjectInfoPage = () => {
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">시작 API:</Label>
|
||||
<Input value={externalUrls.api.start} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.api.start)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">완료 API:</Label>
|
||||
<Input value={externalUrls.api.complete} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.api.complete)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">스크린 API:</Label>
|
||||
<Input value={externalUrls.api.screen} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.api.screen)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 text-base">쿼터 API:</Label>
|
||||
<Input value={externalUrls.api.quota} disabled className="bg-white h-9" />
|
||||
<Input value={replacePrjctIdx(externalUrls.api.quota)} readOnly className="bg-white h-9" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user