From c3e33b7e0bcc26c091ba3cb4b009a504386b8830 Mon Sep 17 00:00:00 2001 From: HaneenT Date: Mon, 18 Dec 2023 10:00:12 -0500 Subject: [PATCH] KPMP-4420: added feature switch to hide row in sv participant report --- src/helpers/Api.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/helpers/Api.js b/src/helpers/Api.js index 83ab4d68..6dd2a6ea 100644 --- a/src/helpers/Api.js +++ b/src/helpers/Api.js @@ -59,7 +59,18 @@ export const fetchParticipantExperimentCounts = async (redcapId) => { }); if (response && response.data && response.data.getDataTypeInformationByParticipant) { - return response.data.getDataTypeInformationByParticipant; + if (process.env.REACT_APP_PROTEOMICS === "off") { + let explorerDataTypes = response.data.getDataTypeInformationByParticipant?.explorerDataTypes.filter((data) => { + return data?.dataType !== "Regional proteomics" + }) + return { + "spatialViewerDataTypes": response.data.getDataTypeInformationByParticipant.spatialViewerDataTypes, + "explorerDataTypes": explorerDataTypes + } + } + else { + return response.data.getDataTypeInformationByParticipant; + } } else { store.dispatch(sendMessageToBackend("Could not retrieve getDataTypeInformationByParticipant: " + response.error)); }