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

mozilla / blurts-server / 743341b5-9a4c-4b6a-b69a-4764b1c64ae2

pending completion
743341b5-9a4c-4b6a-b69a-4764b1c64ae2

push

circleci

GitHub
Merge pull request #2860 from mozilla/MNTOR-1258-Sign-up-email-undefined

282 of 1387 branches covered (20.33%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 4 files covered. (100.0%)

959 of 3746 relevant lines covered (25.6%)

4.17 hits per line

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

0.0
/src/views/emails/email-signup-report.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import { breachCardPartial } from './email-breach-card.js'
6
import { getMessage } from '../../utils/fluent.js'
7

8
const emailStyle = `
×
9
  color: black;
10
  background: #f9f9fa;
11
  padding: 36px 0 24px;
12
`
13

14
const breachSummaryTableStyle = `
×
15
  margin: auto;
16
  max-width: 600px;
17
`
18

19
const breachSummaryCardStyle = `
×
20
  background: #eeeeee;
21
  border-radius: 6px;
22
  margin: 12px auto;
23
  padding: 12px;
24
  table-layout: auto;
25
  width: 100%;
26
`
27

28
const statNumberStyle = `
×
29
  font-size: 48px;
30
  font-weight: bold;
31
  width: 72px;
32
`
33

34
const statTitleStyle = `
×
35
  text-align: left;
36
`
37

38
const ctaStyle = `
×
39
  background-color: #0060DF;
40
  border-radius: 4px;
41
  color: white;
42
  display: inline-block;
43
  margin: 24px 0;
44
  padding: 12px 24px;
45
`
46

47
const signupReportEmailPartial = data => {
×
48
  const {
49
    breachedEmail,
50
    emailBreachStats,
51
    unsafeBreachesForEmail
52
  } = data
×
53

54
  return `
×
55
    <tr>
56
      <td style='${emailStyle}'>
57
        <p>
58
          ${
59
            unsafeBreachesForEmail?.length
×
60
              ? getMessage('email-breach-detected', {
61
                  'email-address': `<strong>${breachedEmail}</strong>`
62
                })
63
              : getMessage('fxm-warns-you-no-breaches')
64
          }
65
        </p>
66
        ${
67
          emailBreachStats?.length
×
68
            ? `
69
                <table style='${breachSummaryTableStyle}'>
70
                  <tr>
71
                    <td>
72
                      ${emailBreachStats.map(breachStat => `
×
73
                        <table style='${breachSummaryCardStyle}'>
74
                          <tr>
75
                            <td style='${statNumberStyle}'>
76
                              ${breachStat.statNumber}
77
                            </td>
78
                            <td style=${statTitleStyle}>
79
                              ${breachStat.statTitle}
80
                            </td>
81
                          </tr>
82
                        </table>
83
                      `).join('')}
84
                    </td>
85
                  </tr>
86
                </table>
87
              `
88
            : ''
89
        }
90
        ${
91
          unsafeBreachesForEmail?.length
×
92
            ? unsafeBreachesForEmail.map(unsafeBreach => (
93
                breachCardPartial(unsafeBreach)
×
94
              )).join('')
95
            : ''
96
        }
97
        <a
98
          href='${data.ctaHref}'
99
          style='${ctaStyle}'
100
        >
101
          ${getMessage('email-dashboard-cta')}
102
        </a>
103
      </td>
104
    </tr>
105
  `
106
}
107

108
export { signupReportEmailPartial }
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