Skip to content

Commit 7dd012d

Browse files
authored
Fix dashboard link filter. Fix past count when no terminating engagements (#595)
1 parent 9d7c8bc commit 7dd012d

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

src/components/dashboard/widgets/dw_engagement_count.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function DwEngagementCount({
134134
<GridItem md={6} lg={3}>
135135
<CountComponent
136136
onClickCount={onClickCount}
137-
count={summaryCount?.past + summaryCount?.terminating}
137+
count={(summaryCount?.past || 0) + (summaryCount?.terminating || 0)}
138138
icon={AsleepIcon}
139139
status={'past'}
140140
subtitle={'All completed engagements.'}

src/routes/dashboard/index.tsx

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -227,37 +227,18 @@ export function Dashboard() {
227227
summaryCount={summaryCount}
228228
isLoading={isLoadingSummaryCount}
229229
onClickCount={(status: string) => {
230-
history.push(
231-
`/app/engagements/${status}?filter=${createBase64ParseableFilter(
232-
{
233-
engagementRegions:
234-
selectedRegions.length > 0
235-
? selectedRegions
236-
: undefined,
237-
}
238-
)}`
239-
);
230+
const filter = {engagementRegions: [], allowedStatuses:[]}
231+
if(selectedRegions.length > 0) {
232+
filter.engagementRegions = selectedRegions
233+
}
234+
if(status !== 'all') {
235+
filter.allowedStatuses = [status];
236+
}
237+
238+
history.push(`/app/engagements/${status}?filter=${createBase64ParseableFilter(filter)}`);
240239
}}
241240
/>
242241
</GridItem>
243-
{/* <GridItem sm={12} xl={12} xl2={6}>
244-
{withArtifacts(
245-
DwLastWeeklyReport2,
246-
() =>
247-
artifactService.getArtifacts({
248-
page: 1,
249-
perPage: 5,
250-
type: 'weeklyReport',
251-
startDate: dateFilter?.startDate,
252-
endDate: dateFilter?.endDate,
253-
regions: selectedRegions,
254-
sortOrder: 'DESC',
255-
sortFields: 'updated',
256-
}),
257-
258-
engagementService.getEngagementById
259-
)}
260-
</GridItem> */}
261242
<GridItem colSpan={1} sm={12} md={6} xl={6} xl2={6}>
262243
<DashboardPeopleEnabledCard
263244
usersEnabled={enabledUsers}

0 commit comments

Comments
 (0)