Refresh after account creation

This commit is contained in:
Andrew Revinsky (DART)
2016-08-31 19:40:09 +03:00
parent d1328e4ce8
commit 1b53bd9147
20 changed files with 5100 additions and 9724 deletions

View File

@@ -1,4 +1,3 @@
{
"plugins": ["transform-runtime"],
"presets": ["es2015", "stage-0", "react"]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -12,8 +12,8 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css"><link href="/style.45c91aea174020d653f5.css" rel="stylesheet"></head>
<body><div id="root"></div><script src="/manifest.6ad78289b29e62452459.js"></script><script src="/vendor.baef2b8165bd82cefb69.js"></script><script src="/style.45c91aea174020d653f5.js"></script><script src="/app.0161ddc3379424602da9.js"></script><script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css"><link href="/style.6d7a32b1405ea1bb2bdf.css" rel="stylesheet"></head>
<body><div id="root"></div><script src="/manifest.3614fb531d249ed18cb9.js"></script><script src="/vendor.9bf2d755cba11113a020.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.3a9a7c962cfa5ee06c64.js"></script><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -27,5 +27,5 @@
ga('send', 'pageview');
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.6ad78289b29e62452459.js","hash":"6ad78289b29e62452459","css":[]},"vendor":{"size":1670874,"entry":"/vendor.baef2b8165bd82cefb69.js","hash":"baef2b8165bd82cefb69","css":[]},"style":{"size":122,"entry":"/style.45c91aea174020d653f5.js","hash":"45c91aea174020d653f5","css":["/style.45c91aea174020d653f5.css"]},"app":{"size":410511,"entry":"/app.0161ddc3379424602da9.js","hash":"0161ddc3379424602da9","css":[]}},"js":["/manifest.6ad78289b29e62452459.js","/vendor.baef2b8165bd82cefb69.js","/style.45c91aea174020d653f5.js","/app.0161ddc3379424602da9.js"],"css":["/style.45c91aea174020d653f5.css"]},"options":{"template":"/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/html-webpack-plugin/lib/loader.js!/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/public/index.ejs","filename":"index.html","hash":false,"inject":false,"compile":true,"favicon":false,"minify":false,"cache":true,"showErrors":true,"chunks":"all","excludeChunks":[],"title":"Money Transfer App","xhtml":false,"description":"ES Money Transfer App","appMountId":"root","googleAnalytics":{"trackingId":"UA-XXXX-XX","pageViewOnLoad":true},"mobile":true}}--></body>
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.3614fb531d249ed18cb9.js","hash":"3614fb531d249ed18cb9","css":[]},"vendor":{"size":1670874,"entry":"/vendor.9bf2d755cba11113a020.js","hash":"9bf2d755cba11113a020","css":[]},"style":{"size":122,"entry":"/style.6d7a32b1405ea1bb2bdf.js","hash":"6d7a32b1405ea1bb2bdf","css":["/style.6d7a32b1405ea1bb2bdf.css"]},"app":{"size":348671,"entry":"/app.3a9a7c962cfa5ee06c64.js","hash":"3a9a7c962cfa5ee06c64","css":[]}},"js":["/manifest.3614fb531d249ed18cb9.js","/vendor.9bf2d755cba11113a020.js","/style.6d7a32b1405ea1bb2bdf.js","/app.3a9a7c962cfa5ee06c64.js"],"css":["/style.6d7a32b1405ea1bb2bdf.css"]},"options":{"template":"/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/html-webpack-plugin/lib/loader.js!/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/public/index.ejs","filename":"index.html","hash":false,"inject":false,"compile":true,"favicon":false,"minify":false,"cache":true,"showErrors":true,"chunks":"all","excludeChunks":[],"title":"Money Transfer App","xhtml":false,"description":"ES Money Transfer App","appMountId":"root","googleAnalytics":{"trackingId":"UA-XXXX-XX","pageViewOnLoad":true},"mobile":true}}--></body>
</html>

View File

@@ -76,7 +76,7 @@
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/
/******/ script.src = __webpack_require__.p + "" + {"0":"0161ddc3379424602da9","1":"45c91aea174020d653f5","2":"baef2b8165bd82cefb69"}[chunkId] + ".js";
/******/ script.src = __webpack_require__.p + "" + {"0":"3a9a7c962cfa5ee06c64","1":"6d7a32b1405ea1bb2bdf","2":"9bf2d755cba11113a020"}[chunkId] + ".js";
/******/ head.appendChild(script);
/******/ }
/******/ };
@@ -92,4 +92,4 @@
/******/ })
/************************************************************************/
/******/ ([]);
//# sourceMappingURL=manifest.6ad78289b29e62452459.js.map
//# sourceMappingURL=manifest.3614fb531d249ed18cb9.js.map

