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,
|
SKIPPED: 2,
|
||||||
PENDING_APPROVAL: 3,
|
PENDING_APPROVAL: 3,
|
||||||
REJECTED: 4,
|
REJECTED: 4,
|
||||||
|
MISSED: 5,
|
||||||
|
RESCHEDULED: 6,
|
||||||
})
|
})
|
||||||
export const ChoreStatus = Object.freeze({
|
export const ChoreStatus = Object.freeze({
|
||||||
INACTIVE: 0,
|
INACTIVE: 0,
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const ChoreHistory = () => {
|
|||||||
{
|
{
|
||||||
icon: <Checklist />,
|
icon: <Checklist />,
|
||||||
text: 'All Completed',
|
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 />,
|
icon: <TrendingUp />,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Person,
|
Person,
|
||||||
Redo,
|
Redo,
|
||||||
RunningWithErrors,
|
RunningWithErrors,
|
||||||
|
Schedule,
|
||||||
ThumbDown,
|
ThumbDown,
|
||||||
Timelapse,
|
Timelapse,
|
||||||
Toll,
|
Toll,
|
||||||
@@ -17,7 +18,7 @@ import moment from 'moment'
|
|||||||
import { TASK_COLOR } from '../../utils/Colors.jsx'
|
import { TASK_COLOR } from '../../utils/Colors.jsx'
|
||||||
|
|
||||||
const getCompletedChip = historyEntry => {
|
const getCompletedChip = historyEntry => {
|
||||||
if (historyEntry.status === 0 || historyEntry.status === 5) {
|
if (historyEntry.status === 0 || historyEntry.status === 5 || historyEntry.status === 6) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +127,7 @@ const HistoryCard = ({
|
|||||||
3: { icon: <HourglassEmpty />, color: 'neutral' }, // Pending Approval
|
3: { icon: <HourglassEmpty />, color: 'neutral' }, // Pending Approval
|
||||||
4: { icon: <ThumbDown />, color: 'danger' }, // Rejected
|
4: { icon: <ThumbDown />, color: 'danger' }, // Rejected
|
||||||
5: { icon: <RunningWithErrors />, color: 'danger' }, // Missed
|
5: { icon: <RunningWithErrors />, color: 'danger' }, // Missed
|
||||||
|
6: { icon: <Schedule />, color: 'warning' }, // Rescheduled
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = statusMap[historyEntry.status] || statusMap[1]
|
const config = statusMap[historyEntry.status] || statusMap[1]
|
||||||
@@ -192,7 +194,9 @@ const HistoryCard = ({
|
|||||||
? 'Rejected'
|
? 'Rejected'
|
||||||
: historyEntry.status === 5
|
: historyEntry.status === 5
|
||||||
? 'Missed'
|
? 'Missed'
|
||||||
: 'Completed'}
|
: historyEntry.status === 6
|
||||||
|
? 'Rescheduled'
|
||||||
|
: 'Completed'}
|
||||||
</Typography>
|
</Typography>
|
||||||
{historyEntry.performedAt && (
|
{historyEntry.performedAt && (
|
||||||
<Chip size='sm' startDecorator={<EventNote />}>
|
<Chip size='sm' startDecorator={<EventNote />}>
|
||||||
|
|||||||
Reference in New Issue
Block a user