Skip to content

[feature] 동아리 지원서 답변 화면 구현 및 관련 컴포넌트 개발#490

Merged
oesnuj merged 10 commits intodevelop-fefrom
feature/#486-answer-form-ui-MOA-33
Jun 4, 2025
Merged

[feature] 동아리 지원서 답변 화면 구현 및 관련 컴포넌트 개발#490
oesnuj merged 10 commits intodevelop-fefrom
feature/#486-answer-form-ui-MOA-33

Conversation

@oesnuj
Copy link
Member

@oesnuj oesnuj commented Jun 4, 2025

#️⃣연관된 이슈

#486

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지/동영상 첨부 가능)

🚀 주요 기능 추가

  • AnswerApplicationForm 컴포넌트: 동아리 지원서 답변 메인 화면 구현
  • QuestionAnswerer 컴포넌트: 질문별 답변 처리 컴포넌트 개발
  • useAnswers 커스텀 훅: 답변 데이터 관리를 위한 재사용 가능한 로직
  • AnswerItem 타입: 답변 데이터 구조 정의

🔧 기능 상세

  1. 답변 화면 구성

    • ClubProfile을 통한 동아리 정보 표시
    • mockData를 활용한 질문 목록 렌더링
    • 답변 제출 버튼 UI
  2. 답변 처리 로직

    • SHORT_TEXT, LONG_TEXT 유형 답변 지원
    • 단일/다중 답변 업데이트 처리
    • ID 기반 답변 데이터 조회 기능
  3. 리팩토링

    • 기존 ApplicationForm 컴포넌트 제거
    • 라우트 경로 수정 및 코드 정리

🎨 스타일링

  • AnswerApplicationForm 전용 스타일 파일 추가
  • QuestionTitle 스타일 속성 개선

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • 신규 기능
    • 새로운 지원서 작성 폼과 답변 관리 기능이 추가되었습니다.
    • 다양한 질문 유형에 따라 입력 필드를 렌더링하는 컴포넌트가 도입되었습니다.
  • 스타일
    • 지원서 답변 폼의 제목, 버튼, 레이아웃 등 시각적 스타일이 개선되었습니다.
  • 버그 수정
    • 입력 필드의 크기 조정 방식이 개선되어 더 자연스러운 입력 경험을 제공합니다.
  • 리팩터
    • 기존 지원서 폼이 제거되고 새로운 구조로 대체되었습니다.

oesnuj added 8 commits June 4, 2025 15:19
1. 동아리 지원서 답변 화면 구현을 위한 AnswerApplicationForm 컴포넌트 신규 추가
2. ClubProfile, QuestionAnswerer, mockData 등을 활용한 화면 구성
3. 하드코딩된 clubId 사용 및 기본 예외 처리 추가
1. 동아리 지원서 답변 데이터를 다루기 위한 새로운 AnswerItem 인터페이스 추가
2. id와 answer 속성을 포함하여 답변 항목의 구조를 정의
1. 단일 답변 및 다중 답변 업데이트를 처리하는 로직 추가
2. 답변 id를 기준으로 답변 데이터를 조회하는 기능 구현
3. 동아리 지원서 답변 관리를 위한 재사용 가능한 훅 제공
1. 동아리 지원서 질문에 대한 답변 처리를 위한 QuestionAnswerer 컴포넌트 신규 추가
2. SHORT_TEXT, LONG_TEXT 유형의 답변 UI 컴포넌트 렌더링 지원
3. 미지원 질문 유형에 대한 기본 예외 처리 추가
@oesnuj oesnuj requested review from Copilot and seongwon030 June 4, 2025 06:26
@oesnuj oesnuj self-assigned this Jun 4, 2025
@oesnuj oesnuj added ✨ Feature 기능 개발 💻 FE Frontend labels Jun 4, 2025
@netlify
Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 0209ba5
🔍 Latest deploy log https://app.netlify.com/projects/moadong/deploys/683fecc7c24244000800fb79
😎 Deploy Preview https://deploy-preview-490--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 36
Accessibility: 87
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • 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

