Skip to content

Commit a9cc9da

Browse files
committed
feat: actualizar colores de estado y prioridad en gráficos y configuración de tareas
1 parent 1c67f58 commit a9cc9da

File tree

4 files changed

+29
-25
lines changed

4 files changed

+29
-25
lines changed

client/src/components/dashboard/dashboardCharts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export function WeeklyTasksChart({ data, config }: WeeklyTasksChartProps) {
189189
<Bar
190190
dataKey="pending"
191191
stackId="a"
192-
fill={config.pending?.color || "#6b7280"}
192+
fill={config.pending?.color || "#f59e0b"}
193193
shape={<CustomBar dataKey="pending" />}
194194
maxBarSize={60}
195195
/>

client/src/config/taskConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const priorityConfig = {
3030
export const statusConfig = {
3131
PENDING: {
3232
color:
33-
"bg-gray-500/10 text-gray-600 dark:text-gray-400 [&_svg]:stroke-gray-600 dark:[&_svg]:stroke-gray-400",
33+
"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 [&_svg]:stroke-yellow-600 dark:[&_svg]:stroke-yellow-400",
3434
label: "Pendiente",
3535
},
3636
IN_PROGRESS: {

client/src/hooks/useDashboardCharts.ts

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { useMemo } from "react";
22
import { priorityConfig } from "@/config/taskConfig";
33
import type { Task } from "@/types/tasks-system/task";
44
import { useTranslation } from "react-i18next";
5+
import { TaskStatusColors, TaskPriorityColors } from "@/types/tasks-system/task";
6+
7+
// Usa los colores importados
8+
const PRIORITY_COLORS = TaskPriorityColors;
9+
const STATUS_COLORS = TaskStatusColors;
510

611
// Helper para obtener inicio de semana
712
function getStartOfWeek(): Date {
@@ -20,20 +25,6 @@ function parseDate(value?: string): Date | null {
2025
return Number.isNaN(d.getTime()) ? null : d;
2126
}
2227

23-
// Colores de gráficos
24-
const PRIORITY_COLORS = {
25-
Baja: "#1d4ed8", // blue-700
26-
Media: "#a16207", // yellow-700
27-
Alta: "#c2410c", // orange-700
28-
Urgente: "#b91c1c", // red-700
29-
} as const;
30-
31-
const STATUS_COLORS = {
32-
pending: "#374151", // gray-700
33-
inProgress: "#1d4ed8", // blue-700
34-
completed: "#15803d", // green-700
35-
} as const;
36-
3728
interface UseDashboardChartsProps {
3829
accessibleTasks: Task[];
3930
accessibleLists?: Array<{ id: string; name: string }>;
@@ -184,17 +175,17 @@ export function useDashboardCharts({
184175
{
185176
name: t("dashboard.statusLabels.pending"),
186177
value: taskStats.pending,
187-
fill: STATUS_COLORS.pending,
178+
fill: STATUS_COLORS.PENDING,
188179
},
189180
{
190181
name: t("dashboard.statusLabels.inProgress"),
191182
value: taskStats.inProgress,
192-
fill: STATUS_COLORS.inProgress,
183+
fill: STATUS_COLORS.IN_PROGRESS,
193184
},
194185
{
195186
name: t("dashboard.statusLabels.completed"),
196187
value: taskStats.completed,
197-
fill: STATUS_COLORS.completed,
188+
fill: STATUS_COLORS.COMPLETED,
198189
},
199190
].filter((item) => item.value > 0);
200191
}, [taskStats, t]);
@@ -203,15 +194,15 @@ export function useDashboardCharts({
203194
() => ({
204195
[t("dashboard.statusLabels.pending")]: {
205196
label: t("dashboard.statusLabels.pending"),
206-
color: STATUS_COLORS.pending,
197+
color: STATUS_COLORS.PENDING,
207198
},
208199
[t("dashboard.statusLabels.inProgress")]: {
209200
label: t("dashboard.statusLabels.inProgress"),
210-
color: STATUS_COLORS.inProgress,
201+
color: STATUS_COLORS.IN_PROGRESS,
211202
},
212203
[t("dashboard.statusLabels.completed")]: {
213204
label: t("dashboard.statusLabels.completed"),
214-
color: STATUS_COLORS.completed,
205+
color: STATUS_COLORS.COMPLETED,
215206
},
216207
}),
217208
[t],
@@ -273,15 +264,15 @@ export function useDashboardCharts({
273264
() => ({
274265
pending: {
275266
label: t("dashboard.statusLabels.pending"),
276-
color: STATUS_COLORS.pending,
267+
color: STATUS_COLORS.PENDING,
277268
},
278269
inProgress: {
279270
label: t("dashboard.statusLabels.inProgress"),
280-
color: STATUS_COLORS.inProgress,
271+
color: STATUS_COLORS.IN_PROGRESS,
281272
},
282273
completed: {
283274
label: t("dashboard.statusLabels.completed"),
284-
color: STATUS_COLORS.completed,
275+
color: STATUS_COLORS.COMPLETED,
285276
},
286277
}),
287278
[t],

client/src/types/tasks-system/task.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
import { SharePermission } from "../permissions";
22

33
export type TaskStatus = "PENDING" | "IN_PROGRESS" | "COMPLETED";
4+
5+
export const TaskStatusColors: Record<TaskStatus, string> = {
6+
PENDING: "#FFA500", // Orange
7+
IN_PROGRESS: "#007BFF", // Blue
8+
COMPLETED: "#28A745", // Green
9+
};
410
export type TaskPriority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
511

12+
export const TaskPriorityColors: Record<TaskPriority, string> = {
13+
LOW: "#6B7280", // Gray
14+
MEDIUM: "#3B82F6", // Blue
15+
HIGH: "#F59E0B", // Yellow
16+
URGENT: "#DC2626", // Red
17+
};
18+
619
export interface Task {
720
id: string;
821
name: string;

0 commit comments

Comments
 (0)