Project

General

Profile

Refactor #31599

Simplify TaxonomySwitcher component

Added by Tomer Brisker 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

there are lots of TaxonomyDropdown internals being passed from TaxonomySwitcher component that can be handled inside the TaxonomyDropdown

Associated revisions

Revision c338ce2d (diff)
Added by Tomer Brisker 9 months ago

Fixes #31599 - Simplify TaxonomySwitcher (#8242)

  • Fixes #31599 - Simplify TaxonomySwitcher

Move internals that depend on the taxonomy type into TaxonomyDropdown
instead of passing as a bunch of props.

  • Refs #31599 - use useReducer hook to filter taxonomies

Instead of using two states and an effect to handle filtering, using a
reducer lets us calculate the filtered taxonomies directly

  • Refs #31599 - use undefined to denote Any taxonomy scope

This is inline with what we do on the server side, removes the need to
do string comparisons and simplifies handling this case.

  • Refs #31599 - ensure taxonomyType is organization or location

History

#1 Updated by The Foreman Bot 9 months ago

  • Assignee set to Tomer Brisker
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8242 added

#2 Updated by The Foreman Bot 9 months ago

  • Fixed in Releases 2.4.0 added

#3 Updated by Tomer Brisker 9 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF