From 1839ebb746a0f1f2715c4708f3389e45b1930603 Mon Sep 17 00:00:00 2001 From: Namkyu Park <53862866+namkyu1999@users.noreply.github.com> Date: Tue, 5 Mar 2024 02:55:54 +0900 Subject: [PATCH] fix: resolve bugs (#21) Signed-off-by: namkyu1999 --- package.json | 2 +- .../EntityLitmusCard/ExperimentRunStatsSection.tsx | 7 ++++++- src/components/EntityLitmusContent/StatusHeatMap.tsx | 2 +- src/types/Experiment.ts | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7a65e66..ebd6f65 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "type": "git", "url": "https://github.com/litmuschaos/backstage-plugin.git" }, - "version": "1.0.0", + "version": "1.0.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/src/components/EntityLitmusCard/ExperimentRunStatsSection.tsx b/src/components/EntityLitmusCard/ExperimentRunStatsSection.tsx index 18e9696..15c8889 100644 --- a/src/components/EntityLitmusCard/ExperimentRunStatsSection.tsx +++ b/src/components/EntityLitmusCard/ExperimentRunStatsSection.tsx @@ -54,7 +54,7 @@ export const ExperimentRunStatsSection = ({ entity }: { entity: Entity }) => { const errored = value?.totalErroredExperimentRuns ?? 0; const stopped = value?.totalStoppedExperimentRuns ?? 0; const terminated = value?.totalTerminatedExperimentRuns?? 0; - + const others = total - (completed + running + errored + stopped + terminated); return ( @@ -94,6 +94,11 @@ export const ExperimentRunStatsSection = ({ entity }: { entity: Entity }) => { color: '#d9d9d9', label: 'Terminated', }, + { + value: others >= 0 ? others : 0, + color: '#f6832c', + label: 'Others', + }, ], }, ]} diff --git a/src/components/EntityLitmusContent/StatusHeatMap.tsx b/src/components/EntityLitmusContent/StatusHeatMap.tsx index f42979d..acf6a70 100644 --- a/src/components/EntityLitmusContent/StatusHeatMap.tsx +++ b/src/components/EntityLitmusContent/StatusHeatMap.tsx @@ -362,7 +362,7 @@ export function StatusHeatMap(props: StatusHeatMapProps): React.ReactElement { color="#D24433" display="inline" > - {execution.resiliencyScore.toString() + ' '} + {(execution.resiliencyScore ?? 0).toString() + ' '}