(condition)
| 386 | }; |
| 387 | |
| 388 | const _onAddFilter = (condition) => { |
| 389 | let found = false; |
| 390 | const newConditions = conditions.map((c) => { |
| 391 | let newCondition = c; |
| 392 | if (c.id === condition.id) { |
| 393 | newCondition = condition; |
| 394 | found = true; |
| 395 | } |
| 396 | return newCondition; |
| 397 | }); |
| 398 | if (!found) newConditions.push(condition); |
| 399 | setConditions(newConditions); |
| 400 | |
| 401 | dispatch(runQueryWithFilters({ |
| 402 | project_id: params.projectId, |
| 403 | chart_id: newChart.id, |
| 404 | filters: [condition], |
| 405 | getCache: useCache, |
| 406 | })); |
| 407 | }; |
| 408 | |
| 409 | const _onClearFilter = (condition) => { |
| 410 | const newConditions = [...conditions]; |
nothing calls this directly
no test coverage detected