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

[KED-2804] Heap event tracking #556

Merged
merged 5 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
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 @@ -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}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to my comment for the visible heap events, we would need to add tests for each type of node to ensure the right heap event gets sent.

.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