PWV-15: Creating routing branch

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:46 -03:00
1 parent e618e32341
commit efb4ca23b5
24 files changed
+158 -437

No files matched your search

@@ -1,3 +1,5 @@
import { Template } from 'meteor/templating';
import { _ } from 'meteor/underscore';
import { OHIF } from 'meteor/ohif:core';
Template.measurementTableTimepointCell.helpers({
@@ -15,6 +17,7 @@ Template.measurementTableTimepointCell.helpers({
return rowItem.entries.length > 0;
}
},
displayData() {
const instance = Template.instance();
const rowItem = instance.data.rowItem;
@@ -26,6 +29,7 @@ Template.measurementTableTimepointCell.helpers({
if (dataAtThisTimepoint.length > 1) {
throw 'More than one measurement was found at the same timepoint with the same measurement number?';
}
data = dataAtThisTimepoint[0];
} else {
data = rowItem.entries[0];
@@ -38,29 +42,14 @@ Template.measurementTableTimepointCell.helpers({
const tool = _.findWhere(toolGroup.childTools, { id: data.toolType });
if (!tool) {
// TODO: Figure out what is going on here?
console.warn('Something went wrong?');
OHIF.log.warn('Something went wrong?');
}
const displayFunction = tool.options.measurementTable.displayFunction;
return displayFunction(data);
}
});
function doneCallback(measurementData, deleteTool) {
// If a Lesion or Non-Target is removed via a dialog
// opened by the Lesion Table, we should clear the data for
// the specified Timepoint Cell
if (deleteTool === true) {
OHIF.log.info('Confirm clicked!');
OHIF.lesiontracker.clearMeasurementTimepointData(measurementData.id, measurementData.timepointId);
}
}
// Delete a lesion if Ctrl+D or DELETE is pressed while a lesion is selected
const keys = {
D: 68,
DELETE: 46
};
Template.measurementTableTimepointCell.events({
'click .measurementTableTimepointCell'(event, instance) {
if (!instance.data.timepointId) {
@@ -71,14 +60,18 @@ Template.measurementTableTimepointCell.events({
const timepoints = instance.data.timepoints.get();
OHIF.measurements.jumpToRowItem(rowItem, timepoints);
},
'keydown .measurementTableTimepointCell'(event, instance) {
// Delete a lesion if Ctrl+D or DELETE is pressed while a lesion is selected
const keys = {
D: 68,
DELETE: 46
};
const keyCode = event.which;
if (keyCode === keys.DELETE || keyCode === keys.BACKSPACE || (keyCode === keys.D && event.ctrlKey === true)) {
const currentMeasurement = Template.parentData(1).rowItem;
const timepointId = this.timepointId;
const timepointId = instance.data.timepointId;
const dialogSettings = {
title: 'Delete measurements',
message: 'Are you sure you want to delete this measurement?'
@@ -88,8 +81,7 @@ Template.measurementTableTimepointCell.events({
const measurementTypeId = instance.data.rowItem.measurementTypeId;
const measurement = instance.data.rowItem.entries[0];
const measurementNumber = measurement.measurementNumber;
const measurementApi = instance.data.measurementApi;
const timepointApi = instance.data.timepointApi;
const { timepointApi, measurementApi } = instance.data;
// Remove all the measurements with the given type and number
measurementApi.deleteMeasurements(measurementTypeId, {