Skip to content

feat: allow property filter custom forms to submit tokens#4808

Draft
ernst-dev wants to merge 1 commit into
mainfrom
feat/property-filter-custom-form-submit
Draft

feat: allow property filter custom forms to submit tokens#4808
ernst-dev wants to merge 1 commit into
mainfrom
feat/property-filter-custom-form-submit

Conversation

@ernst-dev

Copy link
Copy Markdown
Member

Description

Adds a submit callback 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 standard Input does 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.ExtendedOperatorFormProps now includes an optional submit?: () => void. Custom forms call it to apply the current value (the last value propagated via onChange), equivalent to activating the built-in "Apply" action.
  • The callback is wired into both custom-form render sites:
    • the filtering dropdown flow (property-editorinternal), reusing the same token-apply logic as the dropdown footer's Apply button;
    • the token editor flow (token-editortoken-editor-inputs), triggering the editor's existing submit.
  • The components-package operator/property types (ExtendedOperator, FilteringProperty) are locally augmented to reference the extended form renderer, so inline operators: [{ form }] definitions receive submit with correct typing. This follows the existing // TODO: replace with … from collection-hooks once released convention in property-filter/interfaces.ts (mirrors PropertyFilterFreeTextFiltering). The underlying request ultimately belongs in @cloudscape-design/collection-hooks.

Backward compatibility: submit is 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?

  • New unit tests in property-filter-extended-operators.test.tsx covering: submit availability 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 call submit.
  • Added a dev page pages/property-filter/custom-form-submit.page.tsx demonstrating a Cloudscape Input that submits on Enter.
  • npm run quick-build (TypeScript compile) — green.
  • eslint on all changed files — green (0 errors).
  • Full property-filter unit 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

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.61%. Comparing base (f97729a) to head (4a895d3).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Feature Request]: Explicitly Submit Custom Property Filter Form

1 participant