diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-22 16:35:26 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-22 16:35:26 -0700 |
commit | ada71496b699fe487680b0f2233bf3d5afb206ff (patch) | |
tree | bbef789f99a184f615f16e7fb3858a9049db2793 /modern/src/settings/NotificationPage.js | |
parent | d447490a186a473dc398a9214fd37c5180fdcf7d (diff) | |
download | trackermap-web-ada71496b699fe487680b0f2233bf3d5afb206ff.tar.gz trackermap-web-ada71496b699fe487680b0f2233bf3d5afb206ff.tar.bz2 trackermap-web-ada71496b699fe487680b0f2233bf3d5afb206ff.zip |
Update lint
Diffstat (limited to 'modern/src/settings/NotificationPage.js')
-rw-r--r-- | modern/src/settings/NotificationPage.js | 102 |
1 files changed, 50 insertions, 52 deletions
diff --git a/modern/src/settings/NotificationPage.js b/modern/src/settings/NotificationPage.js index 38ba19e5..0533b58e 100644 --- a/modern/src/settings/NotificationPage.js +++ b/modern/src/settings/NotificationPage.js @@ -39,60 +39,58 @@ const NotificationPage = () => { breadcrumbs={['settingsTitle', 'sharedNotification']} > {item && ( - <> - <Accordion defaultExpanded> - <AccordionSummary expandIcon={<ExpandMoreIcon />}> - <Typography variant="subtitle1"> - {t('sharedRequired')} - </Typography> - </AccordionSummary> - <AccordionDetails className={classes.details}> - <SelectField - margin="normal" - value={item.type} - emptyValue={null} - onChange={(e) => setItem({ ...item, type: e.target.value })} - endpoint="/api/notifications/types" - keyGetter={(it) => it.type} - titleGetter={(it) => t(prefixString('event', it.type))} - label={t('sharedType')} - variant="filled" - /> - <SelectField - multiple - margin="normal" - value={item.notificators ? item.notificators.split(/[, ]+/) : []} - onChange={(e) => setItem({ ...item, notificators: e.target.value.join() })} - endpoint="/api/notifications/notificators" - keyGetter={(it) => it.type} - titleGetter={(it) => t(prefixString('notificator', it.type))} - label={t('notificationNotificators')} - variant="filled" - /> - {(!item.type || item.type === 'alarm') && ( - <SelectField - multiple - margin="normal" - value={item.attributes && item.attributes.alarms ? item.attributes.alarms.split(/[, ]+/) : []} - onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, alarms: e.target.value.join() } })} - data={alarms} - keyGetter={(it) => it.key} - label={t('sharedAlarms')} - variant="filled" + <Accordion defaultExpanded> + <AccordionSummary expandIcon={<ExpandMoreIcon />}> + <Typography variant="subtitle1"> + {t('sharedRequired')} + </Typography> + </AccordionSummary> + <AccordionDetails className={classes.details}> + <SelectField + margin="normal" + value={item.type} + emptyValue={null} + onChange={(e) => setItem({ ...item, type: e.target.value })} + endpoint="/api/notifications/types" + keyGetter={(it) => it.type} + titleGetter={(it) => t(prefixString('event', it.type))} + label={t('sharedType')} + variant="filled" + /> + <SelectField + multiple + margin="normal" + value={item.notificators ? item.notificators.split(/[, ]+/) : []} + onChange={(e) => setItem({ ...item, notificators: e.target.value.join() })} + endpoint="/api/notifications/notificators" + keyGetter={(it) => it.type} + titleGetter={(it) => t(prefixString('notificator', it.type))} + label={t('notificationNotificators')} + variant="filled" + /> + {(!item.type || item.type === 'alarm') && ( + <SelectField + multiple + margin="normal" + value={item.attributes && item.attributes.alarms ? item.attributes.alarms.split(/[, ]+/) : []} + onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, alarms: e.target.value.join() } })} + data={alarms} + keyGetter={(it) => it.key} + label={t('sharedAlarms')} + variant="filled" + /> + )} + <FormControlLabel + control={( + <Checkbox + checked={item.always} + onChange={(event) => setItem({ ...item, always: event.target.checked })} /> - )} - <FormControlLabel - control={( - <Checkbox - checked={item.always} - onChange={(event) => setItem({ ...item, always: event.target.checked })} - /> )} - label={t('notificationAlways')} - /> - </AccordionDetails> - </Accordion> - </> + label={t('notificationAlways')} + /> + </AccordionDetails> + </Accordion> )} </EditItemView> ); |