X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fsrc%2FloggingGeneral.jsx;h=0aced4e212a16e4c61fceaf8ddb1e8cb32e35ff9;hp=7b50c76051b9e283bc1452aba7f0e16c253bc778;hb=223366ccc6537984552d07f827750e14e83219b8;hpb=132f9b77e1c32b82eb1c27cea048a5c1f2bfcb56 diff --git a/skyquake/plugins/logging/src/loggingGeneral.jsx b/skyquake/plugins/logging/src/loggingGeneral.jsx index 7b50c7605..0aced4e21 100644 --- a/skyquake/plugins/logging/src/loggingGeneral.jsx +++ b/skyquake/plugins/logging/src/loggingGeneral.jsx @@ -16,7 +16,9 @@ * */ import React from 'react'; -import _ from 'lodash'; +import _isEmpty from 'lodash/isEmpty'; +import _find from 'lodash/find'; +import _cloneDeep from 'lodash/cloneDeep'; import './logging.scss'; import Button from 'widgets/button/rw.button.js'; @@ -199,7 +201,7 @@ export default class LoggingGeneral extends React.Component { getData() { LoggingStore.getLoggingConfig(); this.setState({ - isLoading: _.isEmpty(this.state.loggingConfig) + isLoading: _isEmpty(this.state.loggingConfig) }); } componentWillUnmount = () => { @@ -239,7 +241,7 @@ export default class LoggingGeneral extends React.Component { this.context.router.push({pathname: ''}); } // removeCategoryNulls(config) { - // let cleanConfig = _.cloneDeep(config); + // let cleanConfig = _cloneDeep(config); // let cleanSeverities = []; // config.defaultSeverities.map(function(d) { // if (d.severity) { @@ -250,7 +252,7 @@ export default class LoggingGeneral extends React.Component { // return cleanConfig; // } cleanupConfig(config) { - let cleanConfig = _.cloneDeep(config); + let cleanConfig = _cloneDeep(config); let cleanSeverities = []; cleanConfig.defaultSeverities && cleanConfig.defaultSeverities.map((defSev) => { if (defSev.severity) { @@ -360,14 +362,14 @@ export default class LoggingGeneral extends React.Component { // for RIFT-14856 so that default severities map to syslog sink // Find first syslog sink with (WTF - no type on sinks!) name syslog. - let syslogSink = this.state.loggingConfig.sinks && _.find(this.state.loggingConfig.sinks, { + let syslogSink = this.state.loggingConfig.sinks && _find(this.state.loggingConfig.sinks, { name: 'syslog' }); let defaultSyslogSeverities = []; this.state.loggingConfig && this.state.loggingConfig.defaultSeverities && this.state.loggingConfig.defaultSeverities.map((defaultSeverity) => { // Mapping between default categories and names inside a sink - let syslogFilterCategory = (syslogSink.filter && syslogSink.filter.category && _.find(syslogSink.filter.category, { + let syslogFilterCategory = (syslogSink.filter && syslogSink.filter.category && _find(syslogSink.filter.category, { name: defaultSeverity.category })) || { name: defaultSeverity.category,