mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Unfortunately, I forgot to rebase before renaming trackMixpanelEvent() and a PR adding a new trace point was already in-flight. More precisely: - https://github.com/weaveworks/scope/pull/2861 renames trackMixpanelEvent() to trackAnalysticsEent() - https://github.com/weaveworks/scope/pull/2857 add a new trackMixpanelEvent() call. Each PR is fine, but with the merge of both without rebasing any, we end up with master having a dandling call to trackMixpanelEvent().
33 lines
1022 B
JavaScript
33 lines
1022 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
import { trackAnalyticsEvent } from '../../utils/tracking-utils';
|
|
import { doControl } from '../../actions/app-actions';
|
|
|
|
class NodeDetailsControlButton extends React.Component {
|
|
constructor(props, context) {
|
|
super(props, context);
|
|
this.handleClick = this.handleClick.bind(this);
|
|
}
|
|
|
|
render() {
|
|
let className = `node-control-button fa ${this.props.control.icon}`;
|
|
if (this.props.pending) {
|
|
className += ' node-control-button-pending';
|
|
}
|
|
return (
|
|
<span className={className} title={this.props.control.human} onClick={this.handleClick} />
|
|
);
|
|
}
|
|
|
|
handleClick(ev) {
|
|
ev.preventDefault();
|
|
const { id, human } = this.props.control;
|
|
trackAnalyticsEvent('scope.node.control.click', { id, title: human });
|
|
this.props.dispatch(doControl(this.props.nodeId, this.props.control));
|
|
}
|
|
}
|
|
|
|
// Using this instead of PureComponent because of props.dispatch
|
|
export default connect()(NodeDetailsControlButton);
|