From 0cf4dbf13fee8dc8abd5d16acfaf3f0d201d576c Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Wed, 15 Mar 2017 07:55:38 -0300 Subject: [PATCH] Removing contextMenu templates and title from tabs --- .../client/components/viewer/viewer.js | 2 +- LesionTracker/client/routes.js | 6 ++-- OHIFViewer/client/head.html | 1 + OHIFViewer/public/images/logo.png | Bin 0 -> 15344 bytes .../lib/studylist/openNewTabWithTimepoint.js | 3 +- .../lib/studylist/studylistModification.js | 28 +++++++----------- .../components/longitudinal/dropdown.js | 2 -- .../components/studyContextMenu/index.js | 2 -- .../studyContextMenu/studyContextMenu.html | 12 -------- .../studyContextMenu/studyContextMenu.js | 23 -------------- .../components/studylist/studylist.html | 3 -- .../client/components/studylist/studylist.js | 2 +- .../ohif-study-list/client/lib/openNewTab.js | 13 ++++---- .../ohif-study-list/client/lib/studylist.js | 4 +-- .../client/lib/getName.js | 2 ++ Packages/ohif-viewerbase/package.js | 1 + 16 files changed, 27 insertions(+), 77 deletions(-) create mode 100644 OHIFViewer/public/images/logo.png delete mode 100644 Packages/ohif-study-list/client/components/studyContextMenu/index.js delete mode 100644 Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html delete mode 100644 Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js diff --git a/LesionTracker/client/components/viewer/viewer.js b/LesionTracker/client/components/viewer/viewer.js index a3817bb41..1b87b9f7c 100644 --- a/LesionTracker/client/components/viewer/viewer.js +++ b/LesionTracker/client/components/viewer/viewer.js @@ -92,7 +92,7 @@ Template.viewer.onCreated(() => { OHIF.log.info('Setting default ViewerData'); OHIF.viewer.loadedSeriesData = {}; ViewerData[contentId].loadedSeriesData = {}; - Session.set('ViewerData', ViewerData); + Session.setPersistent('ViewerData', ViewerData); } Session.set('activeViewport', ViewerData[contentId].activeViewport || false); diff --git a/LesionTracker/client/routes.js b/LesionTracker/client/routes.js index 2c9b9ea01..ac8a8e6c2 100644 --- a/LesionTracker/client/routes.js +++ b/LesionTracker/client/routes.js @@ -15,9 +15,7 @@ Router.configure({ Router.onBeforeAction('loading'); -const data = { - additionalTemplates: [] -}; +const data = {}; const routerOptions = { data }; @@ -29,7 +27,7 @@ Router.route('/', function() { } else { const contentId = Session.get('activeContentId'); if (!contentId) { - Session.set('activeContentId', 'studylistTab'); + Session.setPersistent('activeContentId', 'studylistTab'); } this.render('app', routerOptions); diff --git a/OHIFViewer/client/head.html b/OHIFViewer/client/head.html index 7fc632e9a..e27ae1f97 100644 --- a/OHIFViewer/client/head.html +++ b/OHIFViewer/client/head.html @@ -3,6 +3,7 @@ OHIF Viewer + diff --git a/OHIFViewer/public/images/logo.png b/OHIFViewer/public/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fc83b135454a7d4a47fb3c29735eaefe3c7e1d34 GIT binary patch literal 15344 zcmeI3du$s;9>+In8$v>PmREVmxYw$vwRhLgc+YWhW9LQOgw!c1{6RLmlVmUU?q+wB zI025dAfTlvz^T3DCju4&Tx&n|+CjTb z5^L=@dt*#Ytpj~hh4yeaRR6w@_T^ZB_0OiYyO+h!JLvTqML}y_X9RjjZ)Jha`KI)*But19f z4H6&;Q*=myExH!9Pcam|PbmQ~*Ig2$A@!7CVfK_v11YIQn%R?1vuY~6)j?RuT%87Z zL($@jk_e^CwJke)TV0)PWsDaj*<8)_LAp?%ubR9Si0}po!K(H;SjNG+<1U6{eVm6~ z#lZ4r5Rx<1=h*qq#{eT<`a#Sp3l70{CuE!Fx@SdT4^+jb4F70&N&SEr4|%5MBl1O z@J{Cw2rF|3{~ydnERab+H#khAq{G8Af{bsj+q_xVgMqoN*^Y#CmK&4X9(bQ|ykOqh zA)SYt8>Fo}F58x$R64^PC@mwB_8K(%wQJFZTj5L}#&O8wyi`w7G8yY3{bATj%a(wgTtxeoz#+9z{#?Mo3EX zy?|Eb-XNWC%#Rt&{TJZsl!T(e>kNe4LAqEol4aiiW^qGKyj2lwke=68sP8n7eqzwl z`&|tD(5(48lZtj1rfxiQD%xF`n$PTzB_rg@j8@Q$WSRe@(lFM;2Qv`zdA)9LkS=U4 z%xIHRAki6-;BBg#XT%5BW#trh6iwV%DiP_(B&JINd4#emCEW@i(BQKnoqIT(TSU2o z`8x;s75&b}s2v#urGbqJE-WHcKyaZnura}fMT80nE|dl~Cb+POPyxY((!j<97ZwpJ zAh=K(*qGqLB0>cO7fJ&g6I@tCsDR)?X<%c53yTO95L_q?Y)o)r5upNt3#EaL2`(%m zR6uZ{G_Wzjg++u42riTcHYT{Rh)@B+h0?&r1Q!+&Dj>K}8rYcN!XiQi1Q$vJ8xveu zM5ut^LTO-Qf(wfX6%bq~4QxzsVG*GMf(xaAjR`I+B2++dp){~D!G%SH3J5Ng1~w+R zu!v9r!G+Sm#%IJ;m4Dq5$nYJ@VfZp-;EmP0;ER|xp|L$iQKQQ#YV2-``tdaU{+6N! z8HzgD1z+!+ps350M{awoo}$V=Zid|<`D~vpCUv*Dx#iY2R>bukY6+^uf zcZFuvV}Vb=wi9cfd-SdqW!0UB%KyFcxYt(R^2DnhM}(?W=iRbp8#{B0_(p%t ziGhzR#Ro4;18-(2}p!xr!JpZ;@y+xa!K$KI)5G!+|Z z9dGVh?yzhxn;KiRy2}dX<~?s88EJid?~$EL9{RQac>C3hRt;1?+5UB4>(5Pp{r-ig zc5kQ~eSNy(&b^D5TzqPF?Cr5@hYxK@PQ7 { +OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => { const contentId = 'viewerTab'; const Timepoints = StudyList.timepointApi.timepoints; @@ -29,7 +29,6 @@ OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => { // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: data.studyInstanceUids, timepointIds: data.timepointIds, diff --git a/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js b/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js index 2ecc2b964..969d548c4 100644 --- a/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js +++ b/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js @@ -1,9 +1,9 @@ +import { Meteor } from 'meteor/meteor'; import { OHIF } from 'meteor/ohif:core'; -import { Viewerbase } from 'meteor/ohif:viewerbase'; Meteor.startup(function() { - StudyList.callbacks['dblClickOnStudy'] = dblClickOnStudy; - StudyList.callbacks['middleClickOnStudy'] = dblClickOnStudy; + StudyList.callbacks.dblClickOnStudy = dblClickOnStudy; + StudyList.callbacks.middleClickOnStudy = dblClickOnStudy; StudyList.timepointApi = new OHIF.measurements.TimepointApi(); StudyList.timepointApi.retrieveTimepoints(); @@ -12,28 +12,21 @@ Meteor.startup(function() { /** * Lesion Tracker method including Timepoints / other studies */ -function dblClickOnStudy(data) { - // Use the formatPN template helper to clean up the patient name - let title = Viewerbase.helpers.formatPN(data.patientName); - - const instance = Template.instance(); - +const dblClickOnStudy = data => { // Find the relevant timepoint given the clicked-on study const timepointApi = StudyList.timepointApi; if (!timepointApi) { - console.log('No timepoint api on dbl-clicked study?'); + OHIF.log.warn('No timepoint api on dbl-clicked study?'); return; } const timepoint = timepointApi.study(data.studyInstanceUid)[0]; if (timepoint) { - // Add the Timepoint name to the Patient name to create the tab title - title += ' ' + timepointApi.name(timepoint); - OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId, title); + OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId); } else { - open(data.studyInstanceUid, title); + openTab(data.studyInstanceUid); } -} +}; /** * Opens a study @@ -41,14 +34,13 @@ function dblClickOnStudy(data) { * @param studyInstanceUid The UID of the Study to be opened * @param title The title to be used for the tab heading */ -function open(studyInstanceUid, title) { +const openTab = studyInstanceUid => { const contentId = 'viewerTab'; ViewerData = window.ViewerData || ViewerData; // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, isUnassociatedStudy: true, studyInstanceUids: [studyInstanceUid] @@ -56,4 +48,4 @@ function open(studyInstanceUid, title) { // Switch to the new tab switchToTab(contentId); -} +}; diff --git a/Packages/ohif-measurements/client/components/longitudinal/dropdown.js b/Packages/ohif-measurements/client/components/longitudinal/dropdown.js index 1e21d67e4..a37c90838 100644 --- a/Packages/ohif-measurements/client/components/longitudinal/dropdown.js +++ b/Packages/ohif-measurements/client/components/longitudinal/dropdown.js @@ -43,7 +43,6 @@ const viewStudies = () => { return; } - const title = selectedStudies[0].patientName; const studyInstanceUids = selectedStudies.map(study => study.studyInstanceUid); const contentId = 'viewerTab'; @@ -51,7 +50,6 @@ const viewStudies = () => { // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: studyInstanceUids }; diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/index.js b/Packages/ohif-study-list/client/components/studyContextMenu/index.js deleted file mode 100644 index e4a89ca87..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import './studyContextMenu.html'; -import './studyContextMenu.js'; diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html b/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html deleted file mode 100644 index 79bbbf412..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js b/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js deleted file mode 100644 index 3125edcb6..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { OHIF } from 'meteor/ohif:core'; - -Meteor.startup(() => { - OHIF.studylist.dropdown.setItems([{ - action: OHIF.studylist.viewSeriesDetails, - text: 'View Series Details' - }, { - text: 'Anonymize', - disabled: true - }, { - text: 'Send', - disabled: true, - separatorAfter: true - }, { - text: 'Delete', - disabled: true - }, { - action: OHIF.studylist.exportSelectedStudies, - text: 'Export', - title: 'Export Selected Studies' - }]); -}); diff --git a/Packages/ohif-study-list/client/components/studylist/studylist.html b/Packages/ohif-study-list/client/components/studylist/studylist.html index 10e47b76c..4e51ec4c0 100644 --- a/Packages/ohif-study-list/client/components/studylist/studylist.html +++ b/Packages/ohif-study-list/client/components/studylist/studylist.html @@ -10,7 +10,4 @@ - {{#each templateName in additionalTemplates}} - {{>Template.dynamic template=templateName}} - {{/each}} diff --git a/Packages/ohif-study-list/client/components/studylist/studylist.js b/Packages/ohif-study-list/client/components/studylist/studylist.js index 130989f79..df7e47527 100644 --- a/Packages/ohif-study-list/client/components/studylist/studylist.js +++ b/Packages/ohif-study-list/client/components/studylist/studylist.js @@ -31,7 +31,7 @@ Template.studylist.onRendered(() => { const instance = Template.instance(); if (instance.data && instance.data.studyInstanceUid) { const studyInstanceUid = instance.data.studyInstanceUid; - openNewTab(studyInstanceUid, studyInstanceUid); + openNewTab(studyInstanceUid); } else { // If there is a tab set as active in the Session, // switch to that now. diff --git a/Packages/ohif-study-list/client/lib/openNewTab.js b/Packages/ohif-study-list/client/lib/openNewTab.js index 8c4841555..07f84399d 100644 --- a/Packages/ohif-study-list/client/lib/openNewTab.js +++ b/Packages/ohif-study-list/client/lib/openNewTab.js @@ -1,22 +1,23 @@ +import { Random } from 'meteor/random'; +import { OHIF } from 'meteor/ohif:core'; + /** * Opens a new tab in the tabbed studylist environment using * a given study and new tab title. * * @param studyInstanceUid The UID of the Study to be opened - * @param title The title to be used for the tab heading */ -openNewTab = function(studyInstanceUid, title) { - console.log('openNewTab'); - +const openNewTab = studyInstanceUid => { + OHIF.log.info('openNewTab'); + // Generate a unique ID to represent this tab // We can't just use the Mongo entry ID because // then it will change after hot-reloading. - var contentId = Random.id(); + const contentId = Random.id(); // Update the ViewerData global object ViewerData = window.ViewerData || ViewerData; ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: [studyInstanceUid] }; diff --git a/Packages/ohif-study-list/client/lib/studylist.js b/Packages/ohif-study-list/client/lib/studylist.js index 977e7ccad..a3c5966d9 100644 --- a/Packages/ohif-study-list/client/lib/studylist.js +++ b/Packages/ohif-study-list/client/lib/studylist.js @@ -22,9 +22,7 @@ StudyList.callbacks.dblClickOnStudy = dblClickOnStudy; StudyList.callbacks.middleClickOnStudy = dblClickOnStudy; function dblClickOnStudy(data) { - // Use the formatPN template helper to clean up the patient name - var title = Viewerbase.helpers.formatPN(data.patientName); - openNewTab(data.studyInstanceUid, title); + openNewTab(data.studyInstanceUid); } let currentServerChangeHandlerFirstRun = true; diff --git a/Packages/ohif-user-management/client/lib/getName.js b/Packages/ohif-user-management/client/lib/getName.js index 2f0190a27..97914f8d8 100644 --- a/Packages/ohif-user-management/client/lib/getName.js +++ b/Packages/ohif-user-management/client/lib/getName.js @@ -2,6 +2,8 @@ import { Meteor } from 'meteor/meteor'; import { OHIF } from 'meteor/ohif:core'; OHIF.user.getName = () => { + const user = Meteor.user(); + if (!user) return ''; const nameSplit = Meteor.user().profile.fullName.split(' '); const lastName = nameSplit[nameSplit.length - 1]; nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.'; diff --git a/Packages/ohif-viewerbase/package.js b/Packages/ohif-viewerbase/package.js index 7aebf54cc..2e5bb940c 100644 --- a/Packages/ohif-viewerbase/package.js +++ b/Packages/ohif-viewerbase/package.js @@ -14,6 +14,7 @@ Package.onUse(function(api) { api.use('stylus'); api.use('momentjs:moment'); api.use('validatejs'); + api.use('u2622:persistent-session'); // Our custom packages api.use('ohif:design');