• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / gui / 885500671

pending completion
885500671

Pull #3734

gitlab-ci

web-flow
chore: bump @babel/eslint-parser from 7.21.3 to 7.21.8

Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.21.3 to 7.21.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.21.8/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #3734: chore: bump @babel/eslint-parser from 7.21.3 to 7.21.8

4387 of 6376 branches covered (68.8%)

8055 of 9773 relevant lines covered (82.42%)

122.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.94
/src/js/tracking.js
1
/* eslint-disable import/no-named-as-default-member */
2
import ReactGA from 'react-ga';
3

4
const cookieConsentCSS = 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css';
191✔
5
const cookieConsentJS = 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js';
191✔
6

7
class Tracker {
8
  constructor() {
9
    this.initialized = false;
191✔
10
    this.trackingEnabled = true;
191✔
11
    this.currentPageView = null;
191✔
12
    this.currentOrganizationUser = null;
191✔
13
  }
14
  cookieconsent() {
15
    return new Promise(resolve => {
×
16
      const style = document.createElement('link');
×
17
      style.href = cookieConsentCSS;
×
18
      style.rel = 'stylesheet';
×
19
      style.async = true;
×
20
      document.head.appendChild(style);
×
21
      //
22
      const script = document.createElement('script');
×
23
      script.src = cookieConsentJS;
×
24
      script.async = false;
×
25
      script.addEventListener('load', () => {
×
26
        window.cookieconsent.initialise({
×
27
          palette: {
28
            popup: {
29
              background: '#5d0f43',
30
              text: '#ffffff'
31
            },
32
            button: {
33
              background: '#73a4ad',
34
              text: '#ffffff'
35
            }
36
          },
37
          position: 'bottom-left',
38
          type: 'opt-out',
39
          content: {
40
            message: 'We use cookies to analyze our traffic so we can improve our website and give you a better experience.',
41
            link: 'View our cookie policy',
42
            href: 'https://northern.tech/legal/cookies'
43
          },
44
          autoOpen: true,
45
          revokable: false,
46
          law: {
47
            regionalLaw: false
48
          },
49
          onStatusChange: status => {
50
            let hasConsented = status == 'allow';
×
51
            resolve({ trackingConsentGiven: hasConsented });
×
52
          }
53
        });
54
      });
55
      document.body.appendChild(script);
×
56
    });
57
  }
58
  exception(error) {
59
    if (this.initialized && this.trackingEnabled) {
×
60
      ReactGA.exception(error);
×
61
    }
62
  }
63
  event(data) {
64
    if (this.initialized && this.trackingEnabled) {
26!
65
      ReactGA.event(data);
×
66
    }
67
  }
68
  initialize(trackingCode) {
69
    if (this.initialized && this.trackingEnabled) {
×
70
      return false;
×
71
    }
72
    ReactGA.initialize(trackingCode);
×
73
    this.initialized = true;
×
74
    return true;
×
75
  }
76
  pageview(data) {
77
    if (data) {
2!
78
      this.currentPageView = data;
2✔
79
    } else {
80
      data = this.currentPageView;
×
81
    }
82
    if (this.initialized && this.trackingEnabled) {
2!
83
      ReactGA.pageview(data);
×
84
    }
85
  }
86
  set(value) {
87
    if (this.initialized && this.trackingEnabled) {
×
88
      ReactGA.set(value);
×
89
    }
90
  }
91
  setOrganizationUser(organization, user) {
92
    if (this.initialized && this.trackingEnabled && this.currentOrganizationUser != { organization, user }) {
×
93
      this.currentOrganizationUser = { organization, user };
×
94
      this.set({ dimension1: organization.plan });
×
95
      this.set({ dimension2: organization.id });
×
96
      this.set({ dimension3: user.id });
×
97
      this.set({ userId: user.id });
×
98
    }
99
  }
100
  setTrackingEnabled(trackingEnabled) {
101
    this.trackingEnabled = trackingEnabled;
6✔
102
  }
103
}
104

105
const Tracking = new Tracker();
191✔
106
export default Tracking;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc