diff --git a/src/App.js b/src/App.js index bd62df15..d8ce4d2e 100644 --- a/src/App.js +++ b/src/App.js @@ -79,7 +79,10 @@ class App extends Component { - + { + process.env.REACT_APP_PROTEOMICS !== "off" && + + } diff --git a/src/components/Home/SamplesByDataTypeTable.js b/src/components/Home/SamplesByDataTypeTable.js index e4854b4b..4ec41de2 100644 --- a/src/components/Home/SamplesByDataTypeTable.js +++ b/src/components/Home/SamplesByDataTypeTable.js @@ -18,7 +18,7 @@ class SamplesByDataTypeTable extends Component { async componentDidMount(){ let spatialSummary = await fetchSummaryData("spatialViewerSummary"); - spatialSummary = spatialSummary.sort(this.compare) + spatialSummary = spatialSummary.slice().sort(this.compare) spatialSummary = spatialSummary.filter(availableDataVisibilityFilter) let explorerSummary = await fetchDataTypeSummaryInformation(); diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 2f081d10..bf8ef341 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -156,6 +156,11 @@ export const fetchDataTypeSummaryInformation = async (fetchPolicy = 'no-cache') fetchPolicy: fetchPolicy }); if (response.data && response.data.getDataTypeSummaryInformation) { + if (process.env.REACT_APP_PROTEOMICS === "off") { + return response.data.getDataTypeSummaryInformation.filter((data) => { + return data?.dataTypeShort !== "rp" + }) + } return response.data.getDataTypeSummaryInformation; } else { console.log('response.error',response.error) @@ -472,6 +477,11 @@ export const fetchSummaryData = async (dataType) => { }); if (response.data && response.data.getSummaryData) { + if (process.env.REACT_APP_PROTEOMICS === "off") { + return response.data.getSummaryData.filter((data) => { + return data?.dataTypeShort !== "rp" + }) + } return response.data.getSummaryData; } else { store.dispatch(sendMessageToBackend("Could not retrieve summary: " + response.error)); @@ -520,6 +530,15 @@ export const fetchAtlasSummaryRows = async () => { fetchPolicy: 'cache-first' }); if (response.data && response.data.getAtlasSummaryRows) { + if (process.env.REACT_APP_PROTEOMICS === "off") { + let summaryRows = response.data.getAtlasSummaryRows.summaryRows.filter((data) => { + return data?.omicsType !== "Regional Proteomics" + }) + return { + "totalFiles": response.data.getAtlasSummaryRows.totalFiles, + "summaryRows": summaryRows + } + } return response.data.getAtlasSummaryRows; }else { store.dispatch(sendMessageToBackend("Could not retrieve file counts: " + response.error)); diff --git a/src/helpers/Utils.js b/src/helpers/Utils.js index 2a2cb213..ecda1a27 100644 --- a/src/helpers/Utils.js +++ b/src/helpers/Utils.js @@ -113,6 +113,9 @@ export const getAllDataTypeOptions = () => { isDisabled: false } ]; + if (process.env.REACT_APP_PROTEOMICS === "off") { + return options.filter((el) => { return el.value !== "rp" }); + } return options; }; @@ -141,6 +144,9 @@ export const getDataTypeOptions = async (geneSymbol, cluster) => { isDisabled: !dataTypes.includes("rp") } ]; + if (process.env.REACT_APP_PROTEOMICS === "off") { + return options.filter((el) => { return el.value !== "rp" }); + } return options; }); return options;