Renamed isStripeConfigured to arePaidMembersEnabled in Portal#28299
Conversation
no issue This change should not cause any behavior change (tidy-ing) - the field `site.is_stripe_configured` was a client-side alias for `site.paid_members_enabled` (a calculated setting backed by `SettingsHelpers.arePaidMembersEnabled()` server-side, which means members enabled AND Stripe connected), so the old name was misleading - removed the alias creation in `transformApiSiteData` and updated every caller to read `paid_members_enabled` / `arePaidMembersEnabled` directly account-welcome, getAvailablePrices) keeps the same behavior
Changelog for v2.68.53 -> 2.68.54:
WalkthroughThis PR refactors the portal codebase to replace the 🚥 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 docstrings
🧪 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.
🧹 Nitpick comments (1)
apps/portal/src/utils/helpers.js (1)
364-369: ⚡ Quick winReuse
arePaidMembersEnabled()for this gate.Line 365 reimplements the flag check with plain truthiness, while
getAvailablePrices()now uses the helper’s strict boolean semantics. Reusing the helper here keeps product and price gating aligned if the payload ever contains a non-boolean truthy value.Suggested change
return products.filter(product => !!product).filter((product) => { - if (site.paid_members_enabled) { + if (arePaidMembersEnabled({site})) { return true; } return product.type !== 'paid';🤖 Prompt for 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. In `@apps/portal/src/utils/helpers.js` around lines 364 - 369, Replace the ad-hoc truthiness check on site.paid_members_enabled inside the products.filter chain with the existing helper arePaidMembersEnabled(site) so gating logic uses the helper's strict boolean semantics; locate the filter that currently does "if (site.paid_members_enabled) { return true }" (near the products.filter chain) and call arePaidMembersEnabled(site) instead, preserving the same return logic for paid product exclusion and keeping behavior aligned with getAvailablePrices().
🤖 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.
Nitpick comments:
In `@apps/portal/src/utils/helpers.js`:
- Around line 364-369: Replace the ad-hoc truthiness check on
site.paid_members_enabled inside the products.filter chain with the existing
helper arePaidMembersEnabled(site) so gating logic uses the helper's strict
boolean semantics; locate the filter that currently does "if
(site.paid_members_enabled) { return true }" (near the products.filter chain)
and call arePaidMembersEnabled(site) instead, preserving the same return logic
for paid product exclusion and keeping behavior aligned with
getAvailablePrices().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b9be692b-3868-4604-8f79-1d2885d100c3
📒 Files selected for processing (12)
apps/portal/package.jsonapps/portal/src/app.jsapps/portal/src/components/pages/AccountHomePage/components/account-welcome.jsapps/portal/src/components/pages/AccountHomePage/components/continue-gift-subscription-banner.jsapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/src/utils/fixtures-generator.jsapps/portal/src/utils/fixtures.jsapps/portal/src/utils/helpers.jsapps/portal/test/unit/components/pages/AccountHomePage/continue-gift-subscription-banner.test.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsapps/portal/test/utils/helpers.test.jsapps/portal/test/utils/test-fixtures.js
no issue
This change should not affect behaviour.
site.is_stripe_configuredwas a client-side alias forsite.paid_members_enabled(a calculated setting backed bySettingsHelpers.arePaidMembersEnabled()server-side, which meansmembers enabled AND Stripe connected), so the old name was misleading
transformApiSiteDataand updated everycaller to read
paid_members_enabled/arePaidMembersEnableddirectlyaccount-welcome, getAvailablePrices) keeps the same behavior