diff options
author | Emiliano Ciavatta | 2020-10-16 13:26:55 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-10-16 13:26:55 +0000 |
commit | d429a344ef34bb9289616dc7ca11c161fabce5d7 (patch) | |
tree | 664d56822eac93568f44c40ca25be725d1dd81c8 /frontend/src/components/filters | |
parent | 5534413b3a3e6e783310be8147ac8340d3098a7e (diff) |
Refactor js arrow functions
Diffstat (limited to 'frontend/src/components/filters')
-rw-r--r-- | frontend/src/components/filters/AdvancedFilters.js | 4 | ||||
-rw-r--r-- | frontend/src/components/filters/ExitSearchFilter.js | 2 | ||||
-rw-r--r-- | frontend/src/components/filters/RulesConnectionsFilter.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/frontend/src/components/filters/AdvancedFilters.js b/frontend/src/components/filters/AdvancedFilters.js index 15667a5..8598185 100644 --- a/frontend/src/components/filters/AdvancedFilters.js +++ b/frontend/src/components/filters/AdvancedFilters.js @@ -28,10 +28,10 @@ class AdvancedFilters extends Component { componentDidMount() { this.urlParams = new URLSearchParams(this.props.location.search); - this.connectionsFiltersCallback = payload => { + this.connectionsFiltersCallback = (payload) => { this.urlParams = updateParams(this.urlParams, payload); const active = ["client_address", "client_port", "min_duration", "max_duration", "min_bytes", "max_bytes"] - .some(f => this.urlParams.has(f)); + .some((f) => this.urlParams.has(f)); if (this.state.active !== active) { this.setState({active}); } diff --git a/frontend/src/components/filters/ExitSearchFilter.js b/frontend/src/components/filters/ExitSearchFilter.js index 72cfb0c..0aacfd6 100644 --- a/frontend/src/components/filters/ExitSearchFilter.js +++ b/frontend/src/components/filters/ExitSearchFilter.js @@ -28,7 +28,7 @@ class ExitSearchFilter extends Component { let params = new URLSearchParams(this.props.location.search); this.setState({performedSearch: params.get("performed_search")}); - this.connectionsFiltersCallback = payload => { + this.connectionsFiltersCallback = (payload) => { if (this.state.performedSearch !== payload["performed_search"]) { this.setState({performedSearch: payload["performed_search"]}); } diff --git a/frontend/src/components/filters/RulesConnectionsFilter.js b/frontend/src/components/filters/RulesConnectionsFilter.js index 37d36b7..210ee36 100644 --- a/frontend/src/components/filters/RulesConnectionsFilter.js +++ b/frontend/src/components/filters/RulesConnectionsFilter.js @@ -37,7 +37,7 @@ class RulesConnectionsFilter extends Component { backend.get("/api/rules").then((res) => { let rules = res.json.flatMap((rule) => rule.enabled ? [{id: rule.id, name: rule.name}] : []); - activeRules = rules.filter((rule) => activeRules.some(id => rule.id === id)); + activeRules = rules.filter((rule) => activeRules.some((id) => rule.id === id)); this.setState({rules, activeRules}); }); |