[refactor] year, semester 타입 분리에 따른 리팩토링#1051
Conversation
- Award 타입에 year(number), semester(SemesterTermType) 분리
- SemesterTerm 상수 추가 ('FIRST' | 'SECOND')
- AwardEditor 새 타입에 맞게 로직 수정
- ClubIntroContent 로컬 타입 제거, @/types/club에서 import로 통일
- Award 타입에 year(number), semester(SemesterTermType) 분리
- SemesterTerm 상수 추가 ('FIRST' | 'SECOND')
- AwardEditor 새 타입에 맞게 로직 수정
- ClubIntroContent 로컬 타입 제거, @/types/club 통일
- openFaqIndices → openFaqIndexes 리네임
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| 코호트 / 파일(s) | 변경 요약 |
|---|---|
타입 정의 frontend/src/types/club.ts |
SemesterTerm 상수 및 SemesterTermType 추가; Award.semester를 SemesterTermType으로 변경하고 Award.year: number 추가 |
AwardEditor 리팩토링 frontend/src/pages/AdminPage/tabs/ClubIntroEditTab/components/AwardEditor/AwardEditor.tsx |
문자열 기반 학기 파싱 제거 → getSemesterSortValue, formatSemesterLabel, getAwardKey 도입; selectedSemester 및 신규 항목 추적을 SemesterTermType/awardKey로 변경; 정렬·추가·갱신·렌더링·포커스 로직을 새 타입·키 기반으로 업데이트 |
ClubIntroContent 마이그레이션 frontend/src/pages/ClubDetailPage/components/ClubIntroContent/ClubIntroContent.tsx |
로컬 타입 제거 후 중앙 타입(Award, FAQ, IdealCandidate, SemesterTerm) 사용; formatSemesterLabel/getAwardKey 추가; 수상 리스트 키와 레이블, FAQ 인덱스 명칭(openFaqIndexes) 등 렌더링 조정 |
Sequence Diagram(s)
(생성 조건에 부합하지 않아 생략)
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
- MOA-523: 연도와 학기별로 타입을 분리한다 — 연도/학기 타입 분리 목표와 직접 일치합니다.
- [refactor] MOA-521 동아리 설명 award의 semester와 year를 분리한다 #1045 — Award의 연도/학기 분리 및 타입화 작업과 유사합니다.
- [refactor] MOA-523 연도와 학기별로 타입을 분리한다 #1050 — 학기 처리 방식(문자열→타입) 변경 및 관련 컴포넌트 수정을 포함합니다.
Possibly related PRs
- [feature] 동아리 상세페이지 > 공통 레이아웃(UI 틀) 구현 #964 —
Award타입 강화(year/SemesterTerm)와 직접적인 코드 변경이 겹칩니다. - [fix] FAQ 수정, 삭제 버그 해결 #1024 —
AwardEditor,ClubIntroContent, 타입 변경 관련 동일 파일군을 수정한 PR입니다. - [feature] 관리자 페이지 > 동아리 상세정보 수정 탭 추가 및 커버 업로드 UI 제공 #958 — 수상 관련 컴포넌트 리팩토링 및 헬퍼 추가 작업이 유사합니다.
Suggested reviewers
- lepitaaar
- oesnuj
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | PR 제목은 변경 사항의 핵심(year, semester 타입 분리 리팩토링)을 명확하고 간결하게 요약하고 있습니다. |
| Linked Issues check | ✅ Passed | 코드 변경이 MOA-523의 목표(year/semester 타입 분리, 중앙 타입 통일, 타입 안정성 개선)를 충족합니다. |
| Out of Scope Changes check | ✅ Passed | 모든 변경 사항이 year/semester 타입 분리 리팩토링과 관련되어 있으며, 범위를 벗어난 변경은 없습니다. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
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 @coderabbitai help to get the list of available commands and usage tips.
lepitaaar
left a comment
There was a problem hiding this comment.
수고하셨습니다 리뷰 한번 답변부탁드리겠습니다
frontend/src/pages/AdminPage/tabs/ClubIntroEditTab/components/AwardEditor/AwardEditor.tsx
Outdated
Show resolved
Hide resolved
- getAwardKey 함수에 index 파라미터 추가 - 같은 년도-학기에 여러 수상이 있어도 고유한 key 생성 - AwardEditor와 ClubIntroContent 모두 수정 - 백엔드 중복 방지 로직 부재에 대응
#️⃣연관된 이슈
📝작업 내용
1. Award 타입 구조화
기존
변경 후
장점:
2. 중복 타입 정의 제거
ClubIntroContent.tsx에서 로컬로 정의된 타입들을 제거하고 @/types/club에서 통일:
Award→ @/types/clubIdealCandidate→ @/types/clubFaq→ FAQ (중앙 타입 사용)3. UI 표시 로직 개선
formatSemesterLabel()함수로 "2024 1학기" 형식 표시4. 네이밍 개선
openFaqIndices → openFaqIndexes
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.