-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to copy node data from graph #312
Add ability to copy node data from graph #312
Conversation
Signed-off-by: Everett Ross <[email protected]>
Signed-off-by: Everett Ross <[email protected]>
Signed-off-by: Everett Ross <[email protected]>
Signed-off-by: Everett Ross <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #312 +/- ##
==========================================
+ Coverage 82.54% 82.55% +<.01%
==========================================
Files 140 141 +1
Lines 3151 3141 -10
Branches 651 649 -2
==========================================
- Hits 2601 2593 -8
+ Misses 439 438 -1
+ Partials 111 110 -1
Continue to review full report at Codecov.
|
@everett980 please follow the same guidelines for PR description as for commit messages (described in CONTRIBUTING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. A few comments. Let me know if anything looks awry.
.DiffNode--popover .DiffNode--copyIcon, | ||
.DiffNode:not(:hover) .DiffNode--copyIcon { | ||
display: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the use of :not(...)
necessary? Would something like the following work?
.DiffNode .DiffNode--copyIcon { display: none; }
.DiffNode:hover .DiffNode--copyIcon { display: unset; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason to avoid :not
?
I started using to avoid defining multiple styles to achieve one goal (hiding something).
I only discovered when working on #310 when I was styling based on both hover state and focus state in: /packages/jaeger-ui/src/components/TraceDiff/TraceDiffGraph/TraceDiffGraph.css
That seemed easier than defining multiple styles so I started applying to more places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Word.
packages/jaeger-ui/src/components/TraceDiff/TraceDiffGraph/drawNode.css
Outdated
Show resolved
Hide resolved
@@ -57,6 +59,9 @@ class DiffNode extends React.PureComponent<Props> { | |||
</td> | |||
<td className={`DiffNode--labelCell ${className}`}> | |||
<strong>{service}</strong> | |||
<span className="DiffNode--copyIcon"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You migth be able to skip having a wrapping node if you add a className
prop to the CopyIcon
component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is cleaner, added
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.css
Show resolved
Hide resolved
Signed-off-by: Everett Ross <[email protected]>
Signed-off-by: Everett Ross <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
it('renders as expected', () => { | ||
expect(wrapper.find('a').prop('href')).toBe(href); | ||
expect(wrapper.find('a').prop('title')).toBe(title); | ||
expect(wrapper.find('a').text()).toMatch(/childrenText/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would typically recommend saving to a const, const anchor = wrapper.find(...)
* * Refactor KV Table copy icon into standalone component Signed-off-by: Everett Ross <[email protected]> * Adhere to prettier rules Signed-off-by: Everett Ross <[email protected]> * Add <CopyIcon /> to drawNode and OpNode Signed-off-by: Everett Ross <[email protected]> * Improve variable names for splitting CopyIcon into own file Signed-off-by: Everett Ross <[email protected]> * Clean up CopyIcon Signed-off-by: Everett Ross <[email protected]> * Fix KeyValuesTable test coverage Signed-off-by: Everett Ross <[email protected]> Signed-off-by: vvvprabhakar <[email protected]>
## Which problem is this PR solving? - Resolves #1503 ## Short description of the changes - Adds a second Copy icon that copies value only - Change Copy JSON icon to `snippets`, to be visually different - Reduce fade-out time for tooltip Original Copy JSON was added in #292 / #312. --------- Signed-off-by: Yuri Shkuro <[email protected]>
Which problem is this PR solving?
Short description of the changes