Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/components/tooltip/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ class MarkerTooltipContents extends React.PureComponent<Props> {
// Add the details for the markers based on their Marker schema.
const schema = getSchemaFromMarker(markerSchemaByName, marker.data);
if (schema) {
if (schema.description) {
const key = schema.name + '-description';
details.push(
<TooltipDetail key={key} label="Description">
<div className="tooltipDetailsDescription">
{schema.description}
</div>
</TooltipDetail>
);
}

for (const field of schema.fields) {
if (field.hidden) {
// Do not include hidden fields.
Expand Down Expand Up @@ -268,17 +279,6 @@ class MarkerTooltipContents extends React.PureComponent<Props> {
</TooltipDetail>
);
}

if (schema.description) {
const key = schema.name + '-description';
details.push(
<TooltipDetail key={key} label="Description">
<div className="tooltipDetailsDescription">
{schema.description}
</div>
</TooltipDetail>
);
}
}

switch (data.type) {
Expand Down
38 changes: 19 additions & 19 deletions src/test/components/__snapshots__/MarkerChart.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`MarkerChart EmptyReasons shows a reason when a profile has no markers 1`] = `
<div
Expand Down Expand Up @@ -191,28 +191,28 @@ exports[`MarkerChart persists the selected marker tooltips properly 1`] = `
<div
class="tooltipLabel"
>
Name
Description
:
</div>
Marker B
<div
class="tooltipLabel"
class="tooltipDetailsDescription"
>
Entry Type
:
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
</div>
measure
<div
class="tooltipLabel"
>
Description
Name
:
</div>
Marker B
<div
class="tooltipDetailsDescription"
class="tooltipLabel"
>
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
Entry Type
:
</div>
measure
<div
class="tooltipLabel"
>
Expand Down Expand Up @@ -374,28 +374,28 @@ exports[`MarkerChart renders the hoveredItem markers properly 2`] = `
<div
class="tooltipLabel"
>
Name
Description
:
</div>
Marker B
<div
class="tooltipLabel"
class="tooltipDetailsDescription"
>
Entry Type
:
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
</div>
measure
<div
class="tooltipLabel"
>
Description
Name
:
</div>
Marker B
<div
class="tooltipDetailsDescription"
class="tooltipLabel"
>
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
Entry Type
:
</div>
measure
<div
class="tooltipLabel"
>
Expand Down
36 changes: 18 additions & 18 deletions src/test/components/__snapshots__/StackChart.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -869,28 +869,28 @@ exports[`MarkerChart shows a tooltip when hovering 1`] = `
<div
class="tooltipLabel"
>
Name
Description
:
</div>
componentB
<div
class="tooltipLabel"
class="tooltipDetailsDescription"
>
Entry Type
:
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
</div>
measure
<div
class="tooltipLabel"
>
Description
Name
:
</div>
componentB
<div
class="tooltipDetailsDescription"
class="tooltipLabel"
>
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
Entry Type
:
</div>
measure
<div
class="tooltipLabel"
>
Expand Down Expand Up @@ -936,28 +936,28 @@ exports[`MarkerChart shows a tooltip when hovering 2`] = `
<div
class="tooltipLabel"
>
Name
Description
:
</div>
componentA
<div
class="tooltipLabel"
class="tooltipDetailsDescription"
>
Entry Type
:
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
</div>
measure
<div
class="tooltipLabel"
>
Description
Name
:
</div>
componentA
<div
class="tooltipDetailsDescription"
class="tooltipLabel"
>
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
Entry Type
:
</div>
measure
<div
class="tooltipLabel"
>
Expand Down
18 changes: 9 additions & 9 deletions src/test/components/__snapshots__/TooltipMarker.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4684,28 +4684,28 @@ exports[`TooltipMarker renders tooltips for various markers: UserTiming-12.5 1`]
<div
class="tooltipLabel"
>
Name
Description
:
</div>
foobar
<div
class="tooltipLabel"
class="tooltipDetailsDescription"
>
Entry Type
:
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
</div>
mark
<div
class="tooltipLabel"
>
Description
Name
:
</div>
foobar
<div
class="tooltipDetailsDescription"
class="tooltipLabel"
>
UserTiming is created using the DOM APIs performance.mark() and performance.measure().
Entry Type
:
</div>
mark
<div
class="tooltipLabel"
>
Expand Down