"""

Walkthrough

기존 ApplicationForm 컴포넌트와 라우트가 제거되고, AnswerApplicationForm 컴포넌트와 관련 스타일, 훅, 하위 컴포넌트가 새롭게 추가되었습니다. 새로운 폼은 질문 유형별 입력 필드와 응답 상태 관리 훅을 포함하며, 라우트는 /application으로 변경되었습니다.

Changes

파일/경로 그룹 변경 요약
frontend/src/App.tsx ApplicationForm 삭제, AnswerApplicationForm로 라우트 및 import 교체, 동적 clubid 라우트 TODO 주석 추가
frontend/src/pages/AdminPage/application/ApplicationForm.tsx ApplicationForm 컴포넌트 및 관련 타입 전체 삭제
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx AnswerApplicationForm 컴포넌트 새로 추가, club 정보 fetch, 질문 렌더링 및 응답 상태 관리
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.styles.ts AnswerApplicationForm용 스타일 컴포넌트(FormTitle, ButtonWrapper, submitButton) 추가
frontend/src/pages/AdminPage/application/components/QuestionAnswerer/QuestionAnswerer.tsx QuestionAnswerer 컴포넌트 추가, 질문 유형별 입력 필드 분기 렌더링
frontend/src/pages/AdminPage/application/components/QuestionTitle/QuestionTitle.styles.ts QuestionTitleText 스타일 width → field-sizing: content으로 변경
frontend/src/hooks/useAnswers.ts useAnswers 커스텀 훅 추가, 응답 상태 배열 관리 및 변경 함수 제공
frontend/src/types/application.ts AnswerItem 인터페이스(id, answer) 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AnswerApplicationForm
    participant useGetClubDetail
    participant useAnswers
    participant QuestionAnswerer

    User->>AnswerApplicationForm: /application 라우트 접근
    AnswerApplicationForm->>useGetClubDetail: club 정보 fetch
    useGetClubDetail-->>AnswerApplicationForm: club 데이터 반환
    AnswerApplicationForm->>QuestionAnswerer: 각 질문별 렌더링
    User->>QuestionAnswerer: 답변 입력
    QuestionAnswerer->>useAnswers: onChange 호출로 응답 상태 변경
    User->>AnswerApplicationForm: 제출 버튼 클릭
Loading

Assessment against linked issues

Objective (이슈 번호) Addressed Explanation
반응형 레이아웃 구조 설계, 질문 유형별 입력 필드 컴포넌트 개발, 단답형/장문형/객관식/특수타입 렌더링, 응답 상태 저장 로직, 스타일 조정 (MOA-33) CHOICE, MULTI_CHOICE 등 일부 입력 필드 미구현
필수 항목 처리 및 유효성 검사 로직 구현 (MOA-33) 필수 항목/유효성 검사 로직 미포함
모바일/태블릿/PC에서 UI 테스트 및 스타일 조정 (MOA-33) 반응형 스타일 일부 적용 여부 코드상 불명확

Assessment against linked issues: Out-of-scope changes

Code Change (파일 경로 및 라인) Explanation
QuestionTitleText 스타일의 field-sizing 속성 변경 (frontend/src/pages/AdminPage/application/components/QuestionTitle/QuestionTitle.styles.ts) 본 이슈의 Answer 폼 UI 구현과 직접적 관련이 명확하지 않음.

Possibly related PRs

Suggested reviewers

  • seongwon030
    """
✨ 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.

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new AnswerApplicationForm for handling club application answers along with its supporting components and hooks, while removing an obsolete ApplicationForm. Key changes include:

  • Implementation of AnswerApplicationForm and associated styles.
  • Development of QuestionAnswerer to support multiple question types.
  • Addition of the useAnswers hook for answer state management.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/types/application.ts Added AnswerItem type definition to support answer data structures.
