From 9fe1bd6e73acd7eb56c7f2b20cdcffdb3f9768b9 Mon Sep 17 00:00:00 2001 From: Elena Zioga Date: Mon, 5 Dec 2022 12:24:09 +0200 Subject: [PATCH] frontend: Show the successful trials in the experiment graph (#2013) (#2033) * Show the successful trials in the experiment graph. Signed-off-by: Elena Zioga Signed-off-by: Elena Zioga --- .../experiment-details/experiment-details.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.ts b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.ts index a74c2ee227c..dc6bfc6045c 100644 --- a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.ts +++ b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.ts @@ -107,7 +107,7 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy { const data = transformStringResponses(response); this.columns = data.types; this.details = this.parseTrialsDetails(data.details); - this.showGraph = this.showGraphFn(response); + this.showGraph = this.showGraphFn(this.details); }); this.backendService .getExperiment(this.name, this.namespace) @@ -181,7 +181,7 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy { const data = transformStringResponses(trials); this.columns = data.types; this.details = this.parseTrialsDetails(data.details); - this.showGraph = this.showGraphFn(trials); + this.showGraph = this.showGraphFn(this.details); }); }), ); @@ -251,8 +251,10 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy { } } - private showGraphFn(response: string): boolean { - if (!response.includes(',,') && response.includes('\n')) { + private showGraphFn(array: string[][]): boolean { + const found = array.find(a => a[0] === 'Succeeded'); + + if (found) { return true; } }