From 256b21d081423d9d46c876c4c523383a5ad46f3a Mon Sep 17 00:00:00 2001 From: Locrian24 Date: Tue, 28 Jul 2026 10:41:26 -0700 Subject: [PATCH] fix payout alert crash on rewards with no funds transfer, drop dead dashboard prop getStatus assumed every REDEEMED reward has a partnerFundsTransfer, but rewards that never resulted in a payout do not. saasquatch.d.ts already declares the field optional and every other consumer guards it, so this restored the optional chain and corrected the UserQuery type to match. sqm-payout-status-alert.feature already specified the intended behaviour for this case. dashboard_noFormNeededSubtext has had no effect since noFormNeededSubtext was removed from sqm-tax-and-cash-dashboard in 1.15.0, so tenants could still edit copy that renders nowhere. Removed it rather than reconnecting it, since the dashboard now hides the whole tax document section when no form is needed. --- packages/mint-components/CHANGELOG.md | 16 +++++++++++++++- packages/mint-components/src/components.d.ts | 14 -------------- .../sqm-payout-status-alert/usePayoutStatus.ts | 4 ++-- .../tax-and-cash/sqm-tax-and-cash/data.ts | 7 ++++--- .../tax-and-cash/sqm-tax-and-cash/readme.md | 1 - .../sqm-tax-and-cash/sqm-tax-and-cash.tsx | 9 --------- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/packages/mint-components/CHANGELOG.md b/packages/mint-components/CHANGELOG.md index 3dc4af9041..da6e8ce06b 100644 --- a/packages/mint-components/CHANGELOG.md +++ b/packages/mint-components/CHANGELOG.md @@ -7,12 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- \ + - Fixed a crash when a redeemed reward has no `partnerFundsTransfer`, which is the + case for rewards that never resulted in a payout. This matches the documented + behaviour in `sqm-payout-status-alert.feature` and the optional `partnerFundsTransfer` + already declared in `saasquatch.d.ts` + +### Removed + +- \ + - Removed `dashboard_noFormNeededSubtext`, which has had no effect since 1.15.0 when + `noFormNeededSubtext` was removed from \ + ## [1.15.7] - 2025-11-3 ### Changed - \ - - Changed the default text for `registerLabel` to "Choose Your Reward" + - Changed the default text for `registerLabel` to "Claim Your Reward" ## [1.15.6] - 2025-10-28 diff --git a/packages/mint-components/src/components.d.ts b/packages/mint-components/src/components.d.ts index 96104bccc3..888fb64d26 100644 --- a/packages/mint-components/src/components.d.ts +++ b/packages/mint-components/src/components.d.ts @@ -4794,13 +4794,6 @@ export namespace Components { * @uiGroup Dashboard Properties */ "dashboard_newFormButton": string; - /** - * No other statuses or badges will be displayed in the tax form section in this case. - * @uiName Tax form not required text - * @uiGroup Dashboard Properties - * @uiWidget textArea - */ - "dashboard_noFormNeededSubtext": string; /** * @uiName Not registered for indirect tax text * @uiGroup Dashboard Properties @@ -11903,13 +11896,6 @@ declare namespace LocalJSX { * @uiGroup Dashboard Properties */ "dashboard_newFormButton"?: string; - /** - * No other statuses or badges will be displayed in the tax form section in this case. - * @uiName Tax form not required text - * @uiGroup Dashboard Properties - * @uiWidget textArea - */ - "dashboard_noFormNeededSubtext"?: string; /** * @uiName Not registered for indirect tax text * @uiGroup Dashboard Properties diff --git a/packages/mint-components/src/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.ts b/packages/mint-components/src/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.ts index 900dfedd07..54f654fcd7 100644 --- a/packages/mint-components/src/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.ts +++ b/packages/mint-components/src/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.ts @@ -73,8 +73,8 @@ export function getStatus(data: UserQuery): PayoutStatus { const hasTransferredReward = data?.user?.rewards?.data?.find( (reward) => - reward.statuses.includes("REDEEMED") && - reward.partnerFundsTransfer.status === "TRANSFERRED" + reward.statuses?.includes("REDEEMED") && + reward.partnerFundsTransfer?.status === "TRANSFERRED" ); if (!data.user?.impactConnection?.connected || !account) diff --git a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/data.ts b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/data.ts index 4df1c851c8..f5bbceb145 100644 --- a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/data.ts +++ b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/data.ts @@ -170,13 +170,14 @@ export type UserQuery = { customFields?: { [key: string]: any; }; - rewards: { + rewards?: { data: { statuses: string[]; - partnerFundsTransfer: { + // Rewards that never resulted in a payout have no funds transfer + partnerFundsTransfer?: { id: string; status: string; - }; + } | null; }[]; }; managedIdentity?: { diff --git a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/readme.md b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/readme.md index 8b0196be35..a847729e2b 100644 --- a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/readme.md +++ b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/readme.md @@ -37,7 +37,6 @@ | `dashboard_invoiceMoreLabel` | `dashboard_invoice-more-label` | | `string` | `"Next"` | | `dashboard_invoicePrevLabel` | `dashboard_invoice-prev-label` | | `string` | `"Prev"` | | `dashboard_newFormButton` | `dashboard_new-form-button` | | `string` | `"Submit new form"` | -| `dashboard_noFormNeededSubtext` | `dashboard_no-form-needed-subtext` | No other statuses or badges will be displayed in the tax form section in this case. | `string` | `"Tax documents are only required if you are based in the US or joining the referral program of a US based brand."` | | `dashboard_notRegisteredForTax` | `dashboard_not-registered-for-tax` | | `string` | `"Not registered for indirect tax. If you’ve previously registered with your tax authority, contact our {supportLink} to add your information to stay tax compliant."` | | `dashboard_payoutFromImpact` | `dashboard_payout-from-impact` | Displayed under the payout details card. | `string` | `"Your balance may take up to 24 hours to update. Payouts will be sent from our referral program provider, impact.com."` | | `dashboard_payoutHoldAlertDescription` | `dashboard_payout-hold-alert-description` | Part of the alert displayed at the top of the page when there’s been an issue preventing payouts. | `string` | `"Please contact our {supportLink} or check your inbox for an email from our referral program provider, impact.com."` | diff --git a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.tsx b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.tsx index 8f3c0aee4c..020bd7a705 100644 --- a/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.tsx +++ b/packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.tsx @@ -761,15 +761,6 @@ export class TaxAndCashMonolith { */ @Prop() dashboard_taxDocumentSectionSubHeader: string = "{documentType} tax form"; - /** - * No other statuses or badges will be displayed in the tax form section in this case. - * - * @uiName Tax form not required text - * @uiGroup Dashboard Properties - * @uiWidget textArea - */ - @Prop() dashboard_noFormNeededSubtext: string = - "Tax documents are only required if you are based in the US or joining the referral program of a US based brand."; /** * * @uiName Indirect tax section header