Fix payout status alert crash on rewards without a funds transfer, remove dead dashboard prop - #514
Closed
Coleton (Locrian24) wants to merge 1 commit into
Closed
Fix payout status alert crash on rewards without a funds transfer, remove dead dashboard prop#514Coleton (Locrian24) wants to merge 1 commit into
Coleton (Locrian24) wants to merge 1 commit into
Conversation
…ashboard 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fixes to
1.x, both found while assessing whether a customer on 1.14.x could safely move to1.x.1.
<sqm-payout-status-alert>crashes for some participantsgetStatusassumed everyREDEEMEDreward has apartnerFundsTransfer:Rewards that never resulted in a payout (credit rewards, for example) have no funds transfer, so this throws a
TypeErrorand takes out the alert. Three things say this was an oversight rather than intent:saasquatch.d.tsalready declarespartnerFundsTransfer?as optional.sqm-rewards-table-status-cell.tsx:72andsqm-referral-table-rewards-cell.tsx:122both use?..sqm-payout-status-alert.featurealready specifies this exact case: the| NEW_PAYEE_REVIEW | does not have | N/A | is not shown |row expects the banner to be hidden, not for the component to blow up.Restored the optional chain and corrected the
UserQuerytype indata.ts, which declared the field non-nullable and disagreed with both the schema and the surrounding code. With the fix, the missing-transfer case falls through toDONEand the banner stays hidden, matching the feature file.2.
dashboard_noFormNeededSubtextis disconnected1.15.0 removed
noFormNeededSubtextfrom<sqm-tax-and-cash-dashboard>along with the block that rendered it, but the wrapper<sqm-tax-and-cash>kept declaringdashboard_noFormNeededSubtext. BecauseextractPropsforwards prefixed props generically, the value became an ignored extra key — so tenants could still edit copy in the admin UI that renders nowhere.Removed it rather than reconnecting it: the dashboard now hides the entire tax document section when no form is needed, so there is no longer a place for that sentence to live. Updated the generated
components.d.tsandreadme.mdto match.Also
Corrected the 1.15.7 changelog entry, which stated the new
registerLabeldefault was "Choose Your Reward". The value that shipped is "Claim Your Reward".Test plan
tsc --noEmitpasses clean onpackages/mint-componentsREDEEMEDcredit reward and nopartnerFundsTransfer(the previously crashing case)NEW_PAYEE_REVIEW+ transferred reward case still shows the account review bannerdashboard_noFormNeededSubtextthat needs migratingFollow-up, not in this PR
The 1.15.0 removal of
noFormNeededSubtextandtaxAndPayoutsDescriptionfrom<sqm-tax-and-cash-dashboard>was never recorded in the changelog. Anyone reviewing a 1.14 to 1.15 bump fromCHANGELOG.mdalone would miss both. Worth backfilling those entries.