From cf167be8da0e2d2859e4a5d4ec46da2ae0be096e Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Fri, 4 Mar 2022 15:43:27 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20object=20orchestration?= =?UTF-8?q?=20for=20volumes=20in=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Dashboard/VolumeGroups.tsx | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/client/components/Dashboard/VolumeGroups.tsx b/src/client/components/Dashboard/VolumeGroups.tsx index c0a6d98..e78a362 100644 --- a/src/client/components/Dashboard/VolumeGroups.tsx +++ b/src/client/components/Dashboard/VolumeGroups.tsx @@ -1,4 +1,4 @@ -import { map } from "lodash"; +import { map, unionBy } from "lodash"; import React, { ReactElement } from "react"; import ellipsize from "ellipsize"; import { Link } from "react-router-dom"; @@ -11,6 +11,8 @@ export const VolumeGroups = (props): ReactElement => { 700: 2, 500: 1, }; + // Till mongo gives us back the deduplicated results with the ObjectId + const deduplicatedGroups = unionBy(props.volumeGroups, "volumes.id"); return (
@@ -22,29 +24,25 @@ export const VolumeGroups = (props): ReactElement => { className="volumes-grid" columnClassName="volumes-grid-column" > - {map(props.volumeGroups, (data) => { - return map(data.data, (group) => { - return ( -
- -
-
- - {ellipsize(group.volume.name, 18)} - -
-
- - Issues - - {group.volume.count_of_issues} - - -
+ {map(deduplicatedGroups, (data) => { + return ( +
+ +
+
+ + {ellipsize(data.volumes.name, 18)} + +
+
+ + Issues + {data.volumes.count_of_issues} +
- ); - }); +
+ ); })}