fix: Hanging protocol state fixes (#3242)

* fix: Some residual issues with hanging protocol after state sync

fix: Some issues introduced by the state syncing changes

* fix: PR fixes, mostly code cleanup

* Improve a race condition in an automated test

* Remove obsolete code

* PR fixes
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-03-20 15:11:21 -04:00
1 parent 544bf55a4f
commit ee4e8a4105
19 files changed
+268 -171

No files matched your search

@@ -51,6 +51,8 @@ describe('OHIF Study Viewer Page', function() {
});
it('performs double-click to load thumbnail in active viewport', () => {
// Have to finish rendering the image before this works
cy.wait(250);
cy.get('[data-cy="study-browser-thumbnail"]:nth-child(2)').dblclick();
//cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
@@ -1,6 +1,6 @@
import React, { useEffect, useCallback } from 'react';
import PropTypes from 'prop-types';
import { ServicesManager } from '@ohif/core';
import { ServicesManager, Types } from '@ohif/core';
import { ViewportGrid, ViewportPane, useViewportGrid } from '@ohif/ui';
import { utils } from '@ohif/core';
import EmptyViewport from './EmptyViewport';
@@ -23,15 +23,6 @@ const ORIENTATION_MAP = {
},
};
const createHpInfo = (protocol, stage, activeStudyUID) => {
return {
hangingProtocolId: protocol.id,
stageId: stage.stageId,
stageIdx: protocol.stages.findIndex(it => it === stage),
activeStudyUID,
};
};
const compareViewportOptions = (opts1, opts2) => {
if ((opts1.viewportType || 'stack') != opts2.viewportType) {
return false;
@@ -62,7 +53,7 @@ function ViewerViewportGrid(props) {
*/
const updateDisplaySetsFromProtocol = (
protocol,
protocol: Types.HangingProtocol.Protocol,
stage,
activeStudyUID,
viewportMatchDetails
@@ -119,7 +110,6 @@ function ViewerViewportGrid(props) {
numCols,
layoutType,
layoutOptions,
hpInfo: createHpInfo(protocol, stage, activeStudyUID),
findOrCreateViewport,
});
};