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

mendersoftware / gui / 1235064739

01 Apr 2024 05:03AM UTC coverage: 83.603% (-16.4%) from 99.964%
1235064739

Pull #4368

gitlab-ci

web-flow
chore: Bump the development-dependencies group with 18 updates

Bumps the development-dependencies group with 18 updates:

| Package | From | To |
| --- | --- | --- |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.24.0` | `7.24.3` |
| [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) | `7.23.10` | `7.24.1` |
| [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) | `7.24.0` | `7.24.3` |
| [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.24.0` | `7.24.3` |
| [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) | `7.23.3` | `7.24.1` |
| [@testing-library/react](https://github.com/testing-library/react-testing-library) | `14.2.1` | `14.2.2` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `7.1.0` | `7.4.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `7.1.0` | `7.4.0` |
| [autoprefixer](https://github.com/postcss/autoprefixer) | `10.4.17` | `10.4.19` |
| [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) | `3.36.0` | `3.36.1` |
| [esbuild-loader](https://github.com/privatenumber/esbuild-loader) | `4.0.3` | `4.1.0` |
| [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | `7.33.2` | `7.34.1` |
| [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs) | `0.24.0` | `0.25.0` |
| [eslint-webpack-plugin](https://github.com/webpack-contrib/eslint-webpack-plugin) | `4.0.1` | `4.1.0` |
| [msw](https://github.com/mswjs/msw) | `2.2.2` | `2.2.13` |
| [postcss](https://github.com/postcss/postcss) | `8.4.35` | `8.4.38` |
| [webpack](https://github.com/webpack/webpack) | `5.90.3` | `5.91.0` |
| [yarn](https://github.com/yarnpkg/yarn) | ... (continued)
Pull Request #4368: chore: Bump the development-dependencies group with 18 updates

4434 of 6325 branches covered (70.1%)

8408 of 10057 relevant lines covered (83.6%)

140.68 hits per line

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

54.76
/src/js/tracking.js
1
import ReactGA4 from 'react-ga4';
2

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

6
const ReactGA = ReactGA4.default;
183✔
7

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

101
const Tracking = new Tracker();
183✔
102
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