diff --git a/platform/ui/src/components/measurementTable/MeasurementTableItem.styl b/platform/ui/src/components/measurementTable/MeasurementTableItem.styl index 8f1e07bef..949730628 100644 --- a/platform/ui/src/components/measurementTable/MeasurementTableItem.styl +++ b/platform/ui/src/components/measurementTable/MeasurementTableItem.styl @@ -30,6 +30,11 @@ .measurementLocation margin-left: 9px; margin-top: 9px; + overflow: hidden; + max-width: calc(100% - 50px); + text-overflow: ellipsis; + overflow-wrap: normal; + white-space: nowrap; .measurementDisplayText display: inline-block; diff --git a/platform/ui/src/components/tableList/TableListItem.styl b/platform/ui/src/components/tableList/TableListItem.styl index a471d134e..4cc8f3f9f 100644 --- a/platform/ui/src/components/tableList/TableListItem.styl +++ b/platform/ui/src/components/tableList/TableListItem.styl @@ -38,6 +38,7 @@ .itemContent flex: 1 color: var(--text-secondary-color) + width: calc(100% - 30px); font-weight: 400 margin-left: 9px; margin-top: 9px; diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js b/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js index 9a9290fcf..c4092c455 100644 --- a/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/ConnectedMeasurementTable.js @@ -31,7 +31,7 @@ function getAllTools() { function getMeasurementText(measurementData = {}) { const defaultText = '...'; const { location = '', description = '' } = measurementData; - const result = location + (description ? `(${description})` : ''); + const result = location + (description ? ` (${description})` : ''); return result || defaultText; } diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/labelingFlowCallbacks.js b/platform/viewer/src/appExtensions/MeasurementsPanel/labelingFlowCallbacks.js index feaa98646..81fae1f0b 100644 --- a/platform/viewer/src/appExtensions/MeasurementsPanel/labelingFlowCallbacks.js +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/labelingFlowCallbacks.js @@ -105,9 +105,9 @@ function getToolLabellingFlowCallback(store) { if (location) { measurementData.location = location; } - if (description) { - measurementData.description = description; - } + + measurementData.description = description || ''; + if (response) { measurementData.response = response; } diff --git a/platform/viewer/src/components/Labelling/LabellingFlow.js b/platform/viewer/src/components/Labelling/LabellingFlow.js index aa32b609a..6d5160e62 100644 --- a/platform/viewer/src/components/Labelling/LabellingFlow.js +++ b/platform/viewer/src/components/Labelling/LabellingFlow.js @@ -152,6 +152,7 @@ export default class LabellingFlow extends Component { ref={this.descriptionInput} defaultValue={description || ''} autoComplete="off" + onKeyPress={this.handleKeyPress} /> @@ -223,6 +224,12 @@ export default class LabellingFlow extends Component { }); }; + handleKeyPress = e => { + if (e.key === 'Enter') { + this.descriptionSave(); + } + }; + descriptionSave = () => { const description = this.descriptionInput.current.value; this.props.updateLabelling({ description });