Add 'Missed' and 'Rescheduled' statuses to ChoreHistoryStatus and update related components
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -121,7 +121,7 @@ const ChoreHistory = () => {
|
||||
{
|
||||
icon: <Checklist />,
|
||||
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: <TrendingUp />,
|
||||
|
||||
@@ -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: <HourglassEmpty />, color: 'neutral' }, // Pending Approval
|
||||
4: { icon: <ThumbDown />, color: 'danger' }, // Rejected
|
||||
5: { icon: <RunningWithErrors />, color: 'danger' }, // Missed
|
||||
6: { icon: <Schedule />, 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'}
|
||||
</Typography>
|
||||
{historyEntry.performedAt && (
|
||||
<Chip size='sm' startDecorator={<EventNote />}>
|
||||
|
||||
Reference in New Issue
Block a user