Updated copy for once offers in Portal account page#26636
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughBumps apps/portal/package.json version 2.64.16 → 2.64.17. Updates PaidAccountActions: Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99aab91f16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js (1)
333-377: Add a fallback test whencurrentPeriodEndis missing.Given the new dependency on
current_period_end, add one case with it unset and assert no invalid end-date text is rendered.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js` around lines 333 - 377, Add a new test case alongside the existing "displays discounted price with 'Ends {date}' for once offers" that builds the same product/member/subscription fixture but leaves currentPeriodEnd undefined (omit the currentPeriodEnd field or set it to null) on the subscription and on the discount end value, then render via setup({site, member}) and assert that the discounted price is shown but no "Ends" text is present (e.g., queryByText(/Ends/) returns null or queryByTestId('offer-label') exists while queryByText(/Ends \d+/) does not). Use the same helpers (getProductsData, getSiteData, getMemberData, getSubscriptionData, getNextPaymentData, getDiscountData, setup) so the new test mirrors the original except for the missing currentPeriodEnd.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js`:
- Around line 62-65: The call to getOfferLabel dereferences
subscription.current_period_end without ensuring subscription exists (affecting
offerLabelStr); update the code that sets offerLabelStr to guard subscription
(e.g., use optional chaining or a fallback) so you pass a safe value for
currentPeriodEnd to getOfferLabel (or skip calling getOfferLabel when
subscription is falsy), and ensure any downstream use of offerLabelStr or
PlanLabel handles the no-subscription case consistently.
- Line 239: The offer label currently concatenates raw English interval strings
into displayedPrice (const displayedPrice =
`${formattedPrice}/${nextPayment.interval}`), which breaks localization; update
the construction of displayedPrice to use the translated interval instead of
nextPayment.interval (e.g., call your locale function/translator like t or
formatMessage with a key for the interval such as billing.interval.month/year or
similar) so formattedPrice is combined with the translated interval string
returned from the i18n helper used across the app.
- Around line 233-236: The duration label logic for discount.duration === 'once'
assumes currentPeriodEnd exists and calls getDateString(currentPeriodEnd), which
can produce an invalid date UI when currentPeriodEnd is missing; update the
branch in the component where durationLabel is set (referencing
discount.duration, currentPeriodEnd, durationLabel, getDateString and t) to
guard against a falsy currentPeriodEnd — e.g., if currentPeriodEnd is present
use t('Ends {offerEndDate}', {offerEndDate: getDateString(currentPeriodEnd)})
else use a safe fallback like t('Ends soon') (or another neutral string) so the
UI never shows an invalid date.
---
Nitpick comments:
In
`@apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js`:
- Around line 333-377: Add a new test case alongside the existing "displays
discounted price with 'Ends {date}' for once offers" that builds the same
product/member/subscription fixture but leaves currentPeriodEnd undefined (omit
the currentPeriodEnd field or set it to null) on the subscription and on the
discount end value, then render via setup({site, member}) and assert that the
discounted price is shown but no "Ends" text is present (e.g.,
queryByText(/Ends/) returns null or queryByTestId('offer-label') exists while
queryByText(/Ends \d+/) does not). Use the same helpers (getProductsData,
getSiteData, getMemberData, getSubscriptionData, getNextPaymentData,
getDiscountData, setup) so the new test mirrors the original except for the
missing currentPeriodEnd.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
💤 Files with no reviewable changes (63)
- ghost/i18n/locales/ar/portal.json
- ghost/i18n/locales/de/portal.json
- ghost/i18n/locales/fr/portal.json
- ghost/i18n/locales/pl/portal.json
- ghost/i18n/locales/nl/portal.json
- ghost/i18n/locales/sv/portal.json
- ghost/i18n/locales/ro/portal.json
- ghost/i18n/locales/context.json
- ghost/i18n/locales/hu/portal.json
- ghost/i18n/locales/uz/portal.json
- ghost/i18n/locales/ms/portal.json
- ghost/i18n/locales/fa/portal.json
- ghost/i18n/locales/kz/portal.json
- ghost/i18n/locales/ne/portal.json
- ghost/i18n/locales/bn/portal.json
- ghost/i18n/locales/gd/portal.json
- ghost/i18n/locales/lt/portal.json
- ghost/i18n/locales/si/portal.json
- ghost/i18n/locales/sr-Cyrl/portal.json
- ghost/i18n/locales/tr/portal.json
- ghost/i18n/locales/is/portal.json
- ghost/i18n/locales/pt-BR/portal.json
- ghost/i18n/locales/bs/portal.json
- ghost/i18n/locales/ca/portal.json
- ghost/i18n/locales/zh-Hant/portal.json
- ghost/i18n/locales/ja/portal.json
- ghost/i18n/locales/eo/portal.json
- ghost/i18n/locales/nb/portal.json
- ghost/i18n/locales/sk/portal.json
- ghost/i18n/locales/ko/portal.json
- ghost/i18n/locales/sr/portal.json
- ghost/i18n/locales/pt/portal.json
- ghost/i18n/locales/fi/portal.json
- ghost/i18n/locales/hr/portal.json
- ghost/i18n/locales/cs/portal.json
- ghost/i18n/locales/th/portal.json
- ghost/i18n/locales/nn/portal.json
- ghost/i18n/locales/af/portal.json
- ghost/i18n/locales/id/portal.json
- ghost/i18n/locales/en/portal.json
- ghost/i18n/locales/sw/portal.json
- ghost/i18n/locales/ta/portal.json
- ghost/i18n/locales/hi/portal.json
- ghost/i18n/locales/eu/portal.json
- ghost/i18n/locales/zh/portal.json
- ghost/i18n/locales/es/portal.json
- ghost/i18n/locales/it/portal.json
- ghost/i18n/locales/mk/portal.json
- ghost/i18n/locales/he/portal.json
- ghost/i18n/locales/vi/portal.json
- ghost/i18n/locales/da/portal.json
- ghost/i18n/locales/ur/portal.json
- ghost/i18n/locales/et/portal.json
- ghost/i18n/locales/el/portal.json
- ghost/i18n/locales/uk/portal.json
- ghost/i18n/locales/de-CH/portal.json
- ghost/i18n/locales/lv/portal.json
- ghost/i18n/locales/sq/portal.json
- ghost/i18n/locales/bg/portal.json
- ghost/i18n/locales/pa/portal.json
- ghost/i18n/locales/sl/portal.json
- ghost/i18n/locales/ru/portal.json
- ghost/i18n/locales/mn/portal.json
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js
Show resolved
Hide resolved
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js
Outdated
Show resolved
Hide resolved
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js
Outdated
Show resolved
Hide resolved
d503696 to
849d8c3
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js (1)
239-239:⚠️ Potential issue | 🟡 MinorTranslate the interval for consistency with line 33.
Line 33 uses
t(interval)for the regular price label, but this line uses rawnextPayment.interval. This inconsistency will show English "month"/"year" in the offer label for non-English locales.Suggested fix
-const displayedPrice = `${formattedPrice}/${nextPayment.interval}`; +const displayedPrice = `${formattedPrice}/${t(nextPayment.interval)}`;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js` at line 239, The displayedPrice string uses raw nextPayment.interval causing untranslated "month"/"year" in non-English locales; change it to use the i18n translation function like the regular price label (e.g., use t(nextPayment.interval) or the same interval variable used on line 33) so displayedPrice becomes `${formattedPrice}/${t(nextPayment.interval)}` ensuring the interval is translated consistently with the regular price label.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js`:
- Line 239: The displayedPrice string uses raw nextPayment.interval causing
untranslated "month"/"year" in non-English locales; change it to use the i18n
translation function like the regular price label (e.g., use
t(nextPayment.interval) or the same interval variable used on line 33) so
displayedPrice becomes `${formattedPrice}/${t(nextPayment.interval)}` ensuring
the interval is translated consistently with the regular price label.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
💤 Files with no reviewable changes (63)
- ghost/i18n/locales/tr/portal.json
- ghost/i18n/locales/nb/portal.json
- ghost/i18n/locales/uk/portal.json
- ghost/i18n/locales/ar/portal.json
- ghost/i18n/locales/cs/portal.json
- ghost/i18n/locales/sk/portal.json
- ghost/i18n/locales/zh/portal.json
- ghost/i18n/locales/sr/portal.json
- ghost/i18n/locales/sl/portal.json
- ghost/i18n/locales/bg/portal.json
- ghost/i18n/locales/he/portal.json
- ghost/i18n/locales/zh-Hant/portal.json
- ghost/i18n/locales/nl/portal.json
- ghost/i18n/locales/bs/portal.json
- ghost/i18n/locales/pl/portal.json
- ghost/i18n/locales/ca/portal.json
- ghost/i18n/locales/gd/portal.json
- ghost/i18n/locales/ur/portal.json
- ghost/i18n/locales/mk/portal.json
- ghost/i18n/locales/mn/portal.json
- ghost/i18n/locales/fa/portal.json
- ghost/i18n/locales/ru/portal.json
- ghost/i18n/locales/si/portal.json
- ghost/i18n/locales/is/portal.json
- ghost/i18n/locales/sr-Cyrl/portal.json
- ghost/i18n/locales/pt/portal.json
- ghost/i18n/locales/ne/portal.json
- ghost/i18n/locales/it/portal.json
- ghost/i18n/locales/bn/portal.json
- ghost/i18n/locales/ms/portal.json
- ghost/i18n/locales/ta/portal.json
- ghost/i18n/locales/da/portal.json
- ghost/i18n/locales/ko/portal.json
- ghost/i18n/locales/hr/portal.json
- ghost/i18n/locales/sw/portal.json
- ghost/i18n/locales/lt/portal.json
- ghost/i18n/locales/pt-BR/portal.json
- ghost/i18n/locales/af/portal.json
- ghost/i18n/locales/de-CH/portal.json
- ghost/i18n/locales/nn/portal.json
- ghost/i18n/locales/uz/portal.json
- ghost/i18n/locales/sv/portal.json
- ghost/i18n/locales/th/portal.json
- ghost/i18n/locales/fr/portal.json
- ghost/i18n/locales/pa/portal.json
- ghost/i18n/locales/vi/portal.json
- ghost/i18n/locales/es/portal.json
- ghost/i18n/locales/el/portal.json
- ghost/i18n/locales/eo/portal.json
- ghost/i18n/locales/id/portal.json
- ghost/i18n/locales/lv/portal.json
- ghost/i18n/locales/eu/portal.json
- ghost/i18n/locales/ro/portal.json
- ghost/i18n/locales/en/portal.json
- ghost/i18n/locales/ja/portal.json
- ghost/i18n/locales/et/portal.json
- ghost/i18n/locales/hu/portal.json
- ghost/i18n/locales/sq/portal.json
- ghost/i18n/locales/context.json
- ghost/i18n/locales/hi/portal.json
- ghost/i18n/locales/de/portal.json
- ghost/i18n/locales/kz/portal.json
- ghost/i18n/locales/fi/portal.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js (1)
212-213: MakecurrentPeriodEndoptional in JSDoc.Runtime usage treats
currentPeriodEndas optional (Line 233 guard), but docs currently mark it as required.Suggested doc-only tweak
- * `@param` {string} currentPeriodEnd - Subscription current period end (ISO 8601 date string), needed to display the end of "once" offers + * `@param` {string|undefined} currentPeriodEnd - Subscription current period end (ISO 8601 date string), used to display the end of "once" offers🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js` around lines 212 - 213, The JSDoc currently marks currentPeriodEnd as required but the runtime treats it as optional (there's a guard checking it before use), so update the JSDoc for currentPeriodEnd to mark it optional (e.g., use [currentPeriodEnd] or currentPeriodEnd=undefined) and adjust its description to indicate it may be undefined; locate the parameter in the paid-account-actions.js component's JSDoc block where currentPeriodEnd is documented and change the annotation and description accordingly to match the runtime guard.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js`:
- Around line 212-213: The JSDoc currently marks currentPeriodEnd as required
but the runtime treats it as optional (there's a guard checking it before use),
so update the JSDoc for currentPeriodEnd to mark it optional (e.g., use
[currentPeriodEnd] or currentPeriodEnd=undefined) and adjust its description to
indicate it may be undefined; locate the parameter in the
paid-account-actions.js component's JSDoc block where currentPeriodEnd is
documented and change the annotation and description accordingly to match the
runtime guard.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
💤 Files with no reviewable changes (63)
- ghost/i18n/locales/uk/portal.json
- ghost/i18n/locales/fr/portal.json
- ghost/i18n/locales/de/portal.json
- ghost/i18n/locales/da/portal.json
- ghost/i18n/locales/ru/portal.json
- ghost/i18n/locales/hu/portal.json
- ghost/i18n/locales/pt/portal.json
- ghost/i18n/locales/nl/portal.json
- ghost/i18n/locales/ms/portal.json
- ghost/i18n/locales/pt-BR/portal.json
- ghost/i18n/locales/bg/portal.json
- ghost/i18n/locales/th/portal.json
- ghost/i18n/locales/ko/portal.json
- ghost/i18n/locales/mn/portal.json
- ghost/i18n/locales/lt/portal.json
- ghost/i18n/locales/sq/portal.json
- ghost/i18n/locales/cs/portal.json
- ghost/i18n/locales/el/portal.json
- ghost/i18n/locales/sv/portal.json
- ghost/i18n/locales/uz/portal.json
- ghost/i18n/locales/de-CH/portal.json
- ghost/i18n/locales/vi/portal.json
- ghost/i18n/locales/gd/portal.json
- ghost/i18n/locales/bs/portal.json
- ghost/i18n/locales/fa/portal.json
- ghost/i18n/locales/hi/portal.json
- ghost/i18n/locales/sk/portal.json
- ghost/i18n/locales/he/portal.json
- ghost/i18n/locales/nn/portal.json
- ghost/i18n/locales/es/portal.json
- ghost/i18n/locales/ne/portal.json
- ghost/i18n/locales/en/portal.json
- ghost/i18n/locales/ar/portal.json
- ghost/i18n/locales/hr/portal.json
- ghost/i18n/locales/fi/portal.json
- ghost/i18n/locales/sr/portal.json
- ghost/i18n/locales/pa/portal.json
- ghost/i18n/locales/ta/portal.json
- ghost/i18n/locales/it/portal.json
- ghost/i18n/locales/ja/portal.json
- ghost/i18n/locales/tr/portal.json
- ghost/i18n/locales/ur/portal.json
- ghost/i18n/locales/mk/portal.json
- ghost/i18n/locales/context.json
- ghost/i18n/locales/kz/portal.json
- ghost/i18n/locales/zh/portal.json
- ghost/i18n/locales/ro/portal.json
- ghost/i18n/locales/ca/portal.json
- ghost/i18n/locales/pl/portal.json
- ghost/i18n/locales/is/portal.json
- ghost/i18n/locales/id/portal.json
- ghost/i18n/locales/eu/portal.json
- ghost/i18n/locales/zh-Hant/portal.json
- ghost/i18n/locales/lv/portal.json
- ghost/i18n/locales/sl/portal.json
- ghost/i18n/locales/af/portal.json
- ghost/i18n/locales/bn/portal.json
- ghost/i18n/locales/eo/portal.json
- ghost/i18n/locales/et/portal.json
- ghost/i18n/locales/si/portal.json
- ghost/i18n/locales/sr-Cyrl/portal.json
- ghost/i18n/locales/sw/portal.json
- ghost/i18n/locales/nb/portal.json
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/portal/package.json
| } else { | ||
| displayedPrice = `${formattedPrice}/${nextPayment.interval}`; | ||
| } | ||
| const displayedPrice = `${formattedPrice}/${t(nextPayment.interval)}`; |
There was a problem hiding this comment.
Possible values of interval are 'year' and 'month', correct? Those are already picked up elsewhere, but if there are any others, you'd need to enumerate them as a comment, like:
// t('month')
// t('year')
That allows the language parser to pick them up. Any time you're plugging in a variable for t, enumerating the possibilities somewhere in the same i18n namespace is necessary. [And twice is much better than 0 times.]
There was a problem hiding this comment.
Ah 💡 I took the existing pattern, but was wondering how that worked! Thanks, adding comments
849d8c3 to
8e392cc
Compare
closes https://linear.app/ghost/issue/BER-3393 - aligned the copy for once offers with the repeating / free months offers: - Before "$4.00 - Next payment" - After: "$4.00/month - Ends {date}"
8e392cc to
947b0a5
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js (1)
212-213: JSDoc type forcurrentPeriodEndshould reflect optionality.Line 212 documents
currentPeriodEndas requiredstring, but Line 64 passesundefinedwhen subscription is absent. Consider@param {string|undefined} currentPeriodEnd(or optional param syntax) to keep docs accurate.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js` around lines 212 - 213, Update the JSDoc for the parameter currentPeriodEnd in the paid-account-actions component to reflect that it can be undefined; change the param type to either "string|undefined" or use the optional param syntax (e.g. {string} [currentPeriodEnd]) so the documentation matches how currentPeriodEnd is passed (see usages around where subscription may be absent and undefined is supplied).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js`:
- Around line 212-213: Update the JSDoc for the parameter currentPeriodEnd in
the paid-account-actions component to reflect that it can be undefined; change
the param type to either "string|undefined" or use the optional param syntax
(e.g. {string} [currentPeriodEnd]) so the documentation matches how
currentPeriodEnd is passed (see usages around where subscription may be absent
and undefined is supplied).
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
💤 Files with no reviewable changes (63)
- ghost/i18n/locales/ca/portal.json
- ghost/i18n/locales/lv/portal.json
- ghost/i18n/locales/ja/portal.json
- ghost/i18n/locales/kz/portal.json
- ghost/i18n/locales/nn/portal.json
- ghost/i18n/locales/pl/portal.json
- ghost/i18n/locales/lt/portal.json
- ghost/i18n/locales/bs/portal.json
- ghost/i18n/locales/sr-Cyrl/portal.json
- ghost/i18n/locales/pt/portal.json
- ghost/i18n/locales/pt-BR/portal.json
- ghost/i18n/locales/ro/portal.json
- ghost/i18n/locales/es/portal.json
- ghost/i18n/locales/fa/portal.json
- ghost/i18n/locales/zh/portal.json
- ghost/i18n/locales/fr/portal.json
- ghost/i18n/locales/th/portal.json
- ghost/i18n/locales/tr/portal.json
- ghost/i18n/locales/it/portal.json
- ghost/i18n/locales/hr/portal.json
- ghost/i18n/locales/sw/portal.json
- ghost/i18n/locales/de/portal.json
- ghost/i18n/locales/hu/portal.json
- ghost/i18n/locales/ur/portal.json
- ghost/i18n/locales/ms/portal.json
- ghost/i18n/locales/af/portal.json
- ghost/i18n/locales/uk/portal.json
- ghost/i18n/locales/en/portal.json
- ghost/i18n/locales/ru/portal.json
- ghost/i18n/locales/id/portal.json
- ghost/i18n/locales/ar/portal.json
- ghost/i18n/locales/bg/portal.json
- ghost/i18n/locales/sv/portal.json
- ghost/i18n/locales/bn/portal.json
- ghost/i18n/locales/eo/portal.json
- ghost/i18n/locales/eu/portal.json
- ghost/i18n/locales/cs/portal.json
- ghost/i18n/locales/et/portal.json
- ghost/i18n/locales/sl/portal.json
- ghost/i18n/locales/si/portal.json
- ghost/i18n/locales/he/portal.json
- ghost/i18n/locales/mn/portal.json
- ghost/i18n/locales/el/portal.json
- ghost/i18n/locales/da/portal.json
- ghost/i18n/locales/ko/portal.json
- ghost/i18n/locales/de-CH/portal.json
- ghost/i18n/locales/sr/portal.json
- ghost/i18n/locales/ne/portal.json
- ghost/i18n/locales/fi/portal.json
- ghost/i18n/locales/sk/portal.json
- ghost/i18n/locales/ta/portal.json
- ghost/i18n/locales/uz/portal.json
- ghost/i18n/locales/pa/portal.json
- ghost/i18n/locales/mk/portal.json
- ghost/i18n/locales/nl/portal.json
- ghost/i18n/locales/zh-Hant/portal.json
- ghost/i18n/locales/is/portal.json
- ghost/i18n/locales/hi/portal.json
- ghost/i18n/locales/vi/portal.json
- ghost/i18n/locales/gd/portal.json
- ghost/i18n/locales/nb/portal.json
- ghost/i18n/locales/context.json
- ghost/i18n/locales/sq/portal.json
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/portal/package.json
- apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js (1)
212-213: MakecurrentPeriodEndoptional in JSDoc to match actual usage.The implementation accepts missing
currentPeriodEnd, but the current param doc marks it as requiredstring. Marking it optional will keep the contract accurate.Proposed doc update
- * `@param` {string} currentPeriodEnd - Subscription current period end (ISO 8601 date string), needed to display the end of "once" offers + * `@param` {string|undefined} [currentPeriodEnd] - Subscription current period end (ISO 8601 date string), used to display the end of "once" offers when availableAlso applies to: 216-216
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js` around lines 212 - 213, The JSDoc for the parameter currentPeriodEnd in paid-account-actions.js incorrectly marks it as required string; update the JSDoc for the function that accepts this param (search for currentPeriodEnd in the file, e.g., the function/component containing the param) to mark it optional (use {string=} or {string|undefined} or square-bracket param syntax) so the doc matches the implementation that allows a missing currentPeriodEnd; ensure any duplicate JSDoc entries (the other occurrence noted) are updated the same way.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.js`:
- Around line 212-213: The JSDoc for the parameter currentPeriodEnd in
paid-account-actions.js incorrectly marks it as required string; update the
JSDoc for the function that accepts this param (search for currentPeriodEnd in
the file, e.g., the function/component containing the param) to mark it optional
(use {string=} or {string|undefined} or square-bracket param syntax) so the doc
matches the implementation that allows a missing currentPeriodEnd; ensure any
duplicate JSDoc entries (the other occurrence noted) are updated the same way.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/paid-account-actions.jsapps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
💤 Files with no reviewable changes (63)
- ghost/i18n/locales/ur/portal.json
- ghost/i18n/locales/sk/portal.json
- ghost/i18n/locales/de-CH/portal.json
- ghost/i18n/locales/sr-Cyrl/portal.json
- ghost/i18n/locales/mn/portal.json
- ghost/i18n/locales/ar/portal.json
- ghost/i18n/locales/context.json
- ghost/i18n/locales/ko/portal.json
- ghost/i18n/locales/sr/portal.json
- ghost/i18n/locales/bs/portal.json
- ghost/i18n/locales/sv/portal.json
- ghost/i18n/locales/cs/portal.json
- ghost/i18n/locales/pt-BR/portal.json
- ghost/i18n/locales/hr/portal.json
- ghost/i18n/locales/pl/portal.json
- ghost/i18n/locales/et/portal.json
- ghost/i18n/locales/en/portal.json
- ghost/i18n/locales/is/portal.json
- ghost/i18n/locales/sq/portal.json
- ghost/i18n/locales/fi/portal.json
- ghost/i18n/locales/zh-Hant/portal.json
- ghost/i18n/locales/lt/portal.json
- ghost/i18n/locales/es/portal.json
- ghost/i18n/locales/af/portal.json
- ghost/i18n/locales/uz/portal.json
- ghost/i18n/locales/eo/portal.json
- ghost/i18n/locales/de/portal.json
- ghost/i18n/locales/ru/portal.json
- ghost/i18n/locales/vi/portal.json
- ghost/i18n/locales/bg/portal.json
- ghost/i18n/locales/ne/portal.json
- ghost/i18n/locales/tr/portal.json
- ghost/i18n/locales/ca/portal.json
- ghost/i18n/locales/fa/portal.json
- ghost/i18n/locales/ms/portal.json
- ghost/i18n/locales/da/portal.json
- ghost/i18n/locales/nn/portal.json
- ghost/i18n/locales/kz/portal.json
- ghost/i18n/locales/ro/portal.json
- ghost/i18n/locales/pt/portal.json
- ghost/i18n/locales/bn/portal.json
- ghost/i18n/locales/hi/portal.json
- ghost/i18n/locales/lv/portal.json
- ghost/i18n/locales/pa/portal.json
- ghost/i18n/locales/it/portal.json
- ghost/i18n/locales/sw/portal.json
- ghost/i18n/locales/gd/portal.json
- ghost/i18n/locales/ta/portal.json
- ghost/i18n/locales/ja/portal.json
- ghost/i18n/locales/fr/portal.json
- ghost/i18n/locales/uk/portal.json
- ghost/i18n/locales/th/portal.json
- ghost/i18n/locales/nl/portal.json
- ghost/i18n/locales/id/portal.json
- ghost/i18n/locales/el/portal.json
- ghost/i18n/locales/mk/portal.json
- ghost/i18n/locales/nb/portal.json
- ghost/i18n/locales/hu/portal.json
- ghost/i18n/locales/si/portal.json
- ghost/i18n/locales/zh/portal.json
- ghost/i18n/locales/eu/portal.json
- ghost/i18n/locales/he/portal.json
- ghost/i18n/locales/sl/portal.json
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/portal/package.json
- apps/portal/test/unit/components/pages/AccountHomePage/paid-account-actions.test.js
closes https://linear.app/ghost/issue/BER-3393