eui icon indicating copy to clipboard operation
eui copied to clipboard

[FieldValueToggleFilter] Migrate from class to function component

Open ragini-pandey opened this issue 6 months ago โ€ข 1 comments

Summary

  • What: Converted FieldValueToggleFilter from a class component to a function component.
  • Why: Closes #9473 โ€” part of the [Meta] Class component refactoring effort.
  • How:
    • Replaced FC with FunctionComponent and destructured props inline ({ config, query, onChange }), following the same style used in #9511.
    • Inlined the separate valueChanged helper into onClick, removing one level of indirection.
    • Added FieldValueToggleFilter.displayName = 'FieldValueToggleFilter'.
    • Added a changelog entry.

API Changes

component / parent prop / child change description
No public API changes Internal refactor only

Screenshots

N/A โ€” No visual changes. This is an internal refactor only.

Impact Assessment

  • ~~๐Ÿ”ด Breaking changes~~ โ€” No breaking changes. Public API is identical.
  • ~~๐Ÿ’… Visual changes~~ โ€” No visual changes.
  • ~~๐Ÿงช Test impact~~ โ€” No test changes needed. All existing tests pass.
  • ~~๐Ÿ”ง Hard to integrate~~ โ€” No integration impact. Drop-in replacement.

Impact level: ๐ŸŸข None

Release Readiness

  • ~~Documentation:~~ No docs changes needed (internal refactor; FieldValueToggleFilter is not exported)
  • ~~Figma:~~ N/A
  • ~~Migration guide:~~ N/A (no breaking changes)
  • ~~Adoption plan:~~ N/A (internal refactor)

QA instructions for reviewer

  1. Run the unit tests: cd packages/eui && yarn test-unit --testPathPattern=field_value_toggle_filter
  2. Run the TypeScript check: cd packages/eui && npx tsc --noEmit
  3. Verify EuiSearchBar still works by checking the search bar stories in Storybook.

Checklist before marking Ready for Review

  • [x] Filled out all sections above
  • ~~QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader~~ (no visual changes)
  • ~~QA: Tested in CodeSandbox and Kibana~~ (internal component, not exported)
  • ~~QA: Tested docs changes~~ (no docs changes)
  • [x] Tests: All existing tests pass with no modifications needed
  • [x] Changelog: Added changelog entry
  • ~~Breaking changes:~~ N/A

ragini-pandey avatar May 27 '26 16:05 ragini-pandey

๐Ÿ‘‹ Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

github-actions[bot] avatar May 27 '26 16:05 github-actions[bot]