Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workload charts infinite spinning #2228

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/src/components/workload/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default function Overview() {
return totalReplicasDiff;
}

// Get all items except the pods since those shouldn't be shown in the table (only the chart).
function getJointItems() {
// All items except the pods since those shouldn't be shown in the table (only the chart).
const jointItems = React.useMemo(() => {
let joint: Workload[] = [];

// Return null if no items are yet loaded, so we show the spinner in the table.
Expand All @@ -70,7 +70,7 @@ export default function Overview() {
joint = joint.concat(items);
}
return joint;
}
}, [workloadsData]);
illume marked this conversation as resolved.
Show resolved Hide resolved

const workloads: KubeObject[] = [
Pod,
Expand Down Expand Up @@ -104,9 +104,9 @@ export default function Overview() {
<SectionBox py={2} mt={1}>
<Grid container justifyContent="flex-start" alignItems="flex-start" spacing={2}>
{workloads.map(workload => (
<Grid item lg={3} md={4} xs={6} key={workload.name}>
<Grid item lg={3} md={4} xs={6} key={workload.className}>
<WorkloadCircleChart
workloadData={workloadsData[workload.name] || null}
workloadData={workloadsData[workload.className] || null}
// @todo: Use a plural from from the class itself when we have it
title={ChartLink(workload)}
partialLabel={t('translation|Failed')}
Expand Down Expand Up @@ -137,7 +137,7 @@ export default function Overview() {
},
'age',
]}
data={getJointItems()}
data={jointItems}
headerProps={{
noNamespaceFilter: false,
}}
Expand Down
Loading