Skip to content

Commit bc18a42

Browse files
committed
Fixed all outliers for automatic click events
1 parent e0ea6f3 commit bc18a42

File tree

10 files changed

+18
-21
lines changed

10 files changed

+18
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"@mozilla-protocol/core": "^16.0.1",
7-
"@mozilla/glean": "file:../mozilla-glean-4.0.0.tgz",
7+
"@mozilla/glean": "^4.0.0",
88
"firebase": "^9.23.0",
99
"moment": "^2.30.1",
1010
"plotly.js": "^2.29.0",

src/components/Breadcrumbs.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import React from 'react';
88
import { Link } from 'react-router-dom';
99
import useBreadcrumbs from 'use-react-router-breadcrumbs';
10-
import GleanMetrics from '@mozilla/glean/metrics';
1110

1211
import { isUuid } from '../lib/isUuid';
1312
import { recordClick } from '../lib/telemetry';
@@ -18,7 +17,6 @@ const Breadcrumbs = () => {
1817
return (
1918
<div style={{ marginLeft: '0.5rem', paddingLeft: 16, marginBottom: 15 }} onClick={() => {
2019
recordClick('Breadcrumbs');
21-
GleanMetrics.recordElementClick({'label': 'Breadcrumbs'});
2220
}}>
2321
{breadcrumbs.map(({ breadcrumb, key, location, match }) => {
2422
// `/pings` & `/stream` are included in the routes, but they don't have
@@ -56,7 +54,7 @@ const Breadcrumbs = () => {
5654
<React.Fragment key={key}>
5755
{currentKey && <span className='m-2'>/</span>}
5856
<Link key={key} to={breadcrumb.key}>
59-
<span className='breadcrumb-font'>{displayElement}</span>
57+
<span className='breadcrumb-font' data-glean-label='Breadcrumbs'>{displayElement}</span>
6058
</Link>
6159
</React.Fragment>
6260
);

src/components/Icons/BugIcon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ const BugIcon = () => {
1515
fill='currentColor'
1616
className='bi bi-bug'
1717
viewBox='0 0 16 16'
18+
data-glean-label='Bug'
1819
>
19-
<path d='M4.355.522a.5.5 0 0 1 .623.333l.291.956A4.979 4.979 0 0 1 8 1c1.007 0 1.946.298 2.731.811l.29-.956a.5.5 0 1 1 .957.29l-.41 1.352A4.985 4.985 0 0 1 13 6h.5a.5.5 0 0 0 .5-.5V5a.5.5 0 0 1 1 0v.5A1.5 1.5 0 0 1 13.5 7H13v1h1.5a.5.5 0 0 1 0 1H13v1h.5a1.5 1.5 0 0 1 1.5 1.5v.5a.5.5 0 1 1-1 0v-.5a.5.5 0 0 0-.5-.5H13a5 5 0 0 1-10 0h-.5a.5.5 0 0 0-.5.5v.5a.5.5 0 1 1-1 0v-.5A1.5 1.5 0 0 1 2.5 10H3V9H1.5a.5.5 0 0 1 0-1H3V7h-.5A1.5 1.5 0 0 1 1 5.5V5a.5.5 0 0 1 1 0v.5a.5.5 0 0 0 .5.5H3c0-1.364.547-2.601 1.432-3.503l-.41-1.352a.5.5 0 0 1 .333-.623zM4 7v4a4 4 0 0 0 3.5 3.97V7H4zm4.5 0v7.97A4 4 0 0 0 12 11V7H8.5zM12 6a3.989 3.989 0 0 0-1.334-2.982A3.983 3.983 0 0 0 8 2a3.983 3.983 0 0 0-2.667 1.018A3.989 3.989 0 0 0 4 6h8z' />
20+
<path d='M4.355.522a.5.5 0 0 1 .623.333l.291.956A4.979 4.979 0 0 1 8 1c1.007 0 1.946.298 2.731.811l.29-.956a.5.5 0 1 1 .957.29l-.41 1.352A4.985 4.985 0 0 1 13 6h.5a.5.5 0 0 0 .5-.5V5a.5.5 0 0 1 1 0v.5A1.5 1.5 0 0 1 13.5 7H13v1h1.5a.5.5 0 0 1 0 1H13v1h.5a1.5 1.5 0 0 1 1.5 1.5v.5a.5.5 0 1 1-1 0v-.5a.5.5 0 0 0-.5-.5H13a5 5 0 0 1-10 0h-.5a.5.5 0 0 0-.5.5v.5a.5.5 0 1 1-1 0v-.5A1.5 1.5 0 0 1 2.5 10H3V9H1.5a.5.5 0 0 1 0-1H3V7h-.5A1.5 1.5 0 0 1 1 5.5V5a.5.5 0 0 1 1 0v.5a.5.5 0 0 0 .5.5H3c0-1.364.547-2.601 1.432-3.503l-.41-1.352a.5.5 0 0 1 .333-.623zM4 7v4a4 4 0 0 0 3.5 3.97V7H4zm4.5 0v7.97A4 4 0 0 0 12 11V7H8.5zM12 6a3.989 3.989 0 0 0-1.334-2.982A3.983 3.983 0 0 0 8 2a3.983 3.983 0 0 0-2.667 1.018A3.989 3.989 0 0 0 4 6h8z' data-glean-label='Bug'/>
2021
</svg>
2122
);
2223
};

src/components/Icons/HelpIcon.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ const HelpIcon = () => {
1515
fill='currentColor'
1616
className='bi bi-question-circle'
1717
viewBox='0 0 16 16'
18+
data-glean-label='Help'
1819
>
19-
<path d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z' />
20-
<path d='M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z' />
20+
<path d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z' data-glean-label='Help'/>
21+
<path d='M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z' data-glean-label='Help'/>
2122
</svg>
2223
);
2324
};

src/components/Icons/MoonIcon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import React from 'react';
88

99
const MoonIcon = () => {
1010
return (
11-
<svg xmlns='http://www.w3.org/2000/svg' width='1.75em' height='1.75em' viewBox='0 0 50 50'>
11+
<svg xmlns='http://www.w3.org/2000/svg' width='1.75em' height='1.75em' viewBox='0 0 50 50' data-glean-label='Moon Theme'>
1212
<path
1313
d='M 43.81 29.354 C 43.688 28.958 43.413 28.626 43.046 28.432 C 42.679 28.238 42.251 28.198 41.854 28.321 C 36.161 29.886 30.067 28.272 25.894 24.096 C 21.722 19.92 20.113 13.824 21.683 8.133 C 21.848 7.582 21.697 6.985 21.29 6.578 C 20.884 6.172 20.287 6.022 19.736 6.187 C 10.659 8.728 4.691 17.389 5.55 26.776 C 6.408 36.163 13.847 43.598 23.235 44.451 C 32.622 45.304 41.28 39.332 43.816 30.253 C 43.902 29.96 43.9 29.647 43.81 29.354 Z'
1414
fill='currentColor'
15+
data-glean-label='Moon Theme'
1516
/>
1617
</svg>
1718
);

src/components/Icons/SignOut.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ const SignOutIcon = () => {
1515
fill='currentColor'
1616
className='bi bi-box-arrow-right'
1717
viewBox='0 0 16 16'
18+
data-glean-label='Sign out'
1819
>
1920
<path
2021
fillRule='evenodd'
2122
d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z'
23+
data-glean-label='Sign out'
2224
/>
2325
<path
2426
fillRule='evenodd'
2527
d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z'
28+
data-glean-label='Sign out'
2629
/>
2730
</svg>
2831
);

src/components/Icons/SunIcon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const SunIcon = () => {
1414
viewBox='0 0 24 24'
1515
fill='none'
1616
xmlns='http://www.w3.org/2000/svg'
17+
data-glean-label='Sun Theme'
1718
>
18-
<circle cx='11.9998' cy='11.9998' r='5.75375' fill='currentColor' />
19+
<circle cx='11.9998' cy='11.9998' r='5.75375' fill='currentColor' data-glean-label='Sun Theme'/>
1920
<g>
2021
<circle
2122
cx='3.08982'

src/components/NavBar.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import React from 'react';
88
import { Link } from 'react-router-dom';
99
import PropTypes from 'prop-types';
10-
//import GleanMetrics from '@mozilla/glean/metrics';
1110

1211
import { auth } from '../Firebase';
1312

@@ -33,9 +32,8 @@ const NavBar = ({ authenticated, theme, themeToggler }) => {
3332
>
3433
<div></div>
3534
<div className='navbar-nav' role='presentation'>
36-
<div className='nav-item nav-link cursor-pointer' data-glean-label='Theme' onClick={() => {
35+
<div className='nav-item nav-link cursor-pointer' onClick={() => {
3736
recordClick('Theme');
38-
//GleanMetrics.recordElementClick({'label': 'Theme'});
3937
}}>
4038
<ThemeToggle theme={theme} toggleTheme={themeToggler} />
4139
</div>
@@ -45,30 +43,25 @@ const NavBar = ({ authenticated, theme, themeToggler }) => {
4543
target='_blank'
4644
rel='noopener noreferrer'
4745
style={{ all: 'unset ' }}
48-
data-glean-label='Bug'
4946
onClick={() => {
5047
recordClick('Bug');
51-
//GleanMetrics.recordElementClick({'label': 'Bug'});
5248
}}
5349
>
5450
<BugIcon />
5551
</a>
5652
</div>
5753
<div className='nav-item nav-link cursor-pointer'>
58-
<Link to={`/help`} style={{ all: 'unset' }} data-glean-label='Help' onClick={() => {
54+
<Link to={`/help`} style={{ all: 'unset' }} onClick={() => {
5955
recordClick('Help');
60-
//GleanMetrics.recordElementClick({'label': 'Help'});
6156
}}>
6257
<HelpIcon />
6358
</Link>
6459
</div>
6560
<div
6661
className='nav-item nav-link cursor-pointer'
6762
type='btn btn-lg '
68-
data-glean-label='Sign out'
6963
onClick={() => {
7064
recordClick('Sign out');
71-
//GleanMetrics.recordElementClick({'label': 'Sign out'});
7265
auth.signOut();
7366
}}
7467
>

src/components/ReadMore.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import React, { useMemo, useState } from 'react';
88
import PropTypes from 'prop-types';
9-
import GleanMetrics from '@mozilla/glean/metrics';
109
import { recordClick } from '../lib/telemetry';
1110

1211
const ReadMore = ({ numberOfLines = 3, text }) => {
@@ -27,7 +26,6 @@ const ReadMore = ({ numberOfLines = 3, text }) => {
2726
<div className='cursor-pointer' onClick={
2827
() => {
2928
recordClick('Expand payload');
30-
GleanMetrics.recordElementClick({'label': 'Expand payload'});
3129
setShow((prev) => !prev)}}
3230
>
3331
<span
@@ -38,6 +36,7 @@ const ReadMore = ({ numberOfLines = 3, text }) => {
3836
display: '-webkit-box',
3937
WebkitBoxOrient: 'vertical'
4038
}}
39+
data-glean-label='Expand payload'
4140
>
4241
{formattedText}
4342
</span>

src/lib/telemetry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function isTelemetryEnabled() {
2020
// If the app environment is not defined (likely because of local development),
2121
// then don't collect any data.
2222
if (typeof(process.env.REACT_APP_ENV) === "undefined") {
23-
return true;
23+
return false;
2424
}
2525

2626
return navigator.doNotTrack !== '1';

0 commit comments

Comments
 (0)