Phase 3.2 (task 2): refactor(DependencyGraph): convert class component to functional#3591
Conversation
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3591 +/- ##
==========================================
+ Coverage 89.13% 89.15% +0.01%
==========================================
Files 304 304
Lines 9712 9727 +15
Branches 2563 2506 -57
==========================================
+ Hits 8657 8672 +15
Misses 1051 1051
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Refactors the Jaeger UI DependencyGraph page from a React class component to a hook-based functional component, updating associated unit tests to align with functional-component patterns.
Changes:
- Converted
DependencyGraphPageImplfrom a class component to a functional component usinguseState,useEffect, anduseRef. - Removed
withRoutePropswrapping from the default export and kept the Reduxconnect(...)wrapper. - Refactored
DependencyGraphunit tests to stop relying on component instances/state and instead assert behavior via mocked child props.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/jaeger-ui/src/components/DependencyGraph/index.tsx | Migrates component logic to hooks, adjusts lifecycle behavior, and simplifies export to connect(...). |
| packages/jaeger-ui/src/components/DependencyGraph/index.test.js | Updates tests for functional component patterns by asserting through mocked DAG / DAGOptions props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…m class conversion Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
packages/jaeger-ui/src/components/DependencyGraph/index.test.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
|
@yurishkuro ptal |
Which problem is this PR solving?
Description of the changes
DependencyGraph/index.tsxfrom class component to a functional component.withRoutePropsis never used in this component, so it's safely removed.How was this change tested?
Checklist
make lint testAI Usage in this PR (choose one)
See AI Usage Policy.