From 72bb372d5721e3973970e4215fcab4f1bdef44b5 Mon Sep 17 00:00:00 2001 From: Marjolaine Bodin Date: Fri, 18 Aug 2023 11:26:35 +0200 Subject: [PATCH] icat/E-DataPortal#696 improve processed and raw display --- .../Investigation/DatasetVolumeStatisticsColumn.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Investigation/DatasetVolumeStatisticsColumn.js b/src/components/Investigation/DatasetVolumeStatisticsColumn.js index 3947f376..1f4f9bc5 100644 --- a/src/components/Investigation/DatasetVolumeStatisticsColumn.js +++ b/src/components/Investigation/DatasetVolumeStatisticsColumn.js @@ -68,7 +68,15 @@ function DatasetVolumeStatisticsColumn(props) { const regex = new RegExp(/__(.*)DatasetCount/g); for (const [name, value] of Object.entries(parameters)) { if (name.match(regex) && !skippedParameters.includes(name)) { - const clearName = name.replace('__', '').replace('DatasetCount', ''); + let clearName = name.replace('__', '').replace('DatasetCount', ''); + const acquisitionRegex = new RegExp(/(.*)Acquisition/g); + if (clearName.match(acquisitionRegex)) { + clearName = `Raw ${clearName.replace('Acquisition', '')}`; + } + const processedRegex = new RegExp(/(.*)Processed/g); + if (clearName.match(processedRegex)) { + clearName = `Processed ${clearName.replace('Processed', '')}`; + } const obj = JSON.parse(value); const values = []; for (const [type, nbDatasets] of Object.entries(obj)) { -- GitLab