frontend/src/pages/AdminPage/application/components/QuestionTitle/QuestionTitle.styles.ts Updated styling properties for QuestionTitle but replaced width with a non-standard CSS property.
frontend/src/pages/AdminPage/application/components/QuestionAnswerer/QuestionAnswerer.tsx Introduced a new component to render question-specific answer fields with commented-out code for choice-based questions.
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx Created a new component for rendering the answer submission form with club details and question mapping.
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.styles.ts Added new styles dedicated to the AnswerApplicationForm component.
frontend/src/pages/AdminPage/application/ApplicationForm.tsx Removed obsolete ApplicationForm code.
frontend/src/hooks/useAnswers.ts Introduced a custom hook to manage answer state updates and retrieval.
frontend/src/App.tsx Updated routing to load AnswerApplicationForm, with comments indicating further route adjustments.
Comments suppressed due to low confidence (1)

frontend/src/App.tsx:74

  • [nitpick] The TODO comment and commented-out route may cause confusion in production. It is recommended to update or remove them once the final routing is determined.
//todo /:clubid로 수정 필요

@codecov
Copy link

codecov bot commented Jun 4, 2025

Copy link
Contributor

@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: 7

🧹 Nitpick comments (3)
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.styles.ts (1)

17-37: 컴포넌트 이름을 PascalCase로 변경해야 합니다.

React 컴포넌트는 PascalCase 명명 규칙을 따라야 합니다.

다음과 같이 수정하세요:

-export const submitButton = styled.button`
+export const SubmitButton = styled.button`

그리고 사용하는 곳에서도 업데이트해야 합니다:

-        <Styled.submitButton onClick={handleSubmit}>제출하기</Styled.submitButton>
+        <Styled.SubmitButton onClick={handleSubmit}>제출하기</Styled.SubmitButton>
frontend/src/pages/AdminPage/application/components/QuestionAnswerer/QuestionAnswerer.tsx (2)

26-36: 중복된 코드를 리팩토링하는 것을 고려해보세요.

여러 질문 타입이 동일한 ShortText 컴포넌트를 사용하고 있습니다. 코드 가독성을 위해 그룹화할 수 있습니다.

다음과 같이 리팩토링할 수 있습니다:

+  const shortTextTypes = ['NAME', 'EMAIL', 'PHONE_NUMBER', 'SHORT_TEXT'];
+  
+  if (shortTextTypes.includes(question.type)) {
+    return (
+      <ShortText
+        {...baseProps}
+        answer={selectedAnswers[0] ?? ''}
+        onAnswerChange={(value) => onChange(question.id, value)}
+      />
+    );
+  }

   switch (question.type) {
-    case 'NAME':
-    case 'EMAIL':
-    case 'PHONE_NUMBER':
-    case 'SHORT_TEXT':
-      return (
-        <ShortText
-          {...baseProps}
-          answer={selectedAnswers[0] ?? ''}
-          onAnswerChange={(value) => onChange(question.id, value)}
-        />
-      );

61-61: 국제화(i18n)를 고려하여 하드코딩된 텍스트를 상수로 분리하세요.

오류 메시지가 한국어로 하드코딩되어 있습니다. 향후 다국어 지원을 위해 상수로 분리하는 것을 권장합니다.

상수 파일에 메시지를 정의하고 import하여 사용하세요:

+// constants/messages.ts
+export const MESSAGES = {
+  UNSUPPORTED_QUESTION_TYPE: '지원하지 않는 질문 유형입니다',
+};

-      return <div>지원하지 않는 질문 유형입니다: {question.type}</div>;
+      return <div>{MESSAGES.UNSUPPORTED_QUESTION_TYPE}: {question.type}</div>;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 879786c and df0a87c.

📒 Files selected for processing (8)
  • frontend/src/App.tsx (2 hunks)
  • frontend/src/hooks/useAnswers.ts (1 hunks)
  • frontend/src/pages/AdminPage/application/ApplicationForm.tsx (0 hunks)
  • frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.styles.ts (1 hunks)
  • frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (1 hunks)
  • frontend/src/pages/AdminPage/application/components/QuestionAnswerer/QuestionAnswerer.tsx (1 hunks)
  • frontend/src/pages/AdminPage/application/components/QuestionTitle/QuestionTitle.styles.ts (1 hunks)
  • frontend/src/types/application.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • frontend/src/pages/AdminPage/application/ApplicationForm.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
frontend/src/hooks/useAnswers.ts (1)
frontend/src/types/application.ts (1)
  • AnswerItem (51-54)
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (4)
frontend/src/hooks/queries/club/useGetClubDetail.ts (1)
  • useGetClubDetail (6-20)
frontend/src/hooks/useAnswers.ts (1)
  • useAnswers (4-33)
frontend/src/pages/MainPage/MainPage.styles.ts (1)
  • PageContainer (3-15)
frontend/src/mocks/data/mockData.ts (1)
  • mockData (25-122)
🪛 Biome (1.9.4)
frontend/src/App.tsx

[error] 74-75: Wrap comments inside children within braces.

Unsafe fix: Wrap the comments with braces

(lint/suspicious/noCommentText)

🔇 Additional comments (3)
frontend/src/types/application.ts (1)

51-54: 잘 정의된 인터페이스입니다.

AnswerItem 인터페이스가 명확하고 간결하게 정의되어 있습니다. 답변 데이터를 관리하기 위한 구조가 적절합니다.

frontend/src/hooks/useAnswers.ts (1)

4-33: 잘 구현된 커스텀 훅입니다.

답변 상태 관리 로직이 명확하게 분리되어 있고, 단일/다중 답변 처리가 적절히 구현되었습니다. ID별 중복 제거 로직과 타입 안전성도 잘 보장되어 있습니다.

frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (1)

36-43: 프로덕션 환경에서 mockData 사용을 검증해야 합니다.

현재 하드코딩된 mock 데이터를 사용하고 있습니다. 실제 API에서 질문 데이터를 가져와야 하는지 확인이 필요합니다.

Mock 데이터 사용이 의도된 것인지 확인하고, 실제 API 연동이 필요한 경우 관련 훅을 구현해야 합니다.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answer mode 구현 수고하셨습니다!

Copy link
Contributor

@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: 2

♻️ Duplicate comments (1)
frontend/src/App.tsx (1)

78-78: JSX 주석 구문을 수정해주세요.

JSX 내부에서 //todo 형태의 주석은 올바르지 않습니다. JSX 주석은 {/* */} 형태로만 사용해야 합니다.

-            {/*//todo /:clubid로 수정 필요*/}
+            {/* todo /:clubid로 수정 필요 */}
🧹 Nitpick comments (1)
frontend/src/App.tsx (1)

17-17: 테스트 커버리지 개선이 필요합니다.

새로운 AnswerApplicationForm 컴포넌트 임포트가 테스트로 커버되지 않고 있습니다. 라우팅 변경사항에 대한 테스트 케이스 추가를 고려해주세요.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 17-17: frontend/src/App.tsx#L17
Added line #L17 was not covered by tests

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 23b288c and 0209ba5.

📒 Files selected for processing (1)
  • frontend/src/App.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
frontend/src/App.tsx (1)
Learnt from: seongwon030
PR: Moadong/moadong#195
File: frontend/src/pages/AdminPage/AdminPage.tsx:7-7
Timestamp: 2025-03-19T05:18:07.818Z
Learning: AdminPage.tsx에서 현재 하드코딩된 클럽 ID('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.
🪛 GitHub Check: codecov/patch
frontend/src/App.tsx

[warning] 17-17: frontend/src/App.tsx#L17
Added line #L17 was not covered by tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments