mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 11:11:13 +00:00
* Ensure connection rows have unique IDs. This adds new types for connections tables. * UI support for new connection table rows * Parameterized node Id key for connections table * also s/node_id/nodeId, and s/topology_id/topologyId in connections * table * Added comment about nodeIdKey * Review feedback:
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|
import reactMixin from 'react-mixin';
|
|
|
|
import { clickRelative } from '../../actions/app-actions';
|
|
|
|
export default class NodeDetailsTableNodeLink extends React.Component {
|
|
|
|
constructor(props, context) {
|
|
super(props, context);
|
|
this.handleClick = this.handleClick.bind(this);
|
|
}
|
|
|
|
handleClick(ev) {
|
|
ev.preventDefault();
|
|
clickRelative(this.props.nodeId, this.props.topologyId, this.props.label,
|
|
ReactDOM.findDOMNode(this).getBoundingClientRect());
|
|
}
|
|
|
|
render() {
|
|
if (this.props.linkable) {
|
|
return (
|
|
<span className="node-details-table-node-link truncate" title={this.props.label}
|
|
onClick={this.handleClick}>
|
|
{this.props.label}
|
|
</span>
|
|
);
|
|
}
|
|
return (
|
|
<span className="node-details-table-node truncate" title={this.props.label}>
|
|
{this.props.label}
|
|
</span>
|
|
);
|
|
}
|
|
}
|
|
|
|
reactMixin.onClass(NodeDetailsTableNodeLink, PureRenderMixin);
|