Skip to content

Commit

Permalink
feat(view): cluster 요약에 최신 ReleaseTag 보여주는 방식 수정(githru#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakseong committed Oct 6, 2024
1 parent d988696 commit e998bbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,7 +85,7 @@ const Summary = () => {
));
})}
</div>
<div>{cluster.latestReleaseTag}</div>
<div>{getCommitLatestTag(cluster.clusterTags)}</div>
<Content
content={cluster.summary.content}
clusterId={cluster.clusterId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export type Summary = {
export type Cluster = {
clusterId: number;
summary: Summary;
latestReleaseTag: string;
clusterTags: string[];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function tagToNumber(tag: string, maxLength: number): number {
* @param tags
* @returns
*/
function getCommitLatestTag(tags: string[]): string {
export function getCommitLatestTag(tags: string[]): string {
if (!Array.isArray(tags) || tags.length === 0) return "";

const validTags = tags.filter((tag) => isValidReleaseTag(tag));
Expand Down Expand Up @@ -78,7 +78,6 @@ export function getInitData(data: GlobalProps["data"]): Cluster[] {
},
},
clusterTags: [],
latestReleaseTag: "",
};

const clusterTags: string[] = [];
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit e998bbe

Please sign in to comment.