Fix#388 상위 학교 정렬 로직 개선 및 RankTableRow 컴포넌트 수정#392
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe competition page now limits topRatedSchools to the top 20 by paidApplicationCount. RankTableRow conditionally renders the third column only when prevRank !== 0. RankTableSection refactors row computation, explicitly handling the first row and calculating gaps based on the previous item. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant P as CompetitionPage
participant D as Data Source
participant S as RankTableSection
participant R as RankTableRow
U->>P: Request /events/competition
P->>D: Fetch schools with paidApplicationCount
D-->>P: List of schools
note over P: Sort desc by paidApplicationCount<br/>Slice top 20 -> topRatedSchools<br/>top3Schools = first 3
P->>S: Render with topRatedSchools
loop For each school (index i)
alt i == 0
S->>R: rank=1, prevRank=0, gap=0
note over R: Third column omitted (prevRank == 0)
else i > 0
S->>S: gap = prev.paidApplicationCount - curr.paidApplicationCount<br/>prevRank = i
S->>R: rank=i+1, prevRank=i, gap=gap
note over R: Third column rendered with nbsp before gap
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
✨ Finishing Touches
🧪 Generate unit tests
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 추가 및 변경된 파일총 3개 파일 변경 |
📚 Storybook이 Chromatic에 배포되었습니다!
|
✅ Linked Issue
Summary by CodeRabbit
New Features
Bug Fixes
Refactor