refactor(GoogleCloud): Clean up some of the Healthcare API Adapter components (#641)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2019-07-10 14:54:27 +02:00
1 parent 4a09f33446
commit 091cab49e0
21 files changed
+613 -438

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Modal from 'react-bootstrap-modal';
import DatasetSelector from './DatasetSelector';
import './googleCloud.css';
import { withTranslation } from 'react-i18next';
class DicomStorePickerModal extends Component {
static propTypes = {
url: PropTypes.string,
oidcStorageKey: PropTypes.string.isRequired,
setServers: PropTypes.func.isRequired,
isOpen: PropTypes.bool.isRequired,
onClose: PropTypes.func,
};
static defaultProps = {
isOpen: false,
};
handleEvent = data => {
const servers = [
{
name: data.dicomStore,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
qidoSupportsIncludeField: false,
type: 'dicomWeb',
qidoRoot: data.qidoRoot,
wadoRoot: data.wadoRoot,
wadoUriRoot: data.wadoUriRoot,
active: true,
},
];
this.props.setServers(servers);
};
render() {
return (
<Modal
show={this.props.isOpen}
onHide={this.props.onClose}
aria-labelledby="ModalHeader"
className="modal fade themed in"
backdrop={false}
size={'md'}
keyboard={true}
>
<Modal.Header closeButton>
<Modal.Title>
{this.props.t('Google Cloud Healthcare API')}
</Modal.Title>
</Modal.Header>
<Modal.Body>
<DatasetSelector
setServers={this.handleEvent}
oidcKey={this.props.oidcStorageKey}
url={this.props.url}
/>
</Modal.Body>
</Modal>
);
}
}
export default withTranslation('Common')(DicomStorePickerModal);