Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(logging): Add logging of change_dashboard_filter event for native dashboard filters #26333

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import { URL_PARAMS } from 'src/constants';
import { getUrlParam } from 'src/utils/urlUtils';
import { useTabId } from 'src/hooks/useTabId';
import { logEvent } from 'src/logger/actions';
import { LOG_ACTIONS_CHANGE_DASHBOARD_FILTER } from 'src/logger/LogUtils';
import { FilterBarOrientation, RootState } from 'src/dashboard/types';
import { checkIsApplyDisabled } from './utils';
import { FiltersBarProps } from './types';
Expand Down Expand Up @@ -223,6 +225,7 @@
}, [dashboardId, dataMaskAppliedText, history, updateKey, tabId]);

const handleApply = useCallback(() => {
dispatch(logEvent(LOG_ACTIONS_CHANGE_DASHBOARD_FILTER, {}));

Check warning on line 228 in superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx

View check run for this annotation

Codecov / codecov/patch

superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx#L228

Added line #L228 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe LOG_ACTIONS_CHANGE_DASHBOARD_FILTERS (plural)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-s-molina I though there was merit in keeping the action name the same for logging consistency.

Note that previously a single filter-box chart could actually have multiple filters so the singular term was also likely misleading then as well.

const filterIds = Object.keys(dataMaskSelected);
setUpdateKey(1);
filterIds.forEach(filterId => {
Expand Down
Loading