fix: 대학 상세 어학 로고 경로 수정#595
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Walkthrough이번 변경은 university-web 앱의 정적 이미지 경로 체계를 정비한 이야기예요! 아래 순서대로 살펴보시면 흐름이 한눈에 들어올 거예요.
Estimated code review effort: 2 (Simple) | ~12 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/university-web/src/utils/languageUtils.ts`:
- Around line 28-37: The normalization in normalizeLanguageTestLogoType is
stripping "." and "/" before converting separators to underscores, which
prevents values like TOEFL.IBT and TOEFL/IBT from matching the TOEFL_IBT key in
logoMap. Update the separator handling so all delimiters are normalized
consistently in one pass, and keep the alias lookup and logoMap check in
normalizeLanguageTestLogoType aligned with the intended underscore-based keys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 797e801e-4d50-4b2d-954b-f2e89afc7107
📒 Files selected for processing (2)
apps/university-web/next.config.mjsapps/university-web/src/utils/languageUtils.ts
| const normalizeLanguageTestLogoType = (type: string): LanguageTestLogoType | undefined => { | ||
| const normalizedType = type | ||
| .trim() | ||
| .toUpperCase() | ||
| .replace(/[./]/g, "") | ||
| .replace(/[\s-]+/g, "_"); | ||
| const logoType = languageTestLogoAliases[normalizedType] ?? normalizedType; | ||
|
|
||
| return logoType in logoMap ? (logoType as LanguageTestLogoType) : undefined; | ||
| }; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
1. 구분자 정규화 순서, 한 번만 더 점검해주세요!
.와 /를 먼저 언더스코어 없이 완전히 지워버리고, 그 다음에야 공백·하이픈만 _로 바꾸고 있어요. 이 순서라면:
"TOEFL.IBT"→"TOEFLIBT"(언더스코어 없음)"TOEFL/IBT"→"TOEFLIBT"(언더스코어 없음)
둘 다 logoMap의 "TOEFL_IBT" 키와 매칭되지 않아, 정작 존재하는 로고인데도 기본 로고로 폴백돼버려요. PR 목표가 "., /, 공백, 하이픈과 같은 구분자 정규화"인데, .와 /만 구분자 취급을 못 받고 있는 셈이죠.
한 번에 처리하도록 정규식을 합쳐주시면 의도한 동작을 회복할 수 있어요.
🔧 제안하는 수정
const normalizedType = type
.trim()
.toUpperCase()
- .replace(/[./]/g, "")
- .replace(/[\s-]+/g, "_");
+ .replace(/[\s./-]+/g, "_");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const normalizeLanguageTestLogoType = (type: string): LanguageTestLogoType | undefined => { | |
| const normalizedType = type | |
| .trim() | |
| .toUpperCase() | |
| .replace(/[./]/g, "") | |
| .replace(/[\s-]+/g, "_"); | |
| const logoType = languageTestLogoAliases[normalizedType] ?? normalizedType; | |
| return logoType in logoMap ? (logoType as LanguageTestLogoType) : undefined; | |
| }; | |
| const normalizeLanguageTestLogoType = (type: string): LanguageTestLogoType | undefined => { | |
| const normalizedType = type | |
| .trim() | |
| .toUpperCase() | |
| .replace(/[\s./-]+/g, "_"); | |
| const logoType = languageTestLogoAliases[normalizedType] ?? normalizedType; | |
| return logoType in logoMap ? (logoType as LanguageTestLogoType) : undefined; | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/university-web/src/utils/languageUtils.ts` around lines 28 - 37, The
normalization in normalizeLanguageTestLogoType is stripping "." and "/" before
converting separators to underscores, which prevents values like TOEFL.IBT and
TOEFL/IBT from matching the TOEFL_IBT key in logoMap. Update the separator
handling so all delimiters are normalized consistently in one pass, and keep the
alias lookup and logoMap check in normalizeLanguageTestLogoType aligned with the
intended underscore-based keys.
관련 이슈
작업 내용
/university-static/images/language/*로 변경했습니다..//, 공백/하이픈 구분자를 정규화하도록 보강했습니다.HSK,DUOLINGO_ENGLISH_TEST처럼 API 값과 로고 파일명이 다른 케이스를 alias로 매핑했습니다.특이 사항
검증
pnpm --filter @solid-connect/university-web lint:check통과pnpm --filter @solid-connect/university-web typecheck:ci통과pnpm --filter @solid-connect/university-web build통과, 205개 정적 페이지 생성 확인pnpm --filter @solid-connect/web lint:check통과pnpm --filter @solid-connect/web typecheck:ci통과UNIVERSITY_WEB_DOMAIN=http://localhost:3001 pnpm --filter @solid-connect/web build통과node --experimental-strip-types --input-type=module로IELTS,TOEFL IBT,TOEFL-ITP,HSK,UNKNOWN로고 매핑 확인http://localhost:3014/university-static/images/language/ielts.png->200 image/png, PNG signature 확인http://localhost:3014/university-static/images/language/toefl_ibt.png->200 image/png, PNG signature 확인http://localhost:3014/university-static/images/language/toefl_itp.png->200 image/png, PNG signature 확인http://localhost:3014/university-static/images/language/default.png->200 image/png, PNG signature 확인http://localhost:3014/university-static/images/language/jlpt.png->200 image/png, PNG signature 확인http://localhost:3014/university-static/images/language/new_hsk.png->200 image/png, PNG signature 확인http://localhost:3014/university/kyunghee/3155HTML에서/university-static/images/language/jlpt.png렌더링 경로 확인리뷰 요구사항 (선택)