Update loopback, ThunderCats and RxJS.

closes #2929
This commit is contained in:
Berkeley Martinez
2015-10-11 15:57:49 -07:00
parent 02ed450b96
commit 7b444b15dc
8 changed files with 43 additions and 30 deletions

View File

@ -8,13 +8,17 @@ const initValue = {
points: 0
};
export default Store(initValue)
.refs({ displayName: 'AppStore' })
.init(({ instance: appStore, args: [cat] }) => {
export default Store({
refs: {
displayName: 'AppStore',
value: initValue
},
init({ instance: appStore, args: [cat] }) {
const { setUser, setTitle } = cat.getActions('appActions');
const register = createRegistrar(appStore);
register(setter(fromMany(setUser, setTitle)));
return appStore;
});
}
});

View File

@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';
import { Button, Col, Row, Panel } from 'react-bootstrap';
import { Navigation } from 'react-router';
import { History } from 'react-router';
import Vimeo from 'react-vimeo';
import debugFactory from 'debug';
@ -8,7 +8,7 @@ const debug = debugFactory('freecc:hikes');
export default React.createClass({
displayName: 'Lecture',
mixins: [Navigation],
mixins: [History],
propTypes: {
currentHike: PropTypes.object,
@ -20,7 +20,7 @@ export default React.createClass({
handleFinish() {
debug('loading questions');
const { dashedName } = this.props.params;
this.transitionTo(`/hikes/${dashedName}/questions/1`);
this.history.pushState(null, `/hikes/${dashedName}/questions/1`);
},
renderTranscript(transcript, dashedName) {

View File

@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';
import { Spring } from 'react-motion';
import { Navigation, TransitionHook } from 'react-router';
import { History, Lifecycle } from 'react-router';
import debugFactory from 'debug';
import {
Button,
@ -19,8 +19,8 @@ export default React.createClass({
displayName: 'Question',
mixins: [
Navigation,
TransitionHook
History,
Lifecycle
],
propTypes: {
@ -150,7 +150,8 @@ export default React.createClass({
postJSON$('/completed-challenge', { id, name }).subscribeOnCompleted(() => {
if (tests[nextQuestionIndex]) {
return this.transitionTo(
return this.history.pushState(
null,
`/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }`
);
}
@ -168,13 +169,13 @@ export default React.createClass({
}, null);
if (nextHike) {
return this.transitionTo(`/hikes/${ nextHike.dashedName }`);
return this.history.pushState(null, `/hikes/${ nextHike.dashedName }`);
}
debug(
'next Hike was not found, currentHike %s',
currentHike.dashedName
);
this.transitionTo('/hikes');
this.history.pushState(null, '/hikes');
});
},

View File

@ -3,7 +3,7 @@ import debugFactory from 'debug';
const debug = debugFactory('freecc:hikes:actions');
function getCurrentHike(hikes =[{}], dashedName, currentHike) {
function getCurrentHike(hikes = [{}], dashedName, currentHike) {
if (!dashedName) {
debug('no dashedName');
return hikes[0];

View File

@ -5,12 +5,16 @@ const initialValue = {
currentHike: {}
};
export default Store(initialValue)
.refs({ displayName: 'HikesStore'})
.init(({ instance: hikeStore, args: [cat] }) => {
export default Store({
refs: {
displayName: 'HikesStore',
value: initialValue
},
init({ instance: hikeStore, args: [cat] }) {
let { setHikes } = cat.getActions('hikesActions');
hikeStore.register(setHikes);
return hikeStore;
});
}
});

View File

@ -6,9 +6,12 @@ const {
transformer
} = Store;
export default Store({ showModal: false })
.refs({ displayName: 'JobsStore' })
.init(({ instance: jobsStore, args: [cat] }) => {
export default Store({
refs: {
displayName: 'JobsStore',
value: { showModal: false }
},
init({ instance: jobsStore, args: [cat] }) {
const {
setJobs,
findJob,
@ -27,4 +30,5 @@ export default Store({ showModal: false })
register(transformer(findJob));
register(handleForm);
});
}
});

View File

@ -63,8 +63,8 @@
"json-loader": "^0.5.2",
"less": "~2.5.1",
"lodash": "^3.9.3",
"loopback": "https://github.com/FreeCodeCamp/loopback.git#fix/no-password",
"loopback-boot": "2.8.2",
"loopback": "^2.22.0",
"loopback-boot": "^2.13.0",
"loopback-component-passport": "https://github.com/FreeCodeCamp/loopback-component-passport.git#feature/flashfailure",
"loopback-connector-mongodb": "^1.10.0",
"lusca": "~1.0.2",
@ -89,17 +89,17 @@
"react": "^0.13.3",
"react-bootstrap": "~0.23.7",
"react-motion": "~0.1.0",
"react-router": "^1.0.0-rc1",
"react-router": "https://github.com/BerkeleyTrue/react-router.git#freecodecamp",
"react-vimeo": "^0.0.3",
"request": "~2.53.0",
"rev-del": "^1.0.5",
"rx": "^2.5.3",
"rx": "^4.0.0",
"sanitize-html": "~1.6.1",
"sort-keys": "^1.1.1",
"source-map-support": "^0.3.2",
"store": "https://github.com/berkeleytrue/store.js.git#feature/noop-server",
"thundercats": "^2.1.0",
"thundercats-react": "^0.1.0",
"thundercats": "^3.0.0",
"thundercats-react": "^0.3.0",
"twit": "~1.1.20",
"uglify-js": "~2.4.15",
"validator": "^3.22.1",

View File

@ -186,7 +186,7 @@ module.exports = function(app) {
);
}
const firstChallengeOfNextBlock$ = blocks$
.elementAtOrDefault(blockIndex + 1, {})
.elementAt(blockIndex + 1, {})
.map(({ challenges = [] }) => challenges[0]);
return blocks$
@ -259,7 +259,7 @@ module.exports = function(app) {
.filter((challenge) => {
return testChallengeName.test(challenge.name);
})
.lastOrDefault(null)
.last({ defaultValue: null })
.flatMap(challenge => {
// Handle not found