diff --git a/extensions/cornerstone-dicom-sr/package.json b/extensions/cornerstone-dicom-sr/package.json
index 8dac65ef21a..4c458f041e1 100644
--- a/extensions/cornerstone-dicom-sr/package.json
+++ b/extensions/cornerstone-dicom-sr/package.json
@@ -44,9 +44,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
- "@cornerstonejs/adapters": "^1.4.4",
- "@cornerstonejs/core": "^1.4.4",
- "@cornerstonejs/tools": "^1.4.4",
+ "@cornerstonejs/adapters": "^1.5.0",
+ "@cornerstonejs/core": "^1.5.0",
+ "@cornerstonejs/tools": "^1.5.0",
"classnames": "^2.3.2"
}
}
diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json
index 00d262e6eee..e81d368f1c3 100644
--- a/extensions/cornerstone/package.json
+++ b/extensions/cornerstone/package.json
@@ -52,10 +52,10 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
- "@cornerstonejs/adapters": "^1.4.4",
- "@cornerstonejs/core": "^1.4.4",
- "@cornerstonejs/streaming-image-volume-loader": "^1.4.4",
- "@cornerstonejs/tools": "^1.4.4",
+ "@cornerstonejs/adapters": "^1.5.0",
+ "@cornerstonejs/core": "^1.5.0",
+ "@cornerstonejs/streaming-image-volume-loader": "^1.5.0",
+ "@cornerstonejs/tools": "^1.5.0",
"@kitware/vtk.js": "27.3.1",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
diff --git a/extensions/measurement-tracking/package.json b/extensions/measurement-tracking/package.json
index d4e69bc3da5..89117143fd5 100644
--- a/extensions/measurement-tracking/package.json
+++ b/extensions/measurement-tracking/package.json
@@ -30,8 +30,8 @@
"start": "yarn run dev"
},
"peerDependencies": {
- "@cornerstonejs/core": "^1.4.4",
- "@cornerstonejs/tools": "^1.4.4",
+ "@cornerstonejs/core": "^1.5.0",
+ "@cornerstonejs/tools": "^1.5.0",
"@ohif/core": "3.7.0-beta.33",
"@ohif/extension-cornerstone-dicom-sr": "3.7.0-beta.33",
"@ohif/ui": "3.7.0-beta.33",
diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js
index df760db1035..0f22951ee73 100644
--- a/platform/app/cypress/support/commands.js
+++ b/platform/app/cypress/support/commands.js
@@ -46,7 +46,7 @@ Cypress.Commands.add('openStudy', PatientName => {
cy.openStudyList();
cy.get('#filter-patientNameOrId').type(PatientName);
// cy.get('@getStudies').then(() => {
- cy.wait(1000);
+ cy.waitQueryList();
cy.get('[data-cy="study-list-results"]', { timeout: 5000 })
.contains(PatientName)
@@ -65,7 +65,8 @@ Cypress.Commands.add(
) {
cy.openStudyInViewer(StudyInstanceUID, otherParams);
cy.waitDicomImage();
- cy.wait(2000);
+ // Very short wait to ensure pending updates are handled
+ cy.wait(25);
}
});
}
@@ -78,6 +79,9 @@ Cypress.Commands.add(
}
);
+Cypress.Commands.add('waitQueryList', () => {
+ cy.get('[data-querying="false"]');
+});
/**
* Command to search for a Modality and open the study.
*
@@ -89,7 +93,7 @@ Cypress.Commands.add('openStudyModality', Modality => {
cy.get('#filter-accessionOrModalityOrDescription')
.type(Modality)
- .wait(2000);
+ .waitQueryList();
cy.get('[data-cy="study-list-results"]')
.contains(Modality)
@@ -113,7 +117,7 @@ Cypress.Commands.add('openStudyList', () => {
// For some reason cypress 12.x does not like to stub the network request
// so we just wait herer for 1 second
// cy.wait('@getStudies');
- cy.wait(1000);
+ cy.waitQueryList();
});
Cypress.Commands.add('waitStudyList', () => {
@@ -198,54 +202,27 @@ Cypress.Commands.add('expectMinimumThumbnails', (seriesToWait = 1) => {
});
//Command to wait DICOM image to load into the viewport
-Cypress.Commands.add('waitDicomImage', (timeout = 50000) => {
- const loaded = cy.isPageLoaded();
-
- if (loaded) {
- cy.window()
- .its('cornerstone')
- .then({ timeout }, $cornerstone => {
- return new Cypress.Promise(resolve => {
- const onEvent = renderedEvt => {
- const element = renderedEvt.detail.element;
-
- element.removeEventListener(
- $cornerstone.Enums.Events.IMAGE_RENDERED,
- onEvent
- );
- $cornerstone.eventTarget.removeEventListener(
- $cornerstone.Enums.Events.IMAGE_RENDERED,
- onEvent
- );
- resolve();
- };
- const onEnabled = enabledEvt => {
- const element = enabledEvt.detail.element;
-
- element.addEventListener(
- $cornerstone.Enums.Events.IMAGE_RENDERED,
- onEvent
- );
-
- $cornerstone.eventTarget.removeEventListener(
- $cornerstone.Enums.Events.ELEMENT_ENABLED,
- onEnabled
- );
- };
- const enabledElements = $cornerstone.getEnabledElements();
- if (enabledElements && enabledElements.length) {
- // Sometimes the page finishes rendering before this gets run,
- // if so, just resolve immediately.
- resolve();
- } else {
- $cornerstone.eventTarget.addEventListener(
- $cornerstone.Enums.Events.ELEMENT_ENABLED,
- onEnabled
+Cypress.Commands.add('waitDicomImage', () => {
+ cy.window()
+ .its('cornerstone')
+ .should($cornerstone => {
+ const enabled = $cornerstone.getEnabledElements();
+ if (enabled?.length) {
+ enabled.forEach((item, i) => {
+ if (
+ item.viewport.viewportStatus !==
+ $cornerstone.Enums.ViewportStatus.RENDERED
+ ) {
+ throw new Error(
+ `Viewport ${i} in state ${item.viewport.viewportStatus}`
);
}
});
- });
- }
+ } else {
+ throw new Error('No enabled elements');
+ }
+ });
+ cy.log('DICOM image loaded');
});
//Command to reset and clear all the changes made to the viewport
@@ -401,7 +378,8 @@ Cypress.Commands.add('setLayout', (columns = 1, rows = 1) => {
.eq(columns - 1)
.click();
- cy.wait(1000);
+ cy.wait(10);
+ cy.waitDicomImage();
});
function convertCanvas(documentClone) {
diff --git a/platform/app/src/routes/WorkList/WorkList.tsx b/platform/app/src/routes/WorkList/WorkList.tsx
index 7156b5451c4..a30141bb2af 100644
--- a/platform/app/src/routes/WorkList/WorkList.tsx
+++ b/platform/app/src/routes/WorkList/WorkList.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect, useMemo } from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import { Link, useNavigate } from 'react-router-dom';
@@ -112,6 +112,9 @@ function WorkList({
const [expandedRows, setExpandedRows] = useState([]);
const [studiesWithSeriesData, setStudiesWithSeriesData] = useState([]);
const numOfStudies = studiesTotal;
+ const querying = useMemo(() => {
+ return isLoadingData || expandedRows.length > 0;
+ }, [isLoadingData, expandedRows]);
const setFilterValues = val => {
if (filterValues.pageNumber === val.pageNumber) {
@@ -218,6 +221,7 @@ function WorkList({
fetchSeries(studyInstanceUid);
}
+
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [expandedRows, studies]);
@@ -501,6 +505,7 @@ function WorkList({