Files
weave-scope/client/app/scripts/components/node-details/node-details-table-node-metric-link.js
Damien Lespiau a205f6ecb7 tracking: Rename trackMixpanelEvent() to trackAnalyticsEvent()
Might as well not mention Mixpanel now that we're sending all events to
Segment.

Commit done with:

  git grep trackMixpanelEvent | cut -d : -f 1 | sort -u | \
	xargs sed -e s/trackMixpanelEvent/trackAnalyticsEvent/g
2017-09-25 13:57:00 +01:00

42 lines
1.0 KiB
JavaScript

import React from 'react';
import CloudLink from '../cloud-link';
import { formatMetric } from '../../utils/string-utils';
import { trackAnalyticsEvent } from '../../utils/tracking-utils';
import { dismissRowClickProps } from './node-details-table-row';
class NodeDetailsTableNodeMetricLink extends React.Component {
constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
trackAnalyticsEvent('scope.node.metric.click', { topologyId: this.props.topologyId });
}
render() {
const { url, style, value, valueEmpty } = this.props;
return (
<td
className="node-details-table-node-metric"
style={style}
{...dismissRowClickProps}
>
<CloudLink
alwaysShow
url={url}
className={url && 'node-details-table-node-metric-link'}
onClick={this.onClick}
>
{!valueEmpty && formatMetric(value, this.props)}
</CloudLink>
</td>
);
}
}
export default NodeDetailsTableNodeMetricLink;