Skip to content

feat(tools): migrates object_topology to functional TypeScript component#1986

Open
hodanoori wants to merge 3 commits into
masterfrom
hoda-react-19-object-topology
Open

feat(tools): migrates object_topology to functional TypeScript component#1986
hodanoori wants to merge 3 commits into
masterfrom
hoda-react-19-object-topology

Conversation

@hodanoori
Copy link
Copy Markdown
Contributor

@hodanoori hodanoori commented Mar 31, 2026

Summary

Migrates object_topology.jsx from a React class component to a functional TypeScript component as part of the React 19 migration epic (#1774).

Changes Made

  • Replace class component App with functional component ObjectTopology in TypeScript
  • Convert class state (filterCollapsed, selectedTypes, details) to useState hooks
  • Replace componentDidMount / componentWillUnmount with a single useEffect with cleanup
  • Replace UNSAFE_componentWillReceiveProps with useEffect watching the objects prop
  • Remove Graph.nodeLabel call — not needed in the functional implementation
  • Add TypeScript interfaces for TopologyObject, Details, and ObjectTopologyProps
  • Fix onBlur on the filter dropdown to properly collapse it instead of console.log
  • Add object_topology.test.tsx with 21 unit tests covering mount/unmount, filter dropdown, graph node/link filtering, and details popover

Related Issues

Screenshots (if applicable)

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

…nt (#1964)

- Replace class component App with functional component ObjectTopology
- Convert state (filterCollapsed, selectedTypes, details) to useState
- Replace componentDidMount/componentWillUnmount with useEffect cleanup
- Replace UNSAFE_componentWillReceiveProps with useEffect([objects])
- Remove Graph.nodeLabel call (not needed in functional implementation)
- Add TypeScript interfaces for TopologyObject, Details, ObjectTopologyProps
- Fix onBlur to actually collapse the dropdown instead of console.log
- Add object_topology.test.tsx with 21 tests covering all component behaviour
@hodanoori hodanoori self-assigned this Mar 31, 2026
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.

[Task](object-topology): Migrate tools/universal_search/topology/components/object_topology.jsx

2 participants