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

mozilla / blurts-server / 45ba77d7-fd3c-4064-90eb-157d6aa10611

pending completion
45ba77d7-fd3c-4064-90eb-157d6aa10611

push

circleci

Robert Helmer
update the queue adr

282 of 1631 branches covered (17.29%)

Branch coverage included in aggregate %.

959 of 4375 relevant lines covered (21.92%)

3.65 hits per line

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

0.0
/src/controllers/dialog.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 AppConstants from '../app-constants.js'
6
import { camelize } from '../utils/string-helpers.js'
7
import { dialogLayout } from '../views/dialogLayout.js'
8
import { generateToken } from '../utils/csrf.js'
9

10
async function dialog (req, res) {
11
  const data = {
×
12
    partialName: req.params.name,
13
    csrfToken: generateToken(res),
14
    stylesheetPath: `/css/partials/${req.params.name}.css` // stylesheet derived from kebab-case partial name, e.g. /css/partials/add-email.css
15
  }
16

17
  try {
×
18
    const module = await import(`../views/partials/${data.partialName}.js`)
×
19
    data.partial = module[camelize(data.partialName)] // kebab-case filename maps to camelCase function export: `add-email.js` -> `addEmail()`
×
20
  } catch (e) {
21
    return res.sendStatus(404)
×
22
  }
23

24
  switch (data.partialName) {
×
25
    case 'add-email':
26
      data.emailLimit = AppConstants.MAX_NUM_ADDRESSES
×
27
      break
×
28
  }
29

30
  res.send(dialogLayout(data))
×
31
}
32

33
export { dialog }
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