Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"@tanstack/react-query": "^5.80.2",
"axios": "^1.9.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"next": "14.2.25",
"next-themes": "^0.4.6",
"react": "18.2.0",
"react-datepicker": "^8.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

date-picker 사용해주셨군용!

"react-dom": "18.2.0",
"react-hook-form": "^7.57.0",
"sonner": "^2.0.5",
Expand Down
4 changes: 2 additions & 2 deletions public/images/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 0 additions & 46 deletions src/app/api/useCards.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/app/api/useColumns.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/app/dashboard/[id]/api/updateCardColumn.ts

This file was deleted.

17 changes: 17 additions & 0 deletions src/app/dashboard/[id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Header from '@components/common/header/Header'

import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
Comment on lines +1 to +3
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

import 경로 일관성 개선 필요

Header와 Sidebar의 import 경로가 일관되지 않습니다. 둘 다 같은 패턴을 사용하는 것이 좋습니다.

-import Header from '@components/common/header/Header'
-
-import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
+import Header from '@/app/shared/components/common/header/Header'
+import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import Header from '@components/common/header/Header'
import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
import Header from '@/app/shared/components/common/header/Header'
import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
🤖 Prompt for AI Agents
In src/app/dashboard/[id]/layout.tsx at lines 1 to 3, the import paths for
Header and Sidebar are inconsistent. Update the import statements so both use
the same path pattern, either both using '@components' or both using
'@/app/shared/components', to maintain consistency across the codebase.


export default function AboutLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<div>
{/* <Sidebar /> */}
<Header />
<div>{children}</div> {/* 여기에 page.tsx 내용이 들어옴 */}
</div>
)
}
22 changes: 12 additions & 10 deletions src/app/dashboard/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
'use client'

import Image from 'next/image'
import { useParams } from 'next/navigation'
import { useRef } from 'react'

import useColumns from '@/app/api/useColumns'

import { useCardMutation } from './api/useCardMutation'
import Column from './Column/Column'
import { useDragStore } from './store/useDragStore'
import type { Card } from './type/Card'
import { useCardMutation } from '@/app/features/dashboard_Id/api/useCardMutation'
import useColumns from '@/app/features/dashboard_Id/api/useColumns'
import Column from '@/app/features/dashboard_Id/Column/Column'
import { useDragStore } from '@/app/features/dashboard_Id/store/useDragStore'
import { Card } from '@/app/features/dashboard_Id/type/Card.type'

export default function DashboardID() {
const dashboard = 15120
const { data: columns, isLoading, error } = useColumns(dashboard)
const params = useParams()
const dashboardId = Number(params.id)
const { data: columns, isLoading, error } = useColumns(dashboardId)
Comment on lines +14 to +16
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

타입 안전성을 개선해주세요.

params.id가 undefined일 수 있고, Number() 변환 결과가 NaN일 수 있습니다. 타입 안전성을 위해 검증 로직을 추가해주세요.

  const params = useParams()
-  const dashboardId = Number(params.id)
+  const dashboardId = params.id ? Number(params.id) : null
+  
+  if (!dashboardId || isNaN(dashboardId)) {
+    return <div>잘못된 대시보드 ID입니다.</div>
+  }
+
  const { data: columns, isLoading, error } = useColumns(dashboardId)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const params = useParams()
const dashboardId = Number(params.id)
const { data: columns, isLoading, error } = useColumns(dashboardId)
const params = useParams()
const dashboardId = params.id ? Number(params.id) : null
if (!dashboardId || isNaN(dashboardId)) {
return <div>잘못된 대시보드 ID입니다.</div>
}
const { data: columns, isLoading, error } = useColumns(dashboardId)
🤖 Prompt for AI Agents
In src/app/dashboard/[id]/page.tsx around lines 14 to 16, the code directly
converts params.id to a number without checking if params.id is undefined or if
the conversion results in NaN, which can cause runtime errors. Add validation to
ensure params.id exists and is a valid number before using it; if invalid,
handle the case appropriately, such as showing an error or returning early to
maintain type safety.

// const { data: columns, isLoading, error } = useColumns(id)

const { draggingCard, setDraggingCard } = useDragStore()
const cardMutation = useCardMutation()
const touchPos = useRef({ x: 0, y: 0 })
Expand Down Expand Up @@ -124,10 +127,9 @@ export default function DashboardID() {
if (error) return <p>error...{error.message}</p>
return (
<>
<div className="fixed left-0 h-1080 w-300 bg-gray-100">사이드바</div>
<div className="ml-300 select-none">
<div
className="tablet:flex-col flex"
className="flex min-h-[calc(100vh-100px)] tablet:flex-col"
onTouchStart={handleTouchStart}
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Tags({ tags }: { tags: string[] }) {
return (
<div className="flex flex-wrap gap-6">
{tags.map((tag) => {
const colorIndex = getColor(tag, bgColors)
const colorIndex = getColor(tag, bgColors.length)

return (
<span
Expand Down
29 changes: 29 additions & 0 deletions src/app/features/dashboardId/Card/cardFormModals/AssigneeList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { cn } from '@/app/shared/lib/cn'
const mockData = ['aaa', 'bbb', 'ccc']
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

목 데이터를 실제 데이터로 교체 필요

하드코딩된 목 데이터 대신 실제 멤버 데이터를 사용해야 합니다. src/app/features/dashboard_Id/Card/cardFormModals/AssigneeList.tsx에 있는 완전한 구현체를 참고하세요.

🤖 Prompt for AI Agents
In src/app/features/dashboardId/Card/cardFormModals/AssigneeList.tsx at line 2,
replace the hardcoded mockData array with the actual member data source. Refer
to the full implementation in
src/app/features/dashboard_Id/Card/cardFormModals/AssigneeList.tsx to correctly
fetch and use real member data instead of static mock values.


interface AssigneeListProps {
setSelectedAssignee: React.Dispatch<React.SetStateAction<string>>
}
export default function AssigneeList({
setSelectedAssignee,
}: AssigneeListProps) {
return (
<div className="BG-white Border-btn Text-gray absolute left-0 top-full z-10 mt-4 w-full rounded-6 text-14">
{mockData.map((Assignee, index) => (
<div
className={cn(
'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent',
index !== 0 && 'border-t',
)}
key={index}
Comment on lines +12 to +18
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

변수명과 키 사용 개선 필요

몇 가지 문제점이 있습니다:

  1. 변수명 Assignee가 타입명과 혼동될 수 있습니다 (소문자 assignee 권장)
  2. 배열 인덱스를 키로 사용하는 것은 React 모범 사례에 어긋납니다
-      {mockData.map((Assignee, index) => (
+      {mockData.map((assignee, index) => (
         <div
           className={cn(
             'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent',
             index !== 0 && 'border-t',
           )}
-          key={index}
+          key={assignee}
           onClick={() => {
-            setSelectedAssignee(Assignee)
-            console.log(Assignee)
+            setSelectedAssignee(assignee)
           }}
         >
-          {Assignee}
+          {assignee}
         </div>
       ))}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{mockData.map((Assignee, index) => (
<div
className={cn(
'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent',
index !== 0 && 'border-t',
)}
key={index}
{mockData.map((assignee, index) => (
<div
className={cn(
'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent',
index !== 0 && 'border-t',
)}
key={assignee}
onClick={() => {
setSelectedAssignee(assignee)
}}
>
{assignee}
</div>
))}
🤖 Prompt for AI Agents
In src/app/features/dashboardId/Card/cardFormModals/AssigneeList.tsx around
lines 12 to 18, rename the variable from `Assignee` to `assignee` to avoid
confusion with type names, and replace the use of the array index as the React
key with a unique and stable identifier from the `assignee` object, such as an
`id` property, to follow React best practices for list rendering.

onClick={() => {
setSelectedAssignee(Assignee)
console.log(Assignee)
}}
>
{Assignee}
</div>
))}
</div>
)
}
Loading