From d45321dae354350337feda3f8630ef49994accdb Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Wed, 22 Feb 2017 10:15:33 -0300 Subject: [PATCH] Fixing Hanging Protocols issue with timepoint type --- .../components/toolbarSection/toolbarSection.js | 1 - .../client/lib/hangingProtocolCustomizations.js | 16 +++++++++------- Packages/ohif-measurements/package.js | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/LesionTracker/client/components/toolbarSection/toolbarSection.js b/LesionTracker/client/components/toolbarSection/toolbarSection.js index 4c8118da7..1822d76df 100644 --- a/LesionTracker/client/components/toolbarSection/toolbarSection.js +++ b/LesionTracker/client/components/toolbarSection/toolbarSection.js @@ -62,7 +62,6 @@ Template.toolbarSection.helpers({ disabled: isToolDisabled }); - // TODO: Get real icons for CR / UN / EX targetSubTools.push({ id: 'targetCR', title: 'CR Target', diff --git a/Packages/ohif-measurements/client/lib/hangingProtocolCustomizations.js b/Packages/ohif-measurements/client/lib/hangingProtocolCustomizations.js index 2a2afcfee..ad8a27dc6 100644 --- a/Packages/ohif-measurements/client/lib/hangingProtocolCustomizations.js +++ b/Packages/ohif-measurements/client/lib/hangingProtocolCustomizations.js @@ -1,9 +1,9 @@ +import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; -// TODO: [LT-refactor] move this to ohif:hanging-protocols package - const getTimepointType = study => { - const timepointApi = Template.instance().timepointApi; + const instance = Template.instance(); + const timepointApi = instance.timepointApi || instance.data.timepointApi; if (!timepointApi) { return; } @@ -16,8 +16,10 @@ const getTimepointType = study => { return timepoint.timepointType; }; -HP = HP || false; +Meteor.startup(() => { + HP = HP || false; -if (HP) { - HP.addCustomAttribute('timepointType', 'Timepoint Type', getTimepointType); -} + if (HP) { + HP.addCustomAttribute('timepointType', 'Timepoint Type', getTimepointType); + } +}); diff --git a/Packages/ohif-measurements/package.js b/Packages/ohif-measurements/package.js index 30423556f..d8b0ae78d 100644 --- a/Packages/ohif-measurements/package.js +++ b/Packages/ohif-measurements/package.js @@ -35,6 +35,7 @@ Package.onUse(function(api) { api.use('ohif:core'); api.use('ohif:log'); api.use('ohif:study-list'); + api.use('ohif:hanging-protocols'); // Client and server imports api.addFiles('both/index.js', ['client', 'server']);