Skip to content

Commit

Permalink
Merge pull request #426 from KPMP/KPMP-4677_fix_navbar_link
Browse files Browse the repository at this point in the history
KPMP-4677: Fix navbar explorer links
  • Loading branch information
zwright authored Sep 12, 2023
2 parents 9e54ef8 + 8a8da4f commit 665fdb6
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/actions/Concepts/conceptActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export const setSelectedConceptAndRedirect = (concept, props) => {
dispatch(setSelectedConcept(concept));
switch (concept.type) {
case "cell_type":
props.history.push('/explorer/celltypesummary');
window.open('/explorer/celltypesummary', '_self');
break;
case "gene":
props.history.push('/explorer/genesummary');
window.open('/explorer/genesummary', '_self');
break;
default:
props.history.push('/explorer');
window.open('/explorer', '_self');
}
}
};
8 changes: 4 additions & 4 deletions src/actions/DataType/dataTypeActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export const setDataTypeAndRedirect = (dataType, props) => {
switch (dataType) {
case "sn":
dispatch(setDataType(dataType));
props.history.push('/explorer/dataviz');
window.open('/explorer/dataviz', '_self');
break;
case "sc":
dispatch(setDataType(dataType));
props.history.push('/explorer/dataviz');
window.open('/explorer/dataviz', '_self');
break;
case "rt":
dispatch(setDataType(dataType));
props.history.push('/explorer/regionalviz');
window.open('/explorer/regionalviz', '_self');
break;
case "wsi":
window.open('/spatial-viewer/?size=n_1000_n&filters%5B0%5D%5Bfield%5D=datatype&filters%5B0%5D%5Bvalues%5D%5B0%5D=Light%20Microscopic%20Whole%20Slide%20Images&filters%5B0%5D%5Btype%5D=any', '_self')
Expand All @@ -60,7 +60,7 @@ export const setDataTypeAndRedirect = (dataType, props) => {
window.open('https://metaspace2020.eu/datasets?prj=8f102fc4-62a8-11ec-89bf-bba413a122a2&q=_glyc', '_blank');
break
default:
props.history.push('/explorer/');
window.open('/explorer/', '_self');
}
}
}
4 changes: 2 additions & 2 deletions src/components/DataViz/DataTypeSelectorContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const mapDispatchToProps = (dispatch, props) =>
setDataType(dataType) {
dispatch(setDataType(dataType));
if (dataType === 'rt') {
dispatch((dispatch) => props.history.push("/explorer/regionalviz"));
dispatch((dispatch) => window.open("/explorer/regionalviz", "_self"));
} else if (dataType === 'sc' || dataType === 'sn') {
dispatch((dispatch) => props.history.push("/explorer/dataViz"));
dispatch((dispatch) => window.open("/explorer/dataViz", "_self"));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/DataViz/RNASeqViz.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RNASeqViz extends Component {
if (queryParam && queryParam.dataType) {
props.resetState();
props.setDataType(queryParam.dataType);
props.history.push(props.location.pathname);
window.open(props.location.pathname, '_self');
this.setState({isLoading: false, isLoadingUmap: false})
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/DataViz/RegionalViz.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RegionalViz extends Component {
if (queryParam && queryParam.dataType) {
this.props.resetState();
props.setDataType('rt');
props.history.push(props.location.pathname);
window.open(props.location.pathname, '_self');
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/ExpressionTables/DiffexByClusterContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const mapDispatchToProps = (dispatch, props) =>
setGene(gene, dataType) {
dispatch(setGene(gene));
if (dataType === 'rt') {
dispatch((dispatch) => props.history.push("/explorer/regionalviz"));
dispatch((dispatch) => window.open("/explorer/regionalviz", '_self'));
} else {
dispatch((dispatch) => props.history.push("/explorer/dataviz"));
dispatch((dispatch) => window.open("/explorer/dataviz", '_self'));
}
},
setDataType(dataType) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Summary/CellTypeSummary.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Container, Row, Col } from 'reactstrap';
import { Grid, TableFixedColumns, TableColumnResizing, TableHeaderRow, Table} from '@devexpress/dx-react-grid-bootstrap4';
import { Grid, TableColumnResizing, TableHeaderRow, Table} from '@devexpress/dx-react-grid-bootstrap4';
import ConceptSelectFullWidth from '../ConceptSelect/ConceptSelectFullWidth';
import { fetchClusterHierarchy } from '../../helpers/ApolloClient';
import { Spinner } from "reactstrap";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Summary/CellTypeSummaryContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch, props) =>
dispatch(setDataType(dataType));
dispatch(setTissueType("all"));
dispatch(setCluster(cluster));
dispatch((dispatch) => props.history.push("/explorer/diffex"));
dispatch((dispatch) => window.open("/explorer/diffex", '_self'));
}
});

Expand Down

0 comments on commit 665fdb6

Please sign in to comment.