MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / _onAddFilter

Function _onAddFilter

client/src/containers/AddChart/AddChart.jsx:388–407  ·  view source on GitHub ↗
(condition)

Source from the content-addressed store, hash-verified

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];

Callers

nothing calls this directly

Calls 2

runQueryWithFiltersFunction · 0.90
dispatchFunction · 0.50

Tested by

no test coverage detected