fix(content-sharing): style and callbacks#4480
Conversation
WalkthroughThe PR extends the ContentSharing component to add onClose and onError callback props, forward them to ContentSharingV2, import the ElementsXhrError type, remove a named export alias, and enable modernized components in the wrapper component. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/elements/wrappers/ContentSharing.js (1)
24-33:⚠️ Potential issue | 🟠 MajorMove
enableModernizedComponentsafter the spread to prevent caller override.Currently,
enableModernizedComponents={true}on line 25 can be overridden ifthis.options.enableModernizedComponentsis provided, since props spread later take precedence. The wrapper should enforce modernized styling by default.Proposed fix
this.root.render( <ContentSharingReactComponent - enableModernizedComponents={true} itemID={this.id} itemType={itemType || ITEM_TYPE_FILE} language={this.language} messages={this.messages} token={this.token} uuid={uniqueId('contentSharing_')} {...this.options} + enableModernizedComponents />, );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/elements/wrappers/ContentSharing.js` around lines 24 - 33, The prop enableModernizedComponents is currently placed before the props spread so this.options.enableModernizedComponents can override it; update the JSX for ContentSharingReactComponent so the spread {...this.options} comes first and then set enableModernizedComponents={true} after the spread (keeping itemID, itemType, language, messages, token, uuid as-is) to ensure the component always receives the enforced modernized styling regardless of incoming options.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/elements/wrappers/ContentSharing.js`:
- Around line 24-33: The prop enableModernizedComponents is currently placed
before the props spread so this.options.enableModernizedComponents can override
it; update the JSX for ContentSharingReactComponent so the spread
{...this.options} comes first and then set enableModernizedComponents={true}
after the spread (keeping itemID, itemType, language, messages, token, uuid
as-is) to ensure the component always receives the enforced modernized styling
regardless of incoming options.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f4f9fc06-9514-4467-8221-ceb94a0abd7b
📒 Files selected for processing (2)
src/elements/content-sharing/ContentSharing.jssrc/elements/wrappers/ContentSharing.js
|
@Mergifyio queue |
|
@Mergifyio refresh |
Merge Queue Status
This pull request spent 40 seconds in the queue, including 1 second running CI. Required conditions to merge
|
✅ Pull request refreshed |
enableModernizedComponentsprop in the wrapperonError: (error) => {console.log('Failed to load sharing data:', error)}into the wrapperonClose: () => {console.log('Sharing modal closed')}into the wrapperSummary by CodeRabbit
Release Notes
New Features
Chores