From 0b19cdc95c3b18b7fe82aff3f0ad370ec6b8c403 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 23 Mar 2026 22:31:59 -0400 Subject: [PATCH] Add 'Missed' and 'Rescheduled' statuses to ChoreHistoryStatus and update related components --- src/utils/Chores.jsx | 2 ++ src/views/History/ChoreHistory.jsx | 2 +- src/views/History/HistoryCard.jsx | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/Chores.jsx b/src/utils/Chores.jsx index f30df14..81a8b7d 100644 --- a/src/utils/Chores.jsx +++ b/src/utils/Chores.jsx @@ -16,6 +16,8 @@ export const ChoreHistoryStatus = Object.freeze({ SKIPPED: 2, PENDING_APPROVAL: 3, REJECTED: 4, + MISSED: 5, + RESCHEDULED: 6, }) export const ChoreStatus = Object.freeze({ INACTIVE: 0, diff --git a/src/views/History/ChoreHistory.jsx b/src/views/History/ChoreHistory.jsx index 506faf0..ab8e307 100644 --- a/src/views/History/ChoreHistory.jsx +++ b/src/views/History/ChoreHistory.jsx @@ -121,7 +121,7 @@ const ChoreHistory = () => { { icon: , text: 'All Completed', - subtext: `${histories.filter(h => h.status === ChoreHistoryStatus.COMPLETED).length} times`, + subtext: `${histories.filter(h => h.status === ChoreHistoryStatus.COMPLETED || h.status === ChoreHistoryStatus.SKIPPED).length} times`, }, { icon: , diff --git a/src/views/History/HistoryCard.jsx b/src/views/History/HistoryCard.jsx index 811179a..e2c8c52 100644 --- a/src/views/History/HistoryCard.jsx +++ b/src/views/History/HistoryCard.jsx @@ -8,6 +8,7 @@ import { Person, Redo, RunningWithErrors, + Schedule, ThumbDown, Timelapse, Toll, @@ -17,7 +18,7 @@ import moment from 'moment' import { TASK_COLOR } from '../../utils/Colors.jsx' const getCompletedChip = historyEntry => { - if (historyEntry.status === 0 || historyEntry.status === 5) { + if (historyEntry.status === 0 || historyEntry.status === 5 || historyEntry.status === 6) { return null } @@ -126,6 +127,7 @@ const HistoryCard = ({ 3: { icon: , color: 'neutral' }, // Pending Approval 4: { icon: , color: 'danger' }, // Rejected 5: { icon: , color: 'danger' }, // Missed + 6: { icon: , color: 'warning' }, // Rescheduled } const config = statusMap[historyEntry.status] || statusMap[1] @@ -192,7 +194,9 @@ const HistoryCard = ({ ? 'Rejected' : historyEntry.status === 5 ? 'Missed' - : 'Completed'} + : historyEntry.status === 6 + ? 'Rescheduled' + : 'Completed'} {historyEntry.performedAt && ( }>