Skip to content

fix: 대학 상세 어학 로고 경로 수정#595

Merged
manNomi merged 1 commit into
mainfrom
fix/university-language-logo-path
Jul 1, 2026
Merged

fix: 대학 상세 어학 로고 경로 수정#595
manNomi merged 1 commit into
mainfrom
fix/university-language-logo-path

Conversation

@manNomi

@manNomi manNomi commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

  • 없음

작업 내용

  • university-web의 어학 로고 이미지 경로를 /university-static/images/language/*로 변경했습니다.
  • web public이나 공통 public으로 복제하지 않고, university-web public asset을 university-web rewrites로 노출하도록 정리했습니다.
  • 어학 시험 타입 lookup 전에 공백, 대소문자, .//, 공백/하이픈 구분자를 정규화하도록 보강했습니다.
  • HSK, DUOLINGO_ENGLISH_TEST처럼 API 값과 로고 파일명이 다른 케이스를 alias로 매핑했습니다.

특이 사항

  • 이 PR은 #576에 잘못 포함됐던 어학 로고 경로 수정만 별도 분리한 PR입니다.
  • 로컬 Node 버전은 v23.10.0이라 repository engines의 Node 22.x 경고가 출력됩니다.

검증

  • 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=moduleIELTS, TOEFL IBT, TOEFL-ITP, HSK, UNKNOWN 로고 매핑 확인
  • production start 환경에서 web 경유 이미지 응답 확인
    • 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/3155 HTML에서 /university-static/images/language/jlpt.png 렌더링 경로 확인

리뷰 요구사항 (선택)

  • web이 직접 language asset을 소유하지 않고 university-web rewrite로만 노출하는 방향이 맞는지 봐주세요.

@manNomi manNomi requested review from enunsnv and wibaek as code owners July 1, 2026 11:19
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview, Comment Jul 1, 2026 11:20am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jul 1, 2026 11:20am
solid-connection-web Skipped Skipped Jul 1, 2026 11:20am

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

이번 변경은 university-web 앱의 정적 이미지 경로 체계를 정비한 이야기예요! 아래 순서대로 살펴보시면 흐름이 한눈에 들어올 거예요.

  1. Next.js rewrite 규칙 신설
    • next.config.mjsasync rewrites()를 새로 추가해서, /university-static/images/language/:path* 요청이 조용히 /images/language/:path*로 안내받도록 길을 터줬어요.
  2. 로고 경로 상수 이전
    • languageUtils.ts의 로고 베이스 경로가 /images/language에서 /university-static/images/language로 이사했고, 기본 로고 상수도 같이 짐을 쌌어요.
  3. 정규화 및 별칭 로직 추가
    • languageTestLogoAliasesnormalizeLanguageTestLogoType이 새로 등장해서, 입력값의 공백·대소문자·구두점을 깔끔히 다듬고 별칭까지 챙겨 logoMap의 키로 변신시켜줘요.
  4. 조회 및 포맷팅 로직 변경
    • getLanguageTestLogo는 이제 정규화된 키로만 조회하고, 못 찾으면 기본 로고로 안전하게 착지해요. formatLanguageTestNametrim()을 더해 앞뒤 공백까지 말끔히 정리했답니다.

Estimated code review effort: 2 (Simple) | ~12 minutes

Suggested reviewers: wibaek, enunsnv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 어학 로고 경로 수정이라는 주요 변경점을 간결하게 잘 요약합니다.
Description check ✅ Passed 필수 섹션인 관련 이슈, 작업 내용, 특이 사항, 리뷰 요구사항이 모두 포함되어 있고 내용도 충분히 구체적입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/university-language-logo-path

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3e339e and 303a723.

📒 Files selected for processing (2)
  • apps/university-web/next.config.mjs
  • apps/university-web/src/utils/languageUtils.ts

Comment on lines +28 to +37
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;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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.

@manNomi manNomi merged commit 239c0ff into main Jul 1, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant