fix(invitations): inert referrals state when public signup is open#4306
Conversation
The server never claims/finalizes an invite token while public signup is open, so the account Referrals tab solicited invites that could never convert. When the public auth config reports sign.up true the invite form is replaced by an informational alert; the My-referrals list stays visible read-only. Unknown/missing server config keeps the form (backend policy is the real gate). refs pierreb-devkit/Node#3833
|
Warning Review limit reached
More reviews will be available in 47 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4306 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 32 32
Lines 1219 1219
Branches 360 360
=======================================
Hits 1214 1214
Misses 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Pull request overview
Updates the invitations module’s account “Referrals” view to avoid presenting a broken invite/referral flow when the deployment has public signup enabled (per authStore.serverConfig.sign.up), replacing the invite form with an informational inert state while keeping the referrals list visible/read-only.
Changes:
- Add a
signupOpencomputed flag sourced fromuseAuthStore().serverConfig.sign.upand conditionally render an info alert instead of the invite form. - Add unit tests covering signup-open vs signup-closed rendering, plus null/unknown config fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/modules/invitations/views/invitations.account.view.vue |
Adds signupOpen guard and an informational alert to disable the invite form when public signup is open. |
src/modules/invitations/tests/invitations.account.view.unit.tests.js |
Mocks useAuthStore() and adds tests for the new open-signup inert UI state and safe defaults. |
…mputed Rephrase "Strict === true" (read as an undefined config flag) to explicit "Uses strict equality (=== true)" wording — no behaviour change.
Summary
serverConfig.sign.up === true) and replaces the invite form with an informational state, keeping the My-referrals list read-only. On closed signup nothing changes.Refs pierreb-devkit/Node#3833Scope
src/modules/invitations/nonelowValidation
npm run lintnpm run test:unitnpm run buildGuardrails check
.env*,secrets/**, keys, tokens)Optional: Infra/Stack alignment details
Before vs After (key changes only)
serverConfig.sign.up === trueguardpierreb-devkit/Node#38337e7b356fNotes for reviewers
/server-configendpoint/update-stackon consumer projects after both Node#3833 and this PR are mergedTest plan
invitations.account.viewunit suite 20/20 (signup-open inert state, signup-closed form shown, unknown-config safe-default, list read-only)Refs pierreb-devkit/Node#3833