diff --git a/platform/viewer/src/googleCloud/DatasetPicker.js b/platform/viewer/src/googleCloud/DatasetPicker.js
index bfa9cf891..120f021c0 100644
--- a/platform/viewer/src/googleCloud/DatasetPicker.js
+++ b/platform/viewer/src/googleCloud/DatasetPicker.js
@@ -9,7 +9,7 @@ export default class DatasetPicker extends Component {
error: null,
loading: true,
datasets: [],
- filterStr: ""
+ filterStr: '',
};
static propTypes = {
@@ -42,22 +42,23 @@ export default class DatasetPicker extends Component {
}
render() {
- const { datasets, loading, error, filterStr } = this.state;
+ const { datasets, loading, error, filterStr } = this.state;
const { onSelect } = this.props;
return (
- this.setState({ filterStr: e.target.value }) }
+ this.setState({ filterStr: e.target.value })}
+ />
+
-
);
}
diff --git a/platform/viewer/src/googleCloud/DatasetSelector.js b/platform/viewer/src/googleCloud/DatasetSelector.js
index 724a7a33f..f1179c32b 100644
--- a/platform/viewer/src/googleCloud/DatasetSelector.js
+++ b/platform/viewer/src/googleCloud/DatasetSelector.js
@@ -122,10 +122,7 @@ class DatasetSelector extends Component {
<>
{projectBreadcrumbs}
{!project && (
-
+
)}
{project && !location && (
diff --git a/platform/viewer/src/googleCloud/DicomStorePicker.js b/platform/viewer/src/googleCloud/DicomStorePicker.js
index 34a6e1c53..7944d1b93 100644
--- a/platform/viewer/src/googleCloud/DicomStorePicker.js
+++ b/platform/viewer/src/googleCloud/DicomStorePicker.js
@@ -10,13 +10,13 @@ export default class DicomStorePicker extends Component {
loading: true,
stores: [],
locations: [],
- filterStr: ""
+ filterStr: '',
};
static propTypes = {
dataset: PropTypes.object,
onSelect: PropTypes.func,
- accessToken: PropTypes.string.isRequired
+ accessToken: PropTypes.string.isRequired,
};
async componentDidMount() {
@@ -44,10 +44,11 @@ export default class DicomStorePicker extends Component {
return (
-
this.setState({ filterStr: e.target.value }) }
+
this.setState({ filterStr: e.target.value })}
/>
{
+ const handleEvent = data => {
+ const servers = GoogleCloudUtilServers.getServers(data, data.dicomstore);
+ setServers(servers);
+
+ // Force auto close
+ UIModalService.hide();
+ onClose();
+ };
+
+ if (UIModalService) {
+ UIModalService.show({
+ content: DatasetSelector,
+ title: t('Google Cloud Healthcare API'),
+ contentProps: {
+ setServers: handleEvent,
+ user,
+ url,
+ },
+ });
+ }
};
- static defaultProps = {
- isOpen: false,
- };
-
- handleEvent = data => {
- const servers = GoogleCloudUtilServers.getServers(data, data.dicomstore);
- this.props.setServers(servers);
- // Force auto close
- this.props.onClose();
- };
-
- render() {
- return (
-
-
-
- {this.props.t('Google Cloud Healthcare API')}
-
-
-
-
-
-
- );
- }
+ return (
+ {isOpen && showDicomStorePickerModal()}
+ );
}
+DicomStorePickerModal.propTypes = {
+ isOpen: PropTypes.bool.isRequired,
+ setServers: PropTypes.func.isRequired,
+ onClose: PropTypes.func,
+ user: PropTypes.object.isRequired,
+ url: PropTypes.string,
+};
+
export default withTranslation('Common')(DicomStorePickerModal);
diff --git a/platform/viewer/src/googleCloud/LocationPicker.js b/platform/viewer/src/googleCloud/LocationPicker.js
index b61368c5e..0766d5c5f 100644
--- a/platform/viewer/src/googleCloud/LocationPicker.js
+++ b/platform/viewer/src/googleCloud/LocationPicker.js
@@ -9,7 +9,7 @@ export default class LocationPicker extends Component {
error: null,
loading: true,
locations: [],
- filterStr: "",
+ filterStr: '',
};
static propTypes = {
@@ -42,10 +42,11 @@ export default class LocationPicker extends Component {
const { onSelect } = this.props;
return (