Skip to content

feat: Create a file upload hook to queue uploads #4759

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

apburnes
Copy link
Contributor

@apburnes apburnes commented Mar 21, 2025

Closes #4746
Closes #4753

Changes proposed in this pull request:

  • Creates a new useMultiFileUpload hook to manage a file upload queue
  • Updates useFileStorage to provide a uploadFile function
  • Adds file content-type to s3 putObject so the proxy reads the proper file type headers
  • Switches to 100MB file upload limit

security considerations

None

@apburnes apburnes requested a review from a team March 21, 2025 00:57
@cloud-gov-pages-operations
Copy link
Contributor

cloud-gov-pages-operations commented Mar 21, 2025

🤖 This is an automated code coverage report

Total coverage (lines): 28.26%
Coverage diff: 0.04% 📈

@apburnes apburnes force-pushed the feat-create-file-upload-hook-queue branch from 3dbb1b1 to af9596b Compare March 24, 2025 22:12
@apburnes apburnes requested review from sknep and a team March 24, 2025 22:25
@apburnes apburnes force-pushed the feat-create-file-upload-hook-queue branch from af9596b to a458a3b Compare March 25, 2025 18:19
const MEGABYTE_LIMIT = 250;
const MAX_FILE_SIZE = MEGABYTE_LIMIT * 1024 * 1024; // 250MB
const getFileStatusColor = (status) => {
if (status === 'error') return 'bg-secondary-lighter';
Copy link
Contributor

Choose a reason for hiding this comment

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

would you consider a switch statement for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our linting prefers if over switch

@apburnes apburnes merged commit ed8c688 into main Mar 26, 2025
8 checks passed
@apburnes apburnes deleted the feat-create-file-upload-hook-queue branch March 26, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update putObject for file storage to read the file content-type Update file storage hooks to use a queue to manage upload progress.
3 participants