Merge remote-tracking branch 'remotes/dartandrevinsky/wip-customer' into wip-customer

This commit is contained in:
dartpopikyardo
2016-09-02 23:53:11 +03:00
12 changed files with 45 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@@ -185,11 +185,11 @@ webpackJsonp([0,3],{
return store.dispatch((0, _configure.configure)([{
default: {
//apiUrl: '/',
emailSignInPath: '/login',
customersPath: '/customers',
currentUserPath: '/user',
accountsPath: '/accounts',
transfersPath: '/transfers'
emailSignInPath: '/api/login',
customersPath: '/api/customers',
currentUserPath: '/api/user',
accountsPath: '/api/accounts',
transfersPath: '/api/transfers'
}
}], {
cookies: cookies,
@@ -1403,6 +1403,9 @@ webpackJsonp([0,3],{
var state = arguments.length <= 0 || arguments[0] === undefined ? _extends({}, initialState) : arguments[0];
var action = arguments[1];
if (typeof action.length !== 'undefined') {
debugger;
}
switch (action.type) {
case _ACTION_TYPES2.default.ENTITIES.REQUESTED:
{
@@ -2419,7 +2422,7 @@ webpackJsonp([0,3],{
function apiRetrieveAccounts(customerId) {
return (0, _fetch2.default)((0, _sessionStorage.getAccountsUrl)() + '?' + makeQuery({ customerId: customerId }), {
return (0, _fetch2.default)((0, _sessionStorage.getCustomersUrl)() + '/' + customerId + '/accounts', {
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
@@ -2799,7 +2802,7 @@ webpackJsonp([0,3],{
return function (dispatch) {
//dispatch(accountsListRequested());
return api.apiRetrieveAccounts(customerId).then(function (data) {
dispatch(accountsListReceived(data));
dispatch(accountsListReceived(data.accounts));
});
};
}
@@ -7287,4 +7290,4 @@ webpackJsonp([0,3],{
/***/ }
});
//# sourceMappingURL=app.3a9a7c962cfa5ee06c64.js.map
//# sourceMappingURL=app.55956eebecdad90ea191.js.map

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@
<!-- Optional theme -->
<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>
<body><div id="root"></div><script src="/manifest.bc378b891fe9d196dbb4.js"></script><script src="/vendor.9bf2d755cba11113a020.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.55956eebecdad90ea191.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.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>
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.bc378b891fe9d196dbb4.js","hash":"bc378b891fe9d196dbb4","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":348752,"entry":"/app.55956eebecdad90ea191.js","hash":"55956eebecdad90ea191","css":[]}},"js":["/manifest.bc378b891fe9d196dbb4.js","/vendor.9bf2d755cba11113a020.js","/style.6d7a32b1405ea1bb2bdf.js","/app.55956eebecdad90ea191.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":"3a9a7c962cfa5ee06c64","1":"6d7a32b1405ea1bb2bdf","2":"9bf2d755cba11113a020"}[chunkId] + ".js";
/******/ script.src = __webpack_require__.p + "" + {"0":"55956eebecdad90ea191","1":"6d7a32b1405ea1bb2bdf","2":"9bf2d755cba11113a020"}[chunkId] + ".js";
/******/ head.appendChild(script);
/******/ }
/******/ };
@@ -92,4 +92,4 @@
/******/ })
/************************************************************************/
/******/ ([]);
//# sourceMappingURL=manifest.3614fb531d249ed18cb9.js.map
//# sourceMappingURL=manifest.bc378b891fe9d196dbb4.js.map

View File

@@ -1 +1 @@
{"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":""}
{"version":3,"sources":["webpack:///webpack/bootstrap c0f72443ea68d5422262?"],"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.bc378b891fe9d196dbb4.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\":\"55956eebecdad90ea191\",\"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 c0f72443ea68d5422262\n **/"],"sourceRoot":""}

View File

@@ -21,21 +21,24 @@ exports.devServer = function(options) {
host: options.host, // Defaults to `localhost`
port: options.port, // Defaults to 8080
proxy: {
'/user*' : {
target: 'http://localhost:8080'
},
'/login' : {
target: 'http://localhost:8080'
},
'/customers*' : {
target: 'http://localhost:8080'
},
'/accounts*' : {
target: 'http://localhost:8080'
},
'/transfers*' : {
'/api*' : {
target: 'http://localhost:8080'
}
// '/user*' : {
// target: 'http://localhost:8080'
// },
// '/login' : {
// target: 'http://localhost:8080'
// },
// '/customers*' : {
// target: 'http://localhost:8080'
// },
// '/accounts*' : {
// target: 'http://localhost:8080'
// },
// '/transfers*' : {
// target: 'http://localhost:8080'
// }
}
},
watchOptions: {

View File

@@ -15,7 +15,7 @@ import { reduxReactRouter as serverRouter } from "redux-router/server";
import mainReducer from './reducers';
import { configure as reduxAuthConfigure } from './actions/configure';
import { configure as endpointsConfig } from './actions/configure';
import { requireAuthentication } from './components/AuthComponent';
import Container from "./components/partials/Container";
import MyAccounts from "./views/MyAccounts";
@@ -64,15 +64,15 @@ export function initialize({cookies, isServer, currentLocation, userAgent} = {})
/**
* The React Router 1.0 routes for both the server and the client.
*/
return store.dispatch(reduxAuthConfigure([
return store.dispatch(endpointsConfig([
{
default: {
//apiUrl: '/',
emailSignInPath: '/login',
customersPath: '/customers',
currentUserPath: '/user',
accountsPath: '/accounts',
transfersPath: '/transfers'
emailSignInPath: '/api/login',
customersPath: '/api/customers',
currentUserPath: '/api/user',
accountsPath: '/api/accounts',
transfersPath: '/api/transfers'
}
}
], {

View File

@@ -4,15 +4,6 @@
import T from '../constants/ACTION_TYPES';
import {
getCurrentSettings,
setCurrentSettings,
getInitialEndpointKey,
setDefaultEndpointKey,
setCurrentEndpoint,
setCurrentEndpointKey,
retrieveData,
persistData,
destroySession,
persistUserData,
retrieveUserData,
retrieveHeaders

View File

@@ -123,7 +123,7 @@ export function fetchOwnAccounts(customerId) {
//dispatch(accountsListRequested());
return api.apiRetrieveAccounts(customerId)
.then(data => {
dispatch(accountsListReceived(data));
dispatch(accountsListReceived(data.accounts));
});
};
}

View File

@@ -12,6 +12,9 @@ const nodeInitialState = {
};
export const entities = (state = {...initialState}, action) => {
if (typeof action.length !== 'undefined') {
debugger;
}
switch(action.type) {
case T.ENTITIES.REQUESTED: {
const { id } = action;

View File

@@ -108,7 +108,7 @@ export function apiMakeTransfer(fromAccountId, {
export function apiRetrieveAccounts(customerId) {
return fetch(`${getAccountsUrl()}?${makeQuery({ customerId })}`, {
return fetch(`${getCustomersUrl()}/${customerId}/accounts`, {
headers: {
"Accept": "application/json",
"Content-Type": "application/json"