Transfers history - correct statuses and calculation
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1832,7 +1832,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _authenticate = __webpack_require__(316);
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _clientSettings = __webpack_require__(327);
|
||||
|
||||
@@ -1842,7 +1842,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reduxRouter = __webpack_require__(246);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
@@ -1922,35 +1922,32 @@ webpackJsonp([0,3],{
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.authenticateStart = authenticateStart;
|
||||
exports.authenticateComplete = authenticateComplete;
|
||||
exports.authenticateError = authenticateError;
|
||||
exports.authenticateError = exports.authenticateComplete = exports.authenticateStart = undefined;
|
||||
exports.authenticate = authenticate;
|
||||
|
||||
var _ACTION_TYPES = __webpack_require__(295);
|
||||
|
||||
var _ACTION_TYPES2 = _interopRequireDefault(_ACTION_TYPES);
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _actions = __webpack_require__(317);
|
||||
|
||||
var _api = __webpack_require__(320);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var U = _interopRequireWildcard(_sessionStorage);
|
||||
|
||||
var _api = __webpack_require__(321);
|
||||
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Created by andrew on 26/02/16.
|
||||
*/
|
||||
function authenticateStart() {
|
||||
return { type: _ACTION_TYPES2.default.AUTH.AUTHENTICATE_START };
|
||||
}
|
||||
function authenticateComplete(user) {
|
||||
return { type: _ACTION_TYPES2.default.AUTH.AUTHENTICATE_COMPLETE, user: user };
|
||||
}
|
||||
function authenticateError(errors) {
|
||||
return { type: _ACTION_TYPES2.default.AUTH.AUTHENTICATE_ERROR, errors: errors };
|
||||
}
|
||||
var authenticateStart = exports.authenticateStart = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.AUTH.AUTHENTICATE_START); /**
|
||||
* Created by andrew on 26/02/16.
|
||||
*/
|
||||
var authenticateComplete = exports.authenticateComplete = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.AUTH.AUTHENTICATE_COMPLETE, 'user');
|
||||
var authenticateError = exports.authenticateError = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.AUTH.AUTHENTICATE_ERROR, 'errors');
|
||||
|
||||
function authenticate(forceReread) {
|
||||
return function (dispatch) {
|
||||
@@ -1959,25 +1956,24 @@ webpackJsonp([0,3],{
|
||||
|
||||
var savedUserPromise = new Promise(function (rs, rj) {
|
||||
|
||||
var currentHeaders = (0, _sessionStorage.retrieveHeaders)();
|
||||
var currentHeaders = U.retrieveHeaders();
|
||||
var accessToken = currentHeaders["access-token"];
|
||||
|
||||
if (!accessToken) {
|
||||
return rj({ reason: 'no token' });
|
||||
}
|
||||
|
||||
var savedUser = (0, _sessionStorage.retrieveUserData)();
|
||||
var savedUser = U.retrieveUserData();
|
||||
|
||||
if (savedUser && !forceReread) {
|
||||
return rs(savedUser);
|
||||
}
|
||||
|
||||
return (0, _api.apiGetCurrentUser)().then(function (userData) {
|
||||
(0, _sessionStorage.persistUserData)(userData);
|
||||
U.persistUserData(userData);
|
||||
dispatch((0, _entities.entityReceived)(userData.id, userData));
|
||||
rs(userData);
|
||||
}, function (err) {
|
||||
debugger;
|
||||
rj(err);
|
||||
});
|
||||
});
|
||||
@@ -2014,6 +2010,43 @@ webpackJsonp([0,3],{
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeActionCreator = makeActionCreator;
|
||||
/**
|
||||
* Created by andrew on 15/03/16.
|
||||
*/
|
||||
function makeActionCreator(type) {
|
||||
for (var _len = arguments.length, argNames = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
argNames[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return function () {
|
||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
var action = { type: type };
|
||||
argNames.forEach(function (arg, index) {
|
||||
action[argNames[index]] = args[index];
|
||||
});
|
||||
return action;
|
||||
};
|
||||
}
|
||||
|
||||
/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/makeExportsHot.js"); if (makeExportsHot(module, require("react"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "actions.js" + ": " + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 318:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.retrieveUserData = exports.persistUserData = undefined;
|
||||
exports.setCurrentSettings = setCurrentSettings;
|
||||
exports.getCurrentSettings = getCurrentSettings;
|
||||
exports.setCurrentEndpoint = setCurrentEndpoint;
|
||||
@@ -2036,13 +2069,11 @@ webpackJsonp([0,3],{
|
||||
exports.getTransfersUrl = getTransfersUrl;
|
||||
exports.getApiUrl = getApiUrl;
|
||||
exports.getTokenFormat = getTokenFormat;
|
||||
exports.persistUserData = persistUserData;
|
||||
exports.retrieveUserData = retrieveUserData;
|
||||
exports.retrieveHeaders = retrieveHeaders;
|
||||
exports.persistData = persistData;
|
||||
exports.retrieveData = retrieveData;
|
||||
|
||||
var _jsCookie = __webpack_require__(318);
|
||||
var _jsCookie = __webpack_require__(319);
|
||||
|
||||
var _jsCookie2 = _interopRequireDefault(_jsCookie);
|
||||
|
||||
@@ -2050,7 +2081,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var C = _interopRequireWildcard(_constants);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
@@ -2058,31 +2089,39 @@ webpackJsonp([0,3],{
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
//import "babel-polyfill";
|
||||
|
||||
|
||||
// stateful variables that persist throughout session
|
||||
_root2.default.authState = {
|
||||
var authState = {
|
||||
currentSettings: {},
|
||||
currentEndpoint: {},
|
||||
defaultEndpointKey: 'default'
|
||||
}; /**
|
||||
* Created by andrew on 26/02/16.
|
||||
*/
|
||||
|
||||
|
||||
var memoryStorage = {};
|
||||
|
||||
function clean(obj) {
|
||||
Object.keys(obj).forEach(function (k) {
|
||||
delete obj[k];
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
function setCurrentSettings(s) {
|
||||
_root2.default.authState.currentSettings = s;
|
||||
authState.currentSettings = s;
|
||||
}
|
||||
|
||||
function getCurrentSettings() {
|
||||
return _root2.default.authState.currentSettings;
|
||||
return authState.currentSettings;
|
||||
}
|
||||
|
||||
function setCurrentEndpoint(e) {
|
||||
_root2.default.authState.currentEndpoint = e;
|
||||
authState.currentEndpoint = e;
|
||||
}
|
||||
|
||||
function getCurrentEndpoint() {
|
||||
return _root2.default.authState.currentEndpoint;
|
||||
return authState.currentEndpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2111,18 +2150,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
// reset stateful variables
|
||||
function resetConfig() {
|
||||
_root2.default.authState = _root2.default.authState || {};
|
||||
_root2.default.authState.currentSettings = {};
|
||||
_root2.default.authState.currentEndpoint = {};
|
||||
clean(authState);
|
||||
authState.currentSettings = {};
|
||||
authState.currentEndpoint = {};
|
||||
destroySession();
|
||||
}
|
||||
|
||||
function destroySession() {
|
||||
var sessionKeys = [C.SAVED_CREDS_KEY, C.SAVED_CONFIG_KEY, C.SAVED_USER_INFO];
|
||||
|
||||
for (var key in sessionKeys) {
|
||||
key = sessionKeys[key];
|
||||
|
||||
[C.SAVED_CREDS_KEY, C.SAVED_CONFIG_KEY, C.SAVED_USER_INFO].forEach(function (key) {
|
||||
// kill all local storage keys
|
||||
if (_root2.default.localStorage) {
|
||||
_root2.default.localStorage.removeItem(key);
|
||||
@@ -2130,9 +2166,11 @@ webpackJsonp([0,3],{
|
||||
|
||||
// remove from base path in case config is not specified
|
||||
_jsCookie2.default.remove(key, {
|
||||
path: _root2.default.authState.currentSettings.cookiePath || "/"
|
||||
path: authState.currentSettings.cookiePath || "/"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
clean(memoryStorage);
|
||||
}
|
||||
|
||||
function unescapeQuotes(val) {
|
||||
@@ -2161,7 +2199,7 @@ webpackJsonp([0,3],{
|
||||
//}
|
||||
|
||||
function getEmailSignInUrl() {
|
||||
return "" + getSessionEndpoint().emailSignInPath;
|
||||
return '' + getSessionEndpoint().emailSignInPath;
|
||||
}
|
||||
|
||||
function getEmailSignUpUrl() {
|
||||
@@ -2169,19 +2207,19 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
|
||||
function getCurrentUserUrl() {
|
||||
return "" + getSessionEndpoint().currentUserPath;
|
||||
return '' + getSessionEndpoint().currentUserPath;
|
||||
}
|
||||
|
||||
function getAccountsUrl() {
|
||||
return "" + getSessionEndpoint().accountsPath;
|
||||
return '' + getSessionEndpoint().accountsPath;
|
||||
}
|
||||
|
||||
function getCustomersUrl() {
|
||||
return "" + getSessionEndpoint().customersPath;
|
||||
return '' + getSessionEndpoint().customersPath;
|
||||
}
|
||||
|
||||
function getTransfersUrl() {
|
||||
return "" + getSessionEndpoint().transfersPath;
|
||||
return '' + getSessionEndpoint().transfersPath;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2191,20 +2229,20 @@ webpackJsonp([0,3],{
|
||||
*/
|
||||
function getApiUrl(key) {
|
||||
var configKey = getSessionEndpointKey(key);
|
||||
return _root2.default.authState.currentEndpoint[configKey].apiUrl;
|
||||
return rauthState.currentEndpoint[configKey].apiUrl;
|
||||
}
|
||||
|
||||
function getTokenFormat() {
|
||||
return _root2.default.authState.currentSettings.tokenFormat;
|
||||
return authState.currentSettings.tokenFormat;
|
||||
}
|
||||
|
||||
function persistUserData(user) {
|
||||
persistData(C.SAVED_USER_INFO, user);
|
||||
}
|
||||
var persistUserData = exports.persistUserData = function persistUserData(user) {
|
||||
memoryStorage[C.SAVED_USER_INFO] = user;
|
||||
};
|
||||
|
||||
function retrieveUserData() {
|
||||
return retrieveData(C.SAVED_USER_INFO);
|
||||
}
|
||||
var retrieveUserData = exports.retrieveUserData = function retrieveUserData() {
|
||||
return memoryStorage[C.SAVED_USER_INFO];
|
||||
};
|
||||
|
||||
function retrieveHeaders() {
|
||||
return retrieveData(C.SAVED_CREDS_KEY) || {};
|
||||
@@ -2213,15 +2251,15 @@ webpackJsonp([0,3],{
|
||||
function persistData(key, val) {
|
||||
val = _root2.default.JSON.stringify(val);
|
||||
|
||||
switch (_root2.default.authState.currentSettings.storage) {
|
||||
switch (authState.currentSettings.storage) {
|
||||
case "localStorage":
|
||||
_root2.default.localStorage.setItem(key, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
_jsCookie2.default.set(key, val, {
|
||||
expires: _root2.default.authState.currentSettings.cookieExpiry,
|
||||
path: _root2.default.authState.currentSettings.cookiePath
|
||||
expires: authState.currentSettings.cookieExpiry,
|
||||
path: authState.currentSettings.cookiePath
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -2230,7 +2268,7 @@ webpackJsonp([0,3],{
|
||||
function retrieveData(key) {
|
||||
var val = null;
|
||||
|
||||
switch (_root2.default.authState.currentSettings.storage) {
|
||||
switch (authState.currentSettings.storage) {
|
||||
|
||||
case "localStorage":
|
||||
val = _root2.default.localStorage && _root2.default.localStorage.getItem(key);
|
||||
@@ -2256,7 +2294,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 319:
|
||||
/***/ 320:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
@@ -2277,7 +2315,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 320:
|
||||
/***/ 321:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
@@ -2300,17 +2338,17 @@ webpackJsonp([0,3],{
|
||||
exports.apiRetrieveUsers = apiRetrieveUsers;
|
||||
exports.apiRetrieveUser = apiRetrieveUser;
|
||||
|
||||
var _fetch = __webpack_require__(321);
|
||||
var _fetch = __webpack_require__(322);
|
||||
|
||||
var _fetch2 = _interopRequireDefault(_fetch);
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
var _handleFetchResponse = __webpack_require__(324);
|
||||
var _handleFetchResponse = __webpack_require__(325);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
@@ -2490,7 +2528,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 321:
|
||||
/***/ 322:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
@@ -2522,7 +2560,7 @@ webpackJsonp([0,3],{
|
||||
});
|
||||
};
|
||||
|
||||
var _isomorphicFetch = __webpack_require__(322);
|
||||
var _isomorphicFetch = __webpack_require__(323);
|
||||
|
||||
var _isomorphicFetch2 = _interopRequireDefault(_isomorphicFetch);
|
||||
|
||||
@@ -2530,7 +2568,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var C = _interopRequireWildcard(_constants);
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
@@ -2594,7 +2632,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 324:
|
||||
/***/ 325:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
@@ -2652,7 +2690,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 325:
|
||||
/***/ 326:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
@@ -2681,15 +2719,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _ACTION_TYPES2 = _interopRequireDefault(_ACTION_TYPES);
|
||||
|
||||
var _actions = __webpack_require__(326);
|
||||
var _actions = __webpack_require__(317);
|
||||
|
||||
var _api = __webpack_require__(320);
|
||||
var _api = __webpack_require__(321);
|
||||
|
||||
var api = _interopRequireWildcard(_api);
|
||||
|
||||
var _authenticate = __webpack_require__(316);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
@@ -2949,42 +2987,6 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 326:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeActionCreator = makeActionCreator;
|
||||
/**
|
||||
* Created by andrew on 15/03/16.
|
||||
*/
|
||||
function makeActionCreator(type) {
|
||||
for (var _len = arguments.length, argNames = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
argNames[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return function () {
|
||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
var action = { type: type };
|
||||
argNames.forEach(function (arg, index) {
|
||||
action[argNames[index]] = args[index];
|
||||
});
|
||||
return action;
|
||||
};
|
||||
}
|
||||
|
||||
/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require("/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/react-hot-loader/makeExportsHot.js"); if (makeExportsHot(module, require("react"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "actions.js" + ": " + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 327:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
@@ -3006,11 +3008,11 @@ webpackJsonp([0,3],{
|
||||
|
||||
var C = _interopRequireWildcard(_constants);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
var _fetch = __webpack_require__(321);
|
||||
var _fetch = __webpack_require__(322);
|
||||
|
||||
var _fetch2 = _interopRequireDefault(_fetch);
|
||||
|
||||
@@ -3020,7 +3022,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _configure = __webpack_require__(314);
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
@@ -3839,15 +3841,15 @@ webpackJsonp([0,3],{
|
||||
exports.signOutComplete = signOutComplete;
|
||||
exports.signOut = signOut;
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var _configure = __webpack_require__(314);
|
||||
|
||||
var _handleFetchResponse = __webpack_require__(324);
|
||||
var _handleFetchResponse = __webpack_require__(325);
|
||||
|
||||
var _fetch = __webpack_require__(321);
|
||||
var _fetch = __webpack_require__(322);
|
||||
|
||||
var _fetch2 = _interopRequireDefault(_fetch);
|
||||
|
||||
@@ -3855,7 +3857,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _ACTION_TYPES2 = _interopRequireDefault(_ACTION_TYPES);
|
||||
|
||||
var _root = __webpack_require__(319);
|
||||
var _root = __webpack_require__(320);
|
||||
|
||||
var _root2 = _interopRequireDefault(_root);
|
||||
|
||||
@@ -3926,7 +3928,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _IndexPanel2 = _interopRequireDefault(_IndexPanel);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
@@ -4479,7 +4481,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reactSelect2 = _interopRequireDefault(_reactSelect);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
@@ -5104,7 +5106,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _readProp2 = _interopRequireDefault(_readProp);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
@@ -5622,7 +5624,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var Modals = _interopRequireWildcard(_modals);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
@@ -6161,32 +6163,83 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
|
||||
var currentAccountId = forAccount;
|
||||
var transfersMarkup = data.length ? data.filter(function (_ref2) {
|
||||
var transfersMarkup = data.length ? data.sort(function (a, b) {
|
||||
return a.date - b.date;
|
||||
}).filter(function (_ref2) {
|
||||
var entryType = _ref2.entryType;
|
||||
var toAccountId = _ref2.toAccountId;
|
||||
var fromAccountId = _ref2.fromAccountId;
|
||||
return fromAccountId === currentAccountId || toAccountId === currentAccountId;
|
||||
}).sort(function (a, b) {
|
||||
return -(a.date - b.date);
|
||||
}).map(function (_ref3) {
|
||||
var amount = _ref3.amount;
|
||||
var fromAccountId = _ref3.fromAccountId;
|
||||
var toAccountId = _ref3.toAccountId;
|
||||
var transactionId = _ref3.transactionId;
|
||||
var _ref3$description = _ref3.description;
|
||||
var description = _ref3$description === undefined ? '' : _ref3$description;
|
||||
var _ref3$date = _ref3.date;
|
||||
var date = _ref3$date === undefined ? null : _ref3$date;
|
||||
var _ref3$status = _ref3.status;
|
||||
var status = _ref3$status === undefined ? '' : _ref3$status;
|
||||
return entryType !== 'transaction' || fromAccountId === currentAccountId || toAccountId === currentAccountId;
|
||||
}).reduce(function (_ref3, v) {
|
||||
var items = _ref3.items;
|
||||
var balance = _ref3.balance;
|
||||
|
||||
if (v.entryType == 'account') {
|
||||
balance = v.initialBalance;
|
||||
} else if (v.entryType == 'transaction') {
|
||||
var isOriginating = v.fromAccountId == currentAccountId;
|
||||
balance += (isOriginating ? -1 : 1) * v.amount;
|
||||
}
|
||||
v.balance = balance;
|
||||
items.push(v);
|
||||
return { items: items, balance: balance };
|
||||
}, {
|
||||
items: [],
|
||||
balance: 0
|
||||
}).items.sort(function (a, b) {
|
||||
return -(a.date - b.date);
|
||||
}).map(function (_ref4) {
|
||||
var entryType = _ref4.entryType;
|
||||
var amount = _ref4.amount;
|
||||
var fromAccountId = _ref4.fromAccountId;
|
||||
var toAccountId = _ref4.toAccountId;
|
||||
var transactionId = _ref4.transactionId;
|
||||
var _ref4$description = _ref4.description;
|
||||
var description = _ref4$description === undefined ? '—' : _ref4$description;
|
||||
var _ref4$date = _ref4.date;
|
||||
var date = _ref4$date === undefined ? null : _ref4$date;
|
||||
var _ref4$status = _ref4.status;
|
||||
var status = _ref4$status === undefined ? '—' : _ref4$status;
|
||||
var balance = _ref4.balance;
|
||||
var _ref4$initialBalance = _ref4.initialBalance;
|
||||
var initialBalance = _ref4$initialBalance === undefined ? null : _ref4$initialBalance;
|
||||
|
||||
|
||||
var transferTimestamp = new Date(date);
|
||||
var timeAgoTitle = transferTimestamp.toLocaleDateString() + ' ' + transferTimestamp.toLocaleTimeString();
|
||||
|
||||
if (entryType == 'account') {
|
||||
return _react2.default.createElement(
|
||||
"tr",
|
||||
null,
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
_react2.default.createElement(_reactTimeago2.default, { date: date, title: timeAgoTitle })
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
{ colSpan: "3" },
|
||||
"Account created"
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
_react2.default.createElement(_Money.Money, { amount: initialBalance })
|
||||
),
|
||||
_react2.default.createElement("td", null),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
status || '—'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
var isOriginating = fromAccountId == currentAccountId;
|
||||
var directionMarkup = isOriginating ? 'Debit' : 'Credit';
|
||||
var counterAccountMarkup = isOriginating ? _react2.default.createElement(_AccountInfo2.default, { accountId: toAccountId }) : _react2.default.createElement(_AccountInfo2.default, { accountId: fromAccountId });
|
||||
|
||||
var transferTimestamp = new Date(date);
|
||||
var timeAgoTitle = transferTimestamp.toLocaleDateString() + ' ' + transferTimestamp.toLocaleTimeString();
|
||||
|
||||
return _react2.default.createElement(
|
||||
"tr",
|
||||
null,
|
||||
@@ -6210,6 +6263,11 @@ webpackJsonp([0,3],{
|
||||
null,
|
||||
_react2.default.createElement(_Money.Money, { amount: amount })
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
_react2.default.createElement(_Money.Money, { amount: balance })
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
@@ -6260,6 +6318,11 @@ webpackJsonp([0,3],{
|
||||
null,
|
||||
"Amount"
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"th",
|
||||
null,
|
||||
"Balance"
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"th",
|
||||
null,
|
||||
@@ -6312,7 +6375,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
@@ -6766,15 +6829,15 @@ webpackJsonp([0,3],{
|
||||
exports.emailSignInError = exports.emailSignInComplete = exports.emailSignInStart = exports.emailSignInFormUpdate = undefined;
|
||||
exports.emailSignIn = emailSignIn;
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var _configure = __webpack_require__(314);
|
||||
|
||||
var _api = __webpack_require__(320);
|
||||
var _api = __webpack_require__(321);
|
||||
|
||||
var _actions = __webpack_require__(326);
|
||||
var _actions = __webpack_require__(317);
|
||||
|
||||
var _ACTION_TYPES = __webpack_require__(295);
|
||||
|
||||
@@ -7230,13 +7293,13 @@ webpackJsonp([0,3],{
|
||||
exports.emailSignUpError = emailSignUpError;
|
||||
exports.emailSignUp = emailSignUp;
|
||||
|
||||
var _sessionStorage = __webpack_require__(317);
|
||||
var _sessionStorage = __webpack_require__(318);
|
||||
|
||||
var _entities = __webpack_require__(325);
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var _configure = __webpack_require__(314);
|
||||
|
||||
var _api = __webpack_require__(320);
|
||||
var _api = __webpack_require__(321);
|
||||
|
||||
var _signIn = __webpack_require__(609);
|
||||
|
||||
@@ -7290,4 +7353,4 @@ webpackJsonp([0,3],{
|
||||
/***/ }
|
||||
|
||||
});
|
||||
//# sourceMappingURL=app.3838eca59bc9756e204c.js.map
|
||||
//# sourceMappingURL=app.d4bdff82ac1db214898b.js.map
|
||||
1
js-frontend/build/app.d4bdff82ac1db214898b.js.map
Normal file
1
js-frontend/build/app.d4bdff82ac1db214898b.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -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.3a998e0638a2b185f81f.js"></script><script src="/vendor.9bf2d755cba11113a020.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.3838eca59bc9756e204c.js"></script><script>
|
||||
<body><div id="root"></div><script src="/manifest.09cb8f5a05c9cfc35585.js"></script><script src="/vendor.f73c0104cb72cfb2809e.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.d4bdff82ac1db214898b.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.3a998e0638a2b185f81f.js","hash":"3a998e0638a2b185f81f","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":348772,"entry":"/app.3838eca59bc9756e204c.js","hash":"3838eca59bc9756e204c","css":[]}},"js":["/manifest.3a998e0638a2b185f81f.js","/vendor.9bf2d755cba11113a020.js","/style.6d7a32b1405ea1bb2bdf.js","/app.3838eca59bc9756e204c.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.09cb8f5a05c9cfc35585.js","hash":"09cb8f5a05c9cfc35585","css":[]},"vendor":{"size":1670874,"entry":"/vendor.f73c0104cb72cfb2809e.js","hash":"f73c0104cb72cfb2809e","css":[]},"style":{"size":122,"entry":"/style.6d7a32b1405ea1bb2bdf.js","hash":"6d7a32b1405ea1bb2bdf","css":["/style.6d7a32b1405ea1bb2bdf.css"]},"app":{"size":351315,"entry":"/app.d4bdff82ac1db214898b.js","hash":"d4bdff82ac1db214898b","css":[]}},"js":["/manifest.09cb8f5a05c9cfc35585.js","/vendor.f73c0104cb72cfb2809e.js","/style.6d7a32b1405ea1bb2bdf.js","/app.d4bdff82ac1db214898b.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>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
/******/ script.charset = 'utf-8';
|
||||
/******/ script.async = true;
|
||||
/******/
|
||||
/******/ script.src = __webpack_require__.p + "" + {"0":"3838eca59bc9756e204c","1":"6d7a32b1405ea1bb2bdf","2":"9bf2d755cba11113a020"}[chunkId] + ".js";
|
||||
/******/ script.src = __webpack_require__.p + "" + {"0":"d4bdff82ac1db214898b","1":"6d7a32b1405ea1bb2bdf","2":"f73c0104cb72cfb2809e"}[chunkId] + ".js";
|
||||
/******/ head.appendChild(script);
|
||||
/******/ }
|
||||
/******/ };
|
||||
@@ -92,4 +92,4 @@
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([]);
|
||||
//# sourceMappingURL=manifest.3a998e0638a2b185f81f.js.map
|
||||
//# sourceMappingURL=manifest.09cb8f5a05c9cfc35585.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 3846f67b0f41e893cffa?"],"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.3a998e0638a2b185f81f.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\":\"3838eca59bc9756e204c\",\"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 3846f67b0f41e893cffa\n **/"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 8ac05bd1ead33e72514a?"],"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.09cb8f5a05c9cfc35585.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\":\"d4bdff82ac1db214898b\",\"1\":\"6d7a32b1405ea1bb2bdf\",\"2\":\"f73c0104cb72cfb2809e\"}[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 8ac05bd1ead33e72514a\n **/"],"sourceRoot":""}
|
||||
@@ -6,8 +6,8 @@ webpackJsonp([2,3],[
|
||||
__webpack_require__(262);
|
||||
__webpack_require__(621);
|
||||
__webpack_require__(180);
|
||||
__webpack_require__(322);
|
||||
__webpack_require__(318);
|
||||
__webpack_require__(323);
|
||||
__webpack_require__(319);
|
||||
__webpack_require__(622);
|
||||
__webpack_require__(330);
|
||||
__webpack_require__(2);
|
||||
@@ -30146,7 +30146,8 @@ webpackJsonp([2,3],[
|
||||
/* 315 */,
|
||||
/* 316 */,
|
||||
/* 317 */,
|
||||
/* 318 */
|
||||
/* 318 */,
|
||||
/* 319 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
@@ -30297,22 +30298,22 @@ webpackJsonp([2,3],[
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 319 */,
|
||||
/* 320 */,
|
||||
/* 321 */,
|
||||
/* 322 */
|
||||
/* 322 */,
|
||||
/* 323 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
// the whatwg-fetch polyfill installs the fetch() function
|
||||
// on the global object (window or self)
|
||||
//
|
||||
// Return that as the export for use in Webpack, Browserify etc.
|
||||
__webpack_require__(323);
|
||||
__webpack_require__(324);
|
||||
module.exports = self.fetch.bind(self);
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 323 */
|
||||
/* 324 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
(function(self) {
|
||||
@@ -30707,7 +30708,6 @@ webpackJsonp([2,3],[
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 324 */,
|
||||
/* 325 */,
|
||||
/* 326 */,
|
||||
/* 327 */,
|
||||
@@ -55902,4 +55902,4 @@ webpackJsonp([2,3],[
|
||||
|
||||
/***/ }
|
||||
]);
|
||||
//# sourceMappingURL=vendor.9bf2d755cba11113a020.js.map
|
||||
//# sourceMappingURL=vendor.f73c0104cb72cfb2809e.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -2,56 +2,41 @@
|
||||
* Created by andrew on 26/02/16.
|
||||
*/
|
||||
import T from '../constants/ACTION_TYPES';
|
||||
import { makeActionCreator } from '../utils/actions';
|
||||
import * as U from '../utils/sessionStorage';
|
||||
|
||||
import {
|
||||
persistUserData,
|
||||
retrieveUserData,
|
||||
retrieveHeaders
|
||||
} from "../utils/sessionStorage";
|
||||
|
||||
import {
|
||||
apiGetCurrentUser
|
||||
} from '../utils/api';
|
||||
|
||||
import {entityReceived } from './entities';
|
||||
|
||||
export function authenticateStart() {
|
||||
return { type: T.AUTH.AUTHENTICATE_START };
|
||||
}
|
||||
export function authenticateComplete(user) {
|
||||
return { type: T.AUTH.AUTHENTICATE_COMPLETE, user };
|
||||
}
|
||||
export function authenticateError(errors) {
|
||||
return { type: T.AUTH.AUTHENTICATE_ERROR, errors };
|
||||
}
|
||||
import { apiGetCurrentUser } from '../utils/api';
|
||||
import { entityReceived } from './entities';
|
||||
|
||||
export const authenticateStart = makeActionCreator(T.AUTH.AUTHENTICATE_START);
|
||||
export const authenticateComplete = makeActionCreator(T.AUTH.AUTHENTICATE_COMPLETE, 'user');
|
||||
export const authenticateError = makeActionCreator(T.AUTH.AUTHENTICATE_ERROR, 'errors');
|
||||
|
||||
export function authenticate(forceReread) {
|
||||
return dispatch => {
|
||||
return (dispatch) => {
|
||||
|
||||
dispatch(authenticateStart());
|
||||
|
||||
const savedUserPromise = new Promise((rs, rj) => {
|
||||
|
||||
const currentHeaders = retrieveHeaders();
|
||||
const currentHeaders = U.retrieveHeaders();
|
||||
const accessToken = currentHeaders["access-token"];
|
||||
|
||||
if (!accessToken) {
|
||||
return rj({ reason: 'no token'});
|
||||
}
|
||||
|
||||
const savedUser = retrieveUserData();
|
||||
const savedUser = U.retrieveUserData();
|
||||
|
||||
if (savedUser && !forceReread) {
|
||||
return rs(savedUser);
|
||||
}
|
||||
|
||||
return apiGetCurrentUser().then((userData) => {
|
||||
persistUserData(userData);
|
||||
U.persistUserData(userData);
|
||||
dispatch(entityReceived(userData.id, userData));
|
||||
rs(userData);
|
||||
}, (err) => {
|
||||
debugger;
|
||||
rj(err);
|
||||
});
|
||||
|
||||
|
||||
@@ -25,36 +25,67 @@ export class TransfersTable extends React.Component {
|
||||
const currentAccountId = forAccount;
|
||||
const transfersMarkup = data.length ?
|
||||
data
|
||||
.filter(({ toAccountId, fromAccountId}) => ((fromAccountId === currentAccountId) || (toAccountId === currentAccountId)))
|
||||
.sort((a, b) => ((a.date - b.date)))
|
||||
.filter(({ entryType, toAccountId, fromAccountId}) => ((entryType !=='transaction') || (fromAccountId === currentAccountId) || (toAccountId === currentAccountId)))
|
||||
.reduce(({
|
||||
items, balance
|
||||
}, v) => {
|
||||
if (v.entryType == 'account') {
|
||||
balance = v.initialBalance;
|
||||
} else if (v.entryType == 'transaction') {
|
||||
const isOriginating = v.fromAccountId == currentAccountId;
|
||||
balance += (isOriginating ? -1 : 1) * v.amount;
|
||||
}
|
||||
v.balance = balance;
|
||||
items.push(v);
|
||||
return { items, balance };
|
||||
}, {
|
||||
items: [],
|
||||
balance: 0
|
||||
}).items
|
||||
.sort((a, b) => (-(a.date - b.date)))
|
||||
.map(({
|
||||
amount,
|
||||
fromAccountId,
|
||||
toAccountId,
|
||||
transactionId,
|
||||
description = '',
|
||||
date = null,
|
||||
status = ''
|
||||
}) => {
|
||||
entryType,
|
||||
amount,
|
||||
fromAccountId,
|
||||
toAccountId,
|
||||
transactionId,
|
||||
description = '—',
|
||||
date = null,
|
||||
status = '—',
|
||||
balance,
|
||||
initialBalance = null
|
||||
}) => {
|
||||
|
||||
const isOriginating = fromAccountId == currentAccountId;
|
||||
const directionMarkup = isOriginating ? 'Debit' : 'Credit';
|
||||
const counterAccountMarkup = isOriginating ?
|
||||
<AccountInfo accountId={ toAccountId } /> :
|
||||
<AccountInfo accountId={ fromAccountId } />;
|
||||
const transferTimestamp = new Date(date);
|
||||
const timeAgoTitle = transferTimestamp.toLocaleDateString() + ' ' + transferTimestamp.toLocaleTimeString();
|
||||
|
||||
const transferTimestamp = new Date(date);
|
||||
const timeAgoTitle = transferTimestamp.toLocaleDateString() + ' ' + transferTimestamp.toLocaleTimeString();
|
||||
if (entryType == 'account') {
|
||||
return (<tr>
|
||||
<td><TimeAgo date={date} title={ timeAgoTitle } /></td>
|
||||
<td colSpan="3">Account created</td>
|
||||
<td><Money amount={ initialBalance } /></td>
|
||||
<td></td>
|
||||
<td>{ status || '—' }</td>
|
||||
</tr>);
|
||||
}
|
||||
|
||||
return (<tr>
|
||||
<td><TimeAgo date={date} title={ timeAgoTitle } /></td>
|
||||
<td>{ directionMarkup }</td>
|
||||
<td>{ counterAccountMarkup }</td>
|
||||
<td><Money amount={ amount } /></td>
|
||||
<td>{ description || '—' }</td>
|
||||
<td>{ status || '—' }</td>
|
||||
</tr>);
|
||||
}) : (<tr>
|
||||
const isOriginating = fromAccountId == currentAccountId;
|
||||
const directionMarkup = isOriginating ? 'Debit' : 'Credit';
|
||||
const counterAccountMarkup = isOriginating ?
|
||||
<AccountInfo accountId={ toAccountId } /> :
|
||||
<AccountInfo accountId={ fromAccountId } />;
|
||||
|
||||
return (<tr>
|
||||
<td><TimeAgo date={date} title={ timeAgoTitle } /></td>
|
||||
<td>{ directionMarkup }</td>
|
||||
<td>{ counterAccountMarkup }</td>
|
||||
<td><Money amount={ amount } /></td>
|
||||
<td><Money amount={ balance } /></td>
|
||||
<td>{ description || '—' }</td>
|
||||
<td>{ status || '—' }</td>
|
||||
</tr>);
|
||||
}) : (<tr>
|
||||
<td colSpan={6}>No transfers for this account just yet.</td>
|
||||
</tr>);
|
||||
|
||||
@@ -66,6 +97,7 @@ export class TransfersTable extends React.Component {
|
||||
<th>Type</th>
|
||||
<th>Other Account</th>
|
||||
<th>Amount</th>
|
||||
<th>Balance</th>
|
||||
<th>Description</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
|
||||
@@ -1,34 +1,40 @@
|
||||
/**
|
||||
* Created by andrew on 26/02/16.
|
||||
*/
|
||||
import Cookies from "js-cookie";
|
||||
import Cookies from 'js-cookie';
|
||||
import * as C from "./constants";
|
||||
|
||||
import root from './root';
|
||||
//import "babel-polyfill";
|
||||
|
||||
|
||||
// stateful variables that persist throughout session
|
||||
root.authState = {
|
||||
const authState = {
|
||||
currentSettings: {},
|
||||
currentEndpoint: {},
|
||||
defaultEndpointKey: 'default'
|
||||
};
|
||||
|
||||
const memoryStorage = {};
|
||||
|
||||
function clean(obj) {
|
||||
Object.keys(obj).forEach(k => {
|
||||
delete obj[k];
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
export function setCurrentSettings (s) {
|
||||
root.authState.currentSettings = s;
|
||||
authState.currentSettings = s;
|
||||
}
|
||||
|
||||
export function getCurrentSettings () {
|
||||
return root.authState.currentSettings;
|
||||
return authState.currentSettings;
|
||||
}
|
||||
|
||||
export function setCurrentEndpoint (e) {
|
||||
root.authState.currentEndpoint = e;
|
||||
authState.currentEndpoint = e;
|
||||
}
|
||||
|
||||
export function getCurrentEndpoint () {
|
||||
return root.authState.currentEndpoint;
|
||||
return authState.currentEndpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,23 +63,20 @@ export function getDefaultEndpointKey () {
|
||||
|
||||
// reset stateful variables
|
||||
export function resetConfig () {
|
||||
root.authState = root.authState || {};
|
||||
root.authState.currentSettings = {};
|
||||
root.authState.currentEndpoint = {};
|
||||
clean(authState);
|
||||
authState.currentSettings = {};
|
||||
authState.currentEndpoint = {};
|
||||
destroySession();
|
||||
}
|
||||
|
||||
|
||||
export function destroySession () {
|
||||
var sessionKeys = [
|
||||
|
||||
([
|
||||
C.SAVED_CREDS_KEY,
|
||||
C.SAVED_CONFIG_KEY,
|
||||
C.SAVED_USER_INFO
|
||||
];
|
||||
|
||||
for (var key in sessionKeys) {
|
||||
key = sessionKeys[key];
|
||||
|
||||
]).forEach(key => {
|
||||
// kill all local storage keys
|
||||
if (root.localStorage) {
|
||||
root.localStorage.removeItem(key);
|
||||
@@ -81,9 +84,11 @@ export function destroySession () {
|
||||
|
||||
// remove from base path in case config is not specified
|
||||
Cookies.remove(key, {
|
||||
path: root.authState.currentSettings.cookiePath || "/"
|
||||
path: authState.currentSettings.cookiePath || "/"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
clean(memoryStorage);
|
||||
}
|
||||
|
||||
function unescapeQuotes (val) {
|
||||
@@ -146,19 +151,19 @@ export function getTransfersUrl () {
|
||||
*/
|
||||
export function getApiUrl(key) {
|
||||
let configKey = getSessionEndpointKey(key);
|
||||
return root.authState.currentEndpoint[configKey].apiUrl;
|
||||
return rauthState.currentEndpoint[configKey].apiUrl;
|
||||
}
|
||||
|
||||
export function getTokenFormat() {
|
||||
return root.authState.currentSettings.tokenFormat;
|
||||
return authState.currentSettings.tokenFormat;
|
||||
}
|
||||
|
||||
export function persistUserData(user) {
|
||||
persistData(C.SAVED_USER_INFO, user);
|
||||
}
|
||||
export const persistUserData = (user) => {
|
||||
memoryStorage[C.SAVED_USER_INFO] = user;
|
||||
};
|
||||
|
||||
export function retrieveUserData() {
|
||||
return retrieveData(C.SAVED_USER_INFO);
|
||||
export const retrieveUserData = () =>{
|
||||
return memoryStorage[C.SAVED_USER_INFO];
|
||||
}
|
||||
|
||||
export function retrieveHeaders() {
|
||||
@@ -168,24 +173,24 @@ export function retrieveHeaders() {
|
||||
export function persistData (key, val) {
|
||||
val = root.JSON.stringify(val);
|
||||
|
||||
switch (root.authState.currentSettings.storage) {
|
||||
switch (authState.currentSettings.storage) {
|
||||
case "localStorage":
|
||||
root.localStorage.setItem(key, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
Cookies.set(key, val, {
|
||||
expires: root.authState.currentSettings.cookieExpiry,
|
||||
path: root.authState.currentSettings.cookiePath
|
||||
expires: authState.currentSettings.cookieExpiry,
|
||||
path: authState.currentSettings.cookiePath
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
export function retrieveData (key) {
|
||||
var val = null;
|
||||
let val = null;
|
||||
|
||||
switch (root.authState.currentSettings.storage) {
|
||||
switch (authState.currentSettings.storage) {
|
||||
|
||||
case "localStorage":
|
||||
val = root.localStorage && root.localStorage.getItem(key);
|
||||
@@ -205,4 +210,4 @@ export function retrieveData (key) {
|
||||
// unescape quotes
|
||||
return unescapeQuotes(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user