feat: showDate toggle on card via task modal checkbox
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -52,6 +52,7 @@ model Task {
|
|||||||
issueNote String?
|
issueNote String?
|
||||||
startDate DateTime?
|
startDate DateTime?
|
||||||
dueDate DateTime?
|
dueDate DateTime?
|
||||||
|
showDate Boolean @default(true)
|
||||||
creatorId String
|
creatorId String
|
||||||
assigneeId String?
|
assigneeId String?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export interface TaskFormData {
|
|||||||
quarter: string;
|
quarter: string;
|
||||||
startDate: string;
|
startDate: string;
|
||||||
dueDate: string;
|
dueDate: string;
|
||||||
|
showDate: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TaskModalProps {
|
interface TaskModalProps {
|
||||||
@@ -53,6 +54,7 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter =
|
|||||||
quarter: task?.quarter ?? defaultQuarter,
|
quarter: task?.quarter ?? defaultQuarter,
|
||||||
startDate: toDateInput(task?.startDate),
|
startDate: toDateInput(task?.startDate),
|
||||||
dueDate: toDateInput(task?.dueDate),
|
dueDate: toDateInput(task?.dueDate),
|
||||||
|
showDate: task?.showDate ?? true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const set = <K extends keyof TaskFormData>(field: K, value: TaskFormData[K]) =>
|
const set = <K extends keyof TaskFormData>(field: K, value: TaskFormData[K]) =>
|
||||||
@@ -201,18 +203,26 @@ export function TaskModal({ mode, task, defaultSection = 'HR', defaultQuarter =
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 프로젝트 기간 */}
|
{/* 프로젝트 기간 */}
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div>
|
||||||
<div>
|
<div className="flex items-center justify-between mb-1.5">
|
||||||
<label className="block text-sm font-bold text-gray-500 mb-1.5">시작일</label>
|
<label className="text-sm font-bold text-gray-500">기간</label>
|
||||||
|
<label className="flex items-center gap-1.5 cursor-pointer select-none">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={form.showDate}
|
||||||
|
onChange={(e) => set('showDate', e.target.checked)}
|
||||||
|
className="w-4 h-4 accent-blue-500 cursor-pointer"
|
||||||
|
/>
|
||||||
|
<span className="text-sm font-semibold text-gray-500">카드에 기간 표시</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="grid grid-cols-2 gap-3">
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
value={form.startDate}
|
value={form.startDate}
|
||||||
onChange={(e) => set('startDate', e.target.value)}
|
onChange={(e) => set('startDate', e.target.value)}
|
||||||
className="w-full border border-gray-200 rounded-xl px-4 py-2.5 outline-none focus:border-blue-400 focus:ring-2 focus:ring-blue-100 transition"
|
className="w-full border border-gray-200 rounded-xl px-4 py-2.5 outline-none focus:border-blue-400 focus:ring-2 focus:ring-blue-100 transition"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-bold text-gray-500 mb-1.5">종료일</label>
|
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
value={form.dueDate}
|
value={form.dueDate}
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export function DepartmentColumn({ title: initialTitle, titleEn, subtitle: initi
|
|||||||
issueNote: data.issueNote || null,
|
issueNote: data.issueNote || null,
|
||||||
startDate: data.startDate || null,
|
startDate: data.startDate || null,
|
||||||
dueDate: data.dueDate || null,
|
dueDate: data.dueDate || null,
|
||||||
|
showDate: data.showDate,
|
||||||
quarter: data.quarter,
|
quarter: data.quarter,
|
||||||
priority: 'MEDIUM',
|
priority: 'MEDIUM',
|
||||||
creatorId: 'system',
|
creatorId: 'system',
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ export function TaskCard({
|
|||||||
issueNote: data.issueNote || null,
|
issueNote: data.issueNote || null,
|
||||||
startDate: data.startDate || null,
|
startDate: data.startDate || null,
|
||||||
dueDate: data.dueDate || null,
|
dueDate: data.dueDate || null,
|
||||||
|
showDate: data.showDate,
|
||||||
quarter: data.quarter,
|
quarter: data.quarter,
|
||||||
priority: 'MEDIUM',
|
priority: 'MEDIUM',
|
||||||
creatorId: 'system',
|
creatorId: 'system',
|
||||||
@@ -144,6 +145,7 @@ export function TaskCard({
|
|||||||
issueNote: data.issueNote || null,
|
issueNote: data.issueNote || null,
|
||||||
startDate: data.startDate || null,
|
startDate: data.startDate || null,
|
||||||
dueDate: data.dueDate || null,
|
dueDate: data.dueDate || null,
|
||||||
|
showDate: data.showDate,
|
||||||
});
|
});
|
||||||
setModalMode(null);
|
setModalMode(null);
|
||||||
};
|
};
|
||||||
@@ -192,7 +194,7 @@ export function TaskCard({
|
|||||||
{/* ── 기간 + 상태 ── */}
|
{/* ── 기간 + 상태 ── */}
|
||||||
<div className="mt-1 flex items-center gap-2">
|
<div className="mt-1 flex items-center gap-2">
|
||||||
<span className="text-sm text-gray-400 font-medium flex-1 truncate">
|
<span className="text-sm text-gray-400 font-medium flex-1 truncate">
|
||||||
{(task.startDate || task.dueDate)
|
{task.showDate && (task.startDate || task.dueDate)
|
||||||
? `${task.startDate ? fmtDate(task.startDate) : '?'} ~ ${task.dueDate ? fmtDate(task.dueDate) : '?'}`
|
? `${task.startDate ? fmtDate(task.startDate) : '?'} ~ ${task.dueDate ? fmtDate(task.dueDate) : '?'}`
|
||||||
: ''}
|
: ''}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export function TaskManager({ tasks, sectionOptions, quarter, onClose }: TaskMan
|
|||||||
taskType: data.taskType || null, status: data.status, progress: data.progress,
|
taskType: data.taskType || null, status: data.status, progress: data.progress,
|
||||||
description: data.description || null, issueNote: data.issueNote || null,
|
description: data.description || null, issueNote: data.issueNote || null,
|
||||||
startDate: data.startDate || null, dueDate: data.dueDate || null,
|
startDate: data.startDate || null, dueDate: data.dueDate || null,
|
||||||
|
showDate: data.showDate,
|
||||||
quarter: data.quarter, priority: 'MEDIUM', creatorId: 'system',
|
quarter: data.quarter, priority: 'MEDIUM', creatorId: 'system',
|
||||||
});
|
});
|
||||||
setModalMode(null);
|
setModalMode(null);
|
||||||
@@ -73,6 +74,7 @@ export function TaskManager({ tasks, sectionOptions, quarter, onClose }: TaskMan
|
|||||||
taskType: data.taskType || null, status: data.status, progress: data.progress,
|
taskType: data.taskType || null, status: data.status, progress: data.progress,
|
||||||
description: data.description || null, issueNote: data.issueNote || null,
|
description: data.description || null, issueNote: data.issueNote || null,
|
||||||
startDate: data.startDate || null, dueDate: data.dueDate || null,
|
startDate: data.startDate || null, dueDate: data.dueDate || null,
|
||||||
|
showDate: data.showDate,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setModalMode(null);
|
setModalMode(null);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export interface Task {
|
|||||||
issueNote: string | null;
|
issueNote: string | null;
|
||||||
startDate: string | null;
|
startDate: string | null;
|
||||||
dueDate: string | null;
|
dueDate: string | null;
|
||||||
|
showDate: boolean;
|
||||||
creatorId: string;
|
creatorId: string;
|
||||||
assigneeId: string | null;
|
assigneeId: string | null;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user