Skip to content

Gayatri - πŸ”₯ Invalid Team Code error when selecting a suggested QST team code … - #5479

Merged
one-community merged 1 commit into
developmentfrom
hotfix/team-code-whitespace-trim
Aug 29, 2026
Merged

Gayatri - πŸ”₯ Invalid Team Code error when selecting a suggested QST team code …#5479
one-community merged 1 commit into
developmentfrom
hotfix/team-code-whitespace-trim

Conversation

@sawantgayatri19

Copy link
Copy Markdown

Description

Fixes an urgent bug in the Quick Setup Title (QST) "Edit Title" modal where selecting a valid, actively-suggested team code and clicking Confirm incorrectly showed "Invalid team code. Please provide a valid team code."

Root Cause

QSTTeamCodes in QuickSetupModal.jsx is built from Redux state (stateTeamCodes). If any team code in that state has leading/trailing whitespace (common with admin-entered or spreadsheet-sourced data), the dropdown's fuzzy search still matched and displayed it correctly as a suggestion. However, the code was stored with its whitespace intact, while the confirm-time validation trimmed only the selected value before comparing it against the untrimmed array β€” causing an exact-match failure even though it was the exact code that had just been suggested.

Fix

Trim both value and label when building QSTTeamCodes, for both the string and object code formats, so whitespace never causes a mismatch between what's suggested and what's validated.

How to test

  1. Check into this branch and run npm install and yarn start:skip-tests
  2. Open a user's profile β†’ Edit Title (QST) modal
  3. Type into the Team Code field to trigger the autocomplete suggestions
  4. Select a suggested code and click Confirm
  5. Confirm it saves successfully with no "Invalid team code" error

Testing

Added a new unit test simulating a team code with trailing whitespace, verifying the full select β†’ confirm flow succeeds and the submitted payload contains the trimmed value. All existing tests (2198 total) and lint pass.

@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

βœ… Deploy Preview for highestgoodnetwork-dev ready!

Name Link
πŸ”¨ Latest commit f55940d
πŸ” Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a925f7f5335d70008fe28d9
😎 Deploy Preview https://deploy-preview-5479--highestgoodnetwork-dev.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
πŸ€– Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

@one-community one-community changed the title Gayatri - Fix Invalid Team Code error when selecting a suggested QST team code … Gayatri - πŸ”₯ Invalid Team Code error when selecting a suggested QST team code … Aug 29, 2026
@one-community
one-community merged commit d54be6f into development Aug 29, 2026
10 checks passed
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.

3 participants