* fix: Set SR viewport as active by interaction * quick fix * (eslint) add "before" as global variables * add data-cy * add data-cy * create E2E test * (E2E) create custom command to set layout size * remove .only e2e * remove throttle for onScroll
34 lines
748 B
JavaScript
34 lines
748 B
JavaScript
import OHIF from '@ohif/core';
|
|
import { connect } from 'react-redux';
|
|
import DicomHtmlViewport from './DicomHtmlViewport';
|
|
|
|
const { setViewportActive } = OHIF.redux.actions;
|
|
|
|
const mapStateToProps = (state, ownProps) => {
|
|
const { viewportIndex, byteArray } = ownProps;
|
|
const activeViewportIndex = state.viewports;
|
|
|
|
return {
|
|
viewportIndex,
|
|
activeViewportIndex,
|
|
byteArray,
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => {
|
|
const { viewportIndex } = ownProps;
|
|
|
|
return {
|
|
setViewportActive: () => {
|
|
dispatch(setViewportActive(viewportIndex));
|
|
},
|
|
};
|
|
};
|
|
|
|
const ConnectedDicomHtmlViewport = connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(DicomHtmlViewport);
|
|
|
|
export default ConnectedDicomHtmlViewport;
|