From d988696941e00b905fdf97f9b9e1a900a2bf025d Mon Sep 17 00:00:00 2001 From: rakseong Date: Sun, 6 Oct 2024 23:48:28 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat(view)=20:=20cluster=20=EC=9A=94?= =?UTF-8?q?=EC=95=BD=EC=97=90=20=ED=95=B4=EB=8B=B9=20cluster=EA=B0=80=20?= =?UTF-8?q?=ED=8F=AC=ED=95=A8=ED=95=98=EB=8A=94=20release=20tag=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(githru#727)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VerticalClusterList/Summary/Summary.type.ts | 1 + .../VerticalClusterList/Summary/Summary.util.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/view/src/components/VerticalClusterList/Summary/Summary.type.ts b/packages/view/src/components/VerticalClusterList/Summary/Summary.type.ts index 00b5c323..6861a35f 100644 --- a/packages/view/src/components/VerticalClusterList/Summary/Summary.type.ts +++ b/packages/view/src/components/VerticalClusterList/Summary/Summary.type.ts @@ -20,6 +20,7 @@ export type Cluster = { clusterId: number; summary: Summary; latestReleaseTag: string; + clusterTags: string[]; }; export type AuthSrcMap = Record; diff --git a/packages/view/src/components/VerticalClusterList/Summary/Summary.util.ts b/packages/view/src/components/VerticalClusterList/Summary/Summary.util.ts index e17ef18e..472d8600 100644 --- a/packages/view/src/components/VerticalClusterList/Summary/Summary.util.ts +++ b/packages/view/src/components/VerticalClusterList/Summary/Summary.util.ts @@ -77,6 +77,7 @@ export function getInitData(data: GlobalProps["data"]): Cluster[] { count: clusterNode.commitNodeList.length - 1, }, }, + clusterTags: [], latestReleaseTag: "", }; @@ -94,13 +95,18 @@ export function getInitData(data: GlobalProps["data"]): Cluster[] { // get releaseTags in cluster commitNodeList commitNode.commit.releaseTags?.map((tag) => { - clusterTags.push(tag); + if (clusterTags.indexOf(tag) === -1) { + clusterTags.push(tag); + } return clusterTags; }); return commitNode; }); + // set release tag in cluster + cluster.clusterTags = clusterTags; + // set latset release tag const latestReleaseTag = getCommitLatestTag(clusterTags); cluster.latestReleaseTag = latestReleaseTag; From e998bbe9e225a906c7f282c4263f4d5bc6cf8666 Mon Sep 17 00:00:00 2001 From: rakseong Date: Sun, 6 Oct 2024 23:56:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat(view):=20cluster=20=EC=9A=94=EC=95=BD?= =?UTF-8?q?=EC=97=90=20=EC=B5=9C=EC=8B=A0=20ReleaseTag=20=EB=B3=B4?= =?UTF-8?q?=EC=97=AC=EC=A3=BC=EB=8A=94=20=EB=B0=A9=EC=8B=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95(githru#727)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/VerticalClusterList/Summary/Summary.tsx | 4 ++-- .../components/VerticalClusterList/Summary/Summary.type.ts | 1 - .../components/VerticalClusterList/Summary/Summary.util.ts | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/view/src/components/VerticalClusterList/Summary/Summary.tsx b/packages/view/src/components/VerticalClusterList/Summary/Summary.tsx index 3d8a91e0..f913d339 100644 --- a/packages/view/src/components/VerticalClusterList/Summary/Summary.tsx +++ b/packages/view/src/components/VerticalClusterList/Summary/Summary.tsx @@ -14,7 +14,7 @@ import { getClusterSizes } from "../ClusterGraph/ClusterGraph.util"; import { CLUSTER_HEIGHT, DETAIL_HEIGHT, NODE_GAP } from "../ClusterGraph/ClusterGraph.const"; import { usePreLoadAuthorImg } from "./Summary.hook"; -import { getInitData, getClusterIds, getClusterById } from "./Summary.util"; +import { getInitData, getClusterIds, getClusterById, getCommitLatestTag } from "./Summary.util"; import { Content } from "./Content"; const COLLAPSED_ROW_HEIGHT = CLUSTER_HEIGHT + NODE_GAP * 2; @@ -85,7 +85,7 @@ const Summary = () => { )); })} -
{cluster.latestReleaseTag}
+
{getCommitLatestTag(cluster.clusterTags)}
isValidReleaseTag(tag)); @@ -78,7 +78,6 @@ export function getInitData(data: GlobalProps["data"]): Cluster[] { }, }, clusterTags: [], - latestReleaseTag: "", }; const clusterTags: string[] = []; @@ -107,10 +106,6 @@ export function getInitData(data: GlobalProps["data"]): Cluster[] { // set release tag in cluster cluster.clusterTags = clusterTags; - // set latset release tag - const latestReleaseTag = getCommitLatestTag(clusterTags); - cluster.latestReleaseTag = latestReleaseTag; - // remove name overlap const authorsSet = cluster.summary.authorNames.reduce((set, authorArray) => { authorArray.forEach((author) => {