LT-288: Fixing viewer crash for non associated studies
This commit is contained in:
1 parent
0eeb05e72b
commit
396f83b449
7 files changed
+88
-38
No files matched your search
@@ -7,7 +7,14 @@ Template.caseProgress.onCreated(() => {
|
||||
instance.progressText = new ReactiveVar();
|
||||
instance.isLocked = new ReactiveVar();
|
||||
|
||||
// Get the current timepoint
|
||||
const current = instance.data.timepointApi.current();
|
||||
|
||||
// Stop here if no timepoint was found
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!current.timepointId) {
|
||||
console.warn('Case has no timepointId');
|
||||
return;
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<template name="lesionTable">
|
||||
<div id="lesionTableContainer">
|
||||
<div class="lesionTableLayoutChanger viewerRoundedButtonGroup">
|
||||
{{>roundedButtonGroup buttonGroupData}}
|
||||
</div>
|
||||
<div class="lesionTableTimepointHeaderRow">
|
||||
{{#each this.timepoints.get}}
|
||||
{{>lesionTableTimepointHeader}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{>lesionTableView (clone this)}}
|
||||
{{#if this.timepoints.get.length}}
|
||||
<div class="lesionTableLayoutChanger viewerRoundedButtonGroup">
|
||||
{{>roundedButtonGroup buttonGroupData}}
|
||||
</div>
|
||||
<div class="lesionTableTimepointHeaderRow">
|
||||
{{#each this.timepoints.get}}
|
||||
{{>lesionTableTimepointHeader}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{>lesionTableView (clone this)}}
|
||||
{{else}}
|
||||
<h3 class="p-x-1 text-center">No associated timepoint</h3>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
@@ -16,7 +16,14 @@ Template.lesionTableHeaderRow.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
instance.maxNumLesions = new ReactiveVar();
|
||||
|
||||
// Get the current timepoint
|
||||
const current = instance.data.timepointApi.current();
|
||||
|
||||
// Stop here if no timepoint was found
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
const timepointType = current.timepointType;
|
||||
|
||||
if (!instance.data.currentTimepointId) {
|
||||
|
||||
@@ -53,7 +53,10 @@ Template.toolbarSection.helpers({
|
||||
},
|
||||
|
||||
toolbarButtons() {
|
||||
var buttonData = [];
|
||||
// Check if the measure tools shall be disabled
|
||||
const isMesureDisabled = !Template.instance().data.timepointApi.currentTimepointId;
|
||||
const buttonData = [];
|
||||
|
||||
buttonData.push({
|
||||
id: 'zoom',
|
||||
title: 'Zoom',
|
||||
@@ -86,14 +89,16 @@ Template.toolbarSection.helpers({
|
||||
id: 'bidirectional',
|
||||
title: 'Target',
|
||||
classes: 'imageViewerTool rm-l-3',
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-target'
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-target',
|
||||
disabled: isMesureDisabled
|
||||
});
|
||||
|
||||
buttonData.push({
|
||||
id: 'nonTarget',
|
||||
title: 'Non-Target',
|
||||
classes: 'imageViewerTool toolbarSectionButton',
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-non-target'
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-non-target',
|
||||
disabled: isMesureDisabled
|
||||
});
|
||||
|
||||
buttonData.push({
|
||||
@@ -107,28 +112,33 @@ Template.toolbarSection.helpers({
|
||||
},
|
||||
|
||||
extraToolbarButtons() {
|
||||
let buttonData = [];
|
||||
// Check if the measure tools shall be disabled
|
||||
const isMesureDisabled = !Template.instance().data.timepointApi.currentTimepointId;
|
||||
const buttonData = [];
|
||||
|
||||
// TODO: Get real icons for CR / UN / EX
|
||||
buttonData.push({
|
||||
id: 'crTool',
|
||||
title: 'CR Tool',
|
||||
classes: 'imageViewerTool toolbarSectionButton',
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp'
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||
disabled: isMesureDisabled
|
||||
});
|
||||
|
||||
buttonData.push({
|
||||
id: 'unTool',
|
||||
title: 'UN Tool',
|
||||
classes: 'imageViewerTool toolbarSectionButton',
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp'
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||
disabled: isMesureDisabled
|
||||
});
|
||||
|
||||
buttonData.push({
|
||||
id: 'exTool',
|
||||
title: 'EX Tool',
|
||||
classes: 'imageViewerTool toolbarSectionButton',
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp'
|
||||
svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||
disabled: isMesureDisabled
|
||||
});
|
||||
|
||||
return buttonData;
|
||||
|
||||
Reference in new issue
Block a user