-
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a2e3725
add new footer component and add to the table
raejohanek 1784093
Merge branch 'develop' into rj/dt-788-footer
raejohanek 559a198
linting
raejohanek fc9188c
PR feedback: simplify div logic
raejohanek 9f7b606
add unit test for new footer component
raejohanek 97afe13
simplify test data
raejohanek 71cb122
remove circular dependency
raejohanek a21842a
add test for footer on dataset search table
raejohanek 85de688
add new lines at end of files
raejohanek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as _ from 'lodash'; | ||
import {Button} from '@mui/material'; | ||
import * as React from 'react'; | ||
import {Dataset} from 'src/types/model'; | ||
|
||
interface DatasetSearchFooterProps { | ||
selectedDatasets: number[]; | ||
datasets: Dataset[]; | ||
onClick: () => void; | ||
} | ||
export const DatasetSearchFooter = (props: DatasetSearchFooterProps) => { | ||
const { selectedDatasets, datasets, onClick } = props; | ||
const selectedStudies = _.uniq( | ||
_.filter(datasets, dataset => selectedDatasets.includes(dataset.datasetId)) | ||
.map(dataset => dataset.study.studyId)); | ||
return <div style={{ | ||
position: 'fixed', | ||
bottom: 0, | ||
zIndex: 999, | ||
width: '100vw', | ||
height: 60, | ||
display: 'flex', | ||
justifyContent: 'flex-end', | ||
backgroundColor: 'white', | ||
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>)} | ||
{selectedDatasets.length > 1 && selectedStudies.length === 1 && (<div style={{paddingRight: 15}}> {selectedDatasets.length} Datasets selected from 1 Study </div>)} | ||
{selectedDatasets.length === 1 && (<div style={{paddingRight: 15}}> 1 Dataset selected from 1 Study </div>)} | ||
<Button | ||
variant='contained' | ||
onClick={onClick} | ||
sx={{fontSize: 14, height: 35, marginRight: 5}} | ||
> | ||
Apply for Access | ||
</Button> | ||
</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: