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

feat(content-uploader): add onSelection callback (#3839) #3843

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link

Description

This PR adds an onSelection callback to the ContentUploader component to allow developers to control file selection before upload begins. This implements the suggestion from issue #3839.

Changes

  • Added onSelection prop to ContentUploader component
  • Added TypeScript and Flow type definitions
  • Implemented file selection validation in UploadInput component
  • Added comprehensive test coverage for the new callback

Usage

<ContentUploader
  onSelection={(files) => {
    // Return false to prevent upload
    // Return true to allow upload to proceed
    return files.length <= 5; // Example: Only allow up to 5 files
  }}
  {...otherProps}
/>

Testing

  • Added unit tests for UploadInput component
  • Verified all tests pass
  • Ran lint checks via precommit hooks

Link to Devin run: https://app.devin.ai/sessions/acbecd8da4154ad8aba8d8d81d7bd661

Co-Authored-By: gregorywong@box.com <gregorywong@box.com>
@devin-ai-integration devin-ai-integration bot requested review from a team as code owners January 13, 2025 22:41
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits January 13, 2025 23:00
Co-Authored-By: gregorywong@box.com <gregorywong@box.com>
Co-Authored-By: gregorywong@box.com <gregorywong@box.com>
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.

0 participants