From 87608f3e191ee788d0fac1df6a72b6dfc19ad3e2 Mon Sep 17 00:00:00 2001 From: v-liguo Date: Tue, 23 Jul 2019 17:06:53 +0800 Subject: [PATCH 1/3] [fix issue#1332]Double check for trial does not have final result --- src/webui/src/components/trial-detail/Para.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/webui/src/components/trial-detail/Para.tsx b/src/webui/src/components/trial-detail/Para.tsx index 3d32c7c207..f8850e9c9f 100644 --- a/src/webui/src/components/trial-detail/Para.tsx +++ b/src/webui/src/components/trial-detail/Para.tsx @@ -78,7 +78,7 @@ class Para extends React.Component { getParallelAxis = ( dimName: Array, parallelAxis: Array, - accPara: Array, eachTrialParams: Array, + accPara: Array, eachTrialParams: Array, lengthofTrials: number ) => { // get data for every lines. if dim is choice type, number -> toString() @@ -276,7 +276,10 @@ class Para extends React.Component { } }); if (this._isMounted) { - this.setState({ max: Math.max(...accPara), min: Math.min(...accPara) }, () => { + // if not return final result + const maxVal = accPara.length === 0 ? 1 : Math.max(...accPara); + const minVal = accPara.length === 0 ? 1 : Math.min(...accPara); + this.setState({ max: maxVal, min: minVal }, () => { this.getParallelAxis(dimName, parallelAxis, accPara, eachTrialParams, lenOfDataSource); }); } From bf8d6dc625614c12f67f1d5bbb88903b41f29474 Mon Sep 17 00:00:00 2001 From: v-liguo Date: Wed, 24 Jul 2019 18:53:48 +0800 Subject: [PATCH 2/3] update --- src/webui/src/components/public-child/IntermediateVal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webui/src/components/public-child/IntermediateVal.tsx b/src/webui/src/components/public-child/IntermediateVal.tsx index abc4fb45d4..6506c15ace 100644 --- a/src/webui/src/components/public-child/IntermediateVal.tsx +++ b/src/webui/src/components/public-child/IntermediateVal.tsx @@ -30,7 +30,12 @@ class IntermediateVal extends React.Component { } } if (status === 'SUCCEEDED') { - result = `${result} (FINAL)`; + // some trial haven't final result + if (record.acc !== undefined) { + if (record.acc.default !== undefined) { + result = `${result} (FINAL)`; + } + } } else { result = `${result} (LATEST)`; } From 92d75bc059ddb304f6b70ca1b55cc3b4a6138571 Mon Sep 17 00:00:00 2001 From: v-liguo Date: Thu, 25 Jul 2019 15:16:44 +0800 Subject: [PATCH 3/3] fix detail table succeed trial XXX(FINAL) when have not final result --- .../src/components/public-child/IntermediateVal.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/webui/src/components/public-child/IntermediateVal.tsx b/src/webui/src/components/public-child/IntermediateVal.tsx index 6506c15ace..b5bd015843 100644 --- a/src/webui/src/components/public-child/IntermediateVal.tsx +++ b/src/webui/src/components/public-child/IntermediateVal.tsx @@ -15,7 +15,6 @@ class IntermediateVal extends React.Component { render() { const { record } = this.props; const interArr = record.description.intermediate; - const status = record.status; let lastVal; let wei = 0; if (interArr !== undefined) { @@ -29,12 +28,10 @@ class IntermediateVal extends React.Component { result = `${lastVal.toFixed(6)}`; } } - if (status === 'SUCCEEDED') { - // some trial haven't final result - if (record.acc !== undefined) { - if (record.acc.default !== undefined) { - result = `${result} (FINAL)`; - } + // some trial haven't final result + if (record.acc !== undefined) { + if (record.acc.default !== undefined) { + result = `${result} (FINAL)`; } } else { result = `${result} (LATEST)`;