Skip to content
Snippets Groups Projects
Unverified Commit cc12b2b7 authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Merge pull request #6865 from metabase/current-period-instrumentation

instrument current period toggle
parents 207d211c 45eab2c1
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import React, { Component } from "react";
import { t, jt } from 'c-3po';
import CheckBox from "metabase/components/CheckBox";
import MetabaseAnalytics from "metabase/lib/analytics";
import { getOperator } from "./pickers/DatePicker.jsx";
......@@ -50,15 +51,16 @@ export default class FilterOptions extends Component {
toggleCurrentPeriod = () => {
const { filter } = this.props;
const operator = getOperator(filter);
const operator = getOperator(filter);
if (operator && operator.options && operator.options["include-current"]) {
const options = getFilterOptions(filter);
this.props.onFilterChange(setFilterOptions(filter, {
...options,
"include-current": !options["include-current"]
}));
}
if (operator && operator.options && operator.options["include-current"]) {
const options = getFilterOptions(filter);
this.props.onFilterChange(setFilterOptions(filter, {
...options,
"include-current": !options["include-current"]
}));
MetabaseAnalytics.trackEvent("QueryBuilder", "Filter", "ToggleCurrentPeriod", !options["include-current"])
}
}
render() {
......
import "__support__/mocks"
import React from 'react'
import { shallow, mount } from 'enzyme'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment