fix: Clicking on measurement should highlight the measurement row in the measurement panel OHIF-433 (#3111)

* fix: OHIF-433 Clicking on measurement should highlight the measurement row in the measurement panel

Added selected flag to each OHIF measurement.
Listening to CS3D ANNOTATION_SELECTION_CHANGE to keep the selected flag in sync.

* fix: OHIF-433 Clicking on measurement should highlight the measurement row in the measurement panel

Fixed broken unit tests.

* PR feedback from Alireza:
- use MEASUREMENT_UPDATED event for selection changed
- added TODO to eventually have CS3D introduce the selected flag per annotation
- added MeasurementService._publishEvent

* PR feedback: now using _broadcastEvent
This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-01-13 13:57:18 -05:00
1 parent a997198587
commit 58ae8690a7
8 files changed
+103 -36

No files matched your search

@@ -255,14 +255,13 @@ function _getMappedMeasurements(MeasurementService) {
}
function _mapMeasurementToDisplay(measurement, index, types) {
const { displayText, uid, label, type } = measurement;
const { displayText, uid, label, type, selected } = measurement;
return {
uid,
label: label || '(empty)',
measurementType: type,
displayText: displayText || [],
// TODO: handle one layer down
isActive: false, // activeMeasurementItem === i + 1,
isActive: selected,
};
}