Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85ce2d9

Browse files
committed
alert on update tutorial
1 parent63f7bce commit85ce2d9

File tree

16 files changed

+98
-86
lines changed

16 files changed

+98
-86
lines changed

‎lib/components/AppMenu/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var AppBar_1 = require('material-ui/AppBar');
44
varmenuIconLeft_1=require('./menuIconLeft');
55
varmenuRight_1=require('./menuRight');
66
varstyles={
7-
zIndex:'999 !important'
7+
zIndex:'1 !important'
88
};
99
exports.AppMenu=function(_a){
1010
varroute=_a.route;

‎lib/components/Page/Task/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ exports.Task = function (_a) {
2828
vartask=_a.task,taskPosition=_a.taskPosition,index=_a.index,testRun=_a.testRun;
2929
varbackgroundColor=getStatus(index,taskPosition,testRun);
3030
varcurrentTask=taskPosition===index;
31-
return(React.createElement(List_1.ListItem,{key:index,style:Object.assign({},styles,{backgroundColor:backgroundColor})},taskCheckbox_1.taskCheckbox(currentTask,testRun),React.createElement("span",{style:indexStyles},index+1,"."),React.createElement("div",{style:descriptionStyles},React.createElement(index_1.Markdown,null,task.description))));
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))));
3232
};

‎lib/components/Tutorials/UpdateTutorial/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ var UpdateTutorial = (function (_super) {
2828
_super.apply(this,arguments);
2929
}
3030
UpdateTutorial.prototype.render=function(){
31-
var_a=this.props,name=_a.name,tutorialUpdate=_a.tutorialUpdate;
32-
return(React.createElement(update_1.default,{style:styles,color:colors_1.pink500,onTouchTap:tutorialUpdate.bind(this,name)}));
31+
var_a=this.props,tutorial=_a.tutorial,tutorialUpdate=_a.tutorialUpdate;
32+
return(React.createElement("span",null,React.createElement(update_1.default,{style:styles,color:colors_1.pink500,onTouchTap:tutorialUpdate.bind(this,tutorial.name)}),React.createElement("span",{style:{marginLeft:'10px'}},tutorial.latest)));
3333
};
3434
UpdateTutorial=__decorate([
3535
react_redux_1.connect(null,function(dispatch){

‎lib/components/Tutorials/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var styles = {
1111
exports.Tutorials=function(_a){
1212
vartutorials=_a.tutorials;
1313
return(React.createElement("div",{style:styles},React.createElement(Table_1.Table,null,React.createElement(Table_1.TableHeader,{displaySelectAll:false,adjustForCheckbox:false},React.createElement(Table_1.TableRow,null,React.createElement(Table_1.TableHeaderColumn,null,"Tutorial"),React.createElement(Table_1.TableHeaderColumn,null,"Version"))),React.createElement(Table_1.TableBody,{displayRowCheckbox:false},tutorials.map(functiontutorialRow(tutorial,index){
14-
return(React.createElement(Table_1.TableRow,{key:index},React.createElement(Table_1.TableRowColumn,null,React.createElement(SelectTutorial_1.SelectTutorial,{tutorial:tutorial})),React.createElement(Table_1.TableRowColumn,null,tutorial.version,tutorial.latest
15-
?React.createElement(UpdateTutorial_1.UpdateTutorial,{name:tutorial.name})
14+
return(React.createElement(Table_1.TableRow,{key:index},React.createElement(Table_1.TableRowColumn,null,React.createElement(SelectTutorial_1.SelectTutorial,{tutorial:tutorial})),React.createElement(Table_1.TableRowColumn,null,tutorial.version,!!tutorial.latest
15+
?React.createElement(UpdateTutorial_1.UpdateTutorial,{tutorial:tutorial})
1616
:null)));
1717
}))),React.createElement("br",null),React.createElement(LoadTutorials_1.LoadTutorials,null)));
1818
};

‎lib/reducers/alert/index.js‎

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,66 @@ var _alert = {
55
open:false,
66
action:'',
77
};
8+
varopen={
9+
open:true,
10+
pass:true,
11+
};
812
varcurrent=_alert;
913
functionalertReducer(alert,action){
1014
if(alert===void0){alert=_alert;}
1115
varstatusBarAlert=document.getElementsByClassName('cr-alert-replay')[0];
1216
switch(action.type){
1317
case_types_1.ALERT_REPLAY:
14-
returnObject.assign({},current,{open:true});
18+
returnObject.assign({},current,open);
1519
case_types_1.ALERT_TOGGLE:
1620
returnaction.payload.alert||_alert;
21+
case_types_1.TUTORIAL_UPDATE:
22+
current=Object.assign({},{
23+
message:"run `npm install --save-dev "+action.payload.name+"`",
24+
action:'note',
25+
duration:4000,
26+
},open);
27+
returncurrent;
1728
case_types_1.TEST_RESULT:
1829
varresult=action.payload.result;
1930
if(result.pass&&result.change>0){
2031
statusBarAlert.style.color='#73C990';
21-
current={
32+
current=Object.assign({},{
2233
message:result.msg,
23-
open:true,
24-
action:'pass',
2534
duration:result.duration||1500,
26-
};
35+
},open);
2736
returncurrent;
2837
}
2938
elseif(result.pass===false&&result.change<1){
3039
statusBarAlert.style.color='#FF4081';
31-
current={
40+
current=Object.assign({},{
3241
message:result.msg,
33-
open:true,
3442
action:'fail',
3543
duration:result.duration||2500,
36-
};
44+
},open);
3745
returncurrent;
3846
}
3947
statusBarAlert.style.color='#9DA5B4';
40-
current={
48+
current=Object.assign({},{
4149
message:result.msg,
42-
open:true,
4350
action:'note',
4451
duration:result.duration||2500,
45-
};
52+
},open);
4653
returncurrent;
4754
case_types_1.COMPLETE_PAGE:
48-
current={
55+
current=Object.assign({},{
4956
message:"Page "+(action.payload.position.page+1)+" Complete",
50-
open:true,
51-
action:'pass',
52-
};
57+
},open);
5358
returncurrent;
5459
case_types_1.COMPLETE_CHAPTER:
55-
current={
60+
current=Object.assign({},{
5661
message:"Chapter "+(action.payload.chapter+1)+" Complete",
57-
open:true,
58-
action:'pass',
59-
};
62+
},open);
6063
returncurrent;
6164
case_types_1.COMPLETE_TUTORIAL:
62-
current={
65+
current=Object.assign({},{
6366
message:'Tutorial Complete',
64-
open:true,
65-
action:'pass',
66-
};
67+
},open);
6768
returncurrent;
6869
default:
6970
returnalert;

‎lib/reducers/tutorials/index.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
"use strict";
22
var_types_1=require('../../actions/_types');
3-
varupdate_1=require('./update');
43
varstore_1=require('../../store');
54
varcheck_1=require('./check');
65
functiontutorialsReducer(tutorials,action){
76
if(tutorials===void0){tutorials=[];}
87
switch(action.type){
9-
case_types_1.TUTORIAL_UPDATE:
10-
update_1.tutorialUpdate(action.payload.name);
118
case_types_1.TUTORIALS_FIND:
129
varpackageJson=store_1.default.getState().packageJson;
1310
return([]

‎lib/reducers/tutorials/update.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use strict";
22
varcommand_line_1=require('../../services/command-line');
33
functiontutorialUpdate(name){
4-
alert(name);
4+
console.log("run \"npm install --save-dev "+name+"\"");
55
}
66
exports.tutorialUpdate=tutorialUpdate;
77
functioncanUpdateTutorial(name,currentVersion){
88
if(!navigator.onLine){
9-
returnfalse;
9+
returnnull;
1010
}
1111
return(command_line_1.default('npm',"outdated "+name).then(function(res){
1212
console.log(res);
@@ -20,7 +20,7 @@ function canUpdateTutorial(name, currentVersion) {
2020
returntrue;
2121
}
2222
}
23-
returnfalse;
23+
returnnull;
2424
}));
2525
}
2626
exports.canUpdateTutorial=canUpdateTutorial;

‎lib/services/command-line.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function commandLine(root, commands) {
1515
throwroot+' not found. Python may not be installed';
1616
}
1717
}
18-
varrun=child_process_1.exec(root+" "+commands);
18+
varrun=child_process_1.exec(""+root+(commands ?' '+commands :''));
1919
returnnewPromise(function(resolve,reject){
2020
run.stdout.on('data',function(data){returnresolve(data);});
2121
run.stderr.on('data',function(data){returnreject(data);});

‎src/components/AppMenu/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {menuIconLeft} from './menuIconLeft';
44
import{menuRight}from'./menuRight';
55

66
conststyles={
7-
zIndex:'999 !important'
7+
zIndex:'1 !important'
88
};
99

1010
exportconstAppMenu:React.StatelessComponent<{

‎src/components/Page/Task/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const Task: React.StatelessComponent<{
4040
key={index}
4141
style={Object.assign({},styles,{backgroundColor})}
4242
>
43-
{taskCheckbox(currentTask,testRun)}
43+
{taskCheckbox(task,testRun)}
4444
<spanstyle={indexStyles}>{index+1}.</span>
4545
<divstyle={descriptionStyles}>
4646
<Markdown>{task.description}</Markdown>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp