Skip to content

Commit 683b0f5

Browse files
committed
fix task run styles, lower timeout values
1 parent c93d997 commit 683b0f5

File tree

26 files changed

+66
-90
lines changed

26 files changed

+66
-90
lines changed

lib/atom/actions/file.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
var fs_1 = require('fs');
33
var exists_1 = require('../../services/exists');
44
var editor_1 = require('./editor');
5+
var openTimeout = 200;
56
function openFolder() {
67
atom.open();
78
}
@@ -19,7 +20,7 @@ function open(filePath, options) {
1920
atom.workspace.open(filePath, options);
2021
setTimeout(function () {
2122
resolve();
22-
}, 200);
23+
}, openTimeout);
2324
});
2425
}
2526
exports.open = open;

lib/atom/actions/terminal.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
"use strict";
22
function openTerminal() {
3-
if (atom.packages.isPackageActive('terminal-plus')) {
4-
if (!document.getElementsByClassName('xterm')[0]) {
5-
atom.commands.dispatch(document.getElementsByTagName('atom-workspace')[0], 'terminal-plus:toggle');
6-
}
7-
return true;
8-
}
93
return false;
104
}
115
exports.openTerminal = openTerminal;

lib/atom/actions/write.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ function set(text) {
1717
exports.set = set;
1818
function insert(text, options) {
1919
if (options === void 0) { options = {}; }
20-
options = Object.assign(options, {
21-
autoIndent: true,
22-
});
2320
return write('insert', text, options);
2421
}
2522
exports.insert = insert;

lib/components/Page/Task/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ 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-
var currentTask = taskPosition === index;
31-
return (React.createElement(List_1.ListItem, {key: index, style: Object.assign({}, styles, { backgroundColor: backgroundColor })}, taskCheckbox_1.taskCheckbox(task, testRun), React.createElement("span", {style: indexStyles}, index + 1, "."), React.createElement("div", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, task.description))));
30+
var isCurrentTask = taskPosition === index;
31+
return (React.createElement(List_1.ListItem, {key: index, style: Object.assign({}, styles, { backgroundColor: backgroundColor })}, taskCheckbox_1.taskCheckbox(isCurrentTask, testRun), React.createElement("span", {style: indexStyles}, index + 1, "."), React.createElement("div", {style: descriptionStyles}, React.createElement(index_1.Markdown, null, task.description))));
3232
};

lib/components/Page/Task/taskCheckbox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ var styles = {
66
position: 'absolute',
77
top: '15px'
88
};
9-
function taskCheckbox(currentTask, testRun) {
10-
if (!currentTask || !testRun) {
9+
function taskCheckbox(isCurrentTask, testRun) {
10+
if (!isCurrentTask || !testRun) {
1111
return null;
1212
}
1313
return (React.createElement("span", {style: styles}, React.createElement(indeterminate_check_box_1.default, {color: colors_1.orange500})));

lib/reducers/editor-actions/actions.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ function editorActions(actionString) {
1313
var params = action_helpers_1.getParams(actionString);
1414
switch (command) {
1515
case Type.OPEN:
16-
var obj = action_helpers_1.getOptions(params[0]);
17-
var file = obj.param;
18-
var options = obj.options;
16+
var _a = action_helpers_1.getOptions(params[0]), param = _a.param, options = _a.options;
1917
if (params.length === 1) {
20-
editor_1.open(file, options);
18+
editor_1.open(param, options);
2119
setTimeout(function () {
2220
resolve();
2321
}, 100);

lib/reducers/editor-actions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function editorActionsReducer(editorActions, action) {
1818
handleEditorActions(actions.shift());
1919
return actions;
2020
case _types_1.TEST_RESULT:
21-
actions = action.payload.actions;
21+
actions = action.payload.actions || [];
2222
var nextTaskPosition = action.payload.result.taskPosition;
2323
if (nextTaskPosition > currentTaskPosition) {
2424
for (var i = 0; i < nextTaskPosition - currentTaskPosition; i++) {

lib/reducers/progress/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function progressReducer(progress, action) {
2727
})
2828
};
2929
case _types_1.COMPLETE_PAGE:
30-
var position = action.payload.position;
31-
progress.chapters[position.chapter].pages[position.page] = true;
30+
var _a = action.payload.position, chapter = _a.chapter, page = _a.page;
31+
progress.chapters[chapter].pages[page] = true;
3232
local_storage_1.saveToLocalStorage(progress);
3333
return progress;
3434
case _types_1.COMPLETE_CHAPTER:

lib/reducers/route/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ function routeReducer(route, action) {
55
if (route === void 0) { route = _route; }
66
switch (action.type) {
77
case _types_1.ROUTE_SET:
8-
var next = action.payload.route;
98
return action.payload.route;
109
default:
1110
return route;

lib/reducers/task-tests/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ function taskTestsReducer(taskTests, action) {
66
if (taskTests === void 0) { taskTests = ''; }
77
switch (action.type) {
88
case _types_1.TESTS_LOAD:
9-
var tasks = store_1.default.getState().tasks;
10-
var tests = [].concat.apply([], tasks.map(function (task) { return task.tests || []; }));
11-
var output_1 = '';
12-
tests.forEach(function (file) {
9+
return [].concat.apply([], store_1.default.getState().tasks.map(function (task) { return task.tests || []; })).reduce(function (output, file) {
1310
try {
14-
var data = fs_1.readFileSync(file, 'utf8');
15-
output_1 += data + '\n';
11+
output += fs_1.readFileSync(file, 'utf8') + '\n';
1612
}
1713
catch (e) {
1814
console.log('Error reading test file', e);
1915
}
20-
});
21-
return output_1;
16+
return output;
17+
}, '');
2218
default:
2319
return taskTests;
2420
}

0 commit comments

Comments
 (0)