Skip to content

feat: 티켓 종류 선택 퍼블리싱#139

Merged
hyeeuncho merged 3 commits intodevelopfrom
feat/#136/ticket-select
May 25, 2025
Merged

feat: 티켓 종류 선택 퍼블리싱#139
hyeeuncho merged 3 commits intodevelopfrom
feat/#136/ticket-select

Conversation

@hyeeuncho
Copy link
Copy Markdown
Member

@hyeeuncho hyeeuncho commented May 22, 2025

메뉴에 사용자 응답 관리 추가

스크린샷 2025-05-23 오전 12 14 46

티켓 선택 모달

스크린샷 2025-05-22 오후 2 23 14

Summary by CodeRabbit

  • 신규 기능

    • 사이드바에 "사용자 응답 관리" 메뉴가 추가되었습니다.
    • "사용자 응답 관리" 메뉴 클릭 시 티켓 선택 모달이 열리도록 개선되었습니다.
    • 티켓 선택 모달에서 티켓을 선택하면 해당 티켓의 응답을 확인할 수 있습니다.
  • 버그 수정

    • 페이지 및 라우터에서 오타로 인한 컴포넌트/경로명이 올바르게 수정되었습니다.

@hyeeuncho hyeeuncho self-assigned this May 22, 2025
@hyeeuncho hyeeuncho linked an issue May 22, 2025 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 22, 2025

Walkthrough

이 변경 사항은 대시보드의 "사용자 응답 관리" 메뉴와 관련된 모달 관리 및 티켓 선택 기능을 추가합니다. 상태 관리 스토어와 관련 컴포넌트가 확장되었으며, 새로운 모달 컴포넌트가 도입되고, 메뉴 클릭 시 모달이 열리도록 사이드바와 페이지 로직이 수정되었습니다.

Changes

파일/경로 요약 변경 요약
src/features/dashboard/model/store/ResponseStore.tsx ResponseState에 모달 상태(isModalOpen), 선택 티켓 ID(selectedTicketId) 및 관련 setter 함수 추가
src/pages/dashboard/ui/ParticipantsMangementPage.tsx SelectTicketModal에 전달되던 participants prop 제거
src/shared/types/dashboardType.ts 메뉴 리스트에 "사용자 응답 관리" 항목 및 관련 아이콘 추가
src/widgets/dashboard/ui/main/SideBar.tsx "사용자 응답 관리" 메뉴 클릭 시 openModal 호출 로직 추가
src/widgets/dashboard/ui/response/ResponseModal.tsx 티켓 선택을 위한 새로운 모달 컴포넌트(ResponesModal) 추가
src/app/routes/Router.tsx ResponseManagementPage 경로 오타 수정
src/pages/dashboard/ui/ResponseManagementPage.tsx 컴포넌트명 오타 수정 및 모달 상태 연동, 조건부 모달 렌더링 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SideBar
    participant ResponseStore
    participant ResponseManagementPage
    participant ResponesModal

    User->>SideBar: "사용자 응답 관리" 메뉴 클릭
    SideBar->>ResponseStore: openModal()
    SideBar->>ResponseManagementPage: (라우팅 또는 현재 페이지 유지)
    ResponseManagementPage->>ResponseStore: isModalOpen 확인
    alt isModalOpen == true
        ResponseManagementPage->>ResponesModal: onClose=closeModal
        User->>ResponesModal: 티켓 선택
        ResponesModal->>ResponseStore: setSelectedTicketId()
        ResponesModal->>ResponseStore: closeModal()
    end
Loading

Suggested labels

🔧 Feature

Suggested reviewers

  • Yejiin21
  • xaexunxang

Poem

🐇
모달이 열리고 티켓이 반짝,
사이드바 클릭에 응답이 착착!
새로운 기능에 깡총깡총,
토끼도 기뻐서 귀를 쫑긋!
대시보드 관리가 더 쉬워졌네,
모두 함께 환영해요, 새 변화에!
🥕

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ 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.

@hyeeuncho hyeeuncho added the 🖼️ Publishing 페이지 퍼블리싱 label May 22, 2025
@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown

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

🧹 Nitpick comments (10)
src/pages/dashboard/ui/ResponsesManagementPage.tsx (2)

8-8: 컴포넌트 이름에 오타가 있습니다.

ResponesModal이라고 되어 있는데, 올바른 철자는 ResponseModal입니다. 's'가 빠져있습니다.

-import ResponesModal from '../../../widgets/dashboard/ui/response/ResponseModal';
+import ResponseModal from '../../../widgets/dashboard/ui/response/ResponseModal';

26-28: ResponesModal 컴포넌트 이름 오타가 있습니다.

컴포넌트 이름에 오타가 있습니다. 또한 자식 컴포넌트가 필요하지 않다면 self-closing 태그를 사용하는 것이 더 깔끔합니다.

-      {isModalOpen && (
-        <ResponesModal onClose={closeModal}></ResponesModal>
-      )}
+      {isModalOpen && (
+        <ResponseModal onClose={closeModal} />
+      )}
src/widgets/dashboard/ui/main/SideBar.tsx (2)

20-22: 들여쓰기 수정이 필요합니다.

조건문 내부의 코드 들여쓰기가 일관되지 않습니다. 가독성을 위해 들여쓰기를 수정해주세요.

      if (menuText === '사용자 응답 관리') {
-      openModal();
-    }
+        openModal();
+      }

26-28: 들여쓰기 수정이 필요합니다.

조건문 내부의 코드 들여쓰기가 일관되지 않습니다. 가독성을 위해 들여쓰기를 수정해주세요.

      if (menuText === '사용자 응답 관리') {
-      openModal();
-    }
+        openModal();
+      }
src/widgets/dashboard/ui/response/ResponseModal.tsx (4)

11-11: 컴포넌트 이름에 오타가 있습니다.

ResponesModal에 오타가 있습니다. 올바른 이름은 ResponseModal입니다.

-const ResponesModal = ({ onClose }: ResponesModalProps) => {
+const ResponseModal = ({ onClose }: ResponesModalProps) => {

20-24: 개발용 콘솔 로그를 제거해주세요.

프로덕션 코드에 콘솔 로그가 남아있습니다. 배포 전에 제거하는 것이 좋습니다.

const handleClick = (ticketId: number) => {
  setSelectedTicketId(ticketId);
-  console.log(ticketId)
  onClose();
};

37-49: 로딩 상태 처리 및 티켓 목록 렌더링이 잘 구현되어 있습니다.

데이터 로딩 중일 때 로딩 메시지를 표시하고, 데이터가 로드되면 티켓 목록을 렌더링하는 조건부 렌더링이 잘 구현되어 있습니다.

다만, SelectTicketInfo 컴포넌트에 전달되는 tickets prop의 이름이 혼란스러울 수 있습니다. 단일 티켓 객체를 전달하는데 복수형을 사용하고 있습니다.

<SelectTicketInfo
  key={ticket.ticketId}
-  tickets={ticket}
+  ticket={ticket}
  onClick={() => {
    handleClick(ticket.ticketId);
  }}
/>

54-54: export 이름이 컴포넌트 이름과 일치하도록 수정해주세요.

컴포넌트 이름이 ResponesModal이므로 export 이름도 일치시켜야 합니다. 그러나 앞서 언급한대로 컴포넌트 이름 자체를 ResponseModal로 수정하는 것이 더 적절합니다.

-export default ResponesModal;
+export default ResponseModal;
src/features/dashboard/model/store/ResponseStore.tsx (2)

9-10: 모달 상태 관리를 위한 상태 추가가 적절합니다.

모달 표시 여부와 선택된 티켓 ID를 저장하기 위한 상태를 추가한 것은 좋습니다. 다만 selectedTicketId의 타입이 number | null로 정의되어 있지만, 초기값은 0으로 설정되어 있어 일관성이 없습니다. 타입과 초기값을 일치시키는 것이 좋습니다.

interface ResponseState {
  // ...
-  selectedTicketId: number | null;
+  selectedTicketId: number;
  // ...
}

또는 초기값을 null로 변경:

// 초기값 설정 부분
-  selectedTicketId: 0,
+  selectedTicketId: null,

58-60: 선택된 티켓 ID 설정 메서드의 코드 포맷팅을 개선해주세요.

객체 속성 선언에 공백이 누락되어 있습니다.

setSelectedTicketId: (ticketId) => {
-  set({selectedTicketId: ticketId})
+  set({ selectedTicketId: ticketId })
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 49c3bdb and d6b6945.

⛔ Files ignored due to path filters (2)
  • public/assets/dashboard/menu/Response(black).svg is excluded by !**/*.svg
  • public/assets/dashboard/menu/Response(pink).svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • src/features/dashboard/model/store/ResponseStore.tsx (2 hunks)
  • src/pages/dashboard/ui/ParticipantsMangementPage.tsx (1 hunks)
  • src/pages/dashboard/ui/ResponsesManagementPage.tsx (2 hunks)
  • src/shared/types/dashboardType.ts (2 hunks)
  • src/widgets/dashboard/ui/main/SideBar.tsx (1 hunks)
  • src/widgets/dashboard/ui/response/ResponseModal.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/pages/dashboard/ui/ResponsesManagementPage.tsx (1)
src/features/dashboard/model/store/ResponseStore.tsx (1)
  • useResponseStore (21-61)
src/widgets/dashboard/ui/response/ResponseModal.tsx (2)
src/features/ticket/hooks/useTicketHook.ts (1)
  • useTickets (5-11)
src/features/dashboard/model/store/ResponseStore.tsx (1)
  • useResponseStore (21-61)
src/features/dashboard/model/store/ResponseStore.tsx (1)
src/shared/types/responseType.ts (1)
  • responsesData (12-20)
🔇 Additional comments (13)
src/pages/dashboard/ui/ParticipantsMangementPage.tsx (1)

58-58: SelectTicketModal에서 participants 프롭이 제거되었습니다.

모달의 상태와 티켓 선택이 이제 전역 상태로 관리되는 것으로 보입니다. 이는 PR의 전체적인 리팩토링 방향에 맞게 변경된 것으로 판단됩니다.

src/pages/dashboard/ui/ResponsesManagementPage.tsx (1)

12-12: useResponseStore에서 필요한 상태와 메서드를 가져오는 부분이 업데이트되었습니다.

전역 상태에서 모달 상태(isModalOpen)와 모달 닫기 함수(closeModal)를 가져와 사용하도록 변경되었습니다.

src/shared/types/dashboardType.ts (2)

19-20: 응답 관리를 위한 아이콘 에셋이 추가되었습니다.

사용자 응답 관리 메뉴에 사용할 아이콘 에셋이 적절하게 추가되었습니다.


34-34: 새로운 메뉴 항목 '사용자 응답 관리'가 추가되었습니다.

사용자 응답 관리 메뉴가 대시보드 메뉴 목록에 적절하게 추가되었습니다. 경로와 아이콘이 올바르게 설정되었습니다.

src/widgets/dashboard/ui/main/SideBar.tsx (2)

7-7: ResponseStore에서 필요한 기능을 임포트했습니다.

사용자 응답 관리 기능 구현을 위해 필요한 스토어를 임포트했습니다.


14-14: useResponseStore에서 openModal 기능을 가져왔습니다.

모달을 열기 위한 기능을 전역 상태에서 가져와 사용하도록 설정했습니다.

src/widgets/dashboard/ui/response/ResponseModal.tsx (4)

1-6: 모듈 가져오기가 잘 구성되어 있습니다.

필요한 모듈들을 적절히 import 하고 있으며, 의존성 관계가 명확합니다.


7-9: Props 인터페이스가 간결하게 정의되어 있습니다.

모달을 닫기 위한 onClose 콜백 함수를 적절하게 정의했습니다.


12-17: 이벤트 ID 처리 및 티켓 데이터 가져오기가 잘 구현되어 있습니다.

URL 파라미터에서 ID를 추출하고 이를 숫자로 변환하여 사용하는 로직이 적절합니다. 또한 useTickets 훅을 사용하여 해당 이벤트의 티켓 데이터를 가져오고, 결과가 없을 경우 빈 배열로 처리하는 것도 좋습니다.


25-36: 모달 헤더 UI가 잘 구현되어 있습니다.

모달의 기본 레이아웃과 헤더 부분이 시각적으로 명확하게 구성되어 있습니다. TextButton을 사용한 뒤로가기 버튼과 안내 텍스트가 적절히 배치되어 있습니다.

src/features/dashboard/model/store/ResponseStore.tsx (3)

16-18: 모달 관련 메서드 추가가 적절합니다.

모달을 열고 닫는 메서드와 선택된 티켓 ID를 설정하는 메서드가 명확하게 정의되어 있습니다.


26-27: 상태 초기값 설정이 적절합니다.

모달은 기본적으로 닫혀있는 상태로, 선택된 티켓 ID는 0으로 초기화되어 있습니다.


55-56: 모달 열기/닫기 메서드가 간결하게 구현되어 있습니다.

Zustand의 set 함수를 사용하여 상태를 업데이트하는 방식이 적절합니다.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown

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

🔭 Outside diff range comments (1)
src/pages/dashboard/ui/ResponseManagementPage.tsx (1)

1-39: 💡 Verification agent

🧩 Analysis chain

selectedTicketId 활용 방안 검토가 필요합니다.

useResponseStore에 추가된 selectedTicketId 상태가 이 컴포넌트에서 사용되지 않고 있습니다. 모달을 통해 티켓이 선택된 후 이 ID를 활용하는 로직이 필요할 수 있습니다.


🏁 Script executed:

#!/bin/bash
# ResponseModal 컴포넌트에서 selectedTicketId 활용 여부 확인
echo "ResponseModal 컴포넌트 검사:"
cat src/widgets/dashboard/ui/response/ResponseModal.tsx
echo ""
echo "페이지에서 selectedTicketId 활용 검사:"
rg "selectedTicketId" src/pages/dashboard

Length of output: 1916


selectedTicketId 상태 활용 로직 추가 필요

useResponseStore에 저장된 selectedTicketId가 이 페이지 컴포넌트에서 사용되지 않아, 모달에서 티켓을 선택해도 해당 티켓의 응답을 로드하는 로직이 동작하지 않습니다. 다음과 같이 수정을 검토해주세요.

  • 파일: src/pages/dashboard/ui/ResponseManagementPage.tsx
    • useResponseStore에서 selectedTicketId 추가 구조 분해 할당
    • selectedTicketId 변경 시 useEffect
      • setListType('query') (또는 적절한 타입)
      • 선택된 티켓 ID에 맞는 응답 로딩 로직 호출 (예: setSelectedResponseByTicketId(selectedTicketId) 또는 setSelectedResponse 재활용)

예시 수정안:

--- src/pages/dashboard/ui/ResponseManagementPage.tsx
+++ src/pages/dashboard/ui/ResponseManagementPage.tsx
@@
- const { response, setResponses, setSelectedResponse, isModalOpen, closeModal } = useResponseStore();
+ const { response, selectedTicketId, setResponses, setSelectedResponse, isModalOpen, closeModal } = useResponseStore();
@@
   useEffect(() => {
     setResponses(responsesInfo);
   }, [setResponses]);
+
+  useEffect(() => {
+    if (selectedTicketId) {
+      setListType('query');
+      // TODO: 선택된 티켓 ID에 해당하는 응답 로딩 로직 추가
+      setSelectedResponse(selectedTicketId);
+    }
+  }, [selectedTicketId]);

위 변경을 적용하면, 모달에서 티켓을 선택했을 때 자동으로 해당 티켓의 응답 리스트로 전환됩니다.

🧹 Nitpick comments (2)
src/pages/dashboard/ui/ResponseManagementPage.tsx (2)

8-8: 컴포넌트 이름에 오타가 있습니다.

ResponesModal이라는 이름에 오타가 있는 것 같습니다. 정확한 이름은 ResponseModal일 것입니다.

-import ResponesModal from '../../../widgets/dashboard/ui/response/ResponseModal';
+import ResponseModal from '../../../widgets/dashboard/ui/response/ResponseModal';

26-28: 모달 컴포넌트 렌더링이 올바르게 구현되었습니다.

조건부 렌더링을 사용하여 isModalOpen 상태에 따라 모달을 표시하는 방식이 적절합니다. 그러나 컴포넌트 이름에 오타가 있고, 필요한 props가 더 있을 수 있습니다.

{isModalOpen && (
-  <ResponesModal onClose={closeModal}></ResponesModal>
+  <ResponseModal onClose={closeModal} />
)}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d6b6945 and 5845fb3.

📒 Files selected for processing (2)
  • src/app/routes/Router.tsx (1 hunks)
  • src/pages/dashboard/ui/ResponseManagementPage.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/app/routes/Router.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/pages/dashboard/ui/ResponseManagementPage.tsx (1)
src/features/dashboard/model/store/ResponseStore.tsx (1)
  • useResponseStore (21-61)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
🔇 Additional comments (4)
src/pages/dashboard/ui/ResponseManagementPage.tsx (4)

10-10: 컴포넌트 이름 변경이 올바르게 적용되었습니다.

컴포넌트 이름이 ResponsesManagementPage에서 ResponseManagementPage로 변경되어 파일 이름과 일치하도록 수정되었습니다.


12-12: 응답 스토어에서 필요한 상태와 함수를 잘 가져왔습니다.

isModalOpencloseModal을 스토어에서 가져와서 모달 상태를 관리하는 것이 좋습니다.


39-39: 컴포넌트 내보내기가 올바르게 수정되었습니다.

이름이 변경된 컴포넌트를 올바르게 내보내고 있습니다.


1-39:

Details

❌ Incorrect review comment

모달 열기 기능이 이 컴포넌트에 구현되어 있지 않습니다.

useResponseStore에는 openModal 함수가 있지만, 이 페이지에서는 모달을 여는 UI 요소나 트리거가 보이지 않습니다. 사이드바 메뉴 클릭으로 모달이 열린다는 설명이 있으니 이 부분이 다른 컴포넌트에서 처리되고 있는지 확인이 필요합니다.


🏁 Script executed:

#!/bin/bash
# 사이드바에서 모달 열기 기능 구현 확인
echo "사이드바에서 openModal 호출 확인:"
rg "openModal" src/widgets/dashboard/ui/main/SideBar.tsx

Length of output: 195


모달 트리거가 이미 SideBar 컴포넌트에서 구현되어 있습니다.

DashboardLayout에 포함된 SideBar 메뉴 클릭 시 useResponseStore.openModal이 호출되어 모달이 열리므로, 이 페이지(ResponseManagementPage)에서 별도의 모달 오픈 트리거를 추가할 필요가 없습니다.
이 코멘트는 무시하셔도 됩니다.

Likely an incorrect or invalid review comment.

@hyeeuncho hyeeuncho requested a review from Yejiin21 May 23, 2025 06:15
@hyeeuncho hyeeuncho merged commit 265e48d into develop May 25, 2025
2 checks passed
@hyeeuncho hyeeuncho deleted the feat/#136/ticket-select branch May 25, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖼️ Publishing 페이지 퍼블리싱

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 티켓 종류 선택 퍼블리싱

2 participants