reorganize packages, start converting overall app to react (very broken at the moment)
This commit is contained in:
1 parent
024fe1a448
commit
5f30f7bd35
479 files changed
+5364
-11611
No files matched your search
+52
@@ -0,0 +1,52 @@
|
||||
<template name="measurementTableRow">
|
||||
<div class="measurementTableRow {{#if hasWarnings}}warning{{/if}}{{#if responseStatus}}response-status{{/if}}" data-measurementid="{{_id}}">
|
||||
<div class='measurementRowSidebar'>
|
||||
<div class="measurementNumber">
|
||||
{{rowItem.measurementNumber}}
|
||||
</div>
|
||||
{{#if hasWarnings}}
|
||||
<div class="warning-icon">
|
||||
<svg>
|
||||
<use xlink:href={{absoluteUrl "packages/ohif_viewerbase/assets/icons.svg#icon-ui-warning"}}></use>
|
||||
</svg>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if rowItem.responseStatus}}
|
||||
<div class="response-status-icon">
|
||||
{{rowItem.responseStatus}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="measurementDetails">
|
||||
<div class='location'>
|
||||
{{#if rowItem.location}}
|
||||
{{getLocationLabel rowItem.location}}
|
||||
{{else}}
|
||||
(No description)
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="timepointData">
|
||||
<!--Each time point as a column-->
|
||||
{{#each timepoint in timepoints.get}}
|
||||
{{>measurementTableTimepointCell (clone this timepoint)}}
|
||||
{{else}}
|
||||
{{>measurementTableTimepointCell}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="rowOptions">
|
||||
<div class="rowAction js-rename pull-left m-r-2" tabindex="1">
|
||||
<svg class="edit-icon">
|
||||
<use xlink:href={{absoluteUrl "packages/ohif_viewerbase/assets/icons.svg#icon-measurements-additional"}}></use>
|
||||
</svg>
|
||||
Relabel
|
||||
</div>
|
||||
<div class="rowAction js-delete pull-left" tabindex="1">
|
||||
<svg class="close-icon">
|
||||
<use xlink:href={{absoluteUrl "packages/ohif_viewerbase/assets/icons.svg#icon-ui-close"}}></use>
|
||||
</svg>
|
||||
Delete
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import _ from 'underscore';
|
||||
import $ from 'jquery';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { cornerstone } from 'meteor/ohif:cornerstone';
|
||||
|
||||
Template.measurementTableRow.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
instance.getWarningMessages = () => {
|
||||
const measurementTypeId = instance.data.rowItem.measurementTypeId;
|
||||
const measurementNumber = instance.data.rowItem.measurementNumber;
|
||||
const groupedNonConformities = instance.data.conformanceCriteria.groupedNonConformities.get() || {};
|
||||
const nonconformitiesByMeasurementTypeId = groupedNonConformities[measurementTypeId] || {};
|
||||
const nonconformitiesByMeasurementNumbers = nonconformitiesByMeasurementTypeId.measurementNumbers || {};
|
||||
const nonconformitiesByMeasurementNumber = nonconformitiesByMeasurementNumbers[measurementNumber] || {};
|
||||
|
||||
return _.uniq(nonconformitiesByMeasurementNumber.messages || []);
|
||||
};
|
||||
});
|
||||
|
||||
Template.measurementTableRow.helpers({
|
||||
hasWarnings() {
|
||||
return !!Template.instance().getWarningMessages().length;
|
||||
}
|
||||
});
|
||||
|
||||
Template.measurementTableRow.events({
|
||||
'click .measurementRowSidebar .warning-icon'(event, instance) {
|
||||
event.stopPropagation();
|
||||
OHIF.ui.showDialog('measurementTableWarningsDialog', {
|
||||
messages: instance.getWarningMessages(),
|
||||
position: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'click .measurementRowSidebar'(event, instance) {
|
||||
const $row = instance.$('.measurementTableRow');
|
||||
const rowItem = instance.data.rowItem;
|
||||
const timepoints = instance.data.timepoints.get();
|
||||
|
||||
$row.closest('.measurementTableView').find('.measurementTableRow').not($row).removeClass('active');
|
||||
$row.toggleClass('active');
|
||||
|
||||
const childToolKey = $(event.target).attr('data-child');
|
||||
OHIF.measurements.jumpToRowItem(rowItem, timepoints, childToolKey);
|
||||
},
|
||||
|
||||
'click .js-rename'(event, instance) {
|
||||
const rowItem = instance.data.rowItem;
|
||||
const entry = rowItem.entries[0];
|
||||
|
||||
// Show the measure flow for targets
|
||||
OHIF.measurements.toggleLabelButton({
|
||||
measurement: entry,
|
||||
element: document.body,
|
||||
measurementApi: instance.data.measurementApi,
|
||||
position: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
},
|
||||
autoClick: true
|
||||
});
|
||||
},
|
||||
|
||||
'click .js-delete'(event, instance) {
|
||||
const dialogSettings = {
|
||||
class: 'themed',
|
||||
title: 'Delete measurements',
|
||||
message: 'Are you sure you want to delete the measurement across all timepoints?',
|
||||
position: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
}
|
||||
};
|
||||
|
||||
OHIF.ui.showDialog('dialogConfirm', dialogSettings).then(formData => {
|
||||
const measurementTypeId = instance.data.rowItem.measurementTypeId;
|
||||
const measurement = instance.data.rowItem.entries[0];
|
||||
const measurementNumber = measurement.measurementNumber;
|
||||
const { timepointApi, measurementApi } = instance.data;
|
||||
|
||||
// Remove all the measurements with the given type and number
|
||||
measurementApi.deleteMeasurements(measurementTypeId, { measurementNumber });
|
||||
|
||||
// Sync the new measurement data with cornerstone tools
|
||||
const baseline = timepointApi.baseline();
|
||||
measurementApi.sortMeasurements(baseline.timepointId);
|
||||
|
||||
// Repaint the images on all viewports without the removed measurements
|
||||
_.each($('.imageViewerViewport'), element => cornerstone.updateImage(element));
|
||||
|
||||
// Notify that viewer suffered changes
|
||||
OHIF.measurements.triggerTimepointUnsavedChanges('deleted');
|
||||
});
|
||||
}
|
||||
});
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "{ohif:viewerbase}/app"
|
||||
|
||||
.measurementTableRow
|
||||
display: flex
|
||||
margin-left: -6px
|
||||
margin-top: 2px
|
||||
padding-left: 6px
|
||||
// required transformation to make inner fixed elements relative to this one
|
||||
transform(scale(1))
|
||||
width: calc(100% + 6px)
|
||||
|
||||
&.active
|
||||
|
||||
.measurementRowSidebar
|
||||
theme('color', '$activeColor')
|
||||
|
||||
.rowOptions
|
||||
height: 35px
|
||||
visibility: visible
|
||||
|
||||
&.response-status .measurementRowSidebar .response-status-icon
|
||||
theme('background-color', '$defaultColor')
|
||||
theme('color', '$uiGray')
|
||||
border-radius: 11px
|
||||
font-size: 12px
|
||||
font-weight: 700
|
||||
height: 21px
|
||||
line-height: 22px
|
||||
margin: 5px auto 0
|
||||
text-align: center
|
||||
width: 21px
|
||||
|
||||
&.warning .measurementRowSidebar
|
||||
theme('background-color', '$uiYellow')
|
||||
theme('color', '$textPrimaryColor')
|
||||
|
||||
.warning-icon, svg
|
||||
width: 22px
|
||||
height: 20px
|
||||
pointer-events: inherit
|
||||
|
||||
.warning-icon
|
||||
margin: 7px auto 0
|
||||
|
||||
svg
|
||||
theme('fill', '$textPrimaryColor')
|
||||
|
||||
.rowOptions
|
||||
theme('background-color', '$uiGrayDarker')
|
||||
height: 0
|
||||
overflow: hidden
|
||||
transition(all 0.3s ease)
|
||||
visibility: hidden
|
||||
|
||||
.rowAction
|
||||
theme('color', '$defaultColor')
|
||||
cursor: pointer
|
||||
line-height: 35px
|
||||
transition(all 0.3s ease)
|
||||
|
||||
&:hover, &:active
|
||||
theme('color', '$textPrimaryColor')
|
||||
|
||||
svg
|
||||
theme('fill', '$textPrimaryColor')
|
||||
theme('stroke', '$textPrimaryColor')
|
||||
|
||||
svg
|
||||
theme('fill', '$defaultColor')
|
||||
theme('stroke', '$defaultColor')
|
||||
transition(all 0.3s ease)
|
||||
|
||||
&.edit-icon
|
||||
width: 14px
|
||||
height: 13px
|
||||
|
||||
&.close-icon
|
||||
width: 11px
|
||||
height: 11px
|
||||
|
||||
.measurementRowSidebar
|
||||
theme('background', '$uiGray')
|
||||
theme('color', '$textSecondaryColor')
|
||||
cursor: pointer
|
||||
flex: 1
|
||||
max-width: 30px
|
||||
transition(all 0.3s ease)
|
||||
|
||||
.measurementNumber
|
||||
font-size: 14px
|
||||
font-weight: 400
|
||||
margin-right: 5px
|
||||
padding-top: 10px
|
||||
text-align: center
|
||||
|
||||
.measurementDetails
|
||||
flex: 1
|
||||
padding: 5px 2px 0 0
|
||||
|
||||
&>*
|
||||
padding-left: 14px
|
||||
|
||||
.location
|
||||
font-weight: 400
|
||||
font-size: 14px
|
||||
theme('color', '$textSecondaryColor')
|
||||
height: 30px
|
||||
line-height: 30px
|
||||
margin-left: -2px
|
||||
width: 100%
|
||||
|
||||
.timepointData
|
||||
display: flex
|
||||
min-height: 27px
|
||||
margin-top: 1px
|
||||
|
||||
div
|
||||
flex: 1
|
||||
font-size: 14px
|
||||
font-weight: 400
|
||||
justify-content: space-around
|
||||
line-height: 18px
|
||||
padding-bottom: 4px
|
||||
Reference in new issue
Block a user