feat: allow property filter custom forms to submit tokens#4808
Draft
ernst-dev wants to merge 1 commit into
Draft
feat: allow property filter custom forms to submit tokens#4808ernst-dev wants to merge 1 commit into
ernst-dev wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4808 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 952 952
Lines 30816 30817 +1
Branches 11318 11317 -1
=======================================
+ Hits 30081 30082 +1
- Misses 688 728 +40
+ Partials 47 7 -40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Adds a
submitcallback to the props passed to Property Filter custom operator forms, letting a custom form apply its value as a filtering token programmatically — for example, on the Enter key. This resolves #3562: the standardInputdoes not submit the property filter form on Enter by itself, and previously there was no way to trigger submission from within the customizable JSX.What changed
PropertyFilterProps.ExtendedOperatorFormPropsnow includes an optionalsubmit?: () => void. Custom forms call it to apply the current value (the last value propagated viaonChange), equivalent to activating the built-in "Apply" action.property-editor→internal), reusing the same token-apply logic as the dropdown footer's Apply button;token-editor→token-editor-inputs), triggering the editor's existing submit.ExtendedOperator,FilteringProperty) are locally augmented to reference the extended form renderer, so inlineoperators: [{ form }]definitions receivesubmitwith correct typing. This follows the existing// TODO: replace with … from collection-hooks once releasedconvention inproperty-filter/interfaces.ts(mirrorsPropertyFilterFreeTextFiltering). The underlying request ultimately belongs in@cloudscape-design/collection-hooks.Backward compatibility:
submitis optional and additive. Existing custom forms that ignore it are unaffected (regression-guarded by a unit test).Related links, issue #, if available: #3562 (internal: AWSUI-60879)
How has this been tested?
property-filter-extended-operators.test.tsxcovering:submitavailability in the dropdown flow; applying a token via a custom submit button and via the Enter key in the dropdown flow; applying edits from the token editor; and a backward-compatibility guard for forms that never callsubmit.pages/property-filter/custom-form-submit.page.tsxdemonstrating a CloudscapeInputthat submits on Enter.npm run quick-build(TypeScript compile) — green.eslinton all changed files — green (0 errors).property-filterunit suite — 350/350 passing; documenter API snapshot regenerated.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.