Skip to content

feat(content-uploader): add support for item share button and open preview button#4624

Open
Omfalos wants to merge 1 commit into
box:masterfrom
Omfalos:uploadsManagerItemShareButton
Open

feat(content-uploader): add support for item share button and open preview button#4624
Omfalos wants to merge 1 commit into
box:masterfrom
Omfalos:uploadsManagerItemShareButton

Conversation

@Omfalos

@Omfalos Omfalos commented Jun 12, 2026

Copy link
Copy Markdown

Add support to two new callbacks added to the uploads manager that where not passed from wrapping component
They enable to perform action connected to share and to opening in new tab

Summary by CodeRabbit

Release Notes

  • New Features

    • Upload items now support share and open action callbacks, enabling custom handling of these user interactions within the upload manager.
  • Tests

    • Added test coverage for share and open action callbacks, including default behavior verification.

@Omfalos Omfalos requested review from a team as code owners June 12, 2026 11:08
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Karol Machulski seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: afb6d1c7-55e3-494f-9330-0dab9c012b4b

📥 Commits

Reviewing files that changed from the base of the PR and between d4605b9 and 9f97538.

📒 Files selected for processing (2)
  • src/elements/content-uploader/ContentUploader.tsx
  • src/elements/content-uploader/__tests__/ContentUploader.test.js

Walkthrough

ContentUploader adds two new optional callback props—onItemShare and onItemOpen—to its public interface. These props are forwarded to UploadsManagerBP in the modernized uploads rendering path, with no-op defaults ensuring safe behavior when omitted. Tests validate prop forwarding and default behavior.

Changes

Modernized Uploads Callback Props

Layer / File(s) Summary
Callback prop contract and wiring
src/elements/content-uploader/ContentUploader.tsx
ContentUploaderProps interface defines onItemShare and onItemOpen callbacks; defaultProps provides no-op defaults; the modernized uploads render path destructures and forwards these props to UploadsManagerBP.
Prop wiring validation tests
src/elements/content-uploader/__tests__/ContentUploader.test.js
Four new tests verify that onItemShare and onItemOpen props are correctly passed through to UploadsManagerBP and that no-op defaults do not throw when invoked.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • box/box-ui-elements#4571: Modernized UploadsManagerBP integration feature flag that works with this PR's callback prop forwarding.

Suggested labels

ready-to-merge

Suggested reviewers

  • olehrybak
  • jpan-box
  • tjiang-box

Poem

🐰 Two callbacks bound up neat,
Share and open, a complete feat!
Props dance through the upload flow,
Tests ensure the defaults glow.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is vague and contains grammar issues, making it unclear whether the author has understood the template requirements or provided complete context. Clarify the description by explaining what the new callbacks do, why they were needed, and provide more context about the implementation. Fix grammar ('where' should be 'were').
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for item share button and open preview button callbacks to the ContentUploader component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

onMinimize?: () => void;
onProgress: (item: UploadItem) => void;
onResume: (item: UploadItem) => void;
onItemShare: (itemId: string) => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn’t these be optional? If I’m understanding correctly, the old UploadsManager doesn’t support them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we should make them optional

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.

5 participants