Skip to content

Commit 4c0a54f

Browse files
Mohammed AbdiMohammed Abdi
authored andcommitted
add failed status to status summary table
Signed-off-by: Mohammed Abdi <[email protected]>
1 parent 78d317b commit 4c0a54f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

backend/src/routes/api/appwrappers/appwrapper-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AllAppwrappers {
1111
const stats: { [key: string]: any } = {};
1212
const wrappers: { [key: string]: string } = {};
1313
const wrappersLite: { [key: string]: any } = {};
14-
const statusCounts = { Dispatched: 0, Queued: 0, 'Re-enqueued': 0, Other: 0 };
14+
const statusCounts = { Dispatched: 0, Queued: 0, 'Re-enqueued': 0, Failed: 0, Other: 0 };
1515

1616
let jsonData;
1717
for (let i = 0; i < jsonStringList.length; i++) {
@@ -90,6 +90,9 @@ class AllAppwrappers {
9090
rephrasedState = 'Queued';
9191
statusCounts.Queued = statusCounts.Queued + 1;
9292
}
93+
} else if (state === 'Failed') {
94+
rephrasedState = 'Failed';
95+
statusCounts.Failed = statusCounts.Failed + 1;
9396
} else if (state === 'RunningHoldCompletion') {
9497
rephrasedState = 'CompletedWithRunningPods';
9598
statusCounts.Other = statusCounts.Other + 1;

frontend/src/pages/MCADashboard/Tables/status-summary-table.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface StatusSummaryData {
1717
dispatched: string;
1818
queued: string;
1919
reenqueued: string;
20+
failed: string;
2021
other: string;
2122
}
2223

@@ -31,12 +32,12 @@ export const StatusSummaryTable: React.FunctionComponent<{ data: Data }> = ({ da
3132
const onToggle = (isExpanded: boolean) => {
3233
setIsExpanded(isExpanded);
3334
};
34-
3535
const repositories: StatusSummaryData[] = [
3636
{
3737
dispatched: data.stats.statusCounts.Dispatched.toString(),
3838
queued: data.stats.statusCounts.Queued.toString(),
3939
reenqueued: data.stats.statusCounts['Re-enqueued'].toString(),
40+
failed: data.stats.statusCounts.Failed.toString(),
4041
other: data.stats.statusCounts.Other.toString(),
4142
},
4243
];
@@ -45,6 +46,7 @@ export const StatusSummaryTable: React.FunctionComponent<{ data: Data }> = ({ da
4546
{ x: 'Dispatched', y: data.stats.statusCounts.Dispatched },
4647
{ x: 'Queued', y: data.stats.statusCounts.Queued },
4748
{ x: 'Re-enqueued', y: data.stats.statusCounts['Re-enqueued'] },
49+
{ x: 'Failed', y: data.stats.statusCounts.Failed },
4850
{ x: 'Other', y: data.stats.statusCounts.Other },
4951
];
5052

@@ -71,6 +73,11 @@ export const StatusSummaryTable: React.FunctionComponent<{ data: Data }> = ({ da
7173
label: 'Re-enqueued',
7274
sortable: false,
7375
},
76+
{
77+
field: 'failed',
78+
label: 'Failed',
79+
sortable: false,
80+
},
7481
{
7582
field: 'other',
7683
label: 'Other',
@@ -105,6 +112,7 @@ export const StatusSummaryTable: React.FunctionComponent<{ data: Data }> = ({ da
105112
{ name: 'Dispatched: ' + data.stats.statusCounts.Dispatched },
106113
{ name: 'Queued: ' + data.stats.statusCounts.Queued },
107114
{ name: 'Re-enqueued: ' + data.stats.statusCounts['Re-enqueued'] },
115+
{ name: 'Failed: ' + data.stats.statusCounts.Failed },
108116
{ name: 'Other: ' + data.stats.statusCounts.Other },
109117
]}
110118
legendOrientation="vertical"
@@ -135,6 +143,7 @@ export const StatusSummaryTable: React.FunctionComponent<{ data: Data }> = ({ da
135143
<Td dataLabel={statusSummary.dispatched}>{statusSummary.dispatched}</Td>
136144
<Td dataLabel={statusSummary.queued}>{statusSummary.queued}</Td>
137145
<Td dataLabel={statusSummary.reenqueued}>{statusSummary.reenqueued}</Td>
146+
<Td dataLabel={statusSummary.failed}>{statusSummary.failed}</Td>
138147
<Td dataLabel={statusSummary.other}>{statusSummary.other}</Td>
139148
</Tr>
140149
)}

frontend/src/pages/MCADashboard/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface Data {
2121
Dispatched: number | string;
2222
Queued: number | string;
2323
'Re-enqueued': number | string;
24+
Failed: number | string;
2425
Other: number | string;
2526
};
2627
};

0 commit comments

Comments
 (0)