View File

@@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap ad5528b400614ad1cde1?"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAA+C,iFAAiF;AAChI;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA","file":"manifest.6ad78289b29e62452459.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n \t\tif(moreModules[0]) {\n \t\t\tinstalledModules[0] = 0;\n \t\t\treturn __webpack_require__(0);\n \t\t}\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t3:0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + {\"0\":\"0161ddc3379424602da9\",\"1\":\"45c91aea174020d653f5\",\"2\":\"baef2b8165bd82cefb69\"}[chunkId] + \".js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap ad5528b400614ad1cde1\n **/"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap c67ebd10dee52fe43758?"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAA+C,iFAAiF;AAChI;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA","file":"manifest.3614fb531d249ed18cb9.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n \t\tif(moreModules[0]) {\n \t\t\tinstalledModules[0] = 0;\n \t\t\treturn __webpack_require__(0);\n \t\t}\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t3:0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + {\"0\":\"3a9a7c962cfa5ee06c64\",\"1\":\"6d7a32b1405ea1bb2bdf\",\"2\":\"9bf2d755cba11113a020\"}[chunkId] + \".js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap c67ebd10dee52fe43758\n **/"],"sourceRoot":""}

View File

@@ -438,4 +438,4 @@ body {
h1 {
margin-top: .5em;
}
/*# sourceMappingURL=style.45c91aea174020d653f5.css.map*/
/*# sourceMappingURL=style.6d7a32b1405ea1bb2bdf.css.map*/

View File

@@ -1 +1 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"style.45c91aea174020d653f5.css","sourceRoot":""}
{"version":3,"sources":[],"names":[],"mappings":"","file":"style.6d7a32b1405ea1bb2bdf.css","sourceRoot":""}

View File

@@ -3,20 +3,20 @@ webpackJsonp([1,3],{
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(732);
module.exports = __webpack_require__(736);
__webpack_require__(614);
module.exports = __webpack_require__(618);
/***/ },
/***/ 732:
/***/ 614:
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ },
/***/ 736:
/***/ 618:
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
@@ -24,4 +24,4 @@ webpackJsonp([1,3],{
/***/ }
});
//# sourceMappingURL=style.45c91aea174020d653f5.js.map
//# sourceMappingURL=style.6d7a32b1405ea1bb2bdf.js.map

View File

@@ -1 +1 @@
{"version":3,"sources":["webpack:///./~/react-select/dist/react-select.css?","webpack:///./src/main.less?"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,0C;;;;;;;ACAA,0C","file":"style.45c91aea174020d653f5.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react-select/dist/react-select.css\n ** module id = 732\n ** module chunks = 1\n **/","// removed by extract-text-webpack-plugin\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/main.less\n ** module id = 736\n ** module chunks = 1\n **/"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./~/react-select/dist/react-select.css?","webpack:///./src/main.less?"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,0C;;;;;;;ACAA,0C","file":"style.6d7a32b1405ea1bb2bdf.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react-select/dist/react-select.css\n ** module id = 614\n ** module chunks = 1\n **/","// removed by extract-text-webpack-plugin\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/main.less\n ** module id = 618\n ** module chunks = 1\n **/"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -16,16 +16,17 @@
},
"devDependencies": {
"autoprefixer-loader": "^2.0.0",
"babel-core": "6.1.4",
"babel-loader": "6.1.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-polyfill": "^6.1.4",
"babel-preset-es2015": "6.1.4",
"babel-preset-react": "6.1.4",
"babel-preset-stage-0": "6.1.2",
"babel-register": "6.1.4",
"babel-runtime": "^6.0.14",
"babel-cli": "^6.7.7",
"babel-core": "^6.10.4",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.4",
"babel-polyfill": "^6.2.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.1.2",
"clean-webpack-plugin": "^0.1.10",
"copy-webpack-plugin": "^3.0.1",
"css-loader": "^0.14.4",

View File

@@ -5,31 +5,23 @@
import React from "react";
import { createStore, compose, applyMiddleware, combineReducers} from "redux";
import { Provider, connect} from "react-redux";
import thunk from "redux-thunk";
import createLogger from 'redux-logger';
import { Route, IndexRoute, Link, IndexLink } from "react-router";
import { ReduxRouter} from "redux-router";
import mainReducer from './reducers';
import { configure as reduxAuthConfigure } from './actions/configure';
import { createHistory, createHashHistory, createMemoryHistory } from "history";
import { pushState, routerStateReducer, reduxReactRouter as clientRouter} from "redux-router";
import { reduxReactRouter as serverRouter } from "redux-router/server";
import { requireAuthentication } from './components/AuthComponent';
import mainReducer from './reducers';
//import demoButtons from "./reducers/request-test-buttons";
//import demoUi from "./reducers/demo-ui";
import { configure as reduxAuthConfigure } from './actions/configure';
import { requireAuthentication } from './components/AuthComponent';
import Container from "./components/partials/Container";
import MyAccounts from "./views/MyAccounts";
import Account from "./views/Account";
import SignIn from "./views/SignIn";
import SignUp from "./views/SignUp";
//import GlobalComponents from "./views/partials/GlobalComponents";
class App extends React.Component {
render() {

View File

@@ -5,6 +5,7 @@ import T from '../constants/ACTION_TYPES';
import { makeActionCreator } from '../utils/actions';
import * as api from '../utils/api';
import { authenticate } from './authenticate';
import root from '../utils/root';
export const entityRequested = makeActionCreator(T.ENTITIES.REQUESTED, 'id');
export const entityReceived = makeActionCreator(T.ENTITIES.RECEIVED, 'id', 'entity');
@@ -44,18 +45,47 @@ export function accountsList(userId) {
};
}
function readUntilChanged(initialData, customerId) {
const initialDataFlat = root['JSON'].stringify(initialData);
debugger;
return new Promise((rs, rj) => {
setTimeout(() => {
api.apiRetrieveAccounts(customerId)
.then(data => {
debugger;
if (initialDataFlat == root['JSON'].stringify(data)) {
return readUntilChanged.call(this, data, customerId).then(rs, rj); // Promise
}
rs(data);
})
.catch(rj)
}, 500);
})
}
export function accountCreate(customerId, payload) {
return dispatch => {
dispatch(accountCreateStart());
return api.apiCreateAccount(customerId, payload)
.then(({ accountId }) => {
dispatch(accountCreateComplete({
id: accountId,
...payload
}));
// dispatch(entityReceived(accountId, payload));
dispatch(authenticate(true));
return accountId;
.then(data => {
if (data.accountId) {
const { accountId } = data;
dispatch(accountCreateComplete({
id: accountId,
...payload
}));
// dispatch(entityReceived(accountId, payload));
dispatch(authenticate(true));
return accountId;
} else {
return readUntilChanged(data, customerId)
.then(() => {
dispatch(accountCreateComplete({
id: ''
}));
dispatch(authenticate(true));
});
}
})
.catch(err => {
debugger;

View File

@@ -4,8 +4,6 @@
import React from "react";
import ReactDOM from "react-dom";
import { initialize } from "./app";
/**
* Fire-up React Router.
*/

View File

@@ -3,16 +3,16 @@ import invariant from 'invariant'
export const TODO_DEFINE = Symbol('Define property');
export const defineActionType = (obj) => {
const result = Object.entries(obj).reduce((memo, [namespace, value]) => {
const result = Object.keys(obj).reduce((memo, namespace) => {
const value = obj[namespace];
let types = [];
const namespaceTypes = {};
if (typeof value == 'string') {
types = value.trim().split(/\s+/);
} else {
types = Object.entries(value)
.filter(([key, needDefinition]) => needDefinition === TODO_DEFINE)
.map(([key]) => key);
types = Object.keys(value)
.filter((key) => value[key] === TODO_DEFINE);
}
invariant(

View File

@@ -275,7 +275,8 @@ export class Account extends React.Component {
<Col sm={2}>
<br/>
<Button bsStyle="primary"
onClick={this.initiateTransfer.bind(this)}>Transfer</Button>
disabled={transferDisabled}
onClick={!transferDisabled && this.initiateTransfer.bind(this)}>Transfer</Button>
</Col>
</Row>