Skip to content

Commit 9755237

Browse files
committed
fix React deprecations/warnings
1 parent 4e46600 commit 9755237

File tree

23 files changed

+68
-64
lines changed

23 files changed

+68
-64
lines changed

lib/components/Alert/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
"use strict";
22
var __extends = (this && this.__extends) || function (d, b) {
33
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
44
function __() { this.constructor = d; }
@@ -15,7 +15,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515
};
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
18-
var Action = require('../../actions');
18+
var actions_1 = require('../../actions');
1919
var Snackbar_1 = require('material-ui/Snackbar');
2020
var classNames = require('classnames');
2121
var defaultAlert = {
@@ -35,7 +35,7 @@ var Alert = (function (_super) {
3535
Alert = __decorate([
3636
react_redux_1.connect(null, function (dispatch) {
3737
return {
38-
alertToggle: function () { return dispatch(Action.alertToggle()); },
38+
alertToggle: function () { return dispatch(actions_1.alertToggle()); },
3939
};
4040
}),
4141
__metadata('design:paramtypes', [])

lib/components/Page/PageComplete/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var styles = {
77
backgroundColor: colors_1.cyan500,
88
zIndex: '0',
99
position: 'fixed',
10-
bottom: '20px',
1110
padding: '10px 15px 30px',
1211
right: '0px',
1312
margin: '0',

lib/components/Page/PageToolbar/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ var Continue_1 = require('./Continue');
77
var styles = {
88
zIndex: '1000',
99
position: 'fixed',
10-
bottom: '0',
11-
right: '0',
10+
bottom: '0px',
11+
right: '0px',
1212
height: '60px',
1313
width: '400px',
1414
};

lib/components/Page/Tasks/Task.js renamed to lib/components/Page/Task/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
var React = require('react');
33
var index_1 = require('../../index');
4-
var TaskCheckbox_1 = require('./TaskCheckbox');
4+
var taskCheckbox_1 = require('./taskCheckbox');
55
var List_1 = require('material-ui/List');
66
var colors_1 = require('material-ui/styles/colors');
77
var styles = {
@@ -27,5 +27,5 @@ function getStatus(index, taskPosition, testRun) {
2727
exports.Task = function (_a) {
2828
var task = _a.task, taskPosition = _a.taskPosition, index = _a.index, testRun = _a.testRun;
2929
var backgroundColor = getStatus(index, taskPosition, testRun);
30-
return (React.createElement(List_1.ListItem, {key: index, style: Object.assign({}, styles, { backgroundColor: backgroundColor })}, testRun ? React.createElement(TaskCheckbox_1.TaskCheckbox, null) : null, React.createElement("span", {style: indexStyles}, index + 1, "."), React.createElement("div", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, task.description))));
30+
return (React.createElement(List_1.ListItem, {key: index, style: Object.assign({}, styles, { backgroundColor: backgroundColor })}, taskCheckbox_1.taskCheckbox(testRun), React.createElement("span", {style: indexStyles}, index + 1, "."), React.createElement("div", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, task.description))));
3131
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
var React = require('react');
3+
var colors_1 = require('material-ui/styles/colors');
4+
var indeterminate_check_box_1 = require('material-ui/svg-icons/toggle/indeterminate-check-box');
5+
var styles = {
6+
position: 'absolute',
7+
top: '15px'
8+
};
9+
function taskCheckbox(testRun) {
10+
if (!testRun) {
11+
return null;
12+
}
13+
return (React.createElement("span", {style: styles}, React.createElement(indeterminate_check_box_1.default, {color: colors_1.orange500})));
14+
}
15+
exports.taskCheckbox = taskCheckbox;
16+
;

lib/components/Page/Tasks/TaskCheckbox.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/components/Page/Tasks/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ var React = require('react');
33
var List_1 = require('material-ui/List');
44
var Card_1 = require('material-ui/Card');
55
var Subheader_1 = require('material-ui/Subheader');
6-
var Task_1 = require('./Task');
6+
var Task_1 = require('../Task');
77
var colors_1 = require('material-ui/styles/colors');
88
function visibleTasks(tasks, taskPosition) {
99
return tasks.slice(0, taskPosition + 1);
1010
}
11+
var margin = '10px 5px';
1112
exports.Tasks = function (_a) {
1213
var tasks = _a.tasks, taskPosition = _a.taskPosition, testRun = _a.testRun, completed = _a.completed;
1314
var visTasks = visibleTasks(tasks, taskPosition);
14-
var bg = completed ? colors_1.lightGreen200 : 'white';
15-
return (React.createElement(Card_1.Card, {style: { margin: '10px 5px', backGroundColor: bg }}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, "Tasks"), visTasks.map(function (task, index) { return (React.createElement(Task_1.Task, {key: index, index: index, task: task, taskPosition: taskPosition, testRun: testRun})); }))));
15+
var backgroundColor = completed ? colors_1.lightGreen200 : 'white';
16+
return (React.createElement(Card_1.Card, {style: { backgroundColor: backgroundColor, margin: margin }}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, "Tasks"), visTasks.map(function (task, index) { return (React.createElement(Task_1.Task, {key: index, index: index, task: task, taskPosition: taskPosition, testRun: testRun})); }))));
1617
};

lib/components/Progress/ProgressChapter/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ var List_1 = require('material-ui/List');
44
var ProgressPage_1 = require('../ProgressPage');
55
var index_1 = require('../../index');
66
var styles = {
7-
marginBottom: '0'
7+
marginBottom: '0px'
88
};
99
var descriptionStyles = {
1010
fontSize: '14px'
1111
};
1212
exports.ProgressChapter = function (_a) {
1313
var chapter = _a.chapter, chapterIndex = _a.chapterIndex, position = _a.position;
1414
var isActive = chapterIndex === position.chapter;
15-
return (React.createElement(List_1.ListItem, {key: 'c' + chapterIndex, className: isActive ? 'isActive' : null, style: styles, initiallyOpen: chapterIndex === 0, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) { return (React.createElement(ProgressPage_1.ProgressPage, {key: chapterIndex + '_' + pageIndex, pageIndex: pageIndex, page: page, chapterIndex: chapterIndex, position: position})); })}, React.createElement("h3", null, chapterIndex + 1, ". ", chapter.title), React.createElement("span", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, chapter.description))));
15+
return (React.createElement(List_1.ListItem, {key: chapterIndex, className: isActive ? 'isActive' : null, style: styles, initiallyOpen: chapterIndex === 0, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) { return (React.createElement(ProgressPage_1.ProgressPage, {key: pageIndex, pageIndex: pageIndex, page: page, chapterIndex: chapterIndex, position: position})); })}, React.createElement("h3", null, chapterIndex + 1, ". ", chapter.title), React.createElement("span", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, chapter.description))));
1616
};

lib/components/Progress/ProgresPage/index.js renamed to lib/components/Progress/ProgressPage/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var progressIcon_1 = require('../progressIcon');
2121
var colors_1 = require('material-ui/styles/colors');
2222
var styles = {
2323
paddingLeft: '15px',
24-
marginTop: '0',
24+
marginTop: '0px',
2525
};
2626
var ProgressPage = (function (_super) {
2727
__extends(ProgressPage, _super);
@@ -40,7 +40,7 @@ var ProgressPage = (function (_super) {
4040
var _a = this.props, page = _a.page, position = _a.position, chapterIndex = _a.chapterIndex, pageIndex = _a.pageIndex, selectPage = _a.selectPage;
4141
var isActive = chapterIndex === position.chapter && pageIndex === position.page;
4242
var canActivate = this.canActivate(isActive);
43-
return (React.createElement(List_1.ListItem, {style: Object.assign({}, styles, !canActivate ? { color: colors_1.grey400 } : {}), primaryText: (pageIndex + 1) + ". " + page.title, secondaryText: canActivate ? page.description : '', leftIcon: progressIcon_1.progressIcon(page.completed, isActive), onClick: canActivate
43+
return (React.createElement(List_1.ListItem, {key: pageIndex, style: Object.assign({}, styles, !canActivate ? { color: colors_1.grey400 } : {}), primaryText: (pageIndex + 1) + ". " + page.title, secondaryText: canActivate ? page.description : '', leftIcon: progressIcon_1.progressIcon(page.completed, isActive), onClick: canActivate
4444
? selectPage.bind(this, {
4545
chapter: chapterIndex,
4646
page: pageIndex

lib/components/Progress/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ var Subheader_1 = require('material-ui/Subheader');
66
var ProgressChapter_1 = require('./ProgressChapter');
77
var pageStyle = {
88
width: '100%',
9-
margin: 0,
9+
margin: '0px',
1010
};
1111
exports.Progress = function (_a) {
1212
var progress = _a.progress, position = _a.position, info = _a.info;
13-
return (React.createElement(Paper_1.default, {className: 'cr-progress', style: pageStyle, zDepth: 1}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, info.title), progress.chapters.map(function (chapter, chapterIndex) { return (React.createElement(ProgressChapter_1.ProgressChapter, {chapter: chapter, chapterIndex: chapterIndex, position: position})); }))));
13+
return (React.createElement(Paper_1.default, {style: pageStyle}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, info.title), progress.chapters.map(function (chapter, chapterIndex) { return (React.createElement(ProgressChapter_1.ProgressChapter, {key: chapterIndex, chapter: chapter, chapterIndex: chapterIndex, position: position})); }))));
1414
};

0 commit comments

Comments
 (0)