Skip to content

LC-2857 ADMIN 마그넷 내부화 신청폼 관리#2142

Open
hyonun321 wants to merge 1 commit intoLC-2838-Sprint-17from
LC-2857-ADMIN-마그넷-내부화-신청폼-관리

Hidden character warning

The head ref may contain hidden characters: "LC-2857-ADMIN-\ub9c8\uadf8\ub137-\ub0b4\ubd80\ud654-\uc2e0\uccad\ud3fc-\uad00\ub9ac"
Open

LC-2857 ADMIN 마그넷 내부화 신청폼 관리#2142
hyonun321 wants to merge 1 commit intoLC-2838-Sprint-17from
LC-2857-ADMIN-마그넷-내부화-신청폼-관리

Conversation

@hyonun321
Copy link
Contributor

@hyonun321 hyonun321 commented Feb 25, 2026

  • 질문 카드 CRUD, 주관식/객관식 지원, 신청폼 복제 드롭다운 구현.
  • form/ 폴더 컴포넌트는 추후 공통 신청폼 페이지에서 재사용 가능하도록 설계

연관 작업

- 질문 카드 CRUD, 주관식/객관식 지원, 신청폼 복제 드롭다운 구현.
- form/ 폴더 컴포넌트는 추후 공통 신청폼 페이지에서 재사용 가능하도록 설계
@github-actions github-actions bot changed the title feat: 어드민 마그넷 신청폼 관리 페이지 구현 (목데이터) LC-2857 ADMIN 마그넷 내부화 신청폼 관리 Feb 25, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @hyonun321, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 관리자가 각 마그넷에 대한 신청폼을 효율적으로 관리할 수 있도록 새로운 기능을 도입합니다. 질문을 생성하고, 주관식 또는 객관식 유형을 선택하며, 필요에 따라 기존 폼을 복제하여 시간을 절약할 수 있는 사용자 친화적인 인터페이스를 제공합니다. 이는 마그넷 신청 프로세스의 유연성과 관리 편의성을 크게 향상시킬 것입니다.

Highlights

  • 어드민 마그넷 신청폼 관리 페이지 구현: 마그넷별 신청폼을 생성, 편집, 관리할 수 있는 새로운 어드민 페이지가 구현되었습니다.
  • 질문 카드 CRUD 및 유형 지원: 신청폼 내에서 질문을 추가, 수정, 삭제할 수 있는 CRUD 기능이 제공되며, 주관식 및 객관식 질문 유형을 모두 지원합니다.
  • 신청폼 복제 기능: 기존에 생성된 다른 마그넷의 신청폼을 현재 마그넷으로 복제하여 재사용할 수 있는 드롭다운 기능이 추가되었습니다.
  • 재사용 가능한 폼 컴포넌트 설계: 신청폼 관련 컴포넌트들이 추후 공통 신청폼 페이지에서 재사용될 수 있도록 설계되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/app/admin/blog/magnet/[id]/form/page.tsx
    • 기존의 임시 페이지를 제거하고, 실제 마그넷 신청폼 관리 페이지 컴포넌트인 MagnetFormPage를 렌더링하도록 업데이트되었습니다.
    • URL 파라미터에서 magnetId를 추출하고, 해당 ID를 사용하여 초기 폼 데이터를 비동기적으로 가져오도록 변경되었습니다.
  • src/domain/admin/blog/magnet/MagnetFormPage.tsx
    • 마그넷 신청폼 관리 페이지의 메인 컴포넌트가 추가되었습니다.
    • 폼 빌더 섹션과 신청폼 복제 드롭다운을 통합하고, 질문 추가/수정/삭제 및 폼 저장 기능을 제공합니다.
  • src/domain/admin/blog/magnet/form/CloneFormDropdown.tsx
    • 다른 마그넷의 신청폼을 현재 폼으로 복제할 수 있는 드롭다운 컴포넌트가 추가되었습니다.
    • 복제 가능한 마그넷 목록을 가져오고, 복제 시 기존 질문 대체 여부를 확인하는 로직이 포함되었습니다.
  • src/domain/admin/blog/magnet/form/FormBuilderSection.tsx
    • 신청폼의 질문들을 관리하고 표시하는 섹션 컴포넌트가 추가되었습니다.
    • 각 질문을 QuestionCard로 렌더링하고, 질문 추가 기능을 제공합니다.
  • src/domain/admin/blog/magnet/form/QuestionCard.tsx
    • 개별 질문을 표시하고 편집할 수 있는 카드 컴포넌트가 추가되었습니다.
    • 질문 유형(주관식/객관식), 응답 필수 여부, 질문 텍스트, 설명 등을 설정할 수 있는 UI를 제공합니다.
    • 객관식 질문의 경우 선택 방식(단일/다중) 및 항목 목록을 관리하는 기능을 포함합니다.
  • src/domain/admin/blog/magnet/form/QuestionItemList.tsx
    • 객관식 질문의 항목들을 관리하는 컴포넌트가 추가되었습니다.
    • 항목 추가, 삭제, 값 수정 기능을 제공하며, '기타(직접입력)' 항목을 지원합니다.
  • src/domain/admin/blog/magnet/hooks/useMagnetFormBuilder.ts
    • 마그넷 신청폼 빌더의 상태 관리 및 로직을 처리하는 커스텀 훅이 추가되었습니다.
    • 질문 추가, 삭제, 수정, 폼 복제, 폼 저장, 목록으로 이동 등의 기능을 캡슐화합니다.
    • 빈 질문 또는 유효하지 않은 객관식 질문에 대한 유효성 검사 로직이 포함되었습니다.
  • src/domain/admin/blog/magnet/mock.ts
    • 마그넷 신청폼 데이터를 위한 목(mock) 데이터 MOCK_MAGNET_FORMS가 추가되었습니다.
    • 특정 마그넷의 폼 데이터를 가져오는 fetchMagnetForm 함수가 추가되었습니다.
    • 마그넷 폼 데이터를 저장하는 saveMagnetForm 함수가 추가되었습니다.
    • 폼이 있는 마그넷 목록을 가져오는 fetchMagnetsWithForm 함수가 추가되었습니다.
  • src/domain/admin/blog/magnet/types.ts
    • 마그넷 신청폼 관리에 필요한 새로운 타입 정의들이 추가되었습니다.
    • FormQuestionType, FormResponseRequired, FormSelectionMethod 등 질문 관련 열거형 타입이 정의되었습니다.
    • FormQuestionItem, FormQuestion, MagnetFormData, MagnetFormReqBody, MagnetWithFormSummary 등 데이터 구조를 위한 인터페이스가 정의되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@hyonun321 hyonun321 self-assigned this Feb 25, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 어드민 페이지에 마그넷 신청폼 관리 기능을 추가하는 변경사항을 담고 있습니다. 질문 카드 CRUD, 주관식/객관식 지원, 다른 폼 복제 기능 등이 구현되었습니다. 전반적으로 컴포넌트와 훅이 잘 분리되어 있고, 상태 관리 로직도 명확합니다.

다만, 몇 가지 개선점을 제안합니다.

  1. Next.js 페이지 컴포넌트에서 params prop을 잘못 사용하고 있어 런타임 오류가 발생할 수 있는 부분을 수정해야 합니다. (critical)
  2. useMagnetFormBuilder 훅의 유효성 검사 로직에서 복잡한 조건을 변수로 추출하여 가독성을 높이는 것을 제안합니다. (medium)

자세한 내용은 각 파일의 리뷰 코멘트를 참고해주세요.

Comment on lines +4 to +5
const Page = async ({ params }: { params: Promise<{ id: string }> }) => {
const { id } = await params;

Choose a reason for hiding this comment

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

critical

Next.js 페이지 컴포넌트의 params prop 타입과 사용법이 잘못되었습니다. params는 Promise가 아니라 객체이며, await 없이 직접 접근해야 합니다. 현재 코드는 런타임 오류를 발생시킬 수 있습니다.

Suggested change
const Page = async ({ params }: { params: Promise<{ id: string }> }) => {
const { id } = await params;
const Page = async ({ params }: { params: { id: string } }) => {
const { id } = params;

Comment on lines +94 to +98
const invalidObjective = questions.find(
(q) =>
q.questionType === 'OBJECTIVE' &&
q.items.filter((i) => !i.isOther).length === 0,
);

Choose a reason for hiding this comment

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

medium

saveForm 함수 내 객관식 질문의 유효성을 검사하는 로직이 복잡합니다. 가독성을 높이고 코드의 의도를 더 명확하게 전달하기 위해, 복잡한 조건문을 의미 있는 이름을 가진 여러 변수로 나누는 것을 권장합니다. 이는 스타일 가이드의 "복잡한 조건 이름 짓기" 규칙에도 부합합니다.

    const invalidObjective = questions.find((q) => {
      const isObjectiveQuestion = q.questionType === 'OBJECTIVE';
      const hasNoSelectableItems =
        q.items.filter((i) => !i.isOther).length === 0;
      return isObjectiveQuestion && hasNoSelectableItems;
    });
References
  1. 복잡한 불리언 조건은 가독성을 위해 이름 있는 변수에 할당해야 합니다. 이는 코드의 의미를 명확하게 하고, 자체적으로 문서화하는 효과를 가져옵니다. (link)

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.

1 participant