Apply suggestions from code review
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
d08383d759
commit
63e07652a0
@ -992,7 +992,7 @@
|
|||||||
"argocd": {
|
"argocd": {
|
||||||
"apps": "Apps",
|
"apps": "Apps",
|
||||||
"synced": "Synced",
|
"synced": "Synced",
|
||||||
"outOfSync": "OutOfSync",
|
"outOfSync": "Out Of Sync",
|
||||||
"healthy": "Healthy",
|
"healthy": "Healthy",
|
||||||
"degraded": "Degraded",
|
"degraded": "Degraded",
|
||||||
"progressing": "Progressing",
|
"progressing": "Progressing",
|
||||||
|
|||||||
@ -20,9 +20,8 @@ export default function Component({ service }) {
|
|||||||
if (status === "apps") {
|
if (status === "apps") {
|
||||||
return { status, count: appsData?.items?.length };
|
return { status, count: appsData?.items?.length };
|
||||||
}
|
}
|
||||||
const apiStatus = status.charAt(0).toUpperCase() + status.slice(1);
|
|
||||||
const count = appsData?.items?.filter(
|
const count = appsData?.items?.filter(
|
||||||
(item) => item.status?.sync?.status === apiStatus || item.status?.health?.status === apiStatus,
|
(item) => item.status?.sync?.status.toLowerCase() === status.toLowerCase() || item.status?.health?.status.toLowerCase() === status.toLowerCase(),
|
||||||
).length;
|
).length;
|
||||||
return { status, count };
|
return { status, count };
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user