260728_03_ENH: 시나리오에 치환 문자열 적용, 현황 bar chart에 bar max width 적용, 리스트 업로드 이력에서 만료된 파일은 안나오게 수정

This commit is contained in:
2026-07-28 12:17:54 +09:00
parent 17289bf0e8
commit 0285a3fe9d
8 changed files with 95 additions and 36 deletions

View File

@@ -1,5 +1,4 @@
// project.surveyUrl에 들어있는 [$SID], [$헤더명] 치환 토큰을 values에 있는 값으로 바꾼다.
// 값이 없는 토큰은 빈 문자열로 치환한다(URL에 인코딩되지 않은 대괄호가 남지 않도록).
// 참고: src/app/(pages)/(main)/project/info/page.tsx의 sidParam = 'sid=[$SID]'와 동일한 토큰.
export const substituteSurveyUrl = (surveyUrl: string, values: Record<string, string>) =>
surveyUrl.replace(/\[\$([^\]]+)\]/g, (_, key: string) => values[key] ?? "");
// 문자열에 들어있는 [$SID], [$헤더명] 치환 토큰을 values에 있는 값으로 바꾼다.
// 값이 없는 토큰은 빈 문자열로 치환한다.
export const substituteVariables = (contents: string, values: Record<string, string>) =>
contents.replace(/\[\$([^\]]+)\]/g, (_, key: string) => values[key] ?? "");