-
Notifications
You must be signed in to change notification settings - Fork 345
fix(content-sharing): null sharingServiceProps #4352
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
Conversation
WalkthroughThis PR updates the @box/unified-share-modal dependency to a newer version, adds locale-specific build filtering to skip non-English locales, applies optional chaining to sharing service property access, and removes the children prop from a ContentSharing story variant. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/elements/content-sharing/stories/ContentSharing.stories.js (1)
18-18: Remove commented-out code.Commented code in story args should either be removed entirely or kept active. If this is meant as documentation, consider using a JSDoc comment instead.
Apply this diff to remove the commented line:
export const withContentSharingV2Enabled = { args: { - // children: <button>Open Unified Share Modal</button>, features: {Or if the children prop is intentionally optional for documentation purposes, use a JSDoc comment:
+ /** + * Optional: Pass children to customize the trigger + * Example: children: <button>Open Unified Share Modal</button> + */ args: { - // children: <button>Open Unified Share Modal</button>, features: {Based on the past review comment requesting a change on this line.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
package.json(2 hunks)scripts/buildLocaleAssets.js(1 hunks)src/elements/content-sharing/hooks/useSharingService.ts(1 hunks)src/elements/content-sharing/stories/ContentSharing.stories.js(1 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
scripts/buildLocaleAssets.js
[error] 59-59: Illegal return statement outside of a function
(parse)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (2)
src/elements/content-sharing/hooks/useSharingService.ts (1)
53-56: LGTM! Safe null handling with optional chaining.The optional chaining correctly prevents runtime errors when
sharingServicePropsis null or undefined, allowing the permissions and serverUrl to gracefully fall back to undefined values.package.json (1)
143-143: Verify internal package version and breaking changes—v1.5.1 not found in public registries.The version
@box/unified-share-modal@1.5.1does not exist in public npm registries (latest publicly available is ~0.49.0), indicating this is a private or internal Box package. Without access to the internal package registry or v1.5.1 breaking changes documentation, compatibility cannot be verified.The codebase uses the package extensively:
- Type imports in:
types.js,convertCollaborators.ts,getAllowedAccessLevels.ts,fetchItem.ts,fetchCurrentUser.ts- Component usage in:
ContentSharingV2.tsx,SharingModal.js, tests, and stories- Optional chaining is present in
useSharingService.ts(lines 53–57) for defensive property accessManually confirm:
- The version upgrade path and changelog from Box's internal package registry
- Whether all type imports and component prop signatures remain compatible
- That optional chaining in
useSharingService.tssufficiently handles any API changes
sharingServiceProps will be undefined when the hook is first ran. It'll hit a type error hence return an empty page without this fix.
Summary by CodeRabbit
Chores
Refactor