|
1 | 1 | "use strict";
|
| 2 | +var __extends = (this && this.__extends) || function (d, b) { |
| 3 | + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
| 4 | + function __() { this.constructor = d; } |
| 5 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 6 | +}; |
| 7 | +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 8 | + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 9 | + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| 10 | + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
| 11 | + return c > 3 && r && Object.defineProperty(target, key, r), r; |
| 12 | +}; |
| 13 | +var __metadata = (this && this.__metadata) || function (k, v) { |
| 14 | + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
| 15 | +}; |
2 | 16 | var React = require('react');
|
| 17 | +var react_redux_1 = require('react-redux'); |
3 | 18 | var colors_1 = require('material-ui/styles/colors');
|
4 | 19 | var indeterminate_check_box_1 = require('material-ui/svg-icons/toggle/indeterminate-check-box');
|
5 | 20 | var styles = {
|
6 |
| - position: 'absolute', |
7 |
| - top: '15px' |
| 21 | + checkbox: { |
| 22 | + position: 'absolute', |
| 23 | + top: '15px', |
| 24 | + }, |
8 | 25 | };
|
9 |
| -function taskCheckbox(isCurrentTask, testRun) { |
10 |
| - if (!isCurrentTask || !testRun) { |
11 |
| - return null; |
| 26 | +var TaskCheckbox = (function (_super) { |
| 27 | + __extends(TaskCheckbox, _super); |
| 28 | + function TaskCheckbox() { |
| 29 | + _super.apply(this, arguments); |
12 | 30 | }
|
13 |
| - return (React.createElement("span", {style: styles}, React.createElement(indeterminate_check_box_1.default, {color: colors_1.orange500}))); |
14 |
| -} |
| 31 | + TaskCheckbox.prototype.render = function () { |
| 32 | + var _a = this.props, testRun = _a.testRun, isCurrentTask = _a.isCurrentTask; |
| 33 | + if (!isCurrentTask || !testRun) { |
| 34 | + return null; |
| 35 | + } |
| 36 | + return React.createElement(indeterminate_check_box_1.default, {color: colors_1.orange500, style: styles.checkbox}); |
| 37 | + }; |
| 38 | + TaskCheckbox = __decorate([ |
| 39 | + react_redux_1.connect(function (state, props) { return ({ |
| 40 | + testRun: state.testRun, |
| 41 | + isCurrentTask: state.taskPosition === props.index, |
| 42 | + }); }), |
| 43 | + __metadata('design:paramtypes', []) |
| 44 | + ], TaskCheckbox); |
| 45 | + return TaskCheckbox; |
| 46 | +}(React.Component)); |
15 | 47 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 |
| -exports.default = taskCheckbox; |
17 |
| -; |
| 48 | +exports.default = TaskCheckbox; |
0 commit comments