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

[DT-962] Removes links from the access type column #2713

Merged
merged 1 commit into from
Nov 6, 2024
Merged
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
29 changes: 10 additions & 19 deletions src/components/data_search/DatasetSearchTableConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,25 +327,16 @@ export const makeDatasetTableHeader = (datasets: DatasetTerm[], selected: number
label: 'Access Type',
sortable: true,
cellStyle: makeHeaderStyle(cellWidths.accessType),
cellDataFn: (dataset: DatasetTerm) => {
let accessType;
if (dataset.accessManagement === 'external') {
accessType = dataset.url ?
<Link href={dataset.url}>External to DUOS</Link> : 'External to DUOS';
} else if (dataset.accessManagement === 'open') {
accessType = dataset.url ? <Link href={dataset.url}>Open Access</Link> : 'Open Access';
} else {
accessType = dataset.dac?.dacEmail ? <Link
href={'mailto:' + dataset.dac.dacEmail}>{dataset.dac?.dacName}</Link> : dataset.dac?.dacName;
}
return {
data: accessType,
value: dataset.accessManagement,
id: `${dataset.datasetId}-participant-count`,
style: makeRowStyle(cellWidths.accessType),
label: `Access Type for dataset ${dataset.datasetId}: ${dataset.accessManagement}`
};
}
cellDataFn: (dataset: DatasetTerm) => ({
data: dataset.accessManagement === 'external' ?
'External to DUOS' :
dataset.accessManagement === 'open' ?
'Open Access' : dataset.dac?.dacName,
value: dataset.accessManagement,
Comment on lines +331 to +335
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between data and value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data is what is shown to the user, value is the underlying content of the selection.

id: `${dataset.datasetId}-participant-count`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the id is named "participant-count" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a copy-paste from a previous column. We should probably give this a unique name.

style: makeRowStyle(cellWidths.accessType),
label: `Access Type for dataset ${dataset.datasetId}: ${dataset.accessManagement}`
})
},
{
label: 'Data Type',
Expand Down
Loading