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

mozilla / blurts-server / #13258

pending completion
#13258

push

circleci

Vinnl
Update filter results when clearing search field

On the public breach list, the search input that filters the list
of breaches would respond to `keyup` events specifically, rather
than anything that might change the input. Thus, if (e.g. in Chrome
or Safari) a browser adds a "Clear input" icon to the field and the
user clicks that, the field gets emptied, but the list of breaches
are still narrowed down to the previous input.

282 of 1663 branches covered (16.96%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

959 of 4511 relevant lines covered (21.26%)

1.77 hits per line

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

0.0
/lib/remote-settings.js
1
'use strict'
2

3
const got = require('got')
×
4
const AppConstants = require('../app-constants')
×
5

6
const BREACHES_COLLECTION = 'fxmonitor-breaches'
×
7
const FX_RS_COLLECTION = `${AppConstants.FX_REMOTE_SETTINGS_WRITER_SERVER}/buckets/main-workspace/collections/${BREACHES_COLLECTION}`
×
8
const FX_RS_RECORDS = `${FX_RS_COLLECTION}/records`
×
9
const FX_RS_WRITER_USER = AppConstants.FX_REMOTE_SETTINGS_WRITER_USER
×
10
const FX_RS_WRITER_PASS = AppConstants.FX_REMOTE_SETTINGS_WRITER_PASS
×
11

12
const RemoteSettings = {
×
13

14
  async whichBreachesAreNotInRemoteSettingsYet (breaches) {
15
    const fxRSRecords = await got(FX_RS_RECORDS, {
×
16
      responseType: 'json',
17
      username: FX_RS_WRITER_USER,
18
      password: FX_RS_WRITER_PASS
19
    })
20
    const remoteSettingsBreachesSet = new Set(
×
21
      fxRSRecords.body.data.map(b => b.Name)
×
22
    )
23

24
    return breaches.filter(({ Name }) => !remoteSettingsBreachesSet.has(Name))
×
25
  },
26

27
  async postNewBreachToBreachesCollection (data) {
28
    // Create the record
29
    return await got.post(FX_RS_RECORDS, {
×
30
      username: FX_RS_WRITER_USER,
31
      password: FX_RS_WRITER_PASS,
32
      json: { data },
33
      responseType: 'json'
34
    })
35
  },
36

37
  async requestReviewOnBreachesCollection () {
38
    return await got.patch(FX_RS_COLLECTION, {
×
39
      username: FX_RS_WRITER_USER,
40
      password: FX_RS_WRITER_PASS,
41
      json: { data: { status: 'to-review' } },
42
      responseType: 'json'
43
    })
44
  }
45
}
46

47
module.exports = RemoteSettings
×
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