From 85f836cd918614be722fce1bff2373460ec4900b Mon Sep 17 00:00:00 2001 From: ladeirarodolfo <39910206+ladeirarodolfo@users.noreply.github.com> Date: Fri, 25 Oct 2019 23:19:16 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Desc=20of=20meas.table=20?= =?UTF-8?q?not=20being=20updated=20on=20properly=20(#1094)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Is not possible to add Measurement Description if Relabel was not previously selected BREAKING CHANGE: 1013 Closes: #1013 --- .../ConnectedMeasurementTable.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js b/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js index 3c897cdf6..9a9290fcf 100644 --- a/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js @@ -28,16 +28,12 @@ function getAllTools() { return tools; } -function getMeasurementText(measurementData) { - const { location, description } = measurementData; - let text = '...'; - if (location) { - text = location; - if (description) { - text += `(${description})`; - } - } - return text; +function getMeasurementText(measurementData = {}) { + const defaultText = '...'; + const { location = '', description = '' } = measurementData; + const result = location + (description ? `(${description})` : ''); + + return result || defaultText; } function getDataForEachMeasurementNumber(