Compare commits

..
Author SHA1 Message Date
ohif-bot 8cf1e54490 chore(release): publish [skip ci]
- @ohif/extension-vtk@0.52.20
 - @ohif/ui@0.56.1
 - @ohif/viewer@2.0.0
2019-10-26 02:25:52 +00:00
ladeirarodolfo 85f836cd91 fix: 🐛 Desc of meas.table not being updated on properly (#1094)
Is not possible to add Measurement Description if Relabel was not
previously selected

BREAKING CHANGE: 1013

Closes: #1013
2019-10-25 22:19:16 -04:00
Mirna Silva f5560c11b0 test: Stack Scroll, Right-click to zoom, Middle-click to Pan (#1073)
* E2E tests: Stack Scroll, Right-click to zoom, Middle-click to Pan

* About modal tests and added some cypress selectors

* Checking app version number

* Removed accidental import

* Review fixes
2019-10-25 22:14:57 -04:00
ohif-bot bef50f9298 chore(release): publish [skip ci]
- @ohif/extension-vtk@0.52.19
 - @ohif/core@1.5.2
 - @ohif/viewer@1.12.2
2019-10-25 18:32:05 +00:00
Rodrigo Antinarelli 986b7ae2bf fix: set SR in ActiveViewport by clicking thumb (#1091) 2019-10-25 14:22:44 -04:00
17 changed files with 212 additions and 43 deletions

No files matched your search

+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.52.20](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.19...@ohif/extension-vtk@0.52.20) (2019-10-26)
**Note:** Version bump only for package @ohif/extension-vtk
## [0.52.19](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.18...@ohif/extension-vtk@0.52.19) (2019-10-25)
**Note:** Version bump only for package @ohif/extension-vtk
## [0.52.18](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.17...@ohif/extension-vtk@0.52.18) (2019-10-25)
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-vtk",
"version": "0.52.18",
"version": "0.52.20",
"description": "OHIF extension for VTK.js",
"author": "OHIF",
"license": "MIT",
@@ -52,8 +52,8 @@
"react-vtkjs-viewport": "^0.3.7"
},
"devDependencies": {
"@ohif/core": "^1.5.1",
"@ohif/ui": "^0.56.0",
"@ohif/core": "^1.5.2",
"@ohif/ui": "^0.56.1",
"cornerstone-tools": "^4.0.9",
"cornerstone-wado-image-loader": "^3.0.0",
"dcmjs": "^0.6.1",
+11
View File
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.5.2](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.1...@ohif/core@1.5.2) (2019-10-25)
### Bug Fixes
* set SR in ActiveViewport by clicking thumb ([#1091](https://github.com/OHIF/Viewers/issues/1091)) ([986b7ae](https://github.com/OHIF/Viewers/commit/986b7ae2bf4f7d27f326e62f93285ce20eaf0a79))
## [1.5.1](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.0...@ohif/core@1.5.1) (2019-10-25)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/core",
"version": "1.5.1",
"version": "1.5.2",
"description": "Generic business logic for web-based medical imaging applications",
"author": "OHIF Core Team",
"license": "MIT",
+14 -5
View File
@@ -34,7 +34,6 @@ const defaultState = {
* @param {Object} [action.viewportSpecificData]
*/
const viewports = (state = defaultState, action) => {
let currentData;
let viewportSpecificData;
let useActiveViewport = false;
switch (action.type) {
@@ -85,14 +84,24 @@ const viewports = (state = defaultState, action) => {
// Allow fall-through
// eslint-disable-next-line
case SET_SPECIFIC_DATA: {
const layout = cloneDeep(state.layout);
const hasPlugin = action.data && action.data.plugin;
const viewportIndex = useActiveViewport
? state.activeViewportIndex
: action.viewportIndex;
currentData = cloneDeep(state.viewportSpecificData[viewportIndex]) || {};
viewportSpecificData = cloneDeep(state.viewportSpecificData);
viewportSpecificData[viewportIndex] = merge({}, currentData, action.data);
const { dom } = state.viewportSpecificData[viewportIndex];
return Object.assign({}, state, { viewportSpecificData });
viewportSpecificData = cloneDeep(state.viewportSpecificData);
viewportSpecificData[viewportIndex] = {
dom,
...action.data,
};
if (hasPlugin) {
layout.viewports[viewportIndex].plugin = action.data.plugin;
}
return Object.assign({}, state, { layout, viewportSpecificData });
}
case CLEAR_VIEWPORT:
viewportSpecificData = cloneDeep(state.viewportSpecificData);
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.56.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.56.0...@ohif/ui@0.56.1) (2019-10-26)
**Note:** Version bump only for package @ohif/ui
# [0.56.0](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.55.0...@ohif/ui@0.56.0) (2019-10-22)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/ui",
"version": "0.56.0",
"version": "0.56.1",
"description": "A set of React components for Medical Imaging Viewers",
"author": "OHIF Contributors",
"license": "MIT",
@@ -92,7 +92,7 @@ class AboutModal extends Component {
<Modal.Header closeButton>
<Modal.Title>{t('OHIF Viewer - About')}</Modal.Title>
</Modal.Header>
<Modal.Body>
<Modal.Body data-cy="about-modal">
<div className="btn-group">
<a
className="btn btn-default"
@@ -46,6 +46,7 @@ class DropdownMenu extends Component {
<button
key={key}
className="dd-item"
data-cy="about-item-menu"
onClick={() => this.handleOnClick(onClick)}
>
{icon && <Icon {...icon} className="dd-item-icon" />}
@@ -119,7 +120,11 @@ class DropdownMenu extends Component {
render() {
return (
<div className="dd-menu" ref={node => (this.node = node)}>
<div
className="dd-menu"
data-cy="options-menu"
ref={node => (this.node = node)}
>
<div className="dd-menu-toggle" onClick={this.toggleList}>
{this.renderTitleElement()}
</div>
+27
View File
@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.0.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.12.2...@ohif/viewer@2.0.0) (2019-10-26)
### Bug Fixes
* 🐛 Desc of meas.table not being updated on properly ([#1094](https://github.com/OHIF/Viewers/issues/1094)) ([85f836c](https://github.com/OHIF/Viewers/commit/85f836cd918614be722fce1bff2373460ec4900b)), closes [#1013](https://github.com/OHIF/Viewers/issues/1013)
### BREAKING CHANGES
* 1013
## [1.12.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.12.1...@ohif/viewer@1.12.2) (2019-10-25)
### Bug Fixes
* set SR in ActiveViewport by clicking thumb ([#1091](https://github.com/OHIF/Viewers/issues/1091)) ([986b7ae](https://github.com/OHIF/Viewers/commit/986b7ae2bf4f7d27f326e62f93285ce20eaf0a79))
## [1.12.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.12.0...@ohif/viewer@1.12.1) (2019-10-25)
@@ -1,16 +1,16 @@
describe('OHIF Study Viewer Page', () => {
before(() => {
describe('OHIF Study Viewer Page', function() {
before(function() {
cy.openStudy('MISTER^MR');
cy.waitDicomImage();
cy.expectMinimumThumbnails(6);
});
beforeEach(() => {
beforeEach(function() {
cy.initCommonElementsAliases();
cy.resetViewport();
});
it('checks if series thumbnails are being displayed', () => {
it('checks if series thumbnails are being displayed', function() {
cy.screenshot();
cy.percyCanvasSnapshot('Series Thumbnails');
@@ -19,7 +19,7 @@ describe('OHIF Study Viewer Page', () => {
.should('be.gt', 1);
});
it('drags and drop a series thumbnail into viewport', () => {
it('drags and drop a series thumbnail into viewport', function() {
cy.get('[data-cy="thumbnail-list"]:nth-child(2)') //element to be dragged
.drag('.cornerstone-canvas'); //dropzone element
@@ -28,7 +28,7 @@ describe('OHIF Study Viewer Page', () => {
cy.get('@viewportInfoBottomLeft').should('contain.text', expectedText);
});
it('checks if Series left panel can be hidden/displayed', () => {
it('checks if Series left panel can be hidden/displayed', function() {
cy.get('@seriesBtn').click();
cy.get('@seriesPanel').should('not.be.enabled');
@@ -36,7 +36,7 @@ describe('OHIF Study Viewer Page', () => {
cy.get('@seriesPanel').should('be.visible');
});
it('checks if Measurements right panel can be hidden/displayed', () => {
it('checks if Measurements right panel can be hidden/displayed', function() {
cy.get('@measurementsBtn').click();
cy.get('@measurementsPanel').should('be.visible');
@@ -44,7 +44,7 @@ describe('OHIF Study Viewer Page', () => {
cy.get('@measurementsPanel').should('not.be.enabled');
});
it('checks if measurement item can be Relabeled under Measurements panel', () => {
it('checks if measurement item can be Relabeled under Measurements panel', function() {
cy.addLengthMeasurement(); //Adding measurement in the viewport
cy.get('@measurementsBtn').click();
cy.get('.measurementItem').click();
@@ -97,7 +97,7 @@ describe('OHIF Study Viewer Page', () => {
// .should('contain.text', descriptionText);
// });
it('checks if measurement item can be deleted through the context menu on the viewport', () => {
it('checks if measurement item can be deleted through the context menu on the viewport', function() {
cy.addLengthMeasurement([100, 100], [200, 100]); //Adding measurement in the viewport
//Right click on measurement annotation
@@ -131,7 +131,7 @@ describe('OHIF Study Viewer Page', () => {
cy.get('@measurementsPanel').should('not.be.enabled');
});
it('adds relabel and description to measurement item through the context menu on the viewport', () => {
it('adds relabel and description to measurement item through the context menu on the viewport', function() {
cy.addLengthMeasurement([100, 100], [200, 100]); //Adding measurement in the viewport
// Relabel
@@ -206,4 +206,95 @@ describe('OHIF Study Viewer Page', () => {
cy.get('@measurementsBtn').click();
cy.get('@measurementsPanel').should('not.be.enabled');
});
it('scrolls series stack using scrollbar', function() {
// Workaround implemented based on Cypress issue:
// https://github.com/cypress-io/cypress/issues/1570#issuecomment-450966053
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
window.HTMLInputElement.prototype,
'value'
).set;
cy.get('input.imageSlider[type=range]').then($range => {
// get the DOM node
const range = $range[0];
// set the value manually
nativeInputValueSetter.call(range, 13);
// now dispatch the event
range.dispatchEvent(new Event('change', { value: 13, bubbles: true }));
});
const expectedText = 'Img: 13 13/13';
cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
});
//TO-DO: this test is blocked due to issue #1072: https://github.com/OHIF/Viewers/issues/1072
// Uncomment this once #1072 is fixed.
// it('performs single-click to load thumbnail in active viewport', () => {
// cy.get('[data-cy="thumbnail-list"]:nth-child(3)').click();
// const expectedText = 'Ser 3';
// cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
// });
it('performs right click to zoom', function() {
//Right click on viewport
cy.get('@viewport')
.trigger('mousedown', 'top', { which: 3 })
.trigger('mousemove', 'center', { which: 3 })
.trigger('mouseup');
const expectedText = 'Zoom: 442%';
cy.get('@viewportInfoBottomRight').should('contains.text', expectedText);
});
it('performs middle click to pan', function() {
//Get image position from cornerstone and check if y axis was modified
let cornerstone;
let currentPan;
// TO DO: Replace the cornerstone pan check by Percy snapshop comparison
cy.window()
.its('cornerstone')
.then(c => {
cornerstone = c;
currentPan = () =>
cornerstone.getEnabledElements()[0].viewport.translation;
});
//pan image with middle click
cy.get('@viewport')
.trigger('mousedown', 'center', { which: 2 })
.trigger('mousemove', 'bottom', { which: 2 })
.trigger('mouseup', 'bottom')
.then(() => {
expect(currentPan().y > 0).to.eq(true);
});
});
it('opens About modal and verify the displayed information', function() {
cy.get('[data-cy="options-menu"]').click();
cy.get('[data-cy="about-item-menu"]').click();
cy.get('.modal-content')
.as('aboutOverlay')
.should('be.visible');
//check buttons and links
cy.get('[data-cy="about-modal"]')
.should('contains.text', 'Visit the forum')
.and('contains.text', 'Report an issue')
.and('contains.text', 'https://github.com/OHIF/Viewers/');
//check version number
cy.get('[data-cy="about-modal"]').then($modal => {
cy.get('[data-cy="header-version-info"]').should($headerVersionNumber => {
$headerVersionNumber = $headerVersionNumber.text().substring(1);
expect($modal).to.contain($headerVersionNumber);
});
});
//close modal
cy.get('.close').click();
cy.get('@aboutOverlay').should('not.be.enabled');
});
});
+3 -1
View File
@@ -180,7 +180,7 @@ Cypress.Commands.add('waitDicomImage', (timeout = 20000) => {
//Command to reset and clear all the changes made to the viewport
Cypress.Commands.add('resetViewport', () => {
cy.initCornerstoneToolsAliases();
cy.get('@resetBtn').click();
//Click on More button
cy.get('@moreBtn').click();
//Verify if overlay is displayed
@@ -193,6 +193,8 @@ Cypress.Commands.add('resetViewport', () => {
cy.get('.tooltip-inner > :nth-child(10)')
.as('clearBtn')
.click();
//Click on Reset button
cy.get('@resetBtn').click();
});
Cypress.Commands.add('imageZoomIn', () => {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "1.12.1",
"version": "2.0.0",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@@ -45,14 +45,14 @@
},
"dependencies": {
"@babel/runtime": "^7.5.5",
"@ohif/core": "^1.5.1",
"@ohif/core": "^1.5.2",
"@ohif/extension-cornerstone": "^2.0.0",
"@ohif/extension-dicom-html": "^1.0.0",
"@ohif/extension-dicom-microscopy": "^0.50.6",
"@ohif/extension-dicom-pdf": "^1.0.0",
"@ohif/extension-vtk": "^0.52.18",
"@ohif/extension-vtk": "^0.52.20",
"@ohif/i18n": "^0.51.0",
"@ohif/ui": "^0.56.0",
"@ohif/ui": "^0.56.1",
"@tanem/react-nprogress": "^1.1.25",
"classnames": "^2.2.6",
"core-js": "^3.2.1",
@@ -28,16 +28,12 @@ function getAllTools() {
return tools;
}
function getMeasurementText(measurementData) {
const { location, description } = measurementData;
let text = '...';
if (location) {
text = location;
if (description) {
text += `(${description})`;
}
}
return text;
function getMeasurementText(measurementData = {}) {
const defaultText = '...';
const { location = '', description = '' } = measurementData;
const result = location + (description ? `(${description})` : '');
return result || defaultText;
}
function getDataForEachMeasurementNumber(
@@ -105,6 +105,7 @@ class Header extends Component {
className={`${
this.props.home ? 'header-versionInfoHome' : 'header-versionInfo'
}`}
data-cy="header-version-info"
>
v{process.env.VERSION_NUMBER}
</span>
@@ -35,14 +35,14 @@ const mapStateToProps = (state, ownProps) => {
};
};
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch, ownProps) => {
return {
onThumbnailClick: displaySetInstanceUid => {
dispatch(
setActiveViewportSpecificData({
displaySetInstanceUid,
})
const displaySet = ownProps.studyMetadata[0].displaySets.find(
ds => ds.displaySetInstanceUid === displaySetInstanceUid
);
dispatch(setActiveViewportSpecificData(displaySet));
},
};
};
@@ -295,7 +295,10 @@ class Viewer extends Component {
activeIndex={this.props.activeViewportIndex}
/>
) : (
<ConnectedStudyBrowser studies={this.state.thumbnails} />
<ConnectedStudyBrowser
studies={this.state.thumbnails}
studyMetadata={this.props.studies}
/>
)}
</SidePanel>