Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25e6817248 | ||
|
|
681384b742 | ||
|
|
54e07c281f | ||
|
|
9dedccc7f9 | ||
|
|
621e63b3e1 | ||
|
|
64cf3b324d | ||
|
|
b7f315ca47 | ||
|
|
caaa032c4b | ||
|
|
22127a8f59 | ||
|
|
50ca2bde97 | ||
|
|
c73cfbc110 | ||
|
|
5716b71d40 | ||
|
|
a3028ad1f6 | ||
|
|
352407c71a | ||
|
|
1b5a5a2963 | ||
|
|
cf5136899e | ||
|
|
8c4e96bb3d | ||
|
|
5b334175c3 | ||
|
|
20bfc829f7 | ||
|
|
0d498ba17d |
No files matched your search
@@ -16,6 +16,7 @@
|
|||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"cy": true,
|
"cy": true,
|
||||||
|
"before": true,
|
||||||
"context": true,
|
"context": true,
|
||||||
"Cypress": true,
|
"Cypress": true,
|
||||||
"assert": true
|
"assert": true
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"editor.rulers": [
|
"editor.rulers": [80, 120],
|
||||||
80,
|
|
||||||
120
|
|
||||||
],
|
|
||||||
// ===
|
// ===
|
||||||
// Spacing
|
// Spacing
|
||||||
// ===
|
// ===
|
||||||
@@ -29,7 +26,7 @@
|
|||||||
"autoFix": true
|
"autoFix": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"prettier.disableLanguages": [],
|
"prettier.disableLanguages": ["html"],
|
||||||
"prettier.endOfLine": "lf",
|
"prettier.endOfLine": "lf",
|
||||||
"workbench.colorCustomizations": {}
|
"workbench.colorCustomizations": {}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.0.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.0.0...@ohif/extension-dicom-html@1.0.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Set SR viewport as active by interaction ([#1118](https://github.com/OHIF/Viewers/issues/1118)) ([5b33417](https://github.com/OHIF/Viewers/commit/5b334175c370afb930b4b6dbd307ddece8f850e3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.8...@ohif/extension-dicom-html@1.0.0) (2019-09-27)
|
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.8...@ohif/extension-dicom-html@1.0.0) (2019-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-dicom-html",
|
"name": "@ohif/extension-dicom-html",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "OHIF extension for rendering structured reports to HTML",
|
"description": "OHIF extension for rendering structured reports to HTML",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
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;
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import * as dcmjs from 'dcmjs';
|
import * as dcmjs from 'dcmjs';
|
||||||
import TypedArrayProp from './TypedArrayProp';
|
import TypedArrayProp from './TypedArrayProp';
|
||||||
|
|
||||||
import './DicomHtmlViewport.css';
|
import './DicomHtmlViewport.css';
|
||||||
|
|
||||||
function getRelationshipString(data) {
|
function getRelationshipString(data) {
|
||||||
@@ -30,7 +32,7 @@ function getValueString(data) {
|
|||||||
const {
|
const {
|
||||||
CodeMeaning,
|
CodeMeaning,
|
||||||
CodeValue,
|
CodeValue,
|
||||||
CodingSchemeDesignator
|
CodingSchemeDesignator,
|
||||||
} = data.ConceptNameCodeSequence;
|
} = data.ConceptNameCodeSequence;
|
||||||
|
|
||||||
return `${CodeMeaning} (${CodeValue}, ${CodingSchemeDesignator})`;
|
return `${CodeMeaning} (${CodeValue}, ${CodingSchemeDesignator})`;
|
||||||
@@ -75,7 +77,7 @@ function constructContentSequence(data, header) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
items
|
items,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (header) {
|
if (header) {
|
||||||
@@ -106,9 +108,7 @@ const { DicomMetaDictionary, DicomMessage } = dcmjs.data;
|
|||||||
function getMainData(data) {
|
function getMainData(data) {
|
||||||
const root = [];
|
const root = [];
|
||||||
|
|
||||||
const patientValue = `${data.PatientName} (${data.PatientSex}, #${
|
const patientValue = `${data.PatientName} (${data.PatientSex}, #${data.PatientID})`;
|
||||||
data.PatientID
|
|
||||||
})`;
|
|
||||||
root.push(getMainDataItem('Patient', patientValue));
|
root.push(getMainDataItem('Patient', patientValue));
|
||||||
|
|
||||||
const studyValue = data.StudyDescription;
|
const studyValue = data.StudyDescription;
|
||||||
@@ -117,15 +117,13 @@ function getMainData(data) {
|
|||||||
const seriesValue = `${data.SeriesDescription} (#${data.SeriesNumber})`;
|
const seriesValue = `${data.SeriesDescription} (#${data.SeriesNumber})`;
|
||||||
root.push(getMainDataItem('Series', seriesValue));
|
root.push(getMainDataItem('Series', seriesValue));
|
||||||
|
|
||||||
const manufacturerValue = `${data.Manufacturer} (${
|
const manufacturerValue = `${data.Manufacturer} (${data.ManufacturerModelName}, #${data.DeviceSerialNumber})`;
|
||||||
data.ManufacturerModelName
|
|
||||||
}, #${data.DeviceSerialNumber})`;
|
|
||||||
|
|
||||||
root.push(getMainDataItem('Manufacturer', manufacturerValue));
|
root.push(getMainDataItem('Manufacturer', manufacturerValue));
|
||||||
|
|
||||||
const mainDataObjects = {
|
const mainDataObjects = {
|
||||||
CompletionFlag: 'Completion flag',
|
CompletionFlag: 'Completion flag',
|
||||||
VerificationFlag: 'Verification flag'
|
VerificationFlag: 'Verification flag',
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.keys(mainDataObjects).forEach(key => {
|
Object.keys(mainDataObjects).forEach(key => {
|
||||||
@@ -154,7 +152,7 @@ const getContentSequence = (data, level = 1) => {
|
|||||||
const {
|
const {
|
||||||
CodeMeaning,
|
CodeMeaning,
|
||||||
CodeValue,
|
CodeValue,
|
||||||
CodingSchemeDesignator
|
CodingSchemeDesignator,
|
||||||
} = data.ConceptNameCodeSequence;
|
} = data.ConceptNameCodeSequence;
|
||||||
|
|
||||||
header = `${CodeMeaning} (${CodeValue} - ${CodingSchemeDesignator})`;
|
header = `${CodeMeaning} (${CodeValue} - ${CodingSchemeDesignator})`;
|
||||||
@@ -198,11 +196,14 @@ function getMainDataItem(key, value) {
|
|||||||
class DicomHtmlViewport extends Component {
|
class DicomHtmlViewport extends Component {
|
||||||
state = {
|
state = {
|
||||||
content: null,
|
content: null,
|
||||||
error: null
|
error: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
byteArray: TypedArrayProp.uint8
|
byteArray: TypedArrayProp.uint8,
|
||||||
|
setViewportActive: PropTypes.func.isRequired,
|
||||||
|
viewportIndex: PropTypes.number.isRequired,
|
||||||
|
activeViewportIndex: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -225,15 +226,34 @@ class DicomHtmlViewport extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
content
|
content,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setViewportActiveHandler = () => {
|
||||||
|
const {
|
||||||
|
setViewportActive,
|
||||||
|
viewportIndex,
|
||||||
|
activeViewportIndex,
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
if (viewportIndex !== activeViewportIndex) {
|
||||||
|
setViewportActive();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { content, error } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'DicomHtmlViewport'}>
|
<div
|
||||||
{this.state.content}
|
data-cy="dicom-html-viewport"
|
||||||
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
className="DicomHtmlViewport"
|
||||||
|
onClick={this.setViewportActiveHandler}
|
||||||
|
onScroll={this.setViewportActiveHandler}
|
||||||
|
>
|
||||||
|
{content}
|
||||||
|
{error && <h2>{JSON.stringify(error)}</h2>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import DicomHtmlViewport from './DicomHtmlViewport';
|
|
||||||
import OHIF from '@ohif/core';
|
import OHIF from '@ohif/core';
|
||||||
|
import ConnectedDicomHtmlViewport from './ConnectedDicomHtmlViewport';
|
||||||
|
|
||||||
const { DicomLoaderService } = OHIF.utils;
|
const { DicomLoaderService } = OHIF.utils;
|
||||||
|
|
||||||
class OHIFDicomHtmlViewport extends Component {
|
class OHIFDicomHtmlViewport extends Component {
|
||||||
@@ -9,6 +10,7 @@ class OHIFDicomHtmlViewport extends Component {
|
|||||||
studies: PropTypes.object,
|
studies: PropTypes.object,
|
||||||
displaySet: PropTypes.object,
|
displaySet: PropTypes.object,
|
||||||
viewportIndex: PropTypes.number,
|
viewportIndex: PropTypes.number,
|
||||||
|
viewportData: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@@ -40,7 +42,10 @@ class OHIFDicomHtmlViewport extends Component {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.state.byteArray && (
|
{this.state.byteArray && (
|
||||||
<DicomHtmlViewport byteArray={this.state.byteArray} />
|
<ConnectedDicomHtmlViewport
|
||||||
|
byteArray={this.state.byteArray}
|
||||||
|
viewportIndex={this.props.viewportIndex}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -3,6 +3,46 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.52.28](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.27...@ohif/extension-vtk@0.52.28) (2019-11-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.27](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.26...@ohif/extension-vtk@0.52.27) (2019-10-31)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.26](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.25...@ohif/extension-vtk@0.52.26) (2019-10-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.25](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.24...@ohif/extension-vtk@0.52.25) (2019-10-29)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.24](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.23...@ohif/extension-vtk@0.52.24) (2019-10-29)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.52.23](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.22...@ohif/extension-vtk@0.52.23) (2019-10-28)
|
## [0.52.23](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.22...@ohif/extension-vtk@0.52.23) (2019-10-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-vtk
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-vtk",
|
"name": "@ohif/extension-vtk",
|
||||||
"version": "0.52.23",
|
"version": "0.52.28",
|
||||||
"description": "OHIF extension for VTK.js",
|
"description": "OHIF extension for VTK.js",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -52,8 +52,8 @@
|
|||||||
"react-vtkjs-viewport": "^0.3.7"
|
"react-vtkjs-viewport": "^0.3.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.1",
|
||||||
"@ohif/ui": "^0.58.0",
|
"@ohif/ui": "^0.58.5",
|
||||||
"cornerstone-tools": "^4.0.9",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.6.1",
|
"dcmjs": "^0.6.1",
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
base = ""
|
base = ""
|
||||||
publish = ".netlify/www/"
|
publish = ".netlify/www/"
|
||||||
command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
command = "chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
||||||
|
# command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
||||||
|
|
||||||
[[headers]]
|
[[headers]]
|
||||||
# Define which paths this specific [[headers]] block will cover.
|
# Define which paths this specific [[headers]] block will cover.
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
"eslint-plugin-react": "7.x",
|
"eslint-plugin-react": "7.x",
|
||||||
"eslint-plugin-react-hooks": "1.5.0",
|
"eslint-plugin-react-hooks": "1.5.0",
|
||||||
"extract-css-chunks-webpack-plugin": "^4.5.4",
|
"extract-css-chunks-webpack-plugin": "^4.5.4",
|
||||||
|
"favicons-webpack-plugin": "^1.0.2",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"husky": "^3.0.0",
|
"husky": "^3.0.0",
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
"webpack-dev-server": "^3.7.2",
|
"webpack-dev-server": "^3.7.2",
|
||||||
"webpack-hot-middleware": "^2.25.0",
|
"webpack-hot-middleware": "^2.25.0",
|
||||||
"webpack-merge": "^4.2.1",
|
"webpack-merge": "^4.2.1",
|
||||||
"workbox-webpack-plugin": "^4.3.1",
|
"workbox-webpack-plugin": "^5.0.0-beta.1",
|
||||||
"worker-loader": "^2.0.0"
|
"worker-loader": "^2.0.0"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/OHIF/Viewers/compare/@ohif/core@1.6.0...@ohif/core@1.6.1) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [1.6.0](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.2...@ohif/core@1.6.0) (2019-10-26)
|
# [1.6.0](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.2...@ohif/core@1.6.0) (2019-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/core",
|
"name": "@ohif/core",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Generic business logic for web-based medical imaging applications",
|
"description": "Generic business logic for web-based medical imaging applications",
|
||||||
"author": "OHIF Core Team",
|
"author": "OHIF Core Team",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
export default function getModalities(modality, modalitiesInStudy) {
|
export default function getModalities(modality, modalitiesInStudy) {
|
||||||
let modalities = {};
|
if (!modality && !modalitiesInStudy) {
|
||||||
if (modality) {
|
return {};
|
||||||
modalities = modality;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modalities = modality || {
|
||||||
|
vr: 'CS',
|
||||||
|
Value: [],
|
||||||
|
};
|
||||||
|
|
||||||
if (modalitiesInStudy) {
|
if (modalitiesInStudy) {
|
||||||
// Find vr in modalities
|
|
||||||
if (modalities.vr && modalities.vr === modalitiesInStudy.vr) {
|
if (modalities.vr && modalities.vr === modalitiesInStudy.vr) {
|
||||||
for (let i = 0; i < modalitiesInStudy.Value.length; i++) {
|
for (let i = 0; i < modalitiesInStudy.Value.length; i++) {
|
||||||
const value = modalitiesInStudy.Value[i];
|
const value = modalitiesInStudy.Value[i];
|
||||||
@@ -14,8 +17,9 @@ export default function getModalities(modality, modalitiesInStudy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
modalities = modalitiesInStudy;
|
return modalitiesInStudy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return modalities;
|
return modalities;
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ function dateToString(date) {
|
|||||||
function getQIDOQueryParams(filter, serverSupportsQIDOIncludeField) {
|
function getQIDOQueryParams(filter, serverSupportsQIDOIncludeField) {
|
||||||
const commaSeparatedFields = [
|
const commaSeparatedFields = [
|
||||||
'00081030', // Study Description
|
'00081030', // Study Description
|
||||||
'00080060', //Modality
|
'00080060', // Modality
|
||||||
// Add more fields here if you want them in the result
|
// Add more fields here if you want them in the result
|
||||||
].join(',');
|
].join(',');
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,61 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.58.5](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.4...@ohif/ui@0.58.5) (2019-11-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Minor issues measurement panel related to description ([#1142](https://github.com/OHIF/Viewers/issues/1142)) ([681384b](https://github.com/OHIF/Viewers/commit/681384b7425c83b02a0ed83371ca92d78ca7838c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.3...@ohif/ui@0.58.4) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.2...@ohif/ui@0.58.3) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Fix ghost shadow on thumb ([#1113](https://github.com/OHIF/Viewers/issues/1113)) ([caaa032](https://github.com/OHIF/Viewers/commit/caaa032c4bc24fd69fdb01a15a8feb2721c321db))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.1...@ohif/ui@0.58.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Limit image download size to avoid browser issues ([#1112](https://github.com/OHIF/Viewers/issues/1112)) ([5716b71](https://github.com/OHIF/Viewers/commit/5716b71d409ee1c6f13393c8cb7f50222415e198)), closes [#1099](https://github.com/OHIF/Viewers/issues/1099)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.0...@ohif/ui@0.58.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **StudyList:** camel case colSpan ([#1123](https://github.com/OHIF/Viewers/issues/1123)) ([0d498ba](https://github.com/OHIF/Viewers/commit/0d498ba17ddde8d8f0c51d742770e1574041eec0))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [0.58.0](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.57.1...@ohif/ui@0.58.0) (2019-10-28)
|
# [0.58.0](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.57.1...@ohif/ui@0.58.0) (2019-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/ui",
|
"name": "@ohif/ui",
|
||||||
"version": "0.58.0",
|
"version": "0.58.5",
|
||||||
"description": "A set of React components for Medical Imaging Viewers",
|
"description": "A set of React components for Medical Imaging Viewers",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -49,9 +49,9 @@
|
|||||||
"prop-types": "15.6.2",
|
"prop-types": "15.6.2",
|
||||||
"react-bootstrap-modal": "4.2.0",
|
"react-bootstrap-modal": "4.2.0",
|
||||||
"react-dates": "21.2.1",
|
"react-dates": "21.2.1",
|
||||||
"react-dnd": "9.3.4",
|
"react-dnd": "9.4.0",
|
||||||
"react-dnd-html5-backend": "^9.3.4",
|
"react-dnd-html5-backend": "^9.4.0",
|
||||||
"react-dnd-touch-backend": "^9.3.4",
|
"react-dnd-touch-backend": "^9.4.0",
|
||||||
"react-i18next": "^10.11.0",
|
"react-i18next": "^10.11.0",
|
||||||
"react-with-direction": "1.3.0"
|
"react-with-direction": "1.3.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const DownloadDialog = ({
|
|||||||
downloadBlob,
|
downloadBlob,
|
||||||
defaultSize,
|
defaultSize,
|
||||||
minimumSize,
|
minimumSize,
|
||||||
|
maximumSize,
|
||||||
canvasClass,
|
canvasClass,
|
||||||
}) => {
|
}) => {
|
||||||
const [filename, setFilename] = useState(DEFAULT_FILENAME);
|
const [filename, setFilename] = useState(DEFAULT_FILENAME);
|
||||||
@@ -75,24 +76,24 @@ const DownloadDialog = ({
|
|||||||
}, [defaultSize, disableViewport, enableViewport, viewportElement]);
|
}, [defaultSize, disableViewport, enableViewport, viewportElement]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const validSize = value => (value >= minimumSize ? value : minimumSize);
|
||||||
const loadAndUpdateViewports = async () => {
|
const loadAndUpdateViewports = async () => {
|
||||||
const {
|
const {
|
||||||
image,
|
image,
|
||||||
width: scaledWidth,
|
width: scaledWidth,
|
||||||
height: scaledHeight,
|
height: scaledHeight,
|
||||||
} = await loadImage(activeViewport, viewportElement, width, height);
|
} = await loadImage(activeViewport, viewportElement, width, height);
|
||||||
|
|
||||||
setLastImage(image);
|
setLastImage(image);
|
||||||
|
|
||||||
toggleAnnotations(showAnnotations, viewportElement);
|
toggleAnnotations(showAnnotations, viewportElement);
|
||||||
|
|
||||||
setViewportElementHeight(scaledHeight);
|
setViewportElementHeight(validSize(scaledHeight));
|
||||||
setViewportElementWidth(scaledWidth);
|
setViewportElementWidth(validSize(scaledWidth));
|
||||||
|
|
||||||
setDownloadCanvas(state => ({
|
setDownloadCanvas(state => ({
|
||||||
...state,
|
...state,
|
||||||
height: scaledHeight,
|
height: validSize(scaledHeight),
|
||||||
width: scaledWidth,
|
width: validSize(scaledWidth),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -108,8 +109,8 @@ const DownloadDialog = ({
|
|||||||
setViewportPreview(state => ({
|
setViewportPreview(state => ({
|
||||||
...state,
|
...state,
|
||||||
src: dataUrl,
|
src: dataUrl,
|
||||||
width: viewportElementWidth,
|
width: validSize(viewportElementWidth),
|
||||||
height: viewportElementHeight,
|
height: validSize(viewportElementHeight),
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,10 +126,12 @@ const DownloadDialog = ({
|
|||||||
updateViewportPreview,
|
updateViewportPreview,
|
||||||
fileType,
|
fileType,
|
||||||
downloadCanvas.ref,
|
downloadCanvas.ref,
|
||||||
|
minimumSize,
|
||||||
|
maximumSize,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onHeightChange = () => {
|
const onHeightChange = event => {
|
||||||
const newHeight = event.target.value;
|
const newHeight = Math.min(event.target.value, maximumSize);
|
||||||
setHeight(newHeight);
|
setHeight(newHeight);
|
||||||
|
|
||||||
setViewportElementHeight(newHeight);
|
setViewportElementHeight(newHeight);
|
||||||
@@ -153,7 +156,7 @@ const DownloadDialog = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onWidthChange = event => {
|
const onWidthChange = event => {
|
||||||
const newWidth = event.target.value;
|
const newWidth = Math.min(event.target.value, maximumSize);
|
||||||
setWidth(newWidth);
|
setWidth(newWidth);
|
||||||
|
|
||||||
setViewportElementWidth(newWidth);
|
setViewportElementWidth(newWidth);
|
||||||
@@ -212,6 +215,7 @@ const DownloadDialog = ({
|
|||||||
<TextInput
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
min={minimumSize}
|
min={minimumSize}
|
||||||
|
max={maximumSize}
|
||||||
value={width}
|
value={width}
|
||||||
label={t('Image width (px)')}
|
label={t('Image width (px)')}
|
||||||
onChange={onWidthChange}
|
onChange={onWidthChange}
|
||||||
@@ -221,6 +225,7 @@ const DownloadDialog = ({
|
|||||||
<TextInput
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
min={minimumSize}
|
min={minimumSize}
|
||||||
|
max={maximumSize}
|
||||||
value={height}
|
value={height}
|
||||||
label={t('Image height (px)')}
|
label={t('Image height (px)')}
|
||||||
onChange={onHeightChange}
|
onChange={onHeightChange}
|
||||||
@@ -329,6 +334,7 @@ DownloadDialog.propTypes = {
|
|||||||
downloadBlob: PropTypes.func.isRequired,
|
downloadBlob: PropTypes.func.isRequired,
|
||||||
defaultSize: PropTypes.number.isRequired,
|
defaultSize: PropTypes.number.isRequired,
|
||||||
minimumSize: PropTypes.number.isRequired,
|
minimumSize: PropTypes.number.isRequired,
|
||||||
|
maximumSize: PropTypes.number.isRequired,
|
||||||
canvasClass: PropTypes.string.isRequired,
|
canvasClass: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { StudyBrowser, ThumbnailEntry } from './studyBrowser';
|
import { StudyBrowser, Thumbnail } from './studyBrowser';
|
||||||
import { LayoutButton, LayoutChooser } from './layoutButton';
|
import { LayoutButton, LayoutChooser } from './layoutButton';
|
||||||
import { MeasurementTable, MeasurementTableItem } from './measurementTable';
|
import { MeasurementTable, MeasurementTableItem } from './measurementTable';
|
||||||
import { Overlay, OverlayTrigger } from './overlayTrigger';
|
import { Overlay, OverlayTrigger } from './overlayTrigger';
|
||||||
@@ -44,9 +44,9 @@ export {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AboutModal,
|
AboutModal,
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
.measurementLocation
|
.measurementLocation
|
||||||
margin-left: 9px;
|
margin-left: 9px;
|
||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: calc(100% - 50px);
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow-wrap: normal;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
.measurementDisplayText
|
.measurementDisplayText
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
.thumbnails-wrapper
|
.thumbnails-wrapper
|
||||||
transform-origin: 0% 0%
|
transform-origin: 0% 0%
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
.series-item
|
.series-item
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
transition: transform 0.3s ease
|
transition: transform 0.3s ease
|
||||||
transform-origin: 100% 0%
|
transform-origin: 100% 0%
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
float: right
|
float: right
|
||||||
|
|
||||||
.series-details
|
.series-details
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
.thumbnails-wrapper
|
.thumbnails-wrapper
|
||||||
transform: scale(1) translateY(0)
|
transform: scale(1) translateY(0)
|
||||||
|
|
||||||
.ThumbnailEntry .series-details
|
.thumbnail .series-details
|
||||||
opacity: 1
|
opacity: 1
|
||||||
transform: translateY(0)
|
transform: translateY(0)
|
||||||
transition-delay: 0.3s
|
transition-delay: 0.3s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { ThumbnailEntry } from './../studyBrowser';
|
import { Thumbnail } from './../studyBrowser';
|
||||||
import './SeriesList.styl';
|
import './SeriesList.styl';
|
||||||
|
|
||||||
export class SeriesList extends Component {
|
export class SeriesList extends Component {
|
||||||
@@ -24,7 +24,7 @@ export class SeriesList extends Component {
|
|||||||
getSeriesItems = () => {
|
getSeriesItems = () => {
|
||||||
return this.props.seriesItems.map((seriesData, index) => {
|
return this.props.seriesItems.map((seriesData, index) => {
|
||||||
return (
|
return (
|
||||||
<ThumbnailEntry
|
<Thumbnail
|
||||||
key={seriesData.displaySetInstanceUid}
|
key={seriesData.displaySetInstanceUid}
|
||||||
id={`series_thumb_${index}`}
|
id={`series_thumb_${index}`}
|
||||||
{...seriesData}
|
{...seriesData}
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
import React, { PureComponent, memo } from 'react';
|
|
||||||
import { DragLayer } from 'react-dnd';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry';
|
|
||||||
import './DragPreview.styl';
|
|
||||||
|
|
||||||
let subscribedToOffsetChange = false;
|
|
||||||
let dragPreviewRef = null;
|
|
||||||
|
|
||||||
const collector = monitor => {
|
|
||||||
if (!subscribedToOffsetChange) {
|
|
||||||
monitor.subscribeToOffsetChange(onOffsetChange(monitor));
|
|
||||||
subscribedToOffsetChange = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dragPreviewRef) {
|
|
||||||
const offset =
|
|
||||||
monitor.getSourceClientOffset() || monitor.getInitialSourceClientOffset();
|
|
||||||
|
|
||||||
if (offset) {
|
|
||||||
const transform = `translate(${offset.x}px, ${offset.y}px)`;
|
|
||||||
dragPreviewRef.style['transform'] = transform;
|
|
||||||
dragPreviewRef.style['-webkit-transform'] = transform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const item = monitor.getItem();
|
|
||||||
let newItem = {};
|
|
||||||
if (item) {
|
|
||||||
newItem = {
|
|
||||||
active: item.active,
|
|
||||||
altImageText: item.altImageText,
|
|
||||||
id: item.id,
|
|
||||||
imageSrc: item.imageSrc,
|
|
||||||
imageId: item.imageId,
|
|
||||||
instanceNumber: item.instanceNumber,
|
|
||||||
error: item.error,
|
|
||||||
numImageFrames: item.numImageFrames,
|
|
||||||
seriesDescription: item.seriesDescription,
|
|
||||||
seriesNumber: item.seriesNumber,
|
|
||||||
stackPercentComplete: item.stackPercentComplete,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
...newItem,
|
|
||||||
isDragging: monitor.isDragging(),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const onOffsetChange = monitor => () => {
|
|
||||||
if (!dragPreviewRef) return;
|
|
||||||
|
|
||||||
const offset =
|
|
||||||
monitor.getSourceClientOffset() || monitor.getInitialSourceClientOffset();
|
|
||||||
if (!offset) return;
|
|
||||||
|
|
||||||
const transform = `translate(${offset.x}px, ${offset.y}px)`;
|
|
||||||
dragPreviewRef.style['transform'] = transform;
|
|
||||||
dragPreviewRef.style['-webkit-transform'] = transform;
|
|
||||||
};
|
|
||||||
|
|
||||||
const updateRef = ref => {
|
|
||||||
dragPreviewRef = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DragPreview extends PureComponent {
|
|
||||||
render() {
|
|
||||||
const { isDragging } = this.props;
|
|
||||||
if (!isDragging) return null;
|
|
||||||
return (
|
|
||||||
<div className="DragPreview">
|
|
||||||
<div className="source-preview" ref={updateRef}>
|
|
||||||
<ThumbnailEntry {...this.props} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DragPreview.propTypes = {
|
|
||||||
isDragging: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DragLayer(collector)(memo(DragPreview));
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
.DragPreview
|
|
||||||
|
|
||||||
.source-preview {
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
position: fixed;
|
|
||||||
opacity: 0.5;
|
|
||||||
z-index: 9999;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
transition: none;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
}
|
|
||||||
@@ -1,62 +1,103 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry';
|
import { Thumbnail } from './Thumbnail.js';
|
||||||
import ThumbnailEntryDragSource from './ThumbnailEntryDragSource.js';
|
|
||||||
import './StudyBrowser.styl';
|
import './StudyBrowser.styl';
|
||||||
|
|
||||||
class StudyBrowser extends Component {
|
function StudyBrowser(props) {
|
||||||
static defaultProps = {
|
const {
|
||||||
studies: [],
|
studies,
|
||||||
supportsDragAndDrop: true,
|
onThumbnailClick,
|
||||||
};
|
onThumbnailDoubleClick,
|
||||||
|
supportsDrag,
|
||||||
|
} = props;
|
||||||
|
|
||||||
static propTypes = {
|
return (
|
||||||
studies: PropTypes.array.isRequired,
|
<div className="study-browser">
|
||||||
supportsDragAndDrop: PropTypes.bool.isRequired,
|
<div className="scrollable-study-thumbnails">
|
||||||
onThumbnailClick: PropTypes.func,
|
{studies
|
||||||
onThumbnailDoubleClick: PropTypes.func,
|
.map((study, studyIndex) => {
|
||||||
};
|
const { studyInstanceUid } = study;
|
||||||
|
return study.thumbnails.map((thumb, thumbIndex) => {
|
||||||
|
// TODO: Thumb has more props than we care about?
|
||||||
|
const {
|
||||||
|
altImageText,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
imageId,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
stackPercentComplete,
|
||||||
|
} = thumb;
|
||||||
|
|
||||||
render() {
|
return (
|
||||||
const studies = this.props.studies;
|
<div
|
||||||
|
key={`container_${studyIndex}_${thumbIndex}`}
|
||||||
const thumbnails = studies.map((study, studyIndex) => {
|
className="thumbnail-container"
|
||||||
return study.thumbnails.map((thumb, thumbIndex) => {
|
data-cy="thumbnail-list"
|
||||||
if (this.props.supportsDragAndDrop) {
|
>
|
||||||
return (
|
<Thumbnail
|
||||||
<ThumbnailEntryDragSource
|
supportsDrag={supportsDrag}
|
||||||
key={thumb.displaySetInstanceUid}
|
key={`${studyIndex}_${thumbIndex}`}
|
||||||
{...study}
|
id={`${studyIndex}_${thumbIndex}`} // Unused?
|
||||||
{...thumb}
|
// Study
|
||||||
id={`${studyIndex}_${thumbIndex}`}
|
studyInstanceUid={studyInstanceUid} // used by drop
|
||||||
onClick={this.props.onThumbnailClick}
|
// Thumb
|
||||||
onDoubleClick={this.props.onThumbnailDoubleClick}
|
altImageText={altImageText}
|
||||||
/>
|
imageId={imageId}
|
||||||
);
|
instanceNumber={instanceNumber}
|
||||||
} else {
|
displaySetInstanceUid={displaySetInstanceUid} // used by drop
|
||||||
return (
|
numImageFrames={numImageFrames}
|
||||||
<div className="ThumbnailEntryContainer" data-cy="thumbnail-list">
|
seriesDescription={seriesDescription}
|
||||||
<ThumbnailEntry
|
seriesNumber={seriesNumber}
|
||||||
key={thumb.displaySetInstanceUid}
|
stackPercentComplete={stackPercentComplete}
|
||||||
{...study}
|
// Events
|
||||||
{...thumb}
|
onClick={onThumbnailClick.bind(
|
||||||
id={`${studyIndex}_${thumbIndex}`}
|
undefined,
|
||||||
onClick={this.props.onThumbnailClick}
|
displaySetInstanceUid
|
||||||
onDoubleClick={this.props.onThumbnailDoubleClick}
|
)}
|
||||||
/>
|
onDoubleClick={onThumbnailDoubleClick}
|
||||||
</div>
|
/>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
.flat()}
|
||||||
const components = thumbnails.flat();
|
|
||||||
return (
|
|
||||||
<div className="StudyBrowser">
|
|
||||||
<div className="scrollable-study-thumbnails">{components}</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const noop = () => {};
|
||||||
|
|
||||||
|
StudyBrowser.propTypes = {
|
||||||
|
studies: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
studyInstanceUid: PropTypes.string.isRequired,
|
||||||
|
thumbnails: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
altImageText: PropTypes.string,
|
||||||
|
displaySetInstanceUid: PropTypes.string.isRequired,
|
||||||
|
imageId: PropTypes.string,
|
||||||
|
instanceNumber: PropTypes.number,
|
||||||
|
numImageFrames: PropTypes.number,
|
||||||
|
seriesDescription: PropTypes.string,
|
||||||
|
seriesNumber: PropTypes.number,
|
||||||
|
stackPercentComplete: PropTypes.number,
|
||||||
|
})
|
||||||
|
),
|
||||||
|
})
|
||||||
|
).isRequired,
|
||||||
|
supportsDrag: PropTypes.bool,
|
||||||
|
onThumbnailClick: PropTypes.func,
|
||||||
|
onThumbnailDoubleClick: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
StudyBrowser.defaultProps = {
|
||||||
|
studies: [],
|
||||||
|
supportsDrag: true,
|
||||||
|
onThumbnailClick: noop,
|
||||||
|
onThumbnailDoubleClick: noop,
|
||||||
|
};
|
||||||
|
|
||||||
export { StudyBrowser };
|
export { StudyBrowser };
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.StudyBrowser
|
.study-browser
|
||||||
float: left
|
float: left
|
||||||
height: 100%
|
height: 100%
|
||||||
width: 100%
|
width: 100%
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
&::-webkit-scrollbar
|
&::-webkit-scrollbar
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
.ThumbnailEntryContainer
|
.thumbnail-container
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { useDrag } from 'react-dnd';
|
||||||
|
import ImageThumbnail from './ImageThumbnail';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import './Thumbnail.styl';
|
||||||
|
|
||||||
|
function ThumbnailFooter({
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
}) {
|
||||||
|
const infoOnly = !seriesDescription;
|
||||||
|
|
||||||
|
const getInfo = (value, icon, className = '') => {
|
||||||
|
return (
|
||||||
|
<div className={classNames('item item-series', className)}>
|
||||||
|
<div className="icon">{icon}</div>
|
||||||
|
<div className="value">{value}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const getSeriesInformation = (
|
||||||
|
seriesNumber,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames
|
||||||
|
) => {
|
||||||
|
if (!seriesNumber && !instanceNumber && !numImageFrames) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="series-information">
|
||||||
|
{getInfo(seriesNumber, 'S:')}
|
||||||
|
{getInfo(instanceNumber, 'I:')}
|
||||||
|
{getInfo(numImageFrames, '', 'image-frames')}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classNames('series-details', { 'info-only': infoOnly })}>
|
||||||
|
<div className="series-description">{seriesDescription}</div>
|
||||||
|
{getSeriesInformation(seriesNumber, instanceNumber, numImageFrames)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Thumbnail(props) {
|
||||||
|
const {
|
||||||
|
active,
|
||||||
|
altImageText,
|
||||||
|
error,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
imageId,
|
||||||
|
imageSrc,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
stackPercentComplete,
|
||||||
|
studyInstanceUid,
|
||||||
|
onClick,
|
||||||
|
onDoubleClick,
|
||||||
|
onMouseDown,
|
||||||
|
supportsDrag,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const [collectedProps, drag, dragPreview] = useDrag({
|
||||||
|
// `droppedItem` in `dropTarget`
|
||||||
|
// The only data it will have access to
|
||||||
|
item: {
|
||||||
|
studyInstanceUid,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
type: 'thumbnail', // Has to match `dropTarget`'s type
|
||||||
|
},
|
||||||
|
canDrag: function(monitor) {
|
||||||
|
return supportsDrag;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasImage = imageSrc || imageId;
|
||||||
|
const hasAltText = altImageText !== undefined;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref={drag}
|
||||||
|
className={classNames('thumbnail', { active: active })}
|
||||||
|
onClick={onClick}
|
||||||
|
onDoubleClick={onDoubleClick}
|
||||||
|
onMouseDown={onMouseDown}
|
||||||
|
>
|
||||||
|
{/* SHOW IMAGE */}
|
||||||
|
{hasImage && (
|
||||||
|
<ImageThumbnail
|
||||||
|
imageSrc={imageSrc}
|
||||||
|
imageId={imageId}
|
||||||
|
error={error}
|
||||||
|
stackPercentComplete={stackPercentComplete}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{/* SHOW TEXT ALTERNATIVE */}
|
||||||
|
{!hasImage && hasAltText && (
|
||||||
|
<div className={'alt-image-text p-x-1'}>
|
||||||
|
<h1>{altImageText}</h1>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{ThumbnailFooter(props)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const noop = () => {};
|
||||||
|
|
||||||
|
Thumbnail.propTypes = {
|
||||||
|
supportsDrag: PropTypes.bool,
|
||||||
|
id: PropTypes.string.isRequired,
|
||||||
|
displaySetInstanceUid: PropTypes.string.isRequired,
|
||||||
|
studyInstanceUid: PropTypes.string.isRequired,
|
||||||
|
imageSrc: PropTypes.string,
|
||||||
|
imageId: PropTypes.string,
|
||||||
|
error: PropTypes.bool,
|
||||||
|
active: PropTypes.bool,
|
||||||
|
stackPercentComplete: PropTypes.number,
|
||||||
|
/**
|
||||||
|
altImageText will be used when no imageId or imageSrc is provided.
|
||||||
|
It will be displayed inside the <div>. This is useful when it is difficult
|
||||||
|
to make a preview for a type of DICOM series (e.g. DICOM-SR)
|
||||||
|
*/
|
||||||
|
altImageText: PropTypes.string,
|
||||||
|
seriesDescription: PropTypes.string,
|
||||||
|
seriesNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
instanceNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
numImageFrames: PropTypes.number,
|
||||||
|
onDoubleClick: PropTypes.func,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
onMouseDown: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
Thumbnail.defaultProps = {
|
||||||
|
supportsDrag: false,
|
||||||
|
active: false,
|
||||||
|
error: false,
|
||||||
|
stackPercentComplete: 0,
|
||||||
|
onDoubleClick: noop,
|
||||||
|
onClick: noop,
|
||||||
|
onMouseDown: noop,
|
||||||
|
};
|
||||||
|
|
||||||
|
export { Thumbnail };
|
||||||
@@ -4,12 +4,12 @@
|
|||||||
--series-count-background-color: #678696;
|
--series-count-background-color: #678696;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
display: table
|
display: table
|
||||||
|
margin: 0 auto;
|
||||||
.p-x-1
|
min-width: 90%;
|
||||||
padding: 0 1rem
|
padding-bottom: 1.5rem;
|
||||||
|
|
||||||
.alt-image-text
|
.alt-image-text
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -31,6 +31,8 @@
|
|||||||
color: var(--text-primary-color);
|
color: var(--text-primary-color);
|
||||||
|
|
||||||
.series-details
|
.series-details
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column
|
||||||
color: var(--text-primary-color);
|
color: var(--text-primary-color);
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
line-height: 1.3em
|
line-height: 1.3em
|
||||||
@@ -38,64 +40,30 @@
|
|||||||
margin-left: 1rem
|
margin-left: 1rem
|
||||||
margin-right: 0.5rem
|
margin-right: 0.5rem
|
||||||
max-width: 217px
|
max-width: 217px
|
||||||
min-height: 36px
|
|
||||||
position: relative
|
position: relative
|
||||||
word-wrap: break-word
|
word-wrap: break-word
|
||||||
|
|
||||||
&.info-only
|
.series-description
|
||||||
.series-description
|
flex-grow: 1
|
||||||
display: none
|
|
||||||
|
|
||||||
.series-information
|
|
||||||
display: flex
|
|
||||||
flex-grow: 1
|
|
||||||
float: none
|
|
||||||
max-width: none
|
|
||||||
padding-right: 0
|
|
||||||
|
|
||||||
.item
|
|
||||||
flex: 1
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
.icon, .value
|
|
||||||
display: inline
|
|
||||||
float: none
|
|
||||||
line-height: 25px
|
|
||||||
|
|
||||||
|
&.info-only .series-description
|
||||||
|
display: none
|
||||||
|
|
||||||
.series-information
|
.series-information
|
||||||
display: flex
|
display: flex
|
||||||
flex-direction: row
|
flex-direction: row
|
||||||
align-items: center
|
justify-content: space-between
|
||||||
|
|
||||||
.item
|
|
||||||
flex: 1
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
.item-frames .icon
|
.item-frames .icon
|
||||||
height: 18px
|
height: 18px
|
||||||
|
|
||||||
.value
|
.item-series.image-frames .icon
|
||||||
color: var(--text-secondary-color);
|
|
||||||
display: inline
|
|
||||||
font-size: 12px
|
|
||||||
margin-left: 4px
|
|
||||||
text-overflow: ellipsis
|
|
||||||
white-space: nowrap
|
|
||||||
|
|
||||||
.icon
|
|
||||||
color: var(--active-color);
|
|
||||||
display: inline
|
|
||||||
font-size: 10px
|
|
||||||
font-weight: 900
|
|
||||||
text-align: right
|
|
||||||
|
|
||||||
div
|
|
||||||
background-color: var(--series-count-background-color);
|
background-color: var(--series-count-background-color);
|
||||||
margin-top: 6px
|
margin-top: 6px
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
|
content: ''
|
||||||
background-color: var(--active-color);
|
background-color: var(--active-color);
|
||||||
box-shadow: 1px 1px rgba(0, 0, 0, .115)
|
box-shadow: 1px 1px rgba(0, 0, 0, .115)
|
||||||
left: -4px
|
left: -4px
|
||||||
@@ -104,16 +72,27 @@
|
|||||||
|
|
||||||
&
|
&
|
||||||
&:after
|
&:after
|
||||||
border: 0px solid var(--series-count-background-color)
|
|
||||||
content: ''
|
content: ''
|
||||||
|
border: 0px solid var(--series-count-background-color)
|
||||||
display: inline-block
|
display: inline-block
|
||||||
height: 11px
|
height: 11px
|
||||||
width: 11px
|
width: 11px
|
||||||
|
|
||||||
.image-thumbnail-clone
|
.value
|
||||||
z-index: 100000
|
color: var(--text-secondary-color);
|
||||||
pointer-events: none
|
display: inline-block
|
||||||
|
font-size: 12px
|
||||||
|
margin-left: 4px
|
||||||
|
overflow: hidden
|
||||||
|
text-overflow: ellipsis
|
||||||
|
white-space: nowrap
|
||||||
|
width: calc(100% - 15px)
|
||||||
|
vertical-align: middle
|
||||||
|
|
||||||
&:hover
|
.icon
|
||||||
border-color: var(--hover-color);
|
color: var(--active-color);
|
||||||
box-shadow: none
|
display: inline-block
|
||||||
|
font-size: 10px
|
||||||
|
font-weight: 900
|
||||||
|
text-align: right
|
||||||
|
width: 11px
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import ImageThumbnail from './ImageThumbnail';
|
|
||||||
import './ThumbnailEntry.styl';
|
|
||||||
import classnames from 'classnames';
|
|
||||||
|
|
||||||
class ThumbnailEntry extends Component {
|
|
||||||
static defaultProps = {
|
|
||||||
active: false,
|
|
||||||
error: false,
|
|
||||||
stackPercentComplete: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
id: PropTypes.string.isRequired,
|
|
||||||
imageSrc: PropTypes.string,
|
|
||||||
imageId: PropTypes.string,
|
|
||||||
error: PropTypes.bool.isRequired,
|
|
||||||
active: PropTypes.bool.isRequired,
|
|
||||||
stackPercentComplete: PropTypes.number,
|
|
||||||
/**
|
|
||||||
altImageText will be used when no imageId or imageSrc is provided.
|
|
||||||
It will be displayed inside the <div>. This is useful when it is difficult
|
|
||||||
to make a preview for a type of DICOM series (e.g. DICOM-SR)
|
|
||||||
*/
|
|
||||||
altImageText: PropTypes.string,
|
|
||||||
seriesDescription: PropTypes.string,
|
|
||||||
seriesNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
||||||
instanceNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
||||||
numImageFrames: PropTypes.number,
|
|
||||||
onDoubleClick: PropTypes.func,
|
|
||||||
onClick: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const hasInstanceNumber = this.props.instanceNumber !== undefined;
|
|
||||||
|
|
||||||
let className = classnames('ThumbnailEntry noselect', {
|
|
||||||
active: this.props.active,
|
|
||||||
});
|
|
||||||
|
|
||||||
let contents = null;
|
|
||||||
if (this.props.imageSrc || this.props.imageId) {
|
|
||||||
contents = (
|
|
||||||
<div className="p-x-1">
|
|
||||||
<ImageThumbnail
|
|
||||||
imageSrc={this.props.imageSrc}
|
|
||||||
imageId={this.props.imageId}
|
|
||||||
error={this.props.error}
|
|
||||||
stackPercentComplete={this.props.stackPercentComplete}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else if (this.props.altImageText) {
|
|
||||||
contents = (
|
|
||||||
<div className="p-x-1">
|
|
||||||
<div className="alt-image-text">
|
|
||||||
<h1>{this.props.altImageText}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={className}
|
|
||||||
onClick={this.onClick}
|
|
||||||
onDoubleClick={this.onDoubleClick}
|
|
||||||
onMouseDown={this.onMouseDown}
|
|
||||||
>
|
|
||||||
{contents}
|
|
||||||
<div
|
|
||||||
className="series-details"
|
|
||||||
>
|
|
||||||
<div className="series-description">
|
|
||||||
{this.props.seriesDescription}
|
|
||||||
</div>
|
|
||||||
<div className="series-information">
|
|
||||||
<div className="item item-series">
|
|
||||||
<div className="icon">S:</div>
|
|
||||||
<div className="value">{this.props.seriesNumber}</div>
|
|
||||||
</div>
|
|
||||||
{hasInstanceNumber && (
|
|
||||||
<div className="item item-series">
|
|
||||||
<div className="icon">I:</div>
|
|
||||||
<div className="value">{this.props.instanceNumber}</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="item item-frames">
|
|
||||||
<div className="icon">
|
|
||||||
<div />
|
|
||||||
</div>
|
|
||||||
<div className="value">{this.props.numImageFrames}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
onClick = () => {
|
|
||||||
if (this.props.onClick) {
|
|
||||||
this.props.onClick(this.props.displaySetInstanceUid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onDoubleClick = () => {
|
|
||||||
if (this.props.onDoubleClick) {
|
|
||||||
this.props.onDoubleClick(this.props.displaySetInstanceUid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export { ThumbnailEntry };
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { DragSource } from 'react-dnd';
|
|
||||||
import DragPreview from './DragPreview';
|
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry.js';
|
|
||||||
|
|
||||||
// Drag sources and drop targets only interact
|
|
||||||
// if they have the same string type.
|
|
||||||
const Types = {
|
|
||||||
THUMBNAIL: 'thumbnail',
|
|
||||||
};
|
|
||||||
|
|
||||||
const thumbnailSource = {
|
|
||||||
/*canDrag(props) {
|
|
||||||
return props.error === false;
|
|
||||||
},*/
|
|
||||||
|
|
||||||
beginDrag(props) {
|
|
||||||
return props;
|
|
||||||
},
|
|
||||||
|
|
||||||
endDrag(props, monitor) {
|
|
||||||
//const item = monitor.getItem();
|
|
||||||
const dropResult = monitor.getDropResult();
|
|
||||||
|
|
||||||
if (dropResult) {
|
|
||||||
//console.log(`You dropped ${item.id} into ${dropResult.id}!`);
|
|
||||||
//console.log(item);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
class ThumbnailEntryDragSource extends Component {
|
|
||||||
static propTypes = {
|
|
||||||
connectDragSource: PropTypes.func.isRequired,
|
|
||||||
isDragging: PropTypes.bool.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
isDragging: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { connectDragSource } = this.props;
|
|
||||||
const dropEffect = 'copy';
|
|
||||||
|
|
||||||
return connectDragSource(
|
|
||||||
<div className="ThumbnailEntryContainer" data-cy="thumbnail-list">
|
|
||||||
<DragPreview {...this.props} />
|
|
||||||
<ThumbnailEntry {...this.props} />
|
|
||||||
</div>,
|
|
||||||
{ dropEffect }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const collect = (connect, monitor) => ({
|
|
||||||
connectDragSource: connect.dragSource(),
|
|
||||||
isDragging: monitor.isDragging(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DragSource(Types.THUMBNAIL, thumbnailSource, collect)(
|
|
||||||
ThumbnailEntryDragSource
|
|
||||||
);
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
export { StudyBrowser } from './StudyBrowser.js';
|
export { StudyBrowser } from './StudyBrowser.js';
|
||||||
export { ThumbnailEntry } from './ThumbnailEntry.js';
|
export { Thumbnail } from './Thumbnail.js';
|
||||||
@@ -5,12 +5,9 @@ import classNames from 'classnames';
|
|||||||
import TableSearchFilter from './TableSearchFilter.js';
|
import TableSearchFilter from './TableSearchFilter.js';
|
||||||
import useMedia from '../../hooks/useMedia.js';
|
import useMedia from '../../hooks/useMedia.js';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ColorHash from './internal/color-hash.js';
|
|
||||||
import { StudyListLoadingText } from './StudyListLoadingText.js';
|
import { StudyListLoadingText } from './StudyListLoadingText.js';
|
||||||
import { withTranslation } from '../../utils/LanguageProvider';
|
import { withTranslation } from '../../utils/LanguageProvider';
|
||||||
|
|
||||||
const colorHash = new ColorHash();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -145,14 +142,14 @@ function StudyList(props) {
|
|||||||
{/* LOADING */}
|
{/* LOADING */}
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<tr className="no-hover">
|
<tr className="no-hover">
|
||||||
<td colspan={tableMeta.length}>
|
<td colSpan={tableMeta.length}>
|
||||||
<StudyListLoadingText />
|
<StudyListLoadingText />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
{!isLoading && hasError && (
|
{!isLoading && hasError && (
|
||||||
<tr className="no-hover">
|
<tr className="no-hover">
|
||||||
<td colspan={tableMeta.length}>
|
<td colSpan={tableMeta.length}>
|
||||||
<div className="notFound">
|
<div className="notFound">
|
||||||
{t('There was an error fetching studies')}
|
{t('There was an error fetching studies')}
|
||||||
</div>
|
</div>
|
||||||
@@ -162,7 +159,7 @@ function StudyList(props) {
|
|||||||
{/* EMPTY */}
|
{/* EMPTY */}
|
||||||
{!isLoading && !studies.length && (
|
{!isLoading && !studies.length && (
|
||||||
<tr className="no-hover">
|
<tr className="no-hover">
|
||||||
<td colspan={tableMeta.length}>
|
<td colSpan={tableMeta.length}>
|
||||||
<div className="notFound">{t('No matching results')}</div>
|
<div className="notFound">{t('No matching results')}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -236,13 +233,15 @@ function TableRow(props) {
|
|||||||
onClick={() => handleClick(studyInstanceUid)}
|
onClick={() => handleClick(studyInstanceUid)}
|
||||||
className={classNames({ active: isHighlighted })}
|
className={classNames({ active: isHighlighted })}
|
||||||
>
|
>
|
||||||
<td className={classNames({ emptyCell: !patientName })}>
|
<td className={classNames({ 'empty-value': !patientName })}>
|
||||||
{patientName || `(${t('Empty')})`}
|
{patientName || `(${t('Empty')})`}
|
||||||
</td>
|
</td>
|
||||||
<td>{patientId}</td>
|
<td>{patientId}</td>
|
||||||
<td>{accessionNumber}</td>
|
<td>{accessionNumber}</td>
|
||||||
<td>{studyDate}</td>
|
<td>{studyDate}</td>
|
||||||
<td>{modalities}</td>
|
<td className={classNames({ 'empty-value': !modalities })}>
|
||||||
|
{modalities || `(${t('Empty')})`}
|
||||||
|
</td>
|
||||||
<td>{studyDescription}</td>
|
<td>{studyDescription}</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
@@ -252,7 +251,7 @@ function TableRow(props) {
|
|||||||
onClick={() => handleClick(studyInstanceUid)}
|
onClick={() => handleClick(studyInstanceUid)}
|
||||||
className={classNames({ active: isHighlighted })}
|
className={classNames({ active: isHighlighted })}
|
||||||
>
|
>
|
||||||
<td className={classNames({ emptyCell: !patientName })}>
|
<td className={classNames({ 'empty-value': !patientName })}>
|
||||||
{patientName || `(${t('Empty')})`}
|
{patientName || `(${t('Empty')})`}
|
||||||
<div style={{ color: '#60656f' }}>{patientId}</div>
|
<div style={{ color: '#60656f' }}>{patientId}</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -274,25 +273,19 @@ function TableRow(props) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
minWidth: '80px',
|
maxWidth: '80px',
|
||||||
maxWidth: '100px',
|
width: '80px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
className={classNames({
|
||||||
backgroundColor: colorHash.hex(modalities),
|
modalities: modalities,
|
||||||
borderRadius: '16px',
|
'empty-value': !modalities,
|
||||||
padding: '2px 8px 0px 8px',
|
})}
|
||||||
fontWeight: 500,
|
|
||||||
marginBottom: '4px',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
}}
|
|
||||||
aria-label={modalities}
|
aria-label={modalities}
|
||||||
title={modalities}
|
title={modalities}
|
||||||
>
|
>
|
||||||
{modalities}
|
{modalities || `(${t('Empty')})`}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -322,7 +315,7 @@ function TableRow(props) {
|
|||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
{/* NAME AND ID */}
|
{/* NAME AND ID */}
|
||||||
<div
|
<div
|
||||||
className={classNames({ emptyCell: !patientName })}
|
className={classNames({ 'empty-value': !patientName })}
|
||||||
style={{ width: '150px', minWidth: '150px' }}
|
style={{ width: '150px', minWidth: '150px' }}
|
||||||
>
|
>
|
||||||
<div style={{ fontWeight: 500, paddingTop: '3px' }}>
|
<div style={{ fontWeight: 500, paddingTop: '3px' }}>
|
||||||
@@ -348,19 +341,19 @@ function TableRow(props) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
minWidth: '80px',
|
maxWidth: '80px',
|
||||||
|
width: '80px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
className={classNames({
|
||||||
backgroundColor: colorHash.hex(modalities),
|
modalities: modalities,
|
||||||
borderRadius: '16px',
|
'empty-value': !modalities,
|
||||||
padding: '2px 8px 0px 8px',
|
})}
|
||||||
fontWeight: 500,
|
aria-label={modalities}
|
||||||
marginBottom: '4px',
|
title={modalities}
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{modalities}
|
{modalities || `(${t('Empty')})`}
|
||||||
</div>
|
</div>
|
||||||
<div>{studyDate}</div>
|
<div>{studyDate}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -381,7 +374,7 @@ function TableRow(props) {
|
|||||||
TableRow.propTypes = {
|
TableRow.propTypes = {
|
||||||
accessionNumber: PropTypes.string.isRequired,
|
accessionNumber: PropTypes.string.isRequired,
|
||||||
isHighlighted: PropTypes.bool,
|
isHighlighted: PropTypes.bool,
|
||||||
modalities: PropTypes.string.isRequired,
|
modalities: PropTypes.string,
|
||||||
patientId: PropTypes.string.isRequired,
|
patientId: PropTypes.string.isRequired,
|
||||||
patientName: PropTypes.string.isRequired,
|
patientName: PropTypes.string.isRequired,
|
||||||
studyDate: PropTypes.string.isRequired,
|
studyDate: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -113,11 +113,18 @@ table.table
|
|||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
color: var(--table-text-primary-color)
|
||||||
|
font-weight: 300
|
||||||
|
|
||||||
> tbody tr
|
> tbody tr
|
||||||
padding: 5px
|
padding: 5px
|
||||||
background-color: black
|
background-color: black
|
||||||
|
|
||||||
|
> tbody td
|
||||||
|
padding: $body-cell-top-bottom-padding 8px;
|
||||||
|
height: $body-cell-height
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
/* Striped Variant */
|
/* Striped Variant */
|
||||||
&.table--striped > tbody tr:nth-child(even)
|
&.table--striped > tbody tr:nth-child(even)
|
||||||
background-color: var(--ui-gray-darker)
|
background-color: var(--ui-gray-darker)
|
||||||
@@ -130,6 +137,9 @@ table.table
|
|||||||
&:hover, &:active, &.active
|
&:hover, &:active, &.active
|
||||||
background-color: var(--ui-gray-darker)
|
background-color: var(--ui-gray-darker)
|
||||||
|
|
||||||
|
.empty-value
|
||||||
|
color: var(--ui-gray-light)
|
||||||
|
|
||||||
.study-list-container > table.table > tr
|
.study-list-container > table.table > tr
|
||||||
height: 20px
|
height: 20px
|
||||||
|
|
||||||
@@ -146,18 +156,14 @@ table.table
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
|
|
||||||
.study-list-container > table.table > tbody > tr > td
|
|
||||||
padding: $body-cell-top-bottom-padding 8px;
|
|
||||||
height: $body-cell-height
|
|
||||||
color: var(--table-text-primary-color)
|
|
||||||
font-weight: 300
|
|
||||||
word-wrap: break-word;
|
|
||||||
|
|
||||||
&.emptyCell
|
|
||||||
color: var(--ui-gray-light)
|
|
||||||
|
|
||||||
.study-list-container > table.table > thead > tr > th.studyDate
|
.study-list-container > table.table > thead > tr > th.studyDate
|
||||||
min-width: 230px
|
min-width: 230px
|
||||||
|
.study-list-container > table.table .modalities
|
||||||
|
font-weight: 500;
|
||||||
|
min-height: 20px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.study-list-container
|
.study-list-container
|
||||||
.filters
|
.filters
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
/**
|
|
||||||
* BKDR Hash (modified version)
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Number}
|
|
||||||
*/
|
|
||||||
function BKDRHash(str) {
|
|
||||||
const seed = 131;
|
|
||||||
const seed2 = 137;
|
|
||||||
let hash = 0;
|
|
||||||
// make hash more sensitive for short string like 'a', 'b', 'c'
|
|
||||||
str += 'x';
|
|
||||||
// Note: Number.MAX_SAFE_INTEGER equals 9007199254740991
|
|
||||||
var MAX_SAFE_INTEGER = parseInt(9007199254740991 / seed2);
|
|
||||||
for (var i = 0; i < str.length; i++) {
|
|
||||||
if (hash > MAX_SAFE_INTEGER) {
|
|
||||||
hash = parseInt(hash / seed2);
|
|
||||||
}
|
|
||||||
hash = hash * seed + str.charCodeAt(i);
|
|
||||||
}
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BKDRHash;
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
import BKDRHash from './bkdr-hash';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert RGB Array to HEX
|
|
||||||
*
|
|
||||||
* @param {Array} RGBArray - [R, G, B]
|
|
||||||
* @returns {String} 6 digits hex starting with #
|
|
||||||
*/
|
|
||||||
function RGB2HEX(RGBArray) {
|
|
||||||
let hex = '#';
|
|
||||||
RGBArray.forEach(function(value) {
|
|
||||||
if (value < 16) {
|
|
||||||
hex += 0;
|
|
||||||
}
|
|
||||||
hex += value.toString(16);
|
|
||||||
});
|
|
||||||
return hex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert HSL to RGB
|
|
||||||
*
|
|
||||||
* @see {@link http://zh.wikipedia.org/wiki/HSL和HSV色彩空间} for further information.
|
|
||||||
* @param {Number} H Hue ∈ [0, 360)
|
|
||||||
* @param {Number} S Saturation ∈ [0, 1]
|
|
||||||
* @param {Number} L Lightness ∈ [0, 1]
|
|
||||||
* @returns {Array} R, G, B ∈ [0, 255]
|
|
||||||
*/
|
|
||||||
function HSL2RGB(H, S, L) {
|
|
||||||
H /= 360;
|
|
||||||
|
|
||||||
const q = L < 0.5 ? L * (1 + S) : L + S - L * S;
|
|
||||||
const p = 2 * L - q;
|
|
||||||
|
|
||||||
return [H + 1 / 3, H, H - 1 / 3].map(function(color) {
|
|
||||||
if (color < 0) {
|
|
||||||
color++;
|
|
||||||
}
|
|
||||||
if (color > 1) {
|
|
||||||
color--;
|
|
||||||
}
|
|
||||||
if (color < 1 / 6) {
|
|
||||||
color = p + (q - p) * 6 * color;
|
|
||||||
} else if (color < 0.5) {
|
|
||||||
color = q;
|
|
||||||
} else if (color < 2 / 3) {
|
|
||||||
color = p + (q - p) * 6 * (2 / 3 - color);
|
|
||||||
} else {
|
|
||||||
color = p;
|
|
||||||
}
|
|
||||||
return Math.round(color * 255);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function isArray(o) {
|
|
||||||
return Object.prototype.toString.call(o) === '[object Array]';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Color Hash Class
|
|
||||||
*
|
|
||||||
* @class
|
|
||||||
*/
|
|
||||||
const ColorHash = function(options = {}) {
|
|
||||||
const LS = [options.lightness, options.saturation].map(function(param) {
|
|
||||||
param = param || [0.35, 0.5, 0.65]; // note that 3 is a prime
|
|
||||||
return isArray(param) ? param.concat() : [param];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.L = LS[0];
|
|
||||||
this.S = LS[1];
|
|
||||||
|
|
||||||
if (typeof options.hue === 'number') {
|
|
||||||
options.hue = { min: options.hue, max: options.hue };
|
|
||||||
}
|
|
||||||
if (typeof options.hue === 'object' && !isArray(options.hue)) {
|
|
||||||
options.hue = [options.hue];
|
|
||||||
}
|
|
||||||
if (typeof options.hue === 'undefined') {
|
|
||||||
options.hue = [];
|
|
||||||
}
|
|
||||||
this.hueRanges = options.hue.map(function(range) {
|
|
||||||
return {
|
|
||||||
min: typeof range.min === 'undefined' ? 0 : range.min,
|
|
||||||
max: typeof range.max === 'undefined' ? 360 : range.max,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
this.hash = options.hash || BKDRHash;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in [h, s, l].
|
|
||||||
* Note that H ∈ [0, 360); S ∈ [0, 1]; L ∈ [0, 1];
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Array} [h, s, l]
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.hsl = function(str) {
|
|
||||||
var H, S, L;
|
|
||||||
var hash = this.hash(str);
|
|
||||||
|
|
||||||
if (this.hueRanges.length) {
|
|
||||||
var range = this.hueRanges[hash % this.hueRanges.length];
|
|
||||||
var hueResolution = 727; // note that 727 is a prime
|
|
||||||
H =
|
|
||||||
(((hash / this.hueRanges.length) % hueResolution) *
|
|
||||||
(range.max - range.min)) /
|
|
||||||
hueResolution +
|
|
||||||
range.min;
|
|
||||||
} else {
|
|
||||||
H = hash % 359; // note that 359 is a prime
|
|
||||||
}
|
|
||||||
hash = parseInt(hash / 360);
|
|
||||||
S = this.S[hash % this.S.length];
|
|
||||||
hash = parseInt(hash / this.S.length);
|
|
||||||
L = this.L[hash % this.L.length];
|
|
||||||
|
|
||||||
return [H, S, L];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in [r, g, b].
|
|
||||||
* Note that R, G, B ∈ [0, 255]
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Array} [r, g, b]
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.rgb = function(str) {
|
|
||||||
var hsl = this.hsl(str);
|
|
||||||
return HSL2RGB.apply(this, hsl);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in hex
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {String} hex with #
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.hex = function(str) {
|
|
||||||
var rgb = this.rgb(str);
|
|
||||||
return RGB2HEX(rgb);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ColorHash;
|
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
.itemContent
|
.itemContent
|
||||||
flex: 1
|
flex: 1
|
||||||
color: var(--text-secondary-color)
|
color: var(--text-secondary-color)
|
||||||
|
width: calc(100% - 30px);
|
||||||
font-weight: 400
|
font-weight: 400
|
||||||
margin-left: 9px;
|
margin-left: 9px;
|
||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AboutModal,
|
AboutModal,
|
||||||
@@ -86,9 +86,9 @@ export {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
Toolbar,
|
Toolbar,
|
||||||
ToolbarButton,
|
ToolbarButton,
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// https://developers.google.com/web/tools/workbox/guides/codelabs/webpack
|
||||||
// ~~ WebPack
|
// ~~ WebPack
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
@@ -9,8 +10,9 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
|||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');
|
const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');
|
||||||
|
// const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const WorkboxPlugin = require('workbox-webpack-plugin');
|
const { InjectManifest } = require('workbox-webpack-plugin');
|
||||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||||
// ~~ Rules
|
// ~~ Rules
|
||||||
@@ -80,12 +82,14 @@ module.exports = (env, argv) => {
|
|||||||
templateParameters: {
|
templateParameters: {
|
||||||
PUBLIC_URL: PUBLIC_URL,
|
PUBLIC_URL: PUBLIC_URL,
|
||||||
},
|
},
|
||||||
// favicon: `${PUBLIC_DIR}/favicon.ico`,
|
|
||||||
}),
|
}),
|
||||||
new WorkboxPlugin.GenerateSW({
|
// No longer maintained; but good for generating icons + manifest
|
||||||
|
// new FaviconsWebpackPlugin( path.join(PUBLIC_DIR, 'assets', 'icons-512.png')),
|
||||||
|
new InjectManifest({
|
||||||
swDest: 'sw.js',
|
swDest: 'sw.js',
|
||||||
clientsClaim: true,
|
swSrc: path.join(SRC_DIR, 'service-worker.js'),
|
||||||
skipWaiting: true,
|
// Increase the limit to 4mb:
|
||||||
|
// maximumFileSizeToCacheInBytes: 4 * 1024 * 1024
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
// https://webpack.js.org/configuration/dev-server/
|
// https://webpack.js.org/configuration/dev-server/
|
||||||
|
|||||||
@@ -3,6 +3,110 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.3.7](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.6...@ohif/viewer@2.3.7) (2019-11-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Minor issues measurement panel related to description ([#1142](https://github.com/OHIF/Viewers/issues/1142)) ([681384b](https://github.com/OHIF/Viewers/commit/681384b7425c83b02a0ed83371ca92d78ca7838c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.6](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.5...@ohif/viewer@2.3.6) (2019-11-02)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.4...@ohif/viewer@2.3.5) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.3...@ohif/viewer@2.3.4) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Fix ghost shadow on thumb ([#1113](https://github.com/OHIF/Viewers/issues/1113)) ([caaa032](https://github.com/OHIF/Viewers/commit/caaa032c4bc24fd69fdb01a15a8feb2721c321db))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.2...@ohif/viewer@2.3.3) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* get adapter store picker to show ([#1134](https://github.com/OHIF/Viewers/issues/1134)) ([50ca2bd](https://github.com/OHIF/Viewers/commit/50ca2bde971e1e67b73ece96369052dd1a35ac68))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.1...@ohif/viewer@2.3.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Limit image download size to avoid browser issues ([#1112](https://github.com/OHIF/Viewers/issues/1112)) ([5716b71](https://github.com/OHIF/Viewers/commit/5716b71d409ee1c6f13393c8cb7f50222415e198)), closes [#1099](https://github.com/OHIF/Viewers/issues/1099)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.0...@ohif/viewer@2.3.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* rollbar template needs PUBLIC_URL defined ([#1127](https://github.com/OHIF/Viewers/issues/1127)) ([352407c](https://github.com/OHIF/Viewers/commit/352407c71ae93946e9ebad41446d6086cfbc237b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.3.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.2...@ohif/viewer@2.3.0) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* service worker ([#1045](https://github.com/OHIF/Viewers/issues/1045)) ([cf51368](https://github.com/OHIF/Viewers/commit/cf5136899eac08300ec4f15474a6440129ef7a9a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.2.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.1...@ohif/viewer@2.2.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Set SR viewport as active by interaction ([#1118](https://github.com/OHIF/Viewers/issues/1118)) ([5b33417](https://github.com/OHIF/Viewers/commit/5b334175c370afb930b4b6dbd307ddece8f850e3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.2.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.0...@ohif/viewer@2.2.1) (2019-10-29)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.2.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.1.4...@ohif/viewer@2.2.0) (2019-10-28)
|
# [2.2.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.1.4...@ohif/viewer@2.2.0) (2019-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -393,6 +393,20 @@ describe('OHIF Cornerstone Toolbar', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checks if the available viewport was set to active when layout is decreased', () => {
|
||||||
|
cy.setLayout(3, 3);
|
||||||
|
|
||||||
|
// activate the ninth viewport
|
||||||
|
cy.get('[data-cy=viewport-container-8]')
|
||||||
|
.click()
|
||||||
|
.should('have.class', 'active');
|
||||||
|
|
||||||
|
cy.setLayout(1, 1);
|
||||||
|
|
||||||
|
// first viewport should be active
|
||||||
|
cy.get('[data-cy=viewport-container-0]').should('have.class', 'active');
|
||||||
|
});
|
||||||
|
|
||||||
it('checks if Clear tool will delete all measurements added in the viewport', () => {
|
it('checks if Clear tool will delete all measurements added in the viewport', () => {
|
||||||
//Add measurements in the viewport
|
//Add measurements in the viewport
|
||||||
cy.addLengthMeasurement();
|
cy.addLengthMeasurement();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ describe('ViewerRouting', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// it('thumbnails list has more than 2 items', () => {
|
// it('thumbnails list has more than 2 items', () => {
|
||||||
// cy.get('.scrollable-study-thumbnails div.ThumbnailEntryContainer')
|
// cy.get('.scrollable-study-thumbnails div.thumbnail-container')
|
||||||
// .its('length')
|
// .its('length')
|
||||||
// .should('be.gte', 2);
|
// .should('be.gte', 2);
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -22,4 +22,23 @@ describe('OHIF HTML Extension', () => {
|
|||||||
'Imaging Measurement Report'
|
'Imaging Measurement Report'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checks if the HTML viewport has been set to active by interaction', () => {
|
||||||
|
cy.setLayout('3', '3');
|
||||||
|
|
||||||
|
// check if viewport has been set as active by CLICKING
|
||||||
|
cy.get('[data-cy=viewprt-grid] > :nth-child(4)')
|
||||||
|
.click()
|
||||||
|
.then($viewport => {
|
||||||
|
cy.wrap($viewport).should('have.class', 'active');
|
||||||
|
});
|
||||||
|
|
||||||
|
// check if viewport has been set as active by SCROLLING
|
||||||
|
cy.get('[data-cy=viewprt-grid] > :nth-child(7)').then($viewport => {
|
||||||
|
cy.wrap($viewport)
|
||||||
|
.find('[data-cy=dicom-html-viewport]')
|
||||||
|
.scrollTo('bottom');
|
||||||
|
cy.wrap($viewport).should('have.class', 'active');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -328,6 +328,21 @@ Cypress.Commands.add('percyCanvasSnapshot', (name, options = {}) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('setLayout', (columns = 1, rows = 1) => {
|
||||||
|
cy.get('.toolbar-button-label')
|
||||||
|
.contains('Layout')
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.get('.layoutChooser')
|
||||||
|
.find('tr')
|
||||||
|
.eq(rows - 1)
|
||||||
|
.find('td')
|
||||||
|
.eq(columns - 1)
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
|
||||||
function convertCanvas(documentClone) {
|
function convertCanvas(documentClone) {
|
||||||
documentClone
|
documentClone
|
||||||
.querySelectorAll('canvas')
|
.querySelectorAll('canvas')
|
||||||
@@ -364,4 +379,4 @@ function canvasToImage(selectorOrEl) {
|
|||||||
canvas.setAttribute('data-percy-canvas', true);
|
canvas.setAttribute('data-percy-canvas', true);
|
||||||
canvas.parentElement.appendChild(image);
|
canvas.parentElement.appendChild(image);
|
||||||
canvas.style = 'display: none';
|
canvas.style = 'display: none';
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/viewer",
|
"name": "@ohif/viewer",
|
||||||
"version": "2.2.0",
|
"version": "2.3.7",
|
||||||
"description": "OHIF Viewer",
|
"description": "OHIF Viewer",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -45,14 +45,14 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.1",
|
||||||
"@ohif/extension-cornerstone": "^2.0.0",
|
"@ohif/extension-cornerstone": "^2.0.0",
|
||||||
"@ohif/extension-dicom-html": "^1.0.0",
|
"@ohif/extension-dicom-html": "^1.0.1",
|
||||||
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
||||||
"@ohif/extension-dicom-pdf": "^1.0.0",
|
"@ohif/extension-dicom-pdf": "^1.0.0",
|
||||||
"@ohif/extension-vtk": "^0.52.23",
|
"@ohif/extension-vtk": "^0.52.28",
|
||||||
"@ohif/i18n": "^0.51.0",
|
"@ohif/i18n": "^0.51.0",
|
||||||
"@ohif/ui": "^0.58.0",
|
"@ohif/ui": "^0.58.5",
|
||||||
"@tanem/react-nprogress": "^1.1.25",
|
"@tanem/react-nprogress": "^1.1.25",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"core-js": "^3.2.1",
|
"core-js": "^3.2.1",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 423 B |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 949 B |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 607 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 802 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig>
|
||||||
|
<msapplication>
|
||||||
|
<tile>
|
||||||
|
<square70x70logo src="/assets/mstile-70x70.png"/>
|
||||||
|
<square150x150logo src="/assets/mstile-150x150.png"/>
|
||||||
|
<wide310x150logo src="/assets/mstile-310x150.png"/>
|
||||||
|
<square310x310logo src="/assets/mstile-310x310.png"/>
|
||||||
|
<TileColor>#fff</TileColor>
|
||||||
|
</tile>
|
||||||
|
</msapplication>
|
||||||
|
</browserconfig>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 214 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 685 B |
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"version": "2.2.1",
|
||||||
|
"name": "OHIF Viewer",
|
||||||
|
"description": "OHIF Viewer",
|
||||||
|
"icons": {
|
||||||
|
"60": "/assets/firefox_app_60x60.png",
|
||||||
|
"128": "/assets/firefox_app_128x128.png",
|
||||||
|
"512": "/assets/firefox_app_512x512.png"
|
||||||
|
},
|
||||||
|
"developer": {
|
||||||
|
"name": "OHIF Contributors",
|
||||||
|
"url": "https://github.com/ohif/viewers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 546 B |
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"version": "2.2.1",
|
||||||
|
"api_version": 1,
|
||||||
|
"layout": {
|
||||||
|
"logo": "/assets/yandex-browser-50x50.png",
|
||||||
|
"color": "#fff",
|
||||||
|
"show_title": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,74 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="application-name" content="OHIF Viewer">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="@ohif/viewer">
|
||||||
|
<meta name="msapplication-TileColor" content="#fff">
|
||||||
|
<meta name="msapplication-TileImage" content="<%= PUBLIC_URL %>assets/mstile-144x144.png">
|
||||||
|
<meta name="msapplication-config" content="<%= PUBLIC_URL %>assets/browserconfig.xml">
|
||||||
|
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json">
|
||||||
|
|
||||||
<head>
|
<link rel="shortcut icon" href="<%= PUBLIC_URL %>assets/favicon.ico">
|
||||||
<meta charset="utf-8" />
|
<link rel="icon" type="image/png" sizes="16x16" href="<%= PUBLIC_URL %>assets/favicon-16x16.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<link rel="icon" type="image/png" sizes="32x32" href="<%= PUBLIC_URL %>assets/favicon-32x32.png">
|
||||||
<meta name="theme-color" content="#000000" />
|
<link rel="apple-touch-icon" sizes="57x57" href="<%= PUBLIC_URL %>assets/apple-touch-icon-57x57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="<%= PUBLIC_URL %>assets/apple-touch-icon-60x60.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="<%= PUBLIC_URL %>assets/apple-touch-icon-72x72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="<%= PUBLIC_URL %>assets/apple-touch-icon-76x76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="<%= PUBLIC_URL %>assets/apple-touch-icon-114x114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="<%= PUBLIC_URL %>assets/apple-touch-icon-120x120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="<%= PUBLIC_URL %>assets/apple-touch-icon-144x144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="<%= PUBLIC_URL %>assets/apple-touch-icon-152x152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="167x167" href="<%= PUBLIC_URL %>assets/apple-touch-icon-167x167.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="<%= PUBLIC_URL %>assets/apple-touch-icon-180x180.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="1024x1024" href="<%= PUBLIC_URL %>assets/apple-touch-icon-1024x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-320x460.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x920.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x1096.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-750x1294.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1182x2208.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1242x2148.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-748x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-768x1004.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1496x2048.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1536x2008.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="228x228" href="<%= PUBLIC_URL %>assets/coast-228x228.png">
|
||||||
|
<link rel="yandex-tableau-widget" href="<%= PUBLIC_URL %>assets/yandex-browser-manifest.json">
|
||||||
|
|
||||||
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json" />
|
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
||||||
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
<!-- Targets IE11 -->
|
||||||
<!-- Targets IE11 -->
|
<script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
||||||
<script
|
<script type="text/javascript">
|
||||||
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||||
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
</script>
|
||||||
|
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
||||||
|
<script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script>
|
||||||
|
|
||||||
<title>OHIF Viewer</title>
|
<title>OHIF Viewer</title>
|
||||||
|
|
||||||
<!-- WEB FONTS -->
|
<!-- WEB FONTS -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- EXTENSIONS -->
|
<!-- EXTENSIONS -->
|
||||||
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.config.extensions = [SomeExtension];
|
window.config.extensions = [SomeExtension];
|
||||||
</script> -->
|
</script> -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
|
|
||||||
<div id="root"></div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,50 +1,86 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="application-name" content="OHIF Viewer">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="@ohif/viewer">
|
||||||
|
<meta name="msapplication-TileColor" content="#fff">
|
||||||
|
<meta name="msapplication-TileImage" content="<%= PUBLIC_URL %>assets/mstile-144x144.png">
|
||||||
|
<meta name="msapplication-config" content="<%= PUBLIC_URL %>assets/browserconfig.xml">
|
||||||
|
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json">
|
||||||
|
|
||||||
<head>
|
<link rel="shortcut icon" href="<%= PUBLIC_URL %>assets/favicon.ico">
|
||||||
<meta charset="utf-8" />
|
<link rel="icon" type="image/png" sizes="16x16" href="<%= PUBLIC_URL %>assets/favicon-16x16.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<link rel="icon" type="image/png" sizes="32x32" href="<%= PUBLIC_URL %>assets/favicon-32x32.png">
|
||||||
<meta name="theme-color" content="#000000" />
|
<link rel="apple-touch-icon" sizes="57x57" href="<%= PUBLIC_URL %>assets/apple-touch-icon-57x57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="<%= PUBLIC_URL %>assets/apple-touch-icon-60x60.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="<%= PUBLIC_URL %>assets/apple-touch-icon-72x72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="<%= PUBLIC_URL %>assets/apple-touch-icon-76x76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="<%= PUBLIC_URL %>assets/apple-touch-icon-114x114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="<%= PUBLIC_URL %>assets/apple-touch-icon-120x120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="<%= PUBLIC_URL %>assets/apple-touch-icon-144x144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="<%= PUBLIC_URL %>assets/apple-touch-icon-152x152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="167x167" href="<%= PUBLIC_URL %>assets/apple-touch-icon-167x167.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="<%= PUBLIC_URL %>assets/apple-touch-icon-180x180.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="1024x1024" href="<%= PUBLIC_URL %>assets/apple-touch-icon-1024x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-320x460.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x920.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x1096.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-750x1294.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1182x2208.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1242x2148.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-748x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-768x1004.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1496x2048.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1536x2008.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="228x228" href="<%= PUBLIC_URL %>assets/coast-228x228.png">
|
||||||
|
<link rel="yandex-tableau-widget" href="<%= PUBLIC_URL %>assets/yandex-browser-manifest.json">
|
||||||
|
|
||||||
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json" />
|
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
||||||
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
<!-- Targets IE11 -->
|
||||||
<!-- Targets IE11 -->
|
<script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
||||||
<script
|
<script type="text/javascript">
|
||||||
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||||
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
</script>
|
||||||
|
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
||||||
|
<script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script>
|
||||||
|
|
||||||
<title>OHIF Viewer</title>
|
<title>OHIF Viewer</title>
|
||||||
|
|
||||||
<!-- WEB FONTS -->
|
<!-- WEB FONTS -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
<!-- EXTENSIONS -->
|
<!-- EXTENSIONS -->
|
||||||
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.config.extensions = [SomeExtension];
|
||||||
|
</script> -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
|
|
||||||
|
<div id="root"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.config.extensions = [SomeExtension];
|
// Note: This is a client access token so there is no issue with having it publicly available
|
||||||
</script> -->
|
var _rollbarConfig = {
|
||||||
</head>
|
accessToken: "739c64cd39e84592ba062bc29aac9769",
|
||||||
|
captureUncaught: true,
|
||||||
<body>
|
captureUnhandledRejections: true,
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
payload: {
|
||||||
|
environment: "viewer.ohif.org"
|
||||||
<div id="root"></div>
|
}
|
||||||
|
};
|
||||||
<script>
|
// Rollbar Snippet
|
||||||
// Note: This is a client access token so there is no issue with having it publicly available
|
!function (r) { var e = {}; function o(n) { if (e[n]) return e[n].exports; var t = e[n] = { i: n, l: !1, exports: {} }; return r[n].call(t.exports, t, t.exports, o), t.l = !0, t.exports } o.m = r, o.c = e, o.d = function (r, e, n) { o.o(r, e) || Object.defineProperty(r, e, { enumerable: !0, get: n }) }, o.r = function (r) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 }) }, o.t = function (r, e) { if (1 & e && (r = o(r)), 8 & e) return r; if (4 & e && "object" == typeof r && r && r.__esModule) return r; var n = Object.create(null); if (o.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: r }), 2 & e && "string" != typeof r) for (var t in r) o.d(n, t, function (e) { return r[e] }.bind(null, t)); return n }, o.n = function (r) { var e = r && r.__esModule ? function () { return r.default } : function () { return r }; return o.d(e, "a", e), e }, o.o = function (r, e) { return Object.prototype.hasOwnProperty.call(r, e) }, o.p = "", o(o.s = 0) }([function (r, e, o) { var n = o(1), t = o(4); _rollbarConfig = _rollbarConfig || {}, _rollbarConfig.rollbarJsUrl = _rollbarConfig.rollbarJsUrl || "https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.7.1/rollbar.min.js", _rollbarConfig.async = void 0 === _rollbarConfig.async || _rollbarConfig.async; var a = n.setupShim(window, _rollbarConfig), l = t(_rollbarConfig); window.rollbar = n.Rollbar, a.loadFull(window, document, !_rollbarConfig.async, _rollbarConfig, l) }, function (r, e, o) { var n = o(2); function t(r) { return function () { try { return r.apply(this, arguments) } catch (r) { try { console.error("[Rollbar]: Internal error", r) } catch (r) { } } } } var a = 0; function l(r, e) { this.options = r, this._rollbarOldOnError = null; var o = a++; this.shimId = function () { return o }, "undefined" != typeof window && window._rollbarShims && (window._rollbarShims[o] = { handler: e, messages: [] }) } var i = o(3), d = function (r, e) { return new l(r, e) }, c = function (r) { return new i(d, r) }; function s(r) { return t(function () { var e = Array.prototype.slice.call(arguments, 0), o = { shim: this, method: r, args: e, ts: new Date }; window._rollbarShims[this.shimId()].messages.push(o) }) } l.prototype.loadFull = function (r, e, o, n, a) { var l = !1, i = e.createElement("script"), d = e.getElementsByTagName("script")[0], c = d.parentNode; i.crossOrigin = "", i.src = n.rollbarJsUrl, o || (i.async = !0), i.onload = i.onreadystatechange = t(function () { if (!(l || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState)) { i.onload = i.onreadystatechange = null; try { c.removeChild(i) } catch (r) { } l = !0, function () { var e; if (void 0 === r._rollbarDidLoad) { e = new Error("rollbar.js did not load"); for (var o, n, t, l, i = 0; o = r._rollbarShims[i++];)for (o = o.messages || []; n = o.shift();)for (t = n.args || [], i = 0; i < t.length; ++i)if ("function" == typeof (l = t[i])) { l(e); break } } "function" == typeof a && a(e) }() } }), c.insertBefore(i, d) }, l.prototype.wrap = function (r, e, o) { try { var n; if (n = "function" == typeof e ? e : function () { return e || {} }, "function" != typeof r) return r; if (r._isWrap) return r; if (!r._rollbar_wrapped && (r._rollbar_wrapped = function () { o && "function" == typeof o && o.apply(this, arguments); try { return r.apply(this, arguments) } catch (o) { var e = o; throw e && ("string" == typeof e && (e = new String(e)), e._rollbarContext = n() || {}, e._rollbarContext._wrappedSource = r.toString(), window._rollbarWrappedError = e), e } }, r._rollbar_wrapped._isWrap = !0, r.hasOwnProperty)) for (var t in r) r.hasOwnProperty(t) && (r._rollbar_wrapped[t] = r[t]); return r._rollbar_wrapped } catch (e) { return r } }; for (var p = "log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","), u = 0; u < p.length; ++u)l.prototype[p[u]] = s(p[u]); r.exports = { setupShim: function (r, e) { if (r) { var o = e.globalAlias || "Rollbar"; if ("object" == typeof r[o]) return r[o]; r._rollbarShims = {}, r._rollbarWrappedError = null; var a = new c(e); return t(function () { e.captureUncaught && (a._rollbarOldOnError = r.onerror, n.captureUncaughtExceptions(r, a, !0), n.wrapGlobals(r, a, !0)), e.captureUnhandledRejections && n.captureUnhandledRejections(r, a, !0); var t = e.autoInstrument; return !1 !== e.enabled && (void 0 === t || !0 === t || "object" == typeof t && t.network) && r.addEventListener && (r.addEventListener("load", a.captureLoad.bind(a)), r.addEventListener("DOMContentLoaded", a.captureDomContentLoaded.bind(a))), r[o] = a, a })() } }, Rollbar: c } }, function (r, e) { function o(r, e, o) { if (e.hasOwnProperty && e.hasOwnProperty("addEventListener")) { for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim;)n = n._rLine truncated
|
||||||
var _rollbarConfig = {
|
// End Rollbar Snippet
|
||||||
accessToken: "739c64cd39e84592ba062bc29aac9769",
|
</script>
|
||||||
captureUncaught: true,
|
</body>
|
||||||
captureUnhandledRejections: true,
|
|
||||||
payload: {
|
|
||||||
environment: "viewer.ohif.org"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Rollbar Snippet
|
|
||||||
!function (r) { var e = {}; function o(n) { if (e[n]) return e[n].exports; var t = e[n] = { i: n, l: !1, exports: {} }; return r[n].call(t.exports, t, t.exports, o), t.l = !0, t.exports } o.m = r, o.c = e, o.d = function (r, e, n) { o.o(r, e) || Object.defineProperty(r, e, { enumerable: !0, get: n }) }, o.r = function (r) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 }) }, o.t = function (r, e) { if (1 & e && (r = o(r)), 8 & e) return r; if (4 & e && "object" == typeof r && r && r.__esModule) return r; var n = Object.create(null); if (o.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: r }), 2 & e && "string" != typeof r) for (var t in r) o.d(n, t, function (e) { return r[e] }.bind(null, t)); return n }, o.n = function (r) { var e = r && r.__esModule ? function () { return r.default } : function () { return r }; return o.d(e, "a", e), e }, o.o = function (r, e) { return Object.prototype.hasOwnProperty.call(r, e) }, o.p = "", o(o.s = 0) }([function (r, e, o) { var n = o(1), t = o(4); _rollbarConfig = _rollbarConfig || {}, _rollbarConfig.rollbarJsUrl = _rollbarConfig.rollbarJsUrl || "https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.7.1/rollbar.min.js", _rollbarConfig.async = void 0 === _rollbarConfig.async || _rollbarConfig.async; var a = n.setupShim(window, _rollbarConfig), l = t(_rollbarConfig); window.rollbar = n.Rollbar, a.loadFull(window, document, !_rollbarConfig.async, _rollbarConfig, l) }, function (r, e, o) { var n = o(2); function t(r) { return function () { try { return r.apply(this, arguments) } catch (r) { try { console.error("[Rollbar]: Internal error", r) } catch (r) { } } } } var a = 0; function l(r, e) { this.options = r, this._rollbarOldOnError = null; var o = a++; this.shimId = function () { return o }, "undefined" != typeof window && window._rollbarShims && (window._rollbarShims[o] = { handler: e, messages: [] }) } var i = o(3), d = function (r, e) { return new l(r, e) }, c = function (r) { return new i(d, r) }; function s(r) { return t(function () { var e = Array.prototype.slice.call(arguments, 0), o = { shim: this, method: r, args: e, ts: new Date }; window._rollbarShims[this.shimId()].messages.push(o) }) } l.prototype.loadFull = function (r, e, o, n, a) { var l = !1, i = e.createElement("script"), d = e.getElementsByTagName("script")[0], c = d.parentNode; i.crossOrigin = "", i.src = n.rollbarJsUrl, o || (i.async = !0), i.onload = i.onreadystatechange = t(function () { if (!(l || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState)) { i.onload = i.onreadystatechange = null; try { c.removeChild(i) } catch (r) { } l = !0, function () { var e; if (void 0 === r._rollbarDidLoad) { e = new Error("rollbar.js did not load"); for (var o, n, t, l, i = 0; o = r._rollbarShims[i++];)for (o = o.messages || []; n = o.shift();)for (t = n.args || [], i = 0; i < t.length; ++i)if ("function" == typeof (l = t[i])) { l(e); break } } "function" == typeof a && a(e) }() } }), c.insertBefore(i, d) }, l.prototype.wrap = function (r, e, o) { try { var n; if (n = "function" == typeof e ? e : function () { return e || {} }, "function" != typeof r) return r; if (r._isWrap) return r; if (!r._rollbar_wrapped && (r._rollbar_wrapped = function () { o && "function" == typeof o && o.apply(this, arguments); try { return r.apply(this, arguments) } catch (o) { var e = o; throw e && ("string" == typeof e && (e = new String(e)), e._rollbarContext = n() || {}, e._rollbarContext._wrappedSource = r.toString(), window._rollbarWrappedError = e), e } }, r._rollbar_wrapped._isWrap = !0, r.hasOwnProperty)) for (var t in r) r.hasOwnProperty(t) && (r._rollbar_wrapped[t] = r[t]); return r._rollbar_wrapped } catch (e) { return r } }; for (var p = "log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","), u = 0; u < p.length; ++u)l.prototype[p[u]] = s(p[u]); r.exports = { setupShim: function (r, e) { if (r) { var o = e.globalAlias || "Rollbar"; if ("object" == typeof r[o]) return r[o]; r._rollbarShims = {}, r._rollbarWrappedError = null; var a = new c(e); return t(function () { e.captureUncaught && (a._rollbarOldOnError = r.onerror, n.captureUncaughtExceptions(r, a, !0), n.wrapGlobals(r, a, !0)), e.captureUnhandledRejections && n.captureUnhandledRejections(r, a, !0); var t = e.autoInstrument; return !1 !== e.enabled && (void 0 === t || !0 === t || "object" == typeof t && t.network) && r.addEventListener && (r.addEventListener("load", a.captureLoad.bind(a)), r.addEventListener("DOMContentLoaded", a.captureDomContentLoaded.bind(a))), r[o] = a, a })() } }, Rollbar: c } }, function (r, e) { function o(r, e, o) { if (e.hasOwnProperty && e.hasOwnProperty("addEventListener")) { for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim;)n = n._rolLine truncated
|
|
||||||
// End Rollbar Snippet
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
// https://developers.google.com/web/tools/workbox/modules/workbox-window
|
||||||
|
// All major browsers that support service worker also support native JavaScript
|
||||||
|
// modules, so it's perfectly fine to serve this code to any browsers
|
||||||
|
// (older browsers will just ignore it)
|
||||||
|
//
|
||||||
|
import { Workbox } from 'https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-window.prod.mjs';
|
||||||
|
|
||||||
|
var supportsServiceWorker = 'serviceWorker' in navigator;
|
||||||
|
var isNotLocalDevelopment =
|
||||||
|
['localhost', '127'].indexOf(location.hostname) === -1;
|
||||||
|
|
||||||
|
if (supportsServiceWorker && isNotLocalDevelopment) {
|
||||||
|
const swFileLocation = (window.PUBLIC_URL || '/') + 'sw.js';
|
||||||
|
const wb = new Workbox(swFileLocation);
|
||||||
|
|
||||||
|
// Add an event listener to detect when the registered
|
||||||
|
// service worker has installed but is waiting to activate.
|
||||||
|
wb.addEventListener('waiting', event => {
|
||||||
|
// customize the UI prompt accordingly.
|
||||||
|
const isFirstTimeUpdatedServiceWorkerIsWaiting =
|
||||||
|
event.wasWaitingBeforeRegister === false;
|
||||||
|
console.log(
|
||||||
|
'isFirstTimeUpdatedServiceWorkerIsWaiting',
|
||||||
|
isFirstTimeUpdatedServiceWorkerIsWaiting
|
||||||
|
);
|
||||||
|
|
||||||
|
// Assumes your app has some sort of prompt UI element
|
||||||
|
// that a user can either accept or reject.
|
||||||
|
// const prompt = createUIPrompt({
|
||||||
|
// onAccept: async () => {
|
||||||
|
// Assuming the user accepted the update, set up a listener
|
||||||
|
// that will reload the page as soon as the previously waiting
|
||||||
|
// service worker has taken control.
|
||||||
|
wb.addEventListener('controlling', event => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Send a message telling the service worker to skip waiting.
|
||||||
|
// This will trigger the `controlling` event handler above.
|
||||||
|
// Note: for this to work, you have to add a message
|
||||||
|
// listener in your service worker. See below.
|
||||||
|
wb.messageSW({ type: 'SKIP_WAITING' });
|
||||||
|
// },
|
||||||
|
|
||||||
|
// onReject: () => {
|
||||||
|
// prompt.dismiss();
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
|
wb.register();
|
||||||
|
}
|
||||||
@@ -1,8 +1,59 @@
|
|||||||
{
|
{
|
||||||
"short_name": "react-cornerstone-viewport",
|
"name": "OHIF Viewer",
|
||||||
"name": "react-cornerstone-viewport",
|
"short_name": "Viewer",
|
||||||
|
"description": "OHIF Viewer",
|
||||||
|
"dir": "auto",
|
||||||
|
"lang": "en-US",
|
||||||
|
"orientation": "any",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-36x36.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-48x48.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-256x256.png",
|
||||||
|
"sizes": "256x256",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
"start_url": "./index.html",
|
"start_url": "./index.html",
|
||||||
|
"background_color": "#000000",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"theme_color": "#000000",
|
"theme_color": "#20a5d6"
|
||||||
"background_color": "#ffffff"
|
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ function getAllTools() {
|
|||||||
function getMeasurementText(measurementData = {}) {
|
function getMeasurementText(measurementData = {}) {
|
||||||
const defaultText = '...';
|
const defaultText = '...';
|
||||||
const { location = '', description = '' } = measurementData;
|
const { location = '', description = '' } = measurementData;
|
||||||
const result = location + (description ? `(${description})` : '');
|
const result = location + (description ? ` (${description})` : '');
|
||||||
|
|
||||||
return result || defaultText;
|
return result || defaultText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ function getToolLabellingFlowCallback(store) {
|
|||||||
if (location) {
|
if (location) {
|
||||||
measurementData.location = location;
|
measurementData.location = location;
|
||||||
}
|
}
|
||||||
if (description) {
|
|
||||||
measurementData.description = description;
|
measurementData.description = description || '';
|
||||||
}
|
|
||||||
if (response) {
|
if (response) {
|
||||||
measurementData.response = response;
|
measurementData.response = response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ export default class LabellingFlow extends Component {
|
|||||||
ref={this.descriptionInput}
|
ref={this.descriptionInput}
|
||||||
defaultValue={description || ''}
|
defaultValue={description || ''}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
onKeyPress={this.handleKeyPress}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -223,6 +224,12 @@ export default class LabellingFlow extends Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleKeyPress = e => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
this.descriptionSave();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
descriptionSave = () => {
|
descriptionSave = () => {
|
||||||
const description = this.descriptionInput.current.value;
|
const description = this.descriptionInput.current.value;
|
||||||
this.props.updateLabelling({ description });
|
this.props.updateLabelling({ description });
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const ViewportGrid = function(props) {
|
|||||||
|
|
||||||
ViewportGrid.propTypes = {
|
ViewportGrid.propTypes = {
|
||||||
viewportData: PropTypes.array.isRequired,
|
viewportData: PropTypes.array.isRequired,
|
||||||
supportsDragAndDrop: PropTypes.bool.isRequired,
|
supportsDrop: PropTypes.bool.isRequired,
|
||||||
activeViewportIndex: PropTypes.number.isRequired,
|
activeViewportIndex: PropTypes.number.isRequired,
|
||||||
layout: PropTypes.object.isRequired,
|
layout: PropTypes.object.isRequired,
|
||||||
availablePlugins: PropTypes.object.isRequired,
|
availablePlugins: PropTypes.object.isRequired,
|
||||||
@@ -127,7 +127,7 @@ ViewportGrid.defaultProps = {
|
|||||||
viewports: [{}],
|
viewports: [{}],
|
||||||
},
|
},
|
||||||
activeViewportIndex: 0,
|
activeViewportIndex: 0,
|
||||||
supportsDragAndDrop: true,
|
supportsDrop: true,
|
||||||
availablePlugins: {
|
availablePlugins: {
|
||||||
DefaultViewport,
|
DefaultViewport,
|
||||||
},
|
},
|
||||||
|
|||||||