Skip to content

Commit 1f454f8

Browse files
authored
Merge pull request #2176 from cardstack/ECO-170-fix-task-planner-bugs
ECO-170 fix task planner bugs
2 parents ac6ba09 + 4edf69d commit 1f454f8

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

packages/experiments-realm/CRMTask/eb310b84-6991-4013-a554-85740f36b74f.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"end": "2025-02-19"
1414
},
1515
"priority": {
16-
"index": 3,
17-
"label": "High"
16+
"index": 4,
17+
"label": "Highest"
1818
},
1919
"name": "TechFlow Content Calendar Review",
2020
"details": "Review and approve Q2 content marketing calendar for TechFlow's digital presence",

packages/experiments-realm/crm-app.gts

+22-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type Owner from '@ember/owner';
1313
import { tracked } from '@glimmer/tracking';
1414
import { TrackedMap } from 'tracked-built-ins';
1515
import { restartableTask } from 'ember-concurrency';
16-
import { format, startOfWeek } from 'date-fns';
16+
import { format, startOfWeek, endOfWeek } from 'date-fns';
1717

1818
const dateFormat = `yyyy-MM-dd`;
1919

@@ -452,13 +452,32 @@ class CrmAppTemplate extends Component<typeof CrmApp> {
452452
break;
453453
case 'Due this week':
454454
const dueThisWeek = startOfWeek(today, { weekStartsOn: 1 });
455+
const endOfThisWeek = endOfWeek(today, { weekStartsOn: 1 });
455456
const formattedDueThisWeek = format(dueThisWeek, dateFormat);
457+
const formattedEndOfThisWeek = format(endOfThisWeek, dateFormat);
456458
taskFilter = [
457-
{ range: { 'dateRange.start': { gt: formattedDueThisWeek } } },
459+
{
460+
range: {
461+
'dateRange.end': {
462+
gte: formattedDueThisWeek,
463+
lte: formattedEndOfThisWeek,
464+
},
465+
},
466+
},
458467
];
459468
break;
460469
case 'High Priority':
461-
taskFilter = [{ eq: { 'priority.label': 'High' } }];
470+
taskFilter = [
471+
{
472+
not: { eq: { 'priority.label': 'Lowest' } },
473+
},
474+
{
475+
not: { eq: { 'priority.label': 'Low' } },
476+
},
477+
{
478+
not: { eq: { 'priority.label': 'Medium' } },
479+
},
480+
];
462481
break;
463482
case 'Unassigned':
464483
taskFilter = [{ eq: { 'assignee.id': null } }];

0 commit comments

Comments
 (0)