mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
Refactored mixins into utils ES2015 module exports ES2015-style imports WIP Fixing tests Fixes tests after es2015 code migrations. We we're require()ing an ES2015 module[1]. Have to make sure you account for the .default in this case. [1] We had to use ES5 `require` in Jest: (https://github.com/babel/babel-jest/issues/16)
26 lines
711 B
JavaScript
26 lines
711 B
JavaScript
import React from 'react';
|
|
|
|
import { doControl } from '../../actions/app-actions';
|
|
|
|
export default 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();
|
|
doControl(this.props.control.probeId, this.props.control.nodeId, this.props.control.id);
|
|
}
|
|
}
|