Skip to content

feat(jsonforms-renderers): SearchSelect x-search.defaultFrom - #107

Open
ginaxu1 wants to merge 3 commits into
mainfrom
feat/search-select-default-from
Open

ginaxu1 wants to merge 3 commits into
mainfrom
feat/search-select-default-from

Conversation

@ginaxu1

@ginaxu1 ginaxu1 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds x-search.defaultFrom on SearchSelectControl so a field can mirror a sibling search-select value: fill while empty, and overwrite whenever the sibling changes. The field stays editable between sibling changes.
  • Documents the option in search-select-modes.md and covers empty-copy / sibling-change overwrite / user-edit-until-sibling-change / clear-refill / readonly with tests.
  • Enables the NPQS trader apply form to keep Country of Consignee in step with Name of Importing Country (companion artifacts PR), matching confirmed GeNS-style behaviour.

Test plan

  • vitest run src/renderers/SearchSelectControl.test.tsx (17 passing)
  • After release bump of @opennsw/jsonforms-renderers, verify in trader-app: selecting importing country fills empty consignee country; editing consignee is allowed until importing country changes again (then consignee follows); clearing consignee refills from importing country

Notes

  • Confirmed in LSFLK/lsf-govtech-tnsw#149: Consignee Country auto-fills from Importing Country and updates when Importing Country changes; field remains editable.
  • Version stays at 0.11.0 on purpose — release uses the separate version-bump workflow after merge.
  • Consumers ignore unknown x-search keys until this package is published and apps pick it up.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9dade641-837b-42ea-8763-6d9268754bdb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ginaxu1
ginaxu1 marked this pull request as draft October 12, 2026 00:36
@ginaxu1

ginaxu1 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Awaiting scope confirmation by Poorima in https://github.com/LSFLK/lsf-govtech-tnsw/issues/149#issuecomment-6115676289

@github-actions github-actions Bot added Package/jsonforms-renderers Changes to packages/jsonforms-renderers Type/New Feature New feature request labels Oct 13, 2026
@ginaxu1

ginaxu1 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated for the confirmed rule from Poornima https://github.com/LSFLK/lsf-govtech-tnsw/issues/149#issuecomment-6119098256

  • Consignee Country still editable
  • When Importing Country changes, Consignee Country is updated to match (overwrites a prior edit)
  • Still fills while empty / after clear

@ginaxu1
ginaxu1 marked this pull request as ready for review October 13, 2026 14:53
ginaxu1 and others added 3 commits October 13, 2026 20:23
Prefill a search-select from a sibling field while it is empty, without
overwriting a value the trader already set. Needed so NPQS consignee
country can default from importing country without a JSON Forms COPY rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
tsc flagged 'type' being specified twice when spreading the shared
country object shape into the SearchSelect defaultFrom schema fixtures.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match confirmed GeNS-style rules: Consignee Country stays editable, but
follows Importing Country whenever that sibling changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ginaxu1
ginaxu1 force-pushed the feat/search-select-default-from branch from 97b6b42 to 8c826c4 Compare October 13, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Package/jsonforms-renderers Changes to packages/jsonforms-renderers Type/New Feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant