feat(DicomUploader): Make DICOM Uploader work with all DICOMWeb servers (#717)
* feat(DicomUploader): Make DICOM Uploader work with all DICOMWeb servers * Bump viewerbase version
This commit is contained in:
1 parent
903c41d26f
commit
da318c9c8c
13 files changed
+85
-105
No files matched your search
@@ -24,7 +24,14 @@ function getFilters({ search }) {
|
||||
function StudyListRouting({ location }) {
|
||||
const filters = location ? getFilters(location) : undefined;
|
||||
|
||||
return <ConnectedStudyList filters={filters} />;
|
||||
let studyListFunctionsEnabled = false;
|
||||
if (window.config && window.config.studyListFunctionsEnabled) {
|
||||
studyListFunctionsEnabled = window.config.studyListFunctionsEnabled;
|
||||
}
|
||||
return <ConnectedStudyList
|
||||
filters={filters}
|
||||
studyListFunctionsEnabled={studyListFunctionsEnabled}
|
||||
/>;
|
||||
}
|
||||
|
||||
StudyListRouting.propTypes = {
|
||||
|
||||
@@ -27,6 +27,11 @@ class StudyListWithData extends Component {
|
||||
server: PropTypes.object,
|
||||
user: PropTypes.object,
|
||||
history: PropTypes.object,
|
||||
studyListFunctionsEnabled: PropTypes.bool
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
studyListFunctionsEnabled: true
|
||||
};
|
||||
|
||||
static rowsPerPage = 25;
|
||||
@@ -147,7 +152,7 @@ class StudyListWithData extends Component {
|
||||
};
|
||||
|
||||
onImport = () => {
|
||||
//console.log('onImport');
|
||||
this.openModal('DicomFilesUploader')
|
||||
};
|
||||
|
||||
openModal = modalComponentId => {
|
||||
@@ -176,9 +181,6 @@ class StudyListWithData extends Component {
|
||||
|
||||
render() {
|
||||
const onDrop = async acceptedFiles => {
|
||||
// Do something with the files
|
||||
console.warn(acceptedFiles);
|
||||
|
||||
try {
|
||||
const studies = await filesToStudies(acceptedFiles);
|
||||
|
||||
@@ -200,16 +202,10 @@ class StudyListWithData extends Component {
|
||||
// TODO: This should probably be a prop
|
||||
if (window.config.enableGoogleCloudAdapter) {
|
||||
healthCareApiWindows = (
|
||||
<>
|
||||
<ConnectedDicomStorePicker
|
||||
isOpen={this.state.modalComponentId === 'DicomStorePicker'}
|
||||
onClose={this.closeModals}
|
||||
/>
|
||||
<ConnectedDicomFilesUploader
|
||||
isOpen={this.state.modalComponentId === 'DicomFilesUploader'}
|
||||
onClose={this.closeModals}
|
||||
/>
|
||||
</>
|
||||
<ConnectedDicomStorePicker
|
||||
isOpen={this.state.modalComponentId === 'DicomStorePicker'}
|
||||
onClose={this.closeModals}
|
||||
/>
|
||||
);
|
||||
|
||||
healthCareApiButtons = (
|
||||
@@ -223,24 +219,16 @@ class StudyListWithData extends Component {
|
||||
>
|
||||
{this.props.t('Change DICOM Store')}
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
onClick={() => this.openModal('DicomFilesUploader')}
|
||||
>
|
||||
{this.props.t('Upload Studies')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
console.warn(this.state.studies);
|
||||
|
||||
const studyList = (
|
||||
<div className="paginationArea">
|
||||
{this.state.studies ? (
|
||||
<StudyList
|
||||
studies={this.state.studies}
|
||||
studyListFunctionsEnabled={false}
|
||||
studyListFunctionsEnabled={this.props.studyListFunctionsEnabled}
|
||||
onImport={this.onImport}
|
||||
onSelectItem={this.onSelectItem}
|
||||
pageSize={this.rowsPerPage}
|
||||
@@ -250,6 +238,10 @@ class StudyListWithData extends Component {
|
||||
}
|
||||
onSearch={this.onSearch}
|
||||
>
|
||||
{this.props.studyListFunctionsEnabled ? <ConnectedDicomFilesUploader
|
||||
isOpen={this.state.modalComponentId === 'DicomFilesUploader'}
|
||||
onClose={this.closeModals}
|
||||
/> : null}
|
||||
{healthCareApiButtons}
|
||||
{healthCareApiWindows}
|
||||
</StudyList>
|
||||
|
||||
Reference in new issue
Block a user