From dca4d22c804be2ca211fce1a4ff271c3ec31f258 Mon Sep 17 00:00:00 2001 From: Greg Rushton Date: Wed, 13 Sep 2023 11:14:41 -0400 Subject: [PATCH] show data use codes --- src/pages/data_submitter_console/DataSubmitterConsole.jsx | 1 - .../data_submitter_console/DataSubmitterDatasetsTable.jsx | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/data_submitter_console/DataSubmitterConsole.jsx b/src/pages/data_submitter_console/DataSubmitterConsole.jsx index 12777c03a..dbb7bf418 100644 --- a/src/pages/data_submitter_console/DataSubmitterConsole.jsx +++ b/src/pages/data_submitter_console/DataSubmitterConsole.jsx @@ -39,7 +39,6 @@ export default function DataSubmitterConsole() { } } }; - setIsLoading(true); try { const myDatasets = await DataSet.searchDatasetIndex(query); diff --git a/src/pages/data_submitter_console/DataSubmitterDatasetsTable.jsx b/src/pages/data_submitter_console/DataSubmitterDatasetsTable.jsx index 83e4150d5..ff861234d 100644 --- a/src/pages/data_submitter_console/DataSubmitterDatasetsTable.jsx +++ b/src/pages/data_submitter_console/DataSubmitterDatasetsTable.jsx @@ -3,7 +3,7 @@ import {useCallback, useEffect, useState} from 'react'; import {Notifications} from '../../libs/utils'; import loadingIndicator from '../../images/loading-indicator.svg'; import SortableTable from '../../components/sortable_table/SortableTable'; -import {isNil} from 'lodash/fp'; +import {concat, isNil, join} from 'lodash/fp'; export default function DataSubmitterDatasetsTable(props) { @@ -71,13 +71,15 @@ export default function DataSubmitterDatasetsTable(props) { const redrawRows = useCallback(() => { const rows = datasets.map((dataset) => { const status = isNil(dataset.dacApproval) ? 'Pending' : (dataset.dacApproval ? 'Accepted' : 'Rejected'); + const primaryCodes = dataset.dataUse?.primary.map(du => du.code); + const secondaryCodes = dataset.dataUse?.secondary.map(du => du.code); return { datasetIdentifier: dataset.datasetIdentifier, datasetName: dataset.datasetName, dataSubmitter: dataset?.createUserDisplayName, datasetCustodians: '', dac: dataset.dacName, - dataUse: '', + dataUse: join(', ')(concat(primaryCodes)(secondaryCodes)), status: status, actions: '' };