Skip to content

Commit

Permalink
[KED-2804] Heap event tracking (#556)
Browse files Browse the repository at this point in the history
* testing for theme click

* Added data-heap-events

* add back events lost from merge

Signed-off-by: Tynan DeBold <[email protected]>

Co-authored-by: Tynan DeBold <[email protected]>
  • Loading branch information
rashidakanchwala and tynandebold authored May 18, 2022
1 parent b2c3f6c commit 2ab2366
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const FlowchartPrimaryToolbar = ({
<IconButton
ariaLabel={`Turn data layers ${visibleLayers ? 'off' : 'on'}`}
className={'pipeline-menu-button--layers'}
dataHeapEvent={`visible.layers.${visibleLayers}`}
onClick={() => onToggleLayers(!visibleLayers)}
icon={LayersIcon}
labelText={`${visibleLayers ? 'Hide' : 'Show'} layers`}
Expand Down
1 change: 1 addition & 0 deletions src/components/flowchart/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const drawNodes = function (changed) {
enterNodes
.attr('tabindex', '0')
.attr('class', 'pipeline-node')
.attr('data-heap-event', (node) => `clicked.graph.${node.type}`)
.attr('transform', (node) => `translate(${node.x}, ${node.y})`)
.attr('data-id', (node) => node.id)
.classed(
Expand Down
3 changes: 2 additions & 1 deletion src/components/global-toolbar/global-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export const GlobalToolbar = ({
className={
'pipeline-menu-button--theme pipeline-menu-button--large'
}
dataHeapEvent={`theme.${theme}`}
onClick={() => onToggleTheme(theme === 'light' ? 'dark' : 'light')}
icon={ThemeIcon}
labelText="Toggle theme"
onClick={() => onToggleTheme(theme === 'light' ? 'dark' : 'light')}
/>
<IconButton
ariaLabel={'Change the settings flags'}
Expand Down
6 changes: 6 additions & 0 deletions src/components/node-list/node-list-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const NodeListRow = memo(
`pipeline-nodelist__row__text--kind-${kind}`,
`pipeline-nodelist__row__text--${rowType}`
)}
data-heap-event={`clicked.sidebar.${icon}`}
onClick={onClick}
onFocus={onMouseEnter}
onBlur={onMouseLeave}
Expand Down Expand Up @@ -148,6 +149,11 @@ const NodeListRow = memo(
<input
id={id}
className="pipeline-nodelist__row__checkbox"
data-heap-event={
kind === 'element'
? `focusMode.checked.${checked}`
: `visible.${name}.${checked}`
}
type="checkbox"
checked={checked}
disabled={disabled}
Expand Down
1 change: 1 addition & 0 deletions src/components/primary-toolbar/primary-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const PrimaryToolbar = ({
{displaySidebar && (
<IconButton
ariaLabel={`${visible.sidebar ? 'Hide' : 'Show'} menu`}
dataHeapEvent={`visible.sidebar.${visible.sidebar}`}
className={classnames(
'pipeline-menu-button',
'pipeline-menu-button--menu',
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/command-copier/command-copier.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const CommandCopier = ({ command }) => {
<IconButton
ariaLabel="Copy run command to clipboard."
className="copy-button"
dataHeapEvent={`clicked.run_command`}
icon={CopyIcon}
onClick={onCopyClick}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/components/ui/icon-button/icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const IconButton = ({
hasReminder,
icon,
labelText,
dataHeapEvent,
onClick,
visible,
}) => {
Expand All @@ -24,6 +25,7 @@ const IconButton = ({
return visible ? (
<Container>
<button
data-heap-event={dataHeapEvent}
aria-label={ariaLabel}
aria-live={ariaLive}
className={classnames(className, {
Expand All @@ -48,6 +50,7 @@ IconButton.propTypes = {
disabled: PropTypes.bool,
icon: PropTypes.func,
labelText: PropTypes.string,
dataHeapEvent: PropTypes.string,
onClick: PropTypes.func,
visible: PropTypes.bool,
active: PropTypes.bool,
Expand All @@ -60,6 +63,7 @@ IconButton.defaultProps = {
disabled: false,
icon: null,
labelText: null,
dataHeapEvent: null,
onClick: null,
visible: true,
active: false,
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/toggle/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Toggle = ({
id={`pipeline-toggle-input-${id}`}
className="pipeline-toggle-input"
type="checkbox"
data-heap-event={`visible.code.${checked}`}
checked={checked}
disabled={!enabled}
onChange={onChange}
Expand Down

0 comments on commit 2ab2366

Please sign in to comment.