Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud authored and Mahmoud committed Mar 13, 2024
1 parent a7d23c2 commit 2cc6e84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/components/DataViz/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ export const datapointMatchingMetricFrequency = (
(dp.metric_definition_key &&
new Date(dp.start_date).getUTCMonth() + 1 ===
metricKeyToFrequency[dp.metric_definition_key].starting_month);

console.log("dp", dp);

Check warning on line 745 in common/components/DataViz/utils.ts

View workflow job for this annotation

GitHub Actions / Frontend tests

Unexpected console statement
console.log("metricKeyToFrequency", metricKeyToFrequency);

Check warning on line 746 in common/components/DataViz/utils.ts

View workflow job for this annotation

GitHub Actions / Frontend tests

Unexpected console statement
return hasMatchingFrequency && hasMatchingStartingMonth;
};
11 changes: 8 additions & 3 deletions publisher/src/stores/DatapointsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ class DatapointsStore extends BaseDatapointsStore {
const metricKeyToFrequency = getMetricKeyToFrequencyMap(
this.reportStore.agencyMetrics
);
this.rawDatapoints = result.datapoints.filter((dp: Datapoint) =>
datapointMatchingMetricFrequency(dp, metricKeyToFrequency)
);
this.rawDatapoints = result.datapoints.filter((dp: Datapoint) => {
if (
dp.metric_definition_key &&
!metricKeyToFrequency[dp.metric_definition_key]
)
return false; // Filters out datapoints that are a system
return datapointMatchingMetricFrequency(dp, metricKeyToFrequency);
});
this.dimensionNamesByMetricAndDisaggregation =
result.dimension_names_by_metric_and_disaggregation;
});
Expand Down

0 comments on commit 2cc6e84

Please sign in to comment.