Gayatri - fix(quick-setup): trim canonical team codes before comparison (follow… - #5550
Open
sawantgayatri19 wants to merge 1 commit into
Open
sawantgayatri19 wants to merge 1 commit into
sawantgayatri19 wants to merge 1 commit into
Conversation
…-up to PR #5479) PR #5479 fixed whitespace-trimming for suggested team codes in QuickSetupModal.jsx's dropdown-options builder, but AddNewTitleModal.jsx uses a separate QSTTeamCodes-based flow that was never touched by that fix -- explaining why 'Invalid Team Code' errors persisted after that PR merged. Root cause: the live-validation effect and existTeamCodes Set both trimmed the user's selected value before comparing, but compared it against code?.value from QSTTeamCodes without also trimming that side. If the canonical list itself contains whitespace-padded codes, a correctly-trimmed selection can never match via strict equality. Fixed both comparison sites to trim code?.value as well, so a whitespace-padded canonical entry and a trimmed selection are correctly recognized as equal.
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
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.



Description
Fixes # 5479 (still occurring 2 weeks after merge — Invalid Team Code error when selecting a suggested QST team code)
PR #5479 fixed whitespace trimming for suggested team codes, but only in
QuickSetupModal.jsx's dropdown-options builder.AddNewTitleModal.jsxuses a completely separateQSTTeamCodes-based validation flow that PR never touched — explaining why the error persisted after that fix merged.Root cause: both the live-validation effect and the
existTeamCodesSet correctly trimmed the user's selected value before comparing, but compared it againstcode?.valuefromQSTTeamCodeswithout trimming that side too. A whitespace-padded canonical list entry can never match a correctly-trimmed selection via strict equality, even though they represent the same team code.Related PRs (if any):
Follow-up to #5479.
Main changes explained:
AddNewTitleModal.jsx— trimcode?.valuein both the live-validationuseEffectcomparison and theexistTeamCodesSet-building logic, so a whitespace-padded canonical entry and a trimmed user selection are correctly recognized as equal.How to test:
fix/team-code-whitespace-comparison-followupnpm install, run frontend + backend dev serversQSTTeamCodesentry known to have this issue)Note:
No existing unit tests cover
AddNewTitleModal.jsx; happy to add coverage for this specific comparison logic if requested during review.