|
1 | 1 | import shareActions from 'components/modals/share/share-actions';
|
2 | 2 | import modalActions from 'components/modals/meta/meta-actions';
|
3 | 3 | import buttonActions from 'components/ui/button/button-actions';
|
| 4 | +import widgetActions from 'components/widgets/actions'; |
4 | 5 | import { COUNTRY } from 'pages/dashboards/router';
|
5 |
| -import isEqual from 'lodash/isEqual'; |
6 |
| -import omit from 'lodash/omit'; |
7 | 6 |
|
8 |
| -const allActions = { ...shareActions, ...buttonActions, ...modalActions }; |
| 7 | +const allActions = { |
| 8 | + ...shareActions, |
| 9 | + ...buttonActions, |
| 10 | + ...modalActions, |
| 11 | + ...widgetActions |
| 12 | +}; |
9 | 13 | const actions = Object.keys(allActions).reduce(
|
10 | 14 | (state, action) => ({
|
11 | 15 | ...state,
|
@@ -76,24 +80,11 @@ export const ANALYTICS_EVENTS = [
|
76 | 80 | label: payload => payload.subtitle
|
77 | 81 | },
|
78 | 82 | {
|
79 |
| - name: COUNTRY, |
80 |
| - category: 'Country Page', |
81 |
| - action: 'User changes widget settings', |
82 |
| - label: 'User changed settings', |
83 |
| - condition: payload => { |
84 |
| - const location = payload && payload.location; |
85 |
| - const current = |
86 |
| - location && |
87 |
| - location.current && |
88 |
| - location.current.query && |
89 |
| - omit(location.current.query, ['widget', 'category']); |
90 |
| - const prev = |
91 |
| - location && |
92 |
| - location.prev && |
93 |
| - location.prev.query && |
94 |
| - omit(location.prev.query, ['widget', 'category']); |
95 |
| - return current && prev && !isEqual(current, prev); |
96 |
| - } |
| 83 | + name: actions.settingsItemSelected, |
| 84 | + category: 'Country Widget Settings', |
| 85 | + action: payload => `Change ${Object.keys(payload.value)[0]}`, |
| 86 | + label: payload => |
| 87 | + `${payload.value[Object.keys(payload.value)[0]]} | ${payload.widget}` |
97 | 88 | },
|
98 | 89 | {
|
99 | 90 | name: actions.buttonClicked,
|
|
0 commit comments