Skip to content

feat: 학점 카드에 모학교명 표시#587

Merged
yoonc01 merged 2 commits into
mainfrom
feat/gpa-home-university-name
Jun 27, 2026
Merged

feat: 학점 카드에 모학교명 표시#587
yoonc01 merged 2 commits into
mainfrom
feat/gpa-home-university-name

Conversation

@yoonc01

@yoonc01 yoonc01 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

작업 내용

  • 학점 성적 카드에 하드코딩되어 있던 인하대학교 문구를 제거하고, /scores/gpas 응답의 homeUniversityName을 표시하도록 변경했습니다.
  • GPA 점수 조회 응답을 리스트만 반환하지 않고, homeUniversityNamegpaScoreStatusResponseList를 함께 사용할 수 있도록 훅 반환 구조를 변경했습니다.
  • 학교 인증 후 돌아갈 경로를 returnTo map으로 관리하도록 분리했습니다.
  • 학교 인증이 필요한 화면에서 모학교 정보가 없으면 학교 인증 화면으로 이동하도록 처리했습니다.
    • /university/application/apply
    • /university/score
    • /university/score/submit/gpa

@yoonc01 yoonc01 self-assigned this Jun 26, 2026
@vercel

vercel Bot commented Jun 26, 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 Jun 27, 2026 12:38am
solid-connection-web Ready Ready Preview, Comment Jun 27, 2026 12:38am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jun 27, 2026 12:38am

@github-actions github-actions Bot added the web label Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 29bb1728-de73-439e-8112-b3026f31f844

📥 Commits

Reviewing files that changed from the base of the PR and between 4aae47a and e2f3cc9.

📒 Files selected for processing (1)
  • apps/web/src/app/university/score/ScoreScreen.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/app/university/score/ScoreScreen.tsx

Walkthrough

  1. GPA 응답과 조회 훅
    • GPA 응답에 homeUniversityName이 추가되고, 조회 훅은 enabled 옵션과 전체 응답 선택으로 바뀌었다.
  2. 학교 이메일 경로
    • returnTo별 리턴 경로 상수와 verification 경로 생성 유틸이 추가되었다.
  3. 지원/성적 화면
    • 지원 페이지와 성적 화면이 인증 상태에 따라 GPA 조회와 화면 표시를 제어하고, 학교명은 응답 값에서 사용한다.
  4. GPA 제출 폼
    • GPA 제출 폼도 인증 상태가 맞지 않으면 학교 이메일 검증 경로로 이동하고 렌더링을 중단한다.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • wibaek
  • manNomi
  • enunsnv
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning 작업 내용은 있으나 관련 이슈, 특이 사항, 리뷰 요구사항 섹션이 비어 있어 템플릿을 충분히 채우지 못했습니다. 관련 이슈(#번호), 특이 사항, 리뷰 요구사항을 추가하고 각 변경을 기능 단위로 조금 더 구체화해 주세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Title 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 feat/gpa-home-university-name

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

🧹 Nitpick comments (3)
apps/web/src/app/university/application/apply/ApplyPageContent.tsx (2)

40-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

TODO로 남긴 GPA 조회 실패 fallback, 함께 마무리해 드릴까요?

서버의 모학교 미인증 에러 코드가 확정되면 인증 화면으로 보내는 fallback이 필요하다는 메모가 잘 남아 있습니다. 현재는 shouldFetchGpaScore로만 진입을 막고 있어, 인증은 됐지만 서버가 미인증 에러를 주는 경계 상황은 아직 비어 있는 상태입니다.

원하시면 에러 코드 분기와 리다이렉트 처리를 추가하는 초안을 만들거나, 추적용 이슈를 열어 드리겠습니다.

🤖 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/web/src/app/university/application/apply/ApplyPageContent.tsx` around
lines 40 - 42, The GPA fetch path in ApplyPageContent still lacks the fallback
for server-side “home university not authenticated” failures. Update the
useGetMyGpaScore flow in ApplyPageContent so that when the API returns the
agreed authentication-related error code, the user is redirected to the
school-authentication screen instead of leaving the state unresolved. Use the
existing shouldFetchGpaScore gating and the useGetMyGpaScore result handling to
add the error-code branch and redirect behavior, and keep the fallback logic
colocated with the GPA query so it is easy to find later.

54-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

같은 "인증 게이트 + 리다이렉트" 패턴이 세 화면에 중복되고 있습니다.

shouldFetchGpaScore 계산, useEffect 리다이렉트, 그리고 homeUniversityId === null일 때의 early-return 조합이 이 파일과 ScoreScreen.tsx, GpaSubmitForm.tsx에 거의 동일하게 반복됩니다. 지금은 잘 맞아떨어지지만, 한 곳만 조건이 바뀌면 화면마다 동작이 미묘하게 어긋날 위험이 있습니다. 공용 훅(예: useRequireHomeUniversity(returnTo))으로 모아 두면 한 번의 수정으로 세 화면이 함께 안전해집니다.

🤖 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/web/src/app/university/application/apply/ApplyPageContent.tsx` around
lines 54 - 60, The authentication gate and redirect logic is duplicated across
ApplyPageContent, ScoreScreen, and GpaSubmitForm, including the homeUniversityId
null early-return, shouldFetchGpaScore-style checks, and the useEffect redirect.
Extract this shared behavior into a reusable hook such as
useRequireHomeUniversity(returnTo) and have each screen call it so the redirect
target and gate conditions are defined in one place. Keep the screen-specific
rendering logic, but remove the repeated auth/redirect branching from each
component and rely on the shared hook instead.
apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx (1)

41-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

인증 게이트 로직 자체는 정확하고 안전합니다.

모든 훅(useState, useForm, useEffect)이 early return 위에 위치해 훅 규칙을 위반하지 않으며, 리다이렉트 조건도 ApplyPageContent·ScoreScreen과 동일한 패턴이라 일관성이 좋습니다.

다만 동일한 "인증 초기화 + 인증됨 + homeUniversityId null → verification 경로로 리다이렉트 후 null 반환" 패턴이 세 화면에 그대로 복제되어 있습니다. 작은 커스텀 훅으로 묶으면 분기 조건이 한 곳으로 모여 향후 정책 변경 시 누락을 줄일 수 있습니다.

♻️ 공통 훅 추출 예시
// apps/web/src/app/my/school-email/_lib/useHomeUniversityGate.ts
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import useAuthStore from "`@/lib/zustand/useAuthStore`";
import { getSchoolEmailVerificationPath, type SchoolEmailReturnTo } from "./returnTo";

export const useHomeUniversityGate = (returnTo: SchoolEmailReturnTo) => {
  const router = useRouter();
  const homeUniversityId = useAuthStore((s) => s.homeUniversityId);
  const isAuthInitialized = useAuthStore((s) => s.isInitialized);
  const isAuthenticated = useAuthStore((s) => s.isAuthenticated);

  const shouldRedirect = isAuthInitialized && isAuthenticated && homeUniversityId === null;

  useEffect(() => {
    if (shouldRedirect) router.replace(getSchoolEmailVerificationPath(returnTo));
  }, [shouldRedirect, returnTo, router]);

  return { shouldRedirect };
};
-  useEffect(() => {
-    if (!isAuthInitialized || !isAuthenticated || homeUniversityId !== null) {
-      return;
-    }
-    router.replace(getSchoolEmailVerificationPath("gpaSubmit"));
-  }, [homeUniversityId, isAuthInitialized, isAuthenticated, router]);
-
-  if (isAuthInitialized && isAuthenticated && homeUniversityId === null) {
-    return null;
-  }
+  const { shouldRedirect } = useHomeUniversityGate("gpaSubmit");
+  if (shouldRedirect) {
+    return null;
+  }
🤖 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/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx` around lines
41 - 51, The authentication gate logic in GpaSubmitForm is duplicated across
multiple screens, so extract the shared “initialized + authenticated +
homeUniversityId === null” redirect/return-null flow into a reusable custom
hook. Move the logic currently in useEffect and the null-return guard into a
hook like useHomeUniversityGate, keep the
router.replace(getSchoolEmailVerificationPath(...)) behavior unchanged, and
reuse it alongside the existing ApplyPageContent and ScoreScreen patterns to
centralize future policy changes.
🤖 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/web/src/app/university/score/ScoreScreen.tsx`:
- Around line 49-52: The early-return in ScoreScreen is only guarding after auth
initialization, so before isAuthInitialized becomes true the component can
briefly render an empty GPA state and then update. Update the conditional flow
in ScoreScreen to treat the unauthenticated-initializing state as loading/null
as well, using isAuthInitialized, isAuthenticated, and homeUniversityId together
so the screen does not flash a blank state before data is ready.

---

Nitpick comments:
In `@apps/web/src/app/university/application/apply/ApplyPageContent.tsx`:
- Around line 40-42: The GPA fetch path in ApplyPageContent still lacks the
fallback for server-side “home university not authenticated” failures. Update
the useGetMyGpaScore flow in ApplyPageContent so that when the API returns the
agreed authentication-related error code, the user is redirected to the
school-authentication screen instead of leaving the state unresolved. Use the
existing shouldFetchGpaScore gating and the useGetMyGpaScore result handling to
add the error-code branch and redirect behavior, and keep the fallback logic
colocated with the GPA query so it is easy to find later.
- Around line 54-60: The authentication gate and redirect logic is duplicated
across ApplyPageContent, ScoreScreen, and GpaSubmitForm, including the
homeUniversityId null early-return, shouldFetchGpaScore-style checks, and the
useEffect redirect. Extract this shared behavior into a reusable hook such as
useRequireHomeUniversity(returnTo) and have each screen call it so the redirect
target and gate conditions are defined in one place. Keep the screen-specific
rendering logic, but remove the repeated auth/redirect branching from each
component and rely on the shared hook instead.

In `@apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx`:
- Around line 41-51: The authentication gate logic in GpaSubmitForm is
duplicated across multiple screens, so extract the shared “initialized +
authenticated + homeUniversityId === null” redirect/return-null flow into a
reusable custom hook. Move the logic currently in useEffect and the null-return
guard into a hook like useHomeUniversityGate, keep the
router.replace(getSchoolEmailVerificationPath(...)) behavior unchanged, and
reuse it alongside the existing ApplyPageContent and ScoreScreen patterns to
centralize future policy changes.
🪄 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: a2be88fe-a7cc-46ae-98c6-06c08c453b9e

📥 Commits

Reviewing files that changed from the base of the PR and between 535ac63 and 4aae47a.

📒 Files selected for processing (9)
  • apps/web/src/apis/Scores/api.ts
  • apps/web/src/apis/Scores/getGpaList.ts
  • apps/web/src/app/my/school-email/_lib/returnTo.ts
  • apps/web/src/app/my/school-email/_ui/SchoolEmailVerificationContent/index.tsx
  • apps/web/src/app/university/application/apply/ApplyPageContent.tsx
  • apps/web/src/app/university/application/apply/GpaStep.tsx
  • apps/web/src/app/university/score/ScoreScreen.tsx
  • apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx
  • apps/web/src/types/score.ts

Comment thread apps/web/src/app/university/score/ScoreScreen.tsx Outdated
@vercel vercel Bot temporarily deployed to Preview – solid-connect-web-admin June 27, 2026 00:36 Inactive
@yoonc01 yoonc01 merged commit 3071e1f into main Jun 27, 2026
13 checks passed
@yoonc01 yoonc01 deleted the feat/gpa-home-university-name branch June 27, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant