diff --git a/src/components/dac_dataset_table/DACDatasetTableCellData.jsx b/src/components/dac_dataset_table/DACDatasetTableCellData.jsx index 5518aa6e0..cdf6d0421 100644 --- a/src/components/dac_dataset_table/DACDatasetTableCellData.jsx +++ b/src/components/dac_dataset_table/DACDatasetTableCellData.jsx @@ -71,7 +71,7 @@ export function dataCustodianCellData({dataset, label = 'dataCustodianCellData'} }; } -export function dataUseCellData({dataset, label = 'dataUseCellData'}) { +export function dataUseCellData({dataset, label = 'dataUseCellData', divClass = style['cell-data'], spanClass = style['data-use'], cellWidth = styles.cellWidths.dataUse, tooltipPlace = 'right'}) { const codesAndDescriptions = dataset.dataUse?.primary ? dataset.dataUse.primary.map((dataUse) => { if (dataUse.code === 'OTHER') { return {'code': `OTH1`, 'description': dataUse.description}; @@ -93,10 +93,10 @@ export function dataUseCellData({dataset, label = 'dataUseCellData'}) { } const codeList = codesAndDescriptions.map(du => du.code); const display = -
- {codeList.join(', ')} +
+ {codeList.join(', ')}
    {codesAndDescriptions.map((translation, index) => { @@ -108,7 +108,7 @@ export function dataUseCellData({dataset, label = 'dataUseCellData'}) { data: display, value: codeList.join(', '), id: `data-use-cell-data-${dataset.datasetId}`, - cellStyle: {width: styles.cellWidths.dataUse}, + cellStyle: {width: cellWidth}, label }; } diff --git a/src/components/data_search/DatasetSearch.css b/src/components/data_search/DatasetSearch.css new file mode 100644 index 000000000..2e1db9537 --- /dev/null +++ b/src/components/data_search/DatasetSearch.css @@ -0,0 +1,5 @@ +.data-use-cell { + overflow: hidden; + text-overflow: ellipsis; + text-wrap: nowrap; +} \ No newline at end of file diff --git a/src/components/data_search/DatasetSearchTableConstants.tsx b/src/components/data_search/DatasetSearchTableConstants.tsx index 92768fdd7..1f186491f 100644 --- a/src/components/data_search/DatasetSearchTableConstants.tsx +++ b/src/components/data_search/DatasetSearchTableConstants.tsx @@ -6,6 +6,8 @@ import {OverflowTooltip, tooltipStyle} from '../Tooltips'; import {SnapshotSummaryModel} from 'src/types/tdrModel'; import DatasetExportButton from './DatasetExportButton'; import ReactTooltip from 'react-tooltip'; +import {dataUseCellData} from '../dac_dataset_table/DACDatasetTableCellData'; +import './DatasetSearch.css'; export interface DatasetSearchTableTab { key: string; @@ -230,7 +232,7 @@ export const makeDatasetTableHeader = (datasets: DatasetTerm[], selected: number dataType: string; donorSize: string; dataLocation: string; - dac: string; + dataUse: string; exportToTerra: number; } const cellWidths: CellWidths = { @@ -243,7 +245,7 @@ export const makeDatasetTableHeader = (datasets: DatasetTerm[], selected: number dataType: '15%', donorSize: '7%', dataLocation: '13%', - dac: '10%', + dataUse: '10%', exportToTerra: 100, }; const isSelectable = (dataset: DatasetTerm) => dataset.accessManagement != 'open' && dataset.accessManagement != 'external'; @@ -402,18 +404,18 @@ export const makeDatasetTableHeader = (datasets: DatasetTerm[], selected: number } }, { - label: 'DAC', + label: 'Data Use', sortable: true, - cellStyle: makeHeaderStyle(cellWidths.dac), - cellDataFn: (dataset: DatasetTerm) => ({ - data: - {dataset.dac?.dacName} - , - value: dataset.dac?.dacName, - id: `${dataset.datasetId}-dac`, - style: makeRowStyle(cellWidths.dac), - label: `DAC for dataset ${dataset.datasetId}: ${dataset.dac?.dacName}` - }) + cellStyle: makeHeaderStyle(cellWidths.dataUse), + cellDataFn: (dataset: DatasetTerm) => { + return dataUseCellData({ + dataset, + label: `Data Use for dataset ${dataset.datasetId}: ${dataset.dataUse}`, + divClass: ['data-use-cell'], + spanClass: [], + cellWidth: cellWidths.dataUse, + tooltipPlace: 'top'}); + } }, { label: 'Export to Terra',