refactor: 호스트 대학교 표시명 영문명 기반 자동 생성#589
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Walkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx`:
- Around line 27-33: `toFormatName` can return an empty string when
`englishName` is blank or fully stripped by normalization, so add validation in
the `toFormatName` helper and the submit flow in `HostUniversityTab` to reject
or disable submission when `formatName` is empty. Ensure the logic that
builds/sends the API payload checks the normalized result before use and
prevents `""` from being sent for the required `formatName` field.
🪄 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: 79cf9aab-1b7f-4410-b9ed-1432bcc97aff
📒 Files selected for processing (1)
apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx
| function toFormatName(englishName: string): string { | ||
| return englishName | ||
| .trim() | ||
| .toLowerCase() | ||
| .replace(/[^a-z0-9]+/g, "_") | ||
| .replace(/^_+|_+$/g, ""); | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
1. 정규화 결과가 빈 formatName이 될 수 있습니다.
englishName이 공백뿐이거나 정규화 과정에서 전부 제거되는 값이면 여기서 formatName이 ""가 됩니다. 지금은 제출 전에 이 케이스를 막지 않아서 필수 API 필드에 빈 값이 실려 나갈 수 있습니다.
Also applies to: 77-81
🤖 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/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx`
around lines 27 - 33, `toFormatName` can return an empty string when
`englishName` is blank or fully stripped by normalization, so add validation in
the `toFormatName` helper and the submit flow in `HostUniversityTab` to reject
or disable submission when `formatName` is empty. Ensure the logic that
builds/sends the API payload checks the normalized result before use and
prevents `""` from being sent for the required `formatName` field.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9624494fa0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .replace(/^_+|_+$/g, ""); | ||
| } | ||
|
|
||
| const REQUIRED_FIELDS = ["koreanName", "englishName", "countryCode", "regionCode"] as const; |
There was a problem hiding this comment.
Update tests for the removed formatName input
When the admin Vitest tests are run, removing formatName from REQUIRED_FIELDS means the modal no longer renders the 표시명 * control, but HostUniversityTab.test.tsx still calls screen.getByLabelText("표시명 *") in both create-submit tests. Those tests now throw before reaching their assertions, so the change should update the tests to assert the generated formatName instead of filling the removed input.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
변경 사항
✨ 호스트 대학교 표시명 자동 생성
표시명(formatName)입력 필드 제거englishName을 snake_case로 변환하는toFormatName함수 추가formatName을englishName으로부터 자동 생성변환 규칙: 소문자 변환 → 영문자·숫자 외 문자를
_로 치환 → 연속_병합 → 선두·말미_제거예:
"University of Tokyo"→"university_of_tokyo"♻️ 어드민 대학 네이밍 통일 (UI 레이블 한정)
코드 식별자(TypeScript 타입명, API 함수명)는 유지, UI에 노출되는 한국어 레이블만 변경.
변경 파일:
AdminSidebar,HomeUniversitiesPageContent,UnivApplyInfosPageContent,HostUniversityTab,UnivApplyInfoManageTab,UnivApplyInfoImportTab,HostUniversityTab.test테스트
formatName입력 없이 정상 저장되는지 확인formatName이englishName기반으로 덮어써지는지 확인🤖 Generated with Claude Code