Skip to content

Conversation

@YouD0313
Copy link
Collaborator

@YouD0313 YouD0313 commented Jun 23, 2025

구현내용

깃허브 링크 연결하기

연관이슈

close #320

Summary by CodeRabbit

  • 신규 기능

    • GitHub 프로필 인증 성공/실패 시 안내 모달 및 자동 이동 기능이 추가되었습니다.
    • GitHub 인증 성공 후 자동으로 프로필 수정 화면에 GitHub URL이 반영됩니다.
    • GitHub 인증 및 삭제 버튼 UI가 개선되어 인증 상태에 따라 버튼이 변경됩니다.
  • UI/스타일 개선

    • GitHub 관련 입력란 및 링크, 비밀번호 변경 링크에 스타일이 적용되어 더 깔끔한 UI를 제공합니다.
  • 버그 수정

    • 관리자 메뉴에서 잘못된 경로명이 수정되었습니다.
  • 기타

    • 인증 관련 라우트가 추가되어 GitHub 인증 성공/실패 처리가 원활해졌습니다.

@YouD0313 YouD0313 requested a review from layout-SY June 23, 2025 06:58
@YouD0313 YouD0313 self-assigned this Jun 23, 2025
@YouD0313 YouD0313 linked an issue Jun 23, 2025 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link

coderabbitai bot commented Jun 23, 2025

"""

Walkthrough

이 변경사항은 마이페이지에서 깃허브 링크 인증 기능을 도입하고, 관련된 UI 및 라우팅을 추가합니다. 깃허브 인증 성공/실패 시 모달 메시지와 함께 페이지 이동이 이루어지며, 깃허브 링크는 인증 후 자동으로 입력되고, 링크는 새 창에서 열리도록 스타일이 적용되었습니다.

Changes

파일(들) 변경 요약
src/components/user/mypage/myProfile/editProfile/EditProfile.styled.ts 깃허브 관련 UI 요소를 위한 새로운 styled component 3종 추가
src/components/user/mypage/myProfile/editProfile/EditProfile.tsx 깃허브 인증 입력 필드 로직 및 UI 리팩토링, 인증/삭제 버튼 및 상태 관리 추가
src/components/user/mypage/myProfile/editProfile/ProfileGithubSuccess.tsx 깃허브 인증 성공/실패 후 처리 및 모달 표시, 페이지 이동을 담당하는 신규 컴포넌트 추가
src/components/user/mypage/myProfile/profile/Profile.styled.ts 깃허브 링크 및 비밀번호 변경 링크용 styled component 추가 및 기존 스타일 분리
src/components/user/mypage/myProfile/profile/Profile.tsx 깃허브 링크를 styled link로 조건부 렌더링, 비밀번호 변경 링크 스타일 적용
src/constants/routes.ts 깃허브 인증 성공 경로 추가, 일부 관리자 경로 수정 및 as const 적용
src/constants/user/modalMessage.ts 깃허브 인증 성공/실패용 모달 메시지 상수 2종 추가
src/routes/AppRoutes.tsx 깃허브 인증 성공 페이지 라우트 및 lazy import 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditProfile
    participant OAuthGithub
    participant ProfileGithubSuccess
    participant Modal
    participant Router

    User->>EditProfile: "인증" 버튼 클릭
    EditProfile->>OAuthGithub: 깃허브 OAuth URL로 리다이렉트
    OAuthGithub-->>User: 인증 후 githubUrl 포함 리다이렉트
    User->>ProfileGithubSuccess: /oauth/github-success?githubUrl=...
    ProfileGithubSuccess->>Modal: 성공/실패 모달 표시
    Modal-->>User: 모달 메시지 확인
    ProfileGithubSuccess->>Router: 1초 후 EditProfile로 이동 (githubUrl state 전달)
    Router->>EditProfile: githubUrl state로 진입
    EditProfile->>User: 깃허브 링크 자동 입력 및 UI 갱신
Loading

Assessment against linked issues

Objective Addressed Explanation
마이페이지 깃허브링크 인증하기 (#320)
링크태그로 새 창 띄우게 하기 (#320)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항에서는 모든 코드 변경이 이슈 #320의 요구사항과 직접적으로 연관되어 있습니다.)

Suggested labels

⛏기능, 🛠개선

Suggested reviewers

  • layout-SY

Poem

🐰
깃허브 인증, 마이페이지에
토끼가 뛰며 환호하네!
모달로 성공 알리고,
새 창에 링크 펼치고,
코드 한 줄 한 줄에
개발자 웃음이 피어나네!
🥕✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-23T07_50_07_383Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fdbe1a and d896213.

📒 Files selected for processing (2)
  • src/components/user/mypage/myProfile/MyProfileWrapper.tsx (1 hunks)
  • src/components/user/mypage/myProfile/editProfile/EditProfile.tsx (6 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/user/mypage/myProfile/MyProfileWrapper.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/user/mypage/myProfile/editProfile/EditProfile.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: accessibility-test
✨ 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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

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 (4)
src/components/user/mypage/myProfile/editProfile/ProfileGithubSuccess.tsx (2)

16-16: 프로덕션 코드에서 console.log 제거 필요

디버깅용 console.log가 남아있습니다. 프로덕션 배포 전에 제거해야 합니다.

-      console.log(githubUrl);

13-31: useEffect 내부 로직 개선 제안

현재 구현에서 개선할 수 있는 부분들이 있습니다:

  1. 비동기 작업이 없는데 async IIFE 사용
  2. 하드코딩된 1초 타이머
  3. 의존성 배열 최적화 가능
  useEffect(() => {
-    (async () => {
      const githubUrl = searchParams.get('githubUrl');
-      console.log(githubUrl);
      if (githubUrl) {
        handleModalOpen(MODAL_MESSAGE.githubProfileSuccess);
        setTimeout(() => {
          navigate(`${ROUTES.mypage}/${ROUTES.mypageEdit}`, {
            state: { githubUrl },
          });
-        }, 1000);
+        }, 1500); // 사용자가 메시지를 읽을 충분한 시간 제공
      } else {
        handleModalOpen(MODAL_MESSAGE.githubProfileFail);
        setTimeout(() => {
          navigate(`${ROUTES.mypage}/${ROUTES.mypageEdit}`);
-        }, 1000);
+        }, 1500);
      }
-    })();
-  }, [searchParams, handleModalOpen, navigate]);
+  }, [searchParams, handleModalOpen, navigate]);
src/components/user/mypage/myProfile/editProfile/EditProfile.tsx (2)

68-74: 폼 리셋 로직의 중복 처리 개선 필요

깃허브 값 삭제 시 resetsetValue를 모두 호출하고 있어 중복 처리가 발생할 수 있습니다.

다음과 같이 단순화할 수 있습니다:

  const handleClickDeleteGithubValue = () => {
-   reset({
-     ...control._defaultValues,
-     github: '',
-   });
    setValue('github', '', { shouldValidate: true, shouldDirty: true });
  };

278-326: 깃허브 입력 필드 UI 개선이 잘 구현되었습니다.

읽기 전용 입력 필드와 조건부 버튼 렌더링으로 사용자 경험이 크게 개선되었습니다. 인증/삭제 버튼의 토글 방식도 직관적입니다.

하지만 접근성 개선을 위해 다음 사항을 고려해보세요:

  <InputText
    inputType='text'
    placeholder='깃허브 주소를 인증하면 자동으로 가져옵니다.'
    autoComplete='auto'
    readOnly
+   aria-label='깃허브 주소 입력 필드'
    {...field}
  />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8edda1 and 0fdbe1a.

📒 Files selected for processing (8)
  • src/components/user/mypage/myProfile/editProfile/EditProfile.styled.ts (2 hunks)
  • src/components/user/mypage/myProfile/editProfile/EditProfile.tsx (6 hunks)
  • src/components/user/mypage/myProfile/editProfile/ProfileGithubSuccess.tsx (1 hunks)
  • src/components/user/mypage/myProfile/profile/Profile.styled.ts (3 hunks)
  • src/components/user/mypage/myProfile/profile/Profile.tsx (2 hunks)
  • src/constants/routes.ts (2 hunks)
  • src/constants/user/modalMessage.ts (1 hunks)
  • src/routes/AppRoutes.tsx (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
src/components/user/mypage/myProfile/profile/Profile.tsx (1)
src/constants/routes.ts (1)
  • ROUTES (1-33)
src/components/user/mypage/myProfile/editProfile/EditProfile.tsx (1)
src/api/http.api.ts (1)
  • BASE_URL (5-5)
src/routes/AppRoutes.tsx (2)
src/components/user/mypage/myProfile/editProfile/ProfileGithubSuccess.tsx (1)
  • ProfileGithubSuccess (8-38)
src/constants/routes.ts (1)
  • ROUTES (1-33)
src/components/user/mypage/myProfile/profile/Profile.styled.ts (1)
src/components/user/customerService/inquiry/Inquiry.styled.ts (1)
  • SendButton (205-222)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: accessibility-test
🔇 Additional comments (15)
src/constants/user/modalMessage.ts (1)

33-34: 새로운 GitHub 모달 메시지가 적절히 추가되었습니다.

기존 코드 패턴과 일치하며 한국어 메시지도 명확합니다.

src/constants/routes.ts (2)

32-32: GitHub OAuth 성공 처리용 라우트가 적절히 추가되었습니다.

라우트 경로 /oauth/github-success가 OAuth 콜백 처리에 적합합니다.


54-58: Admin 라우트 일관성 개선과 타입 안전성 강화

appliedProject 값을 'applied-project'로 수정하여 일관성을 맞추고, as const를 추가하여 타입 안전성을 향상시켰습니다.

src/components/user/mypage/myProfile/editProfile/EditProfile.styled.ts (2)

46-48: GitHub 컨테이너 스타일링이 적절합니다.

85% 너비 설정이 기존 UI 패턴과 일치합니다.


60-75: GitHub 삭제 아이콘과 span 스타일 추가

Flexbox 레이아웃과 SVG 크기 지정이 적절하게 구현되었습니다. 컴포넌트 명명도 목적에 맞게 명확합니다.

src/routes/AppRoutes.tsx (2)

50-55: ProfileGithubSuccess 컴포넌트의 lazy import가 적절합니다.

컴포넌트 경로와 lazy loading 패턴이 기존 코드와 일치합니다.


119-122: GitHub 성공 라우트 추가 - 인증 없이 접근 가능한 점 확인 필요

라우트가 적절한 위치에 추가되었지만, OAuth 콜백 처리 라우트가 인증 없이 접근 가능합니다. 이것이 의도된 동작인지 확인해 주세요.

OAuth 콜백 라우트의 보안을 확인하기 위해 다음을 검토해 주세요:

  1. GitHub OAuth 콜백에서 적절한 state 검증이 이루어지는지
  2. 악의적인 사용자가 임의의 githubUrl 파라미터로 접근할 수 있는지
src/components/user/mypage/myProfile/editProfile/ProfileGithubSuccess.tsx (1)

8-38: 전체적인 컴포넌트 구조는 적절합니다.

GitHub OAuth 콜백 처리 로직이 명확하고, 성공/실패 케이스를 모두 적절히 처리합니다. 모달과 네비게이션을 통한 사용자 경험도 좋습니다.

src/components/user/mypage/myProfile/profile/Profile.tsx (2)

134-141: 깃허브 링크 조건부 렌더링이 잘 구현되었습니다.

사용자의 깃허브 URL이 있을 때만 링크를 표시하고, 없을 때는 적절한 기본 메시지를 보여주는 로직이 정확합니다. 새 창에서 링크가 열리도록 target='_blank' 속성도 적절히 설정되어 있습니다.


197-201: 비밀번호 재설정 링크 스타일링이 개선되었습니다.

기존의 일반 Link 컴포넌트를 스타일드 컴포넌트로 변경하여 일관된 디자인을 적용한 것이 좋습니다. as={Link} prop을 사용하여 라우팅 기능을 유지하면서 스타일링을 적용한 방식이 적절합니다.

src/components/user/mypage/myProfile/editProfile/EditProfile.tsx (2)

82-89: 깃허브 URL 상태 처리 로직이 적절합니다.

OAuth 콜백에서 전달된 깃허브 URL을 폼에 자동으로 설정하는 로직이 잘 구현되어 있습니다. shouldValidateshouldDirty 옵션도 적절히 설정되어 있습니다.


39-42: 환경 변수 사용에 대한 검증이 필요합니다.

깃허브 OAuth URL을 환경 변수에서 가져오고 있는데, 해당 환경 변수가 정의되지 않은 경우의 처리가 없습니다.

다음 스크립트로 환경 변수 사용을 확인해주세요:

#!/bin/bash
# 환경 변수 VITE_APP_BASE_URL_GITHUB_LINK 사용 확인
rg -A 3 -B 3 "VITE_APP_BASE_URL_GITHUB_LINK"
src/components/user/mypage/myProfile/profile/Profile.styled.ts (3)

1-3: 새로운 의존성 추가가 적절합니다.

react-router-dom의 Link와 기존 SendButton 컴포넌트를 재사용하여 일관된 스타일링을 구현한 것이 좋습니다.


119-123: 깃허브 링크 호버 효과가 잘 구현되었습니다.

Link 컴포넌트를 확장하여 호버 시 색상 변경 효과를 추가한 것이 사용자 경험 개선에 도움이 됩니다. 테마 색상을 활용한 것도 좋습니다.


175-181: 비밀번호 변경 링크 스타일링이 적절합니다.

기존 SendButton을 확장하여 일관된 디자인을 유지하면서 필요한 커스터마이징을 적용한 것이 좋습니다. 크기와 색상 조정이 적절해 보입니다.

@YouD0313 YouD0313 merged commit 453a09e into develop Jun 23, 2025
4 checks passed
@YouD0313 YouD0313 deleted the feat/#320 branch June 23, 2025 07:53
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.

마이페이지 깃허브링크 인증하기

3 participants