fix(shareddrives): hide leave sharing for owned shared drives#3931
Conversation
The "Leave sharing" action was shown in the sharings list even when the current user owns the federated shared drive. The org shared drive case (B2B) was already excluded via canLeave, but the owner case was missing from displayCondition. Add an isOwner check to hide the action for owners and cover it with a dedicated spec.
There was a problem hiding this comment.
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
BundleMonFiles updated (1)
Unchanged files (19)
Total files change +23B 0% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
What
Why
displayConditiononly filtered org shared drives (B2B) viacanLeave. Owners of federated shared drives still saw the action, which does not apply to them.How
isOwnerto theleaveSharedDriveaction factory options. It is already exposed by the sharing context and propagated throughbuildSharingsActionsOptions, so no wiring change is needed upstream.displayConditionwith!isOwner(docs[0]._id)alongside the existingisSharedDriveDocandcanLeaveguards.leaveSharedDrive.spec.jscovering owner, recipient, org drive, non-shared-drive, and multi-selection cases.https://app.notion.com/p/linagora/Owner-Sharings-hide-action-38262718bad180fcb671dbc1b04cc014
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests