Analytics for target mode
Reviewed By: antonk52 Differential Revision: D47757367 fbshipit-source-id: f6ce53a1edc3095a488097e304d3774b0702185b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c1a99a8a52
commit
b47c88f2b5
@@ -17,6 +17,8 @@ import {
|
|||||||
FullscreenExitOutlined,
|
FullscreenExitOutlined,
|
||||||
FullscreenOutlined,
|
FullscreenOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
import {tracker} from '../../utils/tracker';
|
||||||
|
import {debounce} from 'lodash';
|
||||||
|
|
||||||
export type TargetModeState =
|
export type TargetModeState =
|
||||||
| {
|
| {
|
||||||
@@ -79,6 +81,7 @@ export function VisualiserControls({
|
|||||||
targetMode.targetedNodes[value],
|
targetMode.targetedNodes[value],
|
||||||
'visualiser',
|
'visualiser',
|
||||||
);
|
);
|
||||||
|
debouncedReportTargetAdjusted();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -91,8 +94,10 @@ export function VisualiserControls({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (targetMode.state === 'disabled') {
|
if (targetMode.state === 'disabled') {
|
||||||
setTargetMode({state: 'active'});
|
setTargetMode({state: 'active'});
|
||||||
|
tracker.track('target-mode-switched', {on: true});
|
||||||
} else {
|
} else {
|
||||||
setTargetMode({state: 'disabled'});
|
setTargetMode({state: 'disabled'});
|
||||||
|
tracker.track('target-mode-switched', {on: false});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
icon={
|
icon={
|
||||||
@@ -139,3 +144,7 @@ export function VisualiserControls({
|
|||||||
</Layout.Right>
|
</Layout.Right>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const debouncedReportTargetAdjusted = debounce(() => {
|
||||||
|
tracker.track('target-mode-adjusted', {});
|
||||||
|
}, 500);
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ type TrackerEvents = {
|
|||||||
name: string;
|
name: string;
|
||||||
tags: Tag[];
|
tags: Tag[];
|
||||||
};
|
};
|
||||||
|
'target-mode-switched': {
|
||||||
|
on: boolean;
|
||||||
|
};
|
||||||
|
'target-mode-adjusted': {};
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface Tracker {
|
export interface Tracker {
|
||||||
|
|||||||
Reference in New Issue
Block a user