fix: repair regressions from sidebar PR (#585)#586
Conversation
The sidebar PR overlapped with #577, #581, #582, and #583 and introduced a few cross-cutting issues this commit addresses: - Drop schema-step tests that imported the deleted scripts/create_schema.py one-shot seeding script. The committed snapshot under directus/sync/snapshot/ is the source of truth now, so those structural guards were checking a script that no longer exists. - Update AGENTS.md to remove the create_schema.py reference and point at the snapshot directory. - Populate ref_workspace_id on PROJECT_SHARE_ROLE_CHANGED (project_sharing.py), REPORT_READY, and REPORT_FAILED (tasks.py). The new useNotifications href builder requires both ref_workspace_id and ref_project_id to produce /w/{ws}/projects/... links; without it those notifications rendered as dead clicks. - Strip the per-request org_membership lookup in get_workspace_context. PR #582 enforces role='external' ⟺ no org_membership at every write path, and on_organisation_member_removed cascades workspace_membership soft-deletes correctly, so the read-side normalisation was redundant per-request DB overhead.
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 45 minutes and 43 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughFrontend now detects workspace external-only status via API query; middleware refactors role normalization to use a shared helper; notifications enriched with workspace IDs; outdated schema step structural test assertions removed; Directus documentation clarified. ChangesWorkspace Access and Context Flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@echo/frontend/src/features/sidebar/views/user/UserSettingsView.tsx`:
- Around line 24-37: The current isExternalOnly calculation treats missing
accessData as external-only; change it so unknown or failed loads do NOT count
as external-only by checking accessData is present before inspecting
organisations. Specifically, update the isExternalOnly expression (referencing
accessData and isExternalOnly in UserSettingsView.tsx where useQuery is used) to
only evaluate true when accessData is non-null/defined and
accessData.organisations.length === 0, so undefined/null accessData returns
false.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1ddb6a59-2ccd-4fba-966c-df6ed4188fc9
📒 Files selected for processing (9)
echo/AGENTS.mdecho/frontend/src/features/sidebar/views/user/UserSettingsView.tsxecho/server/dembrane/api/v2/middleware.pyecho/server/dembrane/api/v2/project_sharing.pyecho/server/dembrane/tasks.pyecho/server/tests/test_discount_fields.pyecho/server/tests/test_tier_expiry.pyecho/server/tests/test_tier_expiry_prewarning.pyecho/server/tests/test_workspace_requests.py
💤 Files with no reviewable changes (5)
- echo/server/tests/test_discount_fields.py
- echo/server/dembrane/api/v2/middleware.py
- echo/server/tests/test_tier_expiry_prewarning.py
- echo/server/tests/test_workspace_requests.py
- echo/server/tests/test_tier_expiry.py
Guard with `accessData != null` so "Project defaults" only hides once we've actually loaded an empty organisations list.
fix: repair regressions from sidebar PR (#585)
The sidebar PR overlapped with #577, #581, #582, and #583 and introduced
a few cross-cutting issues this commit addresses:
new sidebar's UserSettingsView. PR feat: promote external collaborators to first-class role #582/Fixes and improvements #583 added this filter to the
old UserSettingsRoute; when the sidebar moved navigation into a new
view component, the NavItem rendered unconditionally and external-only
users could click through to an empty pane.
one-shot seeding script. The committed snapshot under
directus/sync/snapshot/ is the source of truth now, so those structural
guards were checking a script that no longer exists.
the snapshot directory.
REPORT_READY, and REPORT_FAILED (tasks.py). The new useNotifications
href builder requires both ref_workspace_id and ref_project_id to
produce /w/{ws}/projects/... links; without it those notifications
rendered as dead clicks.
PR feat: promote external collaborators to first-class role #582 enforces role='external' ⟺ no org_membership at every write
path, and on_organisation_member_removed cascades workspace_membership
soft-deletes correctly, so the read-side normalisation was redundant
per-request DB overhead.
Summary by CodeRabbit
New Features
Documentation
Tests