Skip to content

feat: Add UploadHandler to Upload #7413

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 12 commits into from
May 13, 2025
Merged

feat: Add UploadHandler to Upload #7413

merged 12 commits into from
May 13, 2025

Conversation

mshabarov
Copy link
Contributor

@mshabarov mshabarov commented May 8, 2025

Description

Add the new UploadHandler to Upload so with the new API the upload can be done using pre-made implementations, e.g.:

Upload upload = new Upload(UploadHandler.inMemory((meta, data) -> {
    Notifiation.show("Got " + data.length + " bytes for " + meta.getFileName());
  }).onProgress(
    (transferredBytes, totalBytes) -> Notification.show("Received "  + transferredBytes),
    32768 // progress interval in bytes
));

Fixes vaadin/flow#21256

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • I have not completed some of the steps above and my pull request can be closed immediately.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@mshabarov mshabarov force-pushed the feat/add-upload-handler branch from d12af78 to a207cab Compare May 9, 2025 12:48
@mshabarov mshabarov marked this pull request as ready for review May 12, 2025 09:07
@mshabarov mshabarov requested a review from caalador May 12, 2025 09:09
@mshabarov mshabarov requested a review from caalador May 12, 2025 12:37
Copy link
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

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

Seems ok. Perhaps someone from the components side will have a look also.

@mshabarov mshabarov requested a review from yuriy-fix May 13, 2025 05:55
@mshabarov
Copy link
Contributor Author

mshabarov commented May 13, 2025

Requested a review from @yuriy-fix , feel free to reassign to anyone else from your team, thanks in advance 😉

@sissbruecker sissbruecker enabled auto-merge (squash) May 13, 2025 09:02
Copy link

@sissbruecker sissbruecker merged commit 1f1b14e into main May 13, 2025
5 checks passed
@sissbruecker sissbruecker deleted the feat/add-upload-handler branch May 13, 2025 09:13
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.8.0.alpha7 and is also targeting the upcoming stable 24.8.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add UploadHandler to Upload component
5 participants