-
Notifications
You must be signed in to change notification settings - Fork 4
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-788] Footer: Apply for Access to selected Studies and Datasets #2723
Conversation
# Conflicts: # src/components/data_search/DatasetSearchTable.jsx
LGTM - thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks for including the video!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One early suggestion:
border: '1px solid #DEDEDE', | ||
alignItems: 'center' | ||
}}> | ||
{selectedDatasets.length > 1 && selectedStudies.length > 1 && (<div style={{paddingRight: 15}}> {selectedDatasets.length} Datasets selected from {selectedStudies.length} Studies </div>)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like:
// at top of component
const datasetText = selectedDatasets.length > 1 ? 'datasets' : 'dataset';
const studyText = selectedStudies.length > 1 ? 'studies' : 'study';
{selectedDatasets.length > 0 && (<div>{selectedDatasets.length} {datasetText} selected from {selectedStudies.length} {studyText}</div>)}
@@ -0,0 +1,51 @@ | |||
import {Styles} from '../../libs/theme'; | |||
|
|||
export const styles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach to this is to use modular css. We have several examples in the codebase for this. If the style objects are being manipulated by components, then I think that approach wouldn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice 👍🏽
@@ -1,6 +1,6 @@ | |||
import React from 'react'; | |||
import style from '../../pages/DACDatasets.module.css'; | |||
import {styles} from './DACDatasetsTable'; | |||
import {styles} from './DACDatasetConstants'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing circular dependency discovered when testing
@@ -79,7 +79,7 @@ export const makeStudyTableHeaders = (datasets: DatasetTerm[], selected: number[ | |||
const selectableDatasetIds = datasets.filter(isSelectable).map(dataset => dataset.datasetId); | |||
return [ | |||
{ | |||
label: <Checkbox checked={datasets.length === selected.length} | |||
label: <Checkbox id='header-checkbox' checked={datasets.length === selected.length} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the id here so the element is easily retrievable in testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice, thank you 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great 👍
Addresses
https://broadworkbench.atlassian.net/browse/DT-788
Summary
Moves the apply for access button to the new footer component that is optionally rendered if any datasets/studies are selected. Also displays text about the number of datasets and studies selected.
footer.mov
Have you read Terra's Contributing Guide lately? If not, do that first.