Skip to content

Renamed isStripeConfigured to arePaidMembersEnabled in Portal#28299

Merged
sagzy merged 2 commits into
mainfrom
tidy/rename-paid-members-only-helper
Jun 1, 2026
Merged

Renamed isStripeConfigured to arePaidMembersEnabled in Portal#28299
sagzy merged 2 commits into
mainfrom
tidy/rename-paid-members-only-helper

Conversation

@sagzy
Copy link
Copy Markdown
Contributor

@sagzy sagzy commented Jun 1, 2026

no issue

This change should not affect behaviour.

  • 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

sagzy added 2 commits June 1, 2026 16:55
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:
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Walkthrough

This PR refactors the portal codebase to replace the isStripeConfigured helper with a new arePaidMembersEnabled helper that directly checks the site.paid_members_enabled flag. The helper is introduced in helpers.js, and all usages across components, utilities, fixtures, and tests are systematically updated. Test fixtures are modified to emit the new flag structure, and unit tests for both components and helpers are updated to verify behavior with the new flag.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: renaming isStripeConfigured to arePaidMembersEnabled throughout the Portal codebase, which aligns with the changeset scope.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description accurately relates to the changeset, explaining the rationale for renaming the misleading field and the scope of changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tidy/rename-paid-members-only-helper

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/portal/src/utils/helpers.js (1)

364-369: ⚡ Quick win

Reuse 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

📥 Commits

Reviewing files that changed from the base of the PR and between 37aab99 and 013a0e1.

📒 Files selected for processing (12)
  • apps/portal/package.json
  • apps/portal/src/app.js
  • apps/portal/src/components/pages/AccountHomePage/components/account-welcome.js
  • apps/portal/src/components/pages/AccountHomePage/components/continue-gift-subscription-banner.js
  • apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js
  • apps/portal/src/utils/fixtures-generator.js
  • apps/portal/src/utils/fixtures.js
  • apps/portal/src/utils/helpers.js
  • apps/portal/test/unit/components/pages/AccountHomePage/continue-gift-subscription-banner.test.js
  • apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js
  • apps/portal/test/utils/helpers.test.js
  • apps/portal/test/utils/test-fixtures.js

@sagzy sagzy enabled auto-merge (squash) June 1, 2026 15:09
@sagzy sagzy merged commit cc172d6 into main Jun 1, 2026
48 checks passed
@sagzy sagzy deleted the tidy/rename-paid-members-only-helper branch June 1, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant