260728_03_ENH: 시나리오에 치환 문자열 적용, 현황 bar chart에 bar max width 적용, 리스트 업로드 이력에서 만료된 파일은 안나오게 수정
This commit is contained in:
@@ -20,6 +20,23 @@ import { cn } from '@/lib/utils'
|
||||
import { getNearestFutureDateTime } from '@/lib/datetime'
|
||||
import { useCtiLastCallHistId } from '@/hooks/useCtiLastCallHistId'
|
||||
import { getCurrentPositionMeta } from '@kri/common/browser'
|
||||
import type { listHeader, ListSearchWithFullResult } from '@/types/list'
|
||||
import { buildListContactVariableValues } from '@/components/list-contact/listContactVariables'
|
||||
import { substituteVariables } from '@/lib/surveyUrl'
|
||||
import { sanitizeHtml } from '@/components/kri-editor/utils/sanitizeHtml'
|
||||
|
||||
const escapeHtml = (value: string) =>
|
||||
value.replace(
|
||||
/[&<>"']/g,
|
||||
(character) =>
|
||||
({
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
})[character] ?? character,
|
||||
)
|
||||
|
||||
const RefreshIconButton = ({ onRefresh, isFetching }: { onRefresh: () => void; isFetching: boolean }) => (
|
||||
<Button
|
||||
@@ -283,6 +300,8 @@ export type ListContactEventPanelProps = {
|
||||
useFF: boolean
|
||||
useContactSenario: boolean
|
||||
contactSenario?: string
|
||||
listHeaders: listHeader[]
|
||||
detail?: ListSearchWithFullResult
|
||||
}
|
||||
|
||||
const ListContactEventPanel = ({
|
||||
@@ -295,12 +314,23 @@ const ListContactEventPanel = ({
|
||||
useFF,
|
||||
useContactSenario,
|
||||
contactSenario,
|
||||
listHeaders,
|
||||
detail,
|
||||
}: ListContactEventPanelProps) => {
|
||||
const addListEventMutation = useAddListEventMutation(prjctIdx, sid)
|
||||
const reserveMutation = useReserveMutation(prjctIdx, sid)
|
||||
const internalInfoQuery = useInternalInfoQuery()
|
||||
const showContactInput = userRole !== FIELD_INTERVIEWER_ROLE
|
||||
const showInterviewInput = userRole !== CONTACT_INTERVIEWER_ROLE
|
||||
const contactSenarioValues = Object.fromEntries(
|
||||
Object.entries(buildListContactVariableValues(listHeaders, detail, sid)).map(([key, value]) => [
|
||||
key,
|
||||
escapeHtml(value),
|
||||
]),
|
||||
)
|
||||
const resolvedContactSenario = contactSenario
|
||||
? sanitizeHtml(substituteVariables(contactSenario, contactSenarioValues))
|
||||
: ''
|
||||
|
||||
const handleAddEvent =
|
||||
(resultCodeType: ResultCodeType) =>
|
||||
@@ -357,10 +387,10 @@ const ListContactEventPanel = ({
|
||||
}
|
||||
|
||||
|
||||
{useContactSenario && contactSenario ? (
|
||||
{useContactSenario && resolvedContactSenario ? (
|
||||
<div className="space-y-2 rounded-lg border bg-white p-4">
|
||||
<h2 className="text-lg font-bold border-b pb-2">컨택 시나리오</h2>
|
||||
<div className="text-base leading-relaxed" dangerouslySetInnerHTML={{ __html: contactSenario }} />
|
||||
<div className="text-base leading-relaxed" dangerouslySetInnerHTML={{ __html: resolvedContactSenario }} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user