diff --git a/src/api/types/configs.ts b/src/api/types/configs.ts index 639bed303..08058a8e6 100644 --- a/src/api/types/configs.ts +++ b/src/api/types/configs.ts @@ -52,7 +52,7 @@ export interface ConfigItem extends Timestamped, Avatar, Agent, Costs { external_id?: string; config_class?: string; type: string; - changes?: Change[]; + changes?: number; analysis?: Record; tags?: Record; labels?: Record; diff --git a/src/components/Configs/ConfigList/Cells/ConfigListChangeCell.tsx b/src/components/Configs/ConfigList/Cells/ConfigListChangeCell.tsx index 55e3dccd0..add006940 100644 --- a/src/components/Configs/ConfigList/Cells/ConfigListChangeCell.tsx +++ b/src/components/Configs/ConfigList/Cells/ConfigListChangeCell.tsx @@ -1,24 +1,16 @@ +import ChangeCountIcon from "@flanksource-ui/ui/Icons/ChangeCount"; import { CellContext } from "@tanstack/react-table"; -import { useMemo } from "react"; import { ConfigItem } from "../../../../api/types/configs"; -import ChangeCountIcon from "@flanksource-ui/ui/Icons/ChangeCount"; export default function ConfigListChangeCell({ row, column }: CellContext) { const changes = row?.getValue(column.id); - const totalChanges = useMemo(() => { - let total = 0; - (changes || []).forEach((change) => { - total += change.total || 0; - }); - return total; - }, [changes]); - if (changes == null) { + if (!changes) { return null; } - return ; + return ; } diff --git a/src/components/Configs/Graph/ConfigItemReactFlowNode.tsx b/src/components/Configs/Graph/ConfigItemReactFlowNode.tsx index 1d109449b..f63000dee 100644 --- a/src/components/Configs/Graph/ConfigItemReactFlowNode.tsx +++ b/src/components/Configs/Graph/ConfigItemReactFlowNode.tsx @@ -33,10 +33,7 @@ export function ConfigItemReactFlowNode({ if (data.data.type === "intermediary") { return undefined; } - return data.data.config.changes?.reduce( - (acc, change) => acc + change.total, - 0 - ); + return data.data.config.changes; }, [data]); if (data.data.type === "intermediary") {