Chore: make notification center UI

Chore: fiatBalancesNotify refactor

Chore: removed now-unused code in some files

Feat: change column "detail" in database to use jsonb

Chore: add notification center background and button

Chore: notifications screen scaffolding

Fix: change position of notification UI

Feat: join backend and frontend

Feat: notification icons and machine names

Feat: add clear all button, stripe overlay on invalid notification

Fix: rework notification styles

Feat: use popper to render notifications

Feat: make notification center UI

Fix: fix css on notification center

Fix: fix invalidateNotification

Chore: apply PR requested changes

Fix: PR fixes

Fix: make toggleable body/root styles be handled by react

Chore: delete old notifier file

Fix: undo variable name changes for cryptobalance notifs
This commit is contained in:
Cesar 2020-12-17 22:18:35 +00:00 committed by Josh Harvey
parent 2a9e8dadba
commit c457faab40
37 changed files with 1337 additions and 1332 deletions

View file

@ -2,22 +2,16 @@ const _ = require('lodash/fp')
const utils = require('./utils')
const sms = require('../sms')
function printSmsAlerts(alertRec, config) {
function printSmsAlerts (alertRec, config) {
let alerts = []
if (config.balance) {
alerts = _.concat(alerts, alertRec.general)
}
_.keys(alertRec.devices).forEach(function (device) {
if (config.balance) {
alerts = _.concat(alerts, alertRec.devices[device].balanceAlerts)
}
if (config.errors) {
alerts = _.concat(alerts, alertRec.devices[device].deviceAlerts)
}
})
_.forEach(device => {
alerts = _.concat(alerts, utils.deviceAlerts(config, alertRec, device))
}, _.keys(alertRec.devices))
if (alerts.length === 0) return null
@ -27,12 +21,12 @@ function printSmsAlerts(alertRec, config) {
const code = entry[0]
const machineNames = _.filter(
_.negate(_.isEmpty),
_.map('machineName', entry[1]),
_.map('machineName', entry[1])
)
const cryptoCodes = _.filter(
_.negate(_.isEmpty),
_.map('cryptoCode', entry[1]),
_.map('cryptoCode', entry[1])
)
return {
@ -43,16 +37,11 @@ function printSmsAlerts(alertRec, config) {
}, _.toPairs(alertsMap))
const mapByCodeDisplay = _.map(it => {
if(_.isEmpty(it.machineNames) && _.isEmpty(it.cryptoCodes)) {
return it.codeDisplay
}
if(_.isEmpty(it.machineNames)) {
return `${it.codeDisplay} (${it.cryptoCodes.join(', ')})`
}
else return `${it.codeDisplay} (${it.machineNames.join(', ')})`
if (_.isEmpty(it.machineNames) && _.isEmpty(it.cryptoCodes)) return it.codeDisplay
if (_.isEmpty(it.machineNames)) return `${it.codeDisplay} (${it.cryptoCodes.join(', ')})`
return `${it.codeDisplay} (${it.machineNames.join(', ')})`
})
const displayAlertTypes = _.compose(
_.uniq,
mapByCodeDisplay,