From aeb2f29d4de6a5844d9ec073c5a738b3af162c88 Mon Sep 17 00:00:00 2001 From: EENE Dashboard Date: Mon, 1 Jun 2026 17:56:18 +0900 Subject: [PATCH] Update task schema with show toggles and keywords Co-authored-by: Cursor --- backend/prisma/schema.prisma | 4 + backend/src/routes/tasks.ts | 14 +- frontend/src/components/common/TaskModal.tsx | 125 +++++++++++------- .../components/dashboard/DepartmentColumn.tsx | 6 +- .../src/components/dashboard/TaskCard.tsx | 34 ++++- .../src/components/dashboard/TaskManager.tsx | 14 +- frontend/src/types/index.ts | 4 + 7 files changed, 141 insertions(+), 60 deletions(-) diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 69b0a1f..da8f80e 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -53,6 +53,10 @@ model Task { startDate DateTime? dueDate DateTime? showDate Boolean @default(true) + showDescription Boolean @default(true) + showStatus Boolean @default(true) + showIssue Boolean @default(true) + keywords String? creatorId String assigneeId String? createdAt DateTime @default(now()) diff --git a/backend/src/routes/tasks.ts b/backend/src/routes/tasks.ts index 7817d2c..845fba7 100644 --- a/backend/src/routes/tasks.ts +++ b/backend/src/routes/tasks.ts @@ -56,7 +56,8 @@ router.get('/:id', async (req, res, next) => { router.post('/', async (req, res, next) => { try { const { title, description, status, priority, quarter, category, - section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate } = + section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate, + showDescription, showStatus, showIssue, keywords } = req.body as Record; if (!title || !quarter) { @@ -79,6 +80,10 @@ router.post('/', async (req, res, next) => { startDate: startDate ? new Date(startDate) : undefined, dueDate: dueDate ? new Date(dueDate) : undefined, showDate: showDate !== undefined ? showDate === 'true' || showDate === true : true, + showDescription: showDescription !== undefined ? showDescription === 'true' || showDescription === true : true, + showStatus: showStatus !== undefined ? showStatus === 'true' || showStatus === true : true, + showIssue: showIssue !== undefined ? showIssue === 'true' || showIssue === true : true, + keywords: keywords || null, assigneeId: assigneeId || null, creatorId: (req.body as Record).creatorId ?? 'system', }, @@ -97,7 +102,8 @@ router.patch('/:id', async (req, res, next) => { if (!existing) throw new AppError(404, '업무를 찾을 수 없습니다.'); const { title, description, status, priority, quarter, category, - section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate } = + section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate, + showDescription, showStatus, showIssue, keywords } = req.body as Record; const task = await prisma.task.update({ @@ -118,6 +124,10 @@ router.patch('/:id', async (req, res, next) => { ...(dueDate !== undefined && { dueDate: dueDate ? new Date(dueDate) : null }), ...(assigneeId !== undefined && { assigneeId: assigneeId || null }), ...(showDate !== undefined && { showDate: showDate === true || showDate === 'true' }), + ...(showDescription !== undefined && { showDescription: showDescription === true || showDescription === 'true' }), + ...(showStatus !== undefined && { showStatus: showStatus === true || showStatus === 'true' }), + ...(showIssue !== undefined && { showIssue: showIssue === true || showIssue === 'true' }), + ...(keywords !== undefined && { keywords: keywords || null }), }, }); diff --git a/frontend/src/components/common/TaskModal.tsx b/frontend/src/components/common/TaskModal.tsx index 19e824a..5ef6e83 100644 --- a/frontend/src/components/common/TaskModal.tsx +++ b/frontend/src/components/common/TaskModal.tsx @@ -2,8 +2,6 @@ import { useState } from 'react'; import { createPortal } from 'react-dom'; import type { Task } from '../../types'; -const TAG_OPTIONS = ['Growth', 'Policy', 'Performance', 'Culture', 'Asset', 'Space', 'Safety', 'Environment']; - const STATUS_OPTIONS = [ { value: 'TODO', label: '대기' }, { value: 'IN_PROGRESS', label: '진행' }, @@ -24,6 +22,10 @@ export interface TaskFormData { startDate: string; dueDate: string; showDate: boolean; + showDescription: boolean; + showStatus: boolean; + showIssue: boolean; + keywords: string; } interface TaskModalProps { @@ -55,6 +57,10 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter = startDate: toDateInput(task?.startDate), dueDate: toDateInput(task?.dueDate), showDate: task?.showDate ?? true, + showDescription: task?.showDescription ?? true, + showStatus: task?.showStatus ?? true, + showIssue: task?.showIssue ?? true, + keywords: task?.keywords ?? '', }); const set = (field: K, value: TaskFormData[K]) => @@ -106,7 +112,7 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter = /> - {/* 섹션 + 태그 */} + {/* 섹션 + 업무유형 */}
@@ -123,23 +129,6 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter = ))}
-
- - -
-
- - {/* 업무유형 + 상태 */} -
+
+ + {/* 상태 + 진행률 */} +
- +
+ + +
-
- - {/* 진행률 */} -
- -
- set('progress', Number(e.target.value))} - className="flex-1 accent-blue-500" - /> -
-
+ +
+ set('progress', Number(e.target.value))} + className="flex-1 accent-blue-500" />
@@ -192,13 +188,35 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter = {/* 내용 */}
- +
+ + +