Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPMP-4417: Added feature switch #447

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ class App extends Component {
<Route exact path='/explorer/dataViz' component={RNASeqVizContainer} store={store} />
<Route exact path='/explorer/regionalviz' component={RegionalVizContainer} store={store} />
<Route exact path='/explorer/diffex' component={DiffexByClusterContainer} store={store} />
<Route exact path='/explorer/regionalpro' component={RegionalProteomicsContainer} store={store}/>
{
process.env.REACT_APP_PROTEOMICS !== "off" &&
<Route exact path='/explorer/regionalpro' component={RegionalProteomicsContainer} store={store}/>
}
<Route exact path='/oops' component={Oops} />
<PrivateUmapRoute exact path='/explorer/dataViz/umap' component={UMAPContainer} store={store} />
<Route path='*' component={NotFoundPage} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/SamplesByDataTypeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
19 changes: 19 additions & 0 deletions src/helpers/ApolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
6 changes: 6 additions & 0 deletions src/helpers/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
Expand Down
Loading