-
Notifications
You must be signed in to change notification settings - Fork 2
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
Austenem/CAT-1052 Add bulk download dialog to detail pages #3622
Merged
austenem
merged 6 commits into
main
from
austenem/cat-1052-add-bulk-download-to-detail-pages
Nov 26, 2024
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
974de3b
add bulk file download to dataset detail page
austenem 11796b0
pass in uuids
austenem 81089a7
update description link
austenem 939b28e
add changelog
austenem e5e2d51
clean up
austenem 9830482
adjust outlined button component
austenem 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 @@ | ||
- Add bulk file download option to the Bulk Download section of dataset detail pages. |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...omSearch/BulkDownloadButtonFromSearch.tsx → ...omSearch/BulkDownloadButtonFromSearch.tsx
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
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
...atic/js/components/bulkDownload/buttons/BulkDownloadTextButton/BulkDownloadTextButton.tsx
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,24 @@ | ||
import React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { ButtonProps } from '@mui/material/Button'; | ||
import { useBulkDownloadDialog } from 'js/components/bulkDownload/hooks'; | ||
import BulkDownloadDialog from 'js/components/bulkDownload/BulkDownloadDialog'; | ||
import OutlinedButton from 'js/shared-styles/buttons/OutlinedButton'; | ||
|
||
interface BulkDownloadTextButtonProps extends ButtonProps { | ||
uuids: Set<string>; | ||
} | ||
function BulkDownloadTextButton({ uuids, ...rest }: BulkDownloadTextButtonProps) { | ||
const { openDialog, isOpen } = useBulkDownloadDialog(); | ||
|
||
return ( | ||
<Box> | ||
<OutlinedButton color="primary" onClick={() => openDialog(uuids)} {...rest}> | ||
Download Files with HuBMAP CLT | ||
</OutlinedButton> | ||
{isOpen && <BulkDownloadDialog />} | ||
</Box> | ||
); | ||
} | ||
|
||
export default BulkDownloadTextButton; |
3 changes: 3 additions & 0 deletions
3
context/app/static/js/components/bulkDownload/buttons/BulkDownloadTextButton/index.ts
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,3 @@ | ||
import BulkDownloadTextButton from './BulkDownloadTextButton'; | ||
|
||
export default BulkDownloadTextButton; |
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
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
context/app/static/js/shared-styles/buttons/OutlinedButton/OutlinedButton.tsx
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,17 @@ | ||
import React from 'react'; | ||
import { StyledButton } from 'js/shared-styles/buttons/OutlinedButton/style'; | ||
import { ButtonProps } from '@mui/material/Button'; | ||
|
||
interface OutlinedButtonProps extends ButtonProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
function OutlinedButton({ children, ...rest }: OutlinedButtonProps) { | ||
return ( | ||
<StyledButton variant="outlined" {...rest}> | ||
{children} | ||
</StyledButton> | ||
); | ||
} | ||
|
||
export default OutlinedButton; |
3 changes: 3 additions & 0 deletions
3
context/app/static/js/shared-styles/buttons/OutlinedButton/index.ts
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,3 @@ | ||
import OutlinedButton from './OutlinedButton'; | ||
|
||
export default OutlinedButton; |
File renamed without changes.
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.
Not sure we need to introduce a new shared component to pass a single prop. @NickAkhmetov thoughts?
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.
It seems like the purpose of this is to decouple the styles from the
OutlinedLinkButton
's link logic so that those styles are usable in non-link scenarios, but it seems like just applying theoutlined
variant toStyledButton
would accomplish the same thing.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.
Good point - this was created because I believed the
variant
styling could only be applied inline, and the outline is always necessary for this component. I just wrapped theButton
component into thestyled
function so that thevariant
styling can be applied there, which eliminates the need for this component.