Skip to content
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

Conversation

everett980
Copy link
Collaborator

@everett980 everett980 commented Jan 11, 2019

Which problem is this PR solving?

Short description of the changes

  • Move KeyValueTable's copy icon into a component () and consume that component in KeyValueTable, OpNode, and drawNode.

image

Signed-off-by: Everett Ross <reverett@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>
@everett980 everett980 requested a review from tiffon January 11, 2019 16:04
@ghost ghost assigned everett980 Jan 11, 2019
@ghost ghost added the review label Jan 11, 2019
@codecov
Copy link

codecov bot commented Jan 11, 2019

Codecov Report

Merging #312 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...rc/components/TraceDiff/TraceDiffGraph/drawNode.js 20% <ø> (ø) ⬆️
...r-ui/src/components/TracePage/TraceGraph/OpNode.js 100% <ø> (ø) ⬆️
...ckages/jaeger-ui/src/components/common/CopyIcon.js 100% <100%> (ø)
...e/TraceTimelineViewer/SpanDetail/KeyValuesTable.js 100% <100%> (+8.82%) ⬆️
...neViewer/TimelineHeaderRow/TimelineViewingLayer.js 87.03% <0%> (-1.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52780c8...7a31a5f. Read the comment docs.

@yurishkuro
Copy link
Member

@everett980 please follow the same guidelines for PR description as for commit messages (described in CONTRIBUTING)

Copy link
Member

@tiffon tiffon left a 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;
}
Copy link
Member

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; }

Copy link
Collaborator Author

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.

Copy link
Member

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/common/copy-icon.js 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">
Copy link
Member

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?

Copy link
Collaborator Author

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/common/copy-icon.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/common/copy-icon.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/common/copy-icon.js Outdated Show resolved Hide resolved
@everett980 everett980 changed the title Issue 304 ability to copy node data from graph Add ability to copy node data from graph Jan 16, 2019
Signed-off-by: Everett Ross <reverett@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>
Copy link
Member

@tiffon tiffon left a 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/);
Copy link
Member

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(...)

@ghost ghost assigned tiffon Jan 18, 2019
@tiffon tiffon merged commit 6597593 into jaegertracing:master Jan 18, 2019
@ghost ghost removed the review label Jan 18, 2019
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
* * Refactor KV Table copy icon into standalone component

Signed-off-by: Everett Ross <reverett@uber.com>

* Adhere to prettier rules

Signed-off-by: Everett Ross <reverett@uber.com>

* Add <CopyIcon /> to drawNode and OpNode

Signed-off-by: Everett Ross <reverett@uber.com>

* Improve variable names for splitting CopyIcon into own file

Signed-off-by: Everett Ross <reverett@uber.com>

* Clean up CopyIcon

Signed-off-by: Everett Ross <reverett@uber.com>

* Fix KeyValuesTable test coverage

Signed-off-by: Everett Ross <reverett@uber.com>

Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
yurishkuro added a commit that referenced this pull request Jun 17, 2023
## 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 <ysh@meta.com>
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.

3 participants