Copy diagnostics
Summary: Track copy events, both names and inline attributes. Reviewed By: LukeDefeo Differential Revision: D44297218 fbshipit-source-id: 5d2b1f2f4fa59d4a86e9e2ae1aa883712ceccb8c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
583eabdd79
commit
c2e41cd095
@@ -35,6 +35,7 @@ import {head, isEqual, last} from 'lodash';
|
|||||||
import {reverse} from 'lodash/fp';
|
import {reverse} from 'lodash/fp';
|
||||||
import {Badge, Dropdown, Menu, Typography} from 'antd';
|
import {Badge, Dropdown, Menu, Typography} from 'antd';
|
||||||
import {UIDebuggerMenuItem} from './util/UIDebuggerMenuItem';
|
import {UIDebuggerMenuItem} from './util/UIDebuggerMenuItem';
|
||||||
|
import {tracker} from '../tracker';
|
||||||
|
|
||||||
const {Text} = Typography;
|
const {Text} = Typography;
|
||||||
|
|
||||||
@@ -425,6 +426,7 @@ const ContextMenu: React.FC<{
|
|||||||
key={'Copy Element name'}
|
key={'Copy Element name'}
|
||||||
text={'Copy Element name'}
|
text={'Copy Element name'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
tracker.track('context-menu-name-copied', {name: hoveredNode.name});
|
||||||
getFlipperLib().writeTextToClipboard(hoveredNode.name);
|
getFlipperLib().writeTextToClipboard(hoveredNode.name);
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
@@ -436,6 +438,11 @@ const ContextMenu: React.FC<{
|
|||||||
key={key}
|
key={key}
|
||||||
text={`Copy ${key}`}
|
text={`Copy ${key}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
tracker.track('context-menu-copied', {
|
||||||
|
name: hoveredNode.name,
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
});
|
||||||
getFlipperLib().writeTextToClipboard(value);
|
getFlipperLib().writeTextToClipboard(value);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ type TrackerEvents = {
|
|||||||
};
|
};
|
||||||
'node-selected': NodeEventPayload;
|
'node-selected': NodeEventPayload;
|
||||||
'node-focused': NodeEventPayload;
|
'node-focused': NodeEventPayload;
|
||||||
|
'context-menu-name-copied': {
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
|
'context-menu-copied': {
|
||||||
|
name: string;
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface Tracker {
|
export interface Tracker {
|
||||||
|
|||||||
Reference in New Issue
Block a user