Merge pull request #39 from dartpopikyardo/private-event-sourcing-examples-37
Add 3d party accounts and previous PR fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo;
|
||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo;
|
||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState;
|
||||
@@ -18,9 +19,9 @@ public class AccountInfo {
|
||||
private long balance;
|
||||
private List<AccountChangeInfo> changes;
|
||||
private Map<String, AccountTransactionInfo> transactions;
|
||||
private Map<String, TransferState> transferStates;
|
||||
private String version;
|
||||
private Date date;
|
||||
@JsonProperty("date")
|
||||
private Date creationDate;
|
||||
|
||||
private AccountInfo() {
|
||||
}
|
||||
@@ -29,7 +30,7 @@ public class AccountInfo {
|
||||
this(id, customerId, title, description, balance, changes, transactions, version, new Date());
|
||||
}
|
||||
|
||||
public AccountInfo(String id, String customerId, String title, String description, long balance, List<AccountChangeInfo> changes, Map<String, AccountTransactionInfo> transactions, String version, Date date) {
|
||||
public AccountInfo(String id, String customerId, String title, String description, long balance, List<AccountChangeInfo> changes, Map<String, AccountTransactionInfo> transactions, String version, Date creationDate) {
|
||||
|
||||
this.id = id;
|
||||
this.customerId = customerId;
|
||||
@@ -39,7 +40,7 @@ public class AccountInfo {
|
||||
this.changes = changes;
|
||||
this.transactions = transactions;
|
||||
this.version = version;
|
||||
this.date = date;
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
@@ -74,15 +75,7 @@ public class AccountInfo {
|
||||
return version;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public Map<String, TransferState> getTransferStates() {
|
||||
return transferStates;
|
||||
}
|
||||
|
||||
public void setTransferStates(Map<String, TransferState> transferStates) {
|
||||
this.transferStates = transferStates;
|
||||
public Date getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class AccountInfoUpdateService {
|
||||
.set("description", description)
|
||||
.set("balance", toIntegerRepr(initialBalance))
|
||||
.push("changes", ci)
|
||||
.set("date", new Date())
|
||||
.set("date", getFromEventId(version))
|
||||
.set("version", version),
|
||||
AccountInfo.class);
|
||||
logger.info("Saved in mongo");
|
||||
@@ -74,7 +74,15 @@ public class AccountInfoUpdateService {
|
||||
public void updateTransactionStatus(String accountId, String transactionId, TransferState status) {
|
||||
mongoTemplate.upsert(new Query(where("id").is(accountId)),
|
||||
new Update().
|
||||
set("transferStates." + transactionId, status),
|
||||
set("transactions." + transactionId + ".status", status),
|
||||
AccountInfo.class);
|
||||
}
|
||||
|
||||
private Date getFromEventId(String eventId) {
|
||||
String[] s = eventId.split("-");
|
||||
if (s.length != 2) {
|
||||
return new Date();
|
||||
}
|
||||
return new Date(Long.parseUnsignedLong(s[0], 16));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ public class AccountQueryService {
|
||||
if (account == null)
|
||||
throw new AccountNotFoundException(accountId);
|
||||
else
|
||||
if(account.getTransferStates()!=null)
|
||||
account.getTransactions().stream().forEach(ati -> ati.setStatus(account.getTransferStates().get(ati.getTransactionId())));
|
||||
return account;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import static net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts.MoneyUtil.toIntegerRepr;
|
||||
|
||||
@@ -40,6 +41,7 @@ public class AccountQueryWorkflow {
|
||||
String customerId = event.getCustomerId();
|
||||
String title = event.getTitle();
|
||||
String description = event.getDescription();
|
||||
|
||||
accountInfoUpdateService.create(id, customerId, title, initialBalance, description, eventId);
|
||||
}
|
||||
|
||||
@@ -68,7 +70,6 @@ public class AccountQueryWorkflow {
|
||||
String accountId = de.getEntityId();
|
||||
String transactionId = de.getEvent().getTransactionId();
|
||||
|
||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.DEBITED);
|
||||
saveChange(de, -1);
|
||||
}
|
||||
|
||||
@@ -77,16 +78,37 @@ public class AccountQueryWorkflow {
|
||||
String accountId = de.getEntityId();
|
||||
String transactionId = de.getEvent().getTransactionId();
|
||||
|
||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.COMPLETED);
|
||||
saveChange(de, +1);
|
||||
}
|
||||
|
||||
@EventHandlerMethod
|
||||
public void recordFailed(DispatchedEvent<AccountDebitFailedDueToInsufficientFundsEvent> de) {
|
||||
String accountId = de.getEntityId();
|
||||
String transactionId = de.getEvent().getTransactionId();
|
||||
public void updateDebitTransactionState(DispatchedEvent<DebitRecordedEvent> de) {
|
||||
String transactionId = de.getEntityId();
|
||||
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||
|
||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
||||
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.DEBITED);
|
||||
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.DEBITED);
|
||||
}
|
||||
|
||||
@EventHandlerMethod
|
||||
public void updateCreditTransactionState(DispatchedEvent<CreditRecordedEvent> de) {
|
||||
String transactionId = de.getEntityId();
|
||||
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||
|
||||
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.COMPLETED);
|
||||
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.COMPLETED);
|
||||
}
|
||||
|
||||
@EventHandlerMethod
|
||||
public void recordFailed(DispatchedEvent<FailedDebitRecordedEvent> de) {
|
||||
String transactionId = de.getEntityId();
|
||||
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||
|
||||
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
||||
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
||||
}
|
||||
|
||||
public <T extends AccountChangedEvent> void saveChange(DispatchedEvent<T> de, int delta) {
|
||||
@@ -101,5 +123,4 @@ public class AccountQueryWorkflow {
|
||||
|
||||
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class AccountQueryController {
|
||||
public ResponseEntity<AccountHistoryResponse> getTransactionsHistory(@PathVariable String accountId) {
|
||||
AccountInfo accountInfo = accountInfoQueryService.findByAccountId(accountId);
|
||||
List<AccountHistoryEntry> historyEntries = new ArrayList<>();
|
||||
historyEntries.add(new AccountOpenInfo(accountInfo.getDate(), AccountHistoryEntry.EntryType.account, accountInfo.getChanges().get(0).getAmount()));
|
||||
historyEntries.add(new AccountOpenInfo(accountInfo.getCreationDate(), AccountHistoryEntry.EntryType.account, accountInfo.getChanges().get(0).getAmount()));
|
||||
accountInfo.getTransactions().forEach(historyEntries::add);
|
||||
|
||||
return ResponseEntity.ok().body(new AccountHistoryResponse(historyEntries));
|
||||
|
||||
@@ -64,12 +64,12 @@ public class GatewayController {
|
||||
logger.info("request: {}", proxiedRequest);
|
||||
HttpResponse proxiedResponse = httpClient.execute(proxiedRequest);
|
||||
logger.info("Response {}", proxiedResponse.getStatusLine().getStatusCode());
|
||||
return new ResponseEntity<>(read(proxiedResponse.getEntity().getContent()), processHeaders(proxiedResponse.getAllHeaders()), HttpStatus.valueOf(proxiedResponse.getStatusLine().getStatusCode()));
|
||||
return new ResponseEntity<>(read(proxiedResponse.getEntity().getContent()), processHeaders(proxiedResponse.getFirstHeader("Content-Type")), HttpStatus.valueOf(proxiedResponse.getStatusLine().getStatusCode()));
|
||||
}
|
||||
|
||||
private HttpHeaders processHeaders(Header[] headers) {
|
||||
private HttpHeaders processHeaders(Header h) {
|
||||
HttpHeaders result = new HttpHeaders();
|
||||
Stream.of(headers).filter(h -> h.getName().equalsIgnoreCase("Content-Type")).forEach( h -> result.set(h.getName(), h.getValue()));
|
||||
result.set(h.getName(), h.getValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -101,7 +101,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _MyAccounts2 = _interopRequireDefault(_MyAccounts);
|
||||
|
||||
var _Account = __webpack_require__(602);
|
||||
var _Account = __webpack_require__(603);
|
||||
|
||||
var _Account2 = _interopRequireDefault(_Account);
|
||||
|
||||
@@ -2928,10 +2928,12 @@ webpackJsonp([0,3],{
|
||||
var createRefAccountLookup = exports.createRefAccountLookup = function createRefAccountLookup(customerId) {
|
||||
return function (dispatch) {
|
||||
dispatch(createRefAccountLookupStart());
|
||||
return api.apiRetrieveAccounts(customerId).then(function (data) {
|
||||
var arr = data.map(function (_ref3) {
|
||||
var accountId = _ref3.accountId;
|
||||
var title = _ref3.title;
|
||||
return api.apiRetrieveAccounts(customerId).then(function (_ref3) {
|
||||
var accounts = _ref3.accounts;
|
||||
|
||||
var arr = accounts.map(function (_ref4) {
|
||||
var accountId = _ref4.accountId;
|
||||
var title = _ref4.title;
|
||||
return {
|
||||
value: accountId,
|
||||
label: title
|
||||
@@ -2946,7 +2948,7 @@ webpackJsonp([0,3],{
|
||||
};
|
||||
};
|
||||
|
||||
var makeTransferRequested = exports.makeTransferRequested = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.TRANSFERS.MAKE_START, 'payload');
|
||||
var makeTransferRequested = exports.makeTransferRequested = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.TRANSFERS.MAKE_START);
|
||||
var makeTransferComplete = exports.makeTransferComplete = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.TRANSFERS.MAKE_COMPLETE, 'payload');
|
||||
var makeTransferError = exports.makeTransferError = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.TRANSFERS.MAKE_ERROR, 'error');
|
||||
var makeTransferFormUpdate = exports.makeTransferFormUpdate = (0, _actions.makeActionCreator)(_ACTION_TYPES2.default.TRANSFERS.MAKE_FORM_UPDATE, 'key', 'value');
|
||||
@@ -3920,11 +3922,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reactSelect2 = _interopRequireDefault(_reactSelect);
|
||||
|
||||
var _modals = __webpack_require__(591);
|
||||
var _AccountInfo = __webpack_require__(591);
|
||||
|
||||
var _AccountInfo2 = _interopRequireDefault(_AccountInfo);
|
||||
|
||||
var _modals = __webpack_require__(594);
|
||||
|
||||
var Modals = _interopRequireWildcard(_modals);
|
||||
|
||||
var _IndexPanel = __webpack_require__(600);
|
||||
var _IndexPanel = __webpack_require__(601);
|
||||
|
||||
var _IndexPanel2 = _interopRequireDefault(_IndexPanel);
|
||||
|
||||
@@ -3936,7 +3942,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _readProp2 = _interopRequireDefault(_readProp);
|
||||
|
||||
var _Money = __webpack_require__(601);
|
||||
var _Money = __webpack_require__(602);
|
||||
|
||||
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; } }
|
||||
|
||||
@@ -4004,7 +4010,7 @@ webpackJsonp([0,3],{
|
||||
// return new Promise((rs, rj) => {
|
||||
setTimeout(function () {
|
||||
_this2.props.dispatch(A.fetchOwnAccounts(customerId)); //.then(rs, rj);
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
// });
|
||||
}).catch(function (err) {
|
||||
// debugger;
|
||||
@@ -4031,7 +4037,7 @@ webpackJsonp([0,3],{
|
||||
return new Promise(function (rs, rj) {
|
||||
setTimeout(function () {
|
||||
_this3.props.dispatch(A.fetchOwnAccounts(customerId)).then(rs, rj);
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
});
|
||||
}).catch(function (err) {
|
||||
// debugger;
|
||||
@@ -4133,11 +4139,7 @@ webpackJsonp([0,3],{
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
{ key: 0 },
|
||||
_react2.default.createElement(
|
||||
_reactRouter.Link,
|
||||
{ to: "/account/" + accountId },
|
||||
title
|
||||
),
|
||||
_react2.default.createElement(_AccountInfo2.default, { accountId: accountId }),
|
||||
description ? [_react2.default.createElement("br", null), _react2.default.createElement(
|
||||
"span",
|
||||
null,
|
||||
@@ -4173,11 +4175,7 @@ webpackJsonp([0,3],{
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
{ key: 0 },
|
||||
_react2.default.createElement(
|
||||
_reactRouter.Link,
|
||||
{ to: "/account/" + id },
|
||||
title
|
||||
),
|
||||
_react2.default.createElement(_AccountInfo2.default, { accountId: id }),
|
||||
description ? [_react2.default.createElement("br", null), _react2.default.createElement(
|
||||
"span",
|
||||
null,
|
||||
@@ -4394,13 +4392,152 @@ webpackJsonp([0,3],{
|
||||
|
||||
/* 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.AccountInfo = undefined;
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _react = __webpack_require__(2);
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactRedux = __webpack_require__(170);
|
||||
|
||||
var _reactLoader = __webpack_require__(592);
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
var _reactBootstrap = __webpack_require__(336);
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
var _readProp = __webpack_require__(334);
|
||||
|
||||
var _readProp2 = _interopRequireDefault(_readProp);
|
||||
|
||||
var _reactRouter = __webpack_require__(183);
|
||||
|
||||
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 }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
|
||||
* Created by andrew on 3/22/16.
|
||||
*/
|
||||
|
||||
|
||||
var AccountInfo = exports.AccountInfo = function (_React$Component) {
|
||||
_inherits(AccountInfo, _React$Component);
|
||||
|
||||
function AccountInfo() {
|
||||
_classCallCheck(this, AccountInfo);
|
||||
|
||||
return _possibleConstructorReturn(this, (AccountInfo.__proto__ || Object.getPrototypeOf(AccountInfo)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(AccountInfo, [{
|
||||
key: "componentWillMount",
|
||||
value: function componentWillMount() {
|
||||
this.ensureData(this.props);
|
||||
}
|
||||
}, {
|
||||
key: "componentWillReceiveProps",
|
||||
value: function componentWillReceiveProps(nextProps) {
|
||||
this.ensureData(nextProps);
|
||||
}
|
||||
}, {
|
||||
key: "ensureData",
|
||||
value: function ensureData(_ref) {
|
||||
var dispatch = _ref.dispatch;
|
||||
var entities = _ref.entities;
|
||||
var accountId = _ref.accountId;
|
||||
|
||||
if (entities[accountId]) {
|
||||
return;
|
||||
}
|
||||
dispatch(A.fetchAccount(accountId));
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _props = this.props;
|
||||
var entities = _props.entities;
|
||||
var accountId = _props.accountId;
|
||||
var customerId = _props.customerId;
|
||||
|
||||
|
||||
var account = entities[accountId];
|
||||
|
||||
if (!account || !accountId) {
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ title: "" + accountId },
|
||||
accountId,
|
||||
" ",
|
||||
_react2.default.createElement(_reactLoader2.default, { loaded: false })
|
||||
);
|
||||
// {/*return (<Link to={ `/account/${accountId}` }>{ accountId } <Spinner loaded={false} /></Link>)*/}
|
||||
}
|
||||
|
||||
var title = account.title;
|
||||
var owner = account.owner;
|
||||
|
||||
|
||||
if (typeof owner !== 'undefined' && customerId !== owner) {
|
||||
return _react2.default.createElement(
|
||||
BS.Button,
|
||||
{ bsStyle: "link", disabled: true, title: "" + accountId, style: { padding: '0 0' } },
|
||||
title
|
||||
);
|
||||
} else {
|
||||
return _react2.default.createElement(
|
||||
_reactRouter.Link,
|
||||
{ to: "/account/" + accountId },
|
||||
title
|
||||
);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return AccountInfo;
|
||||
}(_react2.default.Component);
|
||||
|
||||
exports.default = (0, _reactRedux.connect)(function (_ref2) {
|
||||
var app = _ref2.app;
|
||||
return {
|
||||
entities: app.data.entities,
|
||||
customerId: (0, _readProp2.default)(app, 'auth.user.isSignedIn', false) ? (0, _readProp2.default)(app, 'auth.user.attributes.id', null) : null
|
||||
};
|
||||
})(AccountInfo);
|
||||
|
||||
/* 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 " + "AccountInfo.js" + ": " + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 594:
|
||||
/***/ 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
|
||||
});
|
||||
|
||||
var _Add3rdPartyAccountModal = __webpack_require__(592);
|
||||
var _Add3rdPartyAccountModal = __webpack_require__(595);
|
||||
|
||||
Object.defineProperty(exports, 'Add3rdPartyAccountModal', {
|
||||
enumerable: true,
|
||||
@@ -4409,7 +4546,7 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
});
|
||||
|
||||
var _NewAccountModal = __webpack_require__(598);
|
||||
var _NewAccountModal = __webpack_require__(599);
|
||||
|
||||
Object.defineProperty(exports, 'NewAccountModal', {
|
||||
enumerable: true,
|
||||
@@ -4418,7 +4555,7 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
});
|
||||
|
||||
var _RemoveAccountModal = __webpack_require__(599);
|
||||
var _RemoveAccountModal = __webpack_require__(600);
|
||||
|
||||
Object.defineProperty(exports, 'RemoveAccountBookmarkModal', {
|
||||
enumerable: true,
|
||||
@@ -4433,7 +4570,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 592:
|
||||
/***/ 595:
|
||||
/***/ 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 () {
|
||||
@@ -4457,15 +4594,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _ButtonLoader = __webpack_require__(593);
|
||||
var _ButtonLoader = __webpack_require__(596);
|
||||
|
||||
var _ButtonLoader2 = _interopRequireDefault(_ButtonLoader);
|
||||
|
||||
var _Input = __webpack_require__(596);
|
||||
var _Input = __webpack_require__(597);
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
|
||||
var _AuxErrorLabel = __webpack_require__(597);
|
||||
var _AuxErrorLabel = __webpack_require__(598);
|
||||
|
||||
var _AuxErrorLabel2 = _interopRequireDefault(_AuxErrorLabel);
|
||||
|
||||
@@ -4727,7 +4864,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 593:
|
||||
/***/ 596:
|
||||
/***/ 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 () {
|
||||
@@ -4748,7 +4885,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reactBootstrap = __webpack_require__(336);
|
||||
|
||||
var _reactLoader = __webpack_require__(594);
|
||||
var _reactLoader = __webpack_require__(592);
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
@@ -4855,7 +4992,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 596:
|
||||
/***/ 597:
|
||||
/***/ 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 () {
|
||||
@@ -4967,7 +5104,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 597:
|
||||
/***/ 598:
|
||||
/***/ 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 () {
|
||||
@@ -5066,7 +5203,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 598:
|
||||
/***/ 599:
|
||||
/***/ 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 () {
|
||||
@@ -5092,11 +5229,11 @@ webpackJsonp([0,3],{
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _Input = __webpack_require__(596);
|
||||
var _Input = __webpack_require__(597);
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
|
||||
var _ButtonLoader = __webpack_require__(593);
|
||||
var _ButtonLoader = __webpack_require__(596);
|
||||
|
||||
var _ButtonLoader2 = _interopRequireDefault(_ButtonLoader);
|
||||
|
||||
@@ -5289,7 +5426,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 599:
|
||||
/***/ 600:
|
||||
/***/ 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 () {
|
||||
@@ -5444,7 +5581,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 600:
|
||||
/***/ 601:
|
||||
/***/ 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 () {
|
||||
@@ -5512,7 +5649,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 601:
|
||||
/***/ 602:
|
||||
/***/ 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 () {
|
||||
@@ -5572,7 +5709,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 602:
|
||||
/***/ 603:
|
||||
/***/ 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 () {
|
||||
@@ -5598,7 +5735,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _reactLoader = __webpack_require__(594);
|
||||
var _reactLoader = __webpack_require__(592);
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
@@ -5606,21 +5743,21 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _reactSelect2 = _interopRequireDefault(_reactSelect);
|
||||
|
||||
var _Input = __webpack_require__(596);
|
||||
var _Input = __webpack_require__(597);
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
|
||||
var _Money = __webpack_require__(601);
|
||||
var _Money = __webpack_require__(602);
|
||||
|
||||
var _TransfersTable = __webpack_require__(603);
|
||||
var _TransfersTable = __webpack_require__(604);
|
||||
|
||||
var _reactRouter = __webpack_require__(183);
|
||||
|
||||
var _IndexPanel = __webpack_require__(600);
|
||||
var _IndexPanel = __webpack_require__(601);
|
||||
|
||||
var _IndexPanel2 = _interopRequireDefault(_IndexPanel);
|
||||
|
||||
var _modals = __webpack_require__(591);
|
||||
var _modals = __webpack_require__(594);
|
||||
|
||||
var Modals = _interopRequireWildcard(_modals);
|
||||
|
||||
@@ -6073,7 +6210,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 603:
|
||||
/***/ 604:
|
||||
/***/ 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 () {
|
||||
@@ -6091,7 +6228,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactLoader = __webpack_require__(594);
|
||||
var _reactLoader = __webpack_require__(592);
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
@@ -6099,13 +6236,13 @@ webpackJsonp([0,3],{
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _reactTimeago = __webpack_require__(604);
|
||||
var _reactTimeago = __webpack_require__(605);
|
||||
|
||||
var _reactTimeago2 = _interopRequireDefault(_reactTimeago);
|
||||
|
||||
var _Money = __webpack_require__(601);
|
||||
var _Money = __webpack_require__(602);
|
||||
|
||||
var _AccountInfo = __webpack_require__(605);
|
||||
var _AccountInfo = __webpack_require__(591);
|
||||
|
||||
var _AccountInfo2 = _interopRequireDefault(_AccountInfo);
|
||||
|
||||
@@ -6132,17 +6269,47 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
|
||||
_createClass(TransfersTable, [{
|
||||
key: "preprocessItems",
|
||||
value: function preprocessItems(input, currentAccountId) {
|
||||
return input.sort(function (a, b) {
|
||||
return a.date - b.date;
|
||||
}).filter(function (_ref) {
|
||||
var entryType = _ref.entryType;
|
||||
var toAccountId = _ref.toAccountId;
|
||||
var fromAccountId = _ref.fromAccountId;
|
||||
return entryType !== 'transaction' || fromAccountId === currentAccountId || toAccountId === currentAccountId;
|
||||
}).reduce(function (_ref2, v) {
|
||||
var items = _ref2.items;
|
||||
var balance = _ref2.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);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _props = this.props;
|
||||
var transfers = _props.transfers;
|
||||
var forAccount = _props.forAccount;
|
||||
|
||||
var _ref = transfers || {};
|
||||
var _ref3 = transfers || {};
|
||||
|
||||
var loading = _ref.loading;
|
||||
var data = _ref.data;
|
||||
var errors = _ref.errors;
|
||||
var loading = _ref3.loading;
|
||||
var data = _ref3.data;
|
||||
var errors = _ref3.errors;
|
||||
|
||||
|
||||
if (!transfers || loading) {
|
||||
@@ -6163,32 +6330,8 @@ webpackJsonp([0,3],{
|
||||
}
|
||||
|
||||
var currentAccountId = forAccount;
|
||||
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 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 transfersMarkup = data.length ? this.preprocessItems(data, currentAccountId).map(function (_ref4) {
|
||||
var entryType = _ref4.entryType;
|
||||
var amount = _ref4.amount;
|
||||
var fromAccountId = _ref4.fromAccountId;
|
||||
@@ -6227,7 +6370,11 @@ webpackJsonp([0,3],{
|
||||
null,
|
||||
_react2.default.createElement(_Money.Money, { amount: initialBalance })
|
||||
),
|
||||
_react2.default.createElement("td", null),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
description
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
@@ -6242,7 +6389,7 @@ webpackJsonp([0,3],{
|
||||
|
||||
return _react2.default.createElement(
|
||||
"tr",
|
||||
null,
|
||||
{ key: transactionId },
|
||||
_react2.default.createElement(
|
||||
"td",
|
||||
null,
|
||||
@@ -6351,129 +6498,6 @@ webpackJsonp([0,3],{
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 605:
|
||||
/***/ 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.AccountInfo = undefined;
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _react = __webpack_require__(2);
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactRedux = __webpack_require__(170);
|
||||
|
||||
var _reactLoader = __webpack_require__(594);
|
||||
|
||||
var _reactLoader2 = _interopRequireDefault(_reactLoader);
|
||||
|
||||
var _entities = __webpack_require__(326);
|
||||
|
||||
var A = _interopRequireWildcard(_entities);
|
||||
|
||||
var _reactRouter = __webpack_require__(183);
|
||||
|
||||
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 }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
|
||||
* Created by andrew on 3/22/16.
|
||||
*/
|
||||
|
||||
// import * as BS from "react-bootstrap";
|
||||
|
||||
|
||||
// import { Money } from '../components/Money';
|
||||
|
||||
var AccountInfo = exports.AccountInfo = function (_React$Component) {
|
||||
_inherits(AccountInfo, _React$Component);
|
||||
|
||||
function AccountInfo() {
|
||||
_classCallCheck(this, AccountInfo);
|
||||
|
||||
return _possibleConstructorReturn(this, (AccountInfo.__proto__ || Object.getPrototypeOf(AccountInfo)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(AccountInfo, [{
|
||||
key: "componentWillMount",
|
||||
value: function componentWillMount() {
|
||||
this.ensureData(this.props);
|
||||
}
|
||||
}, {
|
||||
key: "componentWillReceiveProps",
|
||||
value: function componentWillReceiveProps(nextProps) {
|
||||
this.ensureData(nextProps);
|
||||
}
|
||||
}, {
|
||||
key: "ensureData",
|
||||
value: function ensureData(_ref) {
|
||||
var dispatch = _ref.dispatch;
|
||||
var entities = _ref.entities;
|
||||
var accountId = _ref.accountId;
|
||||
|
||||
if (entities[accountId]) {
|
||||
return;
|
||||
}
|
||||
dispatch(A.fetchAccount(accountId));
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _props = this.props;
|
||||
var entities = _props.entities;
|
||||
var accountId = _props.accountId;
|
||||
|
||||
|
||||
var account = entities[accountId];
|
||||
|
||||
if (!account) {
|
||||
return _react2.default.createElement(
|
||||
_reactRouter.Link,
|
||||
{ to: "/account/" + accountId },
|
||||
accountId,
|
||||
" ",
|
||||
_react2.default.createElement(_reactLoader2.default, { loaded: false })
|
||||
);
|
||||
}
|
||||
|
||||
var title = account.title;
|
||||
|
||||
|
||||
return _react2.default.createElement(
|
||||
_reactRouter.Link,
|
||||
{ to: "/account/" + accountId },
|
||||
title
|
||||
);
|
||||
}
|
||||
}]);
|
||||
|
||||
return AccountInfo;
|
||||
}(_react2.default.Component);
|
||||
|
||||
exports.default = (0, _reactRedux.connect)(function (_ref2) {
|
||||
var app = _ref2.app;
|
||||
return {
|
||||
entities: app.data.entities
|
||||
};
|
||||
})(AccountInfo);
|
||||
|
||||
/* 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 " + "AccountInfo.js" + ": " + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 606:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
@@ -6675,15 +6699,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
var BS = _interopRequireWildcard(_reactBootstrap);
|
||||
|
||||
var _Input = __webpack_require__(596);
|
||||
var _Input = __webpack_require__(597);
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
|
||||
var _ButtonLoader = __webpack_require__(593);
|
||||
var _ButtonLoader = __webpack_require__(596);
|
||||
|
||||
var _ButtonLoader2 = _interopRequireDefault(_ButtonLoader);
|
||||
|
||||
var _AuxErrorLabel = __webpack_require__(597);
|
||||
var _AuxErrorLabel = __webpack_require__(598);
|
||||
|
||||
var _AuxErrorLabel2 = _interopRequireDefault(_AuxErrorLabel);
|
||||
|
||||
@@ -7023,15 +7047,15 @@ webpackJsonp([0,3],{
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _Input = __webpack_require__(596);
|
||||
var _Input = __webpack_require__(597);
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
|
||||
var _ButtonLoader = __webpack_require__(593);
|
||||
var _ButtonLoader = __webpack_require__(596);
|
||||
|
||||
var _ButtonLoader2 = _interopRequireDefault(_ButtonLoader);
|
||||
|
||||
var _IndexPanel = __webpack_require__(600);
|
||||
var _IndexPanel = __webpack_require__(601);
|
||||
|
||||
var _IndexPanel2 = _interopRequireDefault(_IndexPanel);
|
||||
|
||||
@@ -7353,4 +7377,4 @@ webpackJsonp([0,3],{
|
||||
/***/ }
|
||||
|
||||
});
|
||||
//# sourceMappingURL=app.d4bdff82ac1db214898b.js.map
|
||||
//# sourceMappingURL=app.fcbedf54f0345474ccc1.js.map
|
||||
1
js-frontend/build/app.fcbedf54f0345474ccc1.js.map
Normal file
1
js-frontend/build/app.fcbedf54f0345474ccc1.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.09cb8f5a05c9cfc35585.js"></script><script src="/vendor.f73c0104cb72cfb2809e.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.d4bdff82ac1db214898b.js"></script><script>
|
||||
<body><div id="root"></div><script src="/manifest.087a5454fa0c34daf3c9.js"></script><script src="/vendor.c882d66445aebc52c21b.js"></script><script src="/style.6d7a32b1405ea1bb2bdf.js"></script><script src="/app.fcbedf54f0345474ccc1.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.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>
|
||||
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.087a5454fa0c34daf3c9.js","hash":"087a5454fa0c34daf3c9","css":[]},"vendor":{"size":1670874,"entry":"/vendor.c882d66445aebc52c21b.js","hash":"c882d66445aebc52c21b","css":[]},"style":{"size":122,"entry":"/style.6d7a32b1405ea1bb2bdf.js","hash":"6d7a32b1405ea1bb2bdf","css":["/style.6d7a32b1405ea1bb2bdf.css"]},"app":{"size":352314,"entry":"/app.fcbedf54f0345474ccc1.js","hash":"fcbedf54f0345474ccc1","css":[]}},"js":["/manifest.087a5454fa0c34daf3c9.js","/vendor.c882d66445aebc52c21b.js","/style.6d7a32b1405ea1bb2bdf.js","/app.fcbedf54f0345474ccc1.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":"d4bdff82ac1db214898b","1":"6d7a32b1405ea1bb2bdf","2":"f73c0104cb72cfb2809e"}[chunkId] + ".js";
|
||||
/******/ script.src = __webpack_require__.p + "" + {"0":"fcbedf54f0345474ccc1","1":"6d7a32b1405ea1bb2bdf","2":"c882d66445aebc52c21b"}[chunkId] + ".js";
|
||||
/******/ head.appendChild(script);
|
||||
/******/ }
|
||||
/******/ };
|
||||
@@ -92,4 +92,4 @@
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([]);
|
||||
//# sourceMappingURL=manifest.09cb8f5a05c9cfc35585.js.map
|
||||
//# sourceMappingURL=manifest.087a5454fa0c34daf3c9.js.map
|
||||
@@ -1 +1 @@
|
||||
{"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":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap edd3ecd6d3192330eb69?"],"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.087a5454fa0c34daf3c9.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\":\"fcbedf54f0345474ccc1\",\"1\":\"6d7a32b1405ea1bb2bdf\",\"2\":\"c882d66445aebc52c21b\"}[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 edd3ecd6d3192330eb69\n **/"],"sourceRoot":""}
|
||||
@@ -13,14 +13,14 @@ webpackJsonp([2,3],[
|
||||
__webpack_require__(2);
|
||||
__webpack_require__(336);
|
||||
__webpack_require__(158);
|
||||
__webpack_require__(594);
|
||||
__webpack_require__(592);
|
||||
__webpack_require__(623);
|
||||
__webpack_require__(170);
|
||||
__webpack_require__(183);
|
||||
__webpack_require__(579);
|
||||
__webpack_require__(625);
|
||||
__webpack_require__(585);
|
||||
__webpack_require__(604);
|
||||
__webpack_require__(605);
|
||||
__webpack_require__(160);
|
||||
__webpack_require__(626);
|
||||
__webpack_require__(182);
|
||||
@@ -49406,15 +49406,13 @@ webpackJsonp([2,3],[
|
||||
|
||||
/***/ },
|
||||
/* 591 */,
|
||||
/* 592 */,
|
||||
/* 593 */,
|
||||
/* 594 */
|
||||
/* 592 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {
|
||||
|
||||
if (true) {
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2), __webpack_require__(158), __webpack_require__(595)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2), __webpack_require__(158), __webpack_require__(593)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
module.exports = factory(require('react'), require('react-dom'), require('spin.js'));
|
||||
} else {
|
||||
@@ -49535,7 +49533,7 @@ webpackJsonp([2,3],[
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 595 */
|
||||
/* 593 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
||||
@@ -49918,6 +49916,8 @@ webpackJsonp([2,3],[
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 594 */,
|
||||
/* 595 */,
|
||||
/* 596 */,
|
||||
/* 597 */,
|
||||
/* 598 */,
|
||||
@@ -49926,7 +49926,8 @@ webpackJsonp([2,3],[
|
||||
/* 601 */,
|
||||
/* 602 */,
|
||||
/* 603 */,
|
||||
/* 604 */
|
||||
/* 604 */,
|
||||
/* 605 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
'use strict'
|
||||
@@ -50059,7 +50060,6 @@ webpackJsonp([2,3],[
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 605 */,
|
||||
/* 606 */,
|
||||
/* 607 */,
|
||||
/* 608 */,
|
||||
@@ -55902,4 +55902,4 @@ webpackJsonp([2,3],[
|
||||
|
||||
/***/ }
|
||||
]);
|
||||
//# sourceMappingURL=vendor.f73c0104cb72cfb2809e.js.map
|
||||
//# sourceMappingURL=vendor.c882d66445aebc52c21b.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -210,8 +210,8 @@ export const createRefAccountLookup = customerId => {
|
||||
return dispatch => {
|
||||
dispatch(createRefAccountLookupStart());
|
||||
return api.apiRetrieveAccounts(customerId)
|
||||
.then(data => {
|
||||
const arr = data.map(({ accountId, title }) => ({
|
||||
.then(({ accounts }) => {
|
||||
const arr = accounts.map(({ accountId, title }) => ({
|
||||
value: accountId,
|
||||
label: title
|
||||
}));
|
||||
@@ -226,7 +226,7 @@ export const createRefAccountLookup = customerId => {
|
||||
};
|
||||
|
||||
|
||||
export const makeTransferRequested = makeActionCreator(T.TRANSFERS.MAKE_START, 'payload');
|
||||
export const makeTransferRequested = makeActionCreator(T.TRANSFERS.MAKE_START);
|
||||
export const makeTransferComplete = makeActionCreator(T.TRANSFERS.MAKE_COMPLETE, 'payload');
|
||||
export const makeTransferError = makeActionCreator(T.TRANSFERS.MAKE_ERROR, 'error');
|
||||
export const makeTransferFormUpdate = makeActionCreator(T.TRANSFERS.MAKE_FORM_UPDATE, 'key', 'value');
|
||||
|
||||
@@ -4,13 +4,11 @@
|
||||
import React from "react";
|
||||
import { connect } from 'react-redux';
|
||||
import Spinner from "react-loader";
|
||||
// import * as BS from "react-bootstrap";
|
||||
import * as BS from "react-bootstrap";
|
||||
import * as A from '../actions/entities';
|
||||
import read from '../utils/readProp';
|
||||
import { Route, IndexRoute, Link, IndexLink } from "react-router";
|
||||
|
||||
|
||||
// import { Money } from '../components/Money';
|
||||
|
||||
export class AccountInfo extends React.Component {
|
||||
componentWillMount() {
|
||||
this.ensureData(this.props);
|
||||
@@ -28,20 +26,26 @@ export class AccountInfo extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { entities, accountId } = this.props;
|
||||
const { entities, accountId, customerId } = this.props;
|
||||
|
||||
const account = entities[accountId];
|
||||
|
||||
if (!account) {
|
||||
return (<Link to={ `/account/${accountId}` }>{ accountId } <Spinner loaded={false} /></Link>)
|
||||
if (!account || !accountId) {
|
||||
return (<div title={ `${accountId}` }>{ accountId } <Spinner loaded={false} /></div>);
|
||||
// {/*return (<Link to={ `/account/${accountId}` }>{ accountId } <Spinner loaded={false} /></Link>)*/}
|
||||
}
|
||||
|
||||
const { title } = account;
|
||||
const { title, owner } = account;
|
||||
|
||||
return (<Link to={ `/account/${accountId}` }>{ title }</Link>);
|
||||
if ((typeof owner !== 'undefined') && (customerId !== owner)) {
|
||||
return (<BS.Button bsStyle="link" disabled title={ `${accountId}` } style={{ padding: '0 0' }}>{ title }</BS.Button>);
|
||||
} else {
|
||||
return (<Link to={ `/account/${accountId}` }>{ title }</Link>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(({ app }) => ({
|
||||
entities: app.data.entities
|
||||
entities: app.data.entities,
|
||||
customerId: read(app, 'auth.user.isSignedIn', false) ? read(app, 'auth.user.attributes.id', null): null,
|
||||
}))(AccountInfo);
|
||||
|
||||
@@ -10,6 +10,30 @@ import { Money } from './Money';
|
||||
import AccountInfo from './AccountInfo';
|
||||
|
||||
export class TransfersTable extends React.Component {
|
||||
|
||||
preprocessItems(input, currentAccountId) {
|
||||
return input
|
||||
.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)))
|
||||
}
|
||||
|
||||
render() {
|
||||
const { transfers, forAccount } = this.props;
|
||||
const { loading, data, errors } = transfers || {};
|
||||
@@ -23,27 +47,9 @@ export class TransfersTable extends React.Component {
|
||||
}
|
||||
|
||||
const currentAccountId = forAccount;
|
||||
|
||||
const transfersMarkup = data.length ?
|
||||
data
|
||||
.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)))
|
||||
this.preprocessItems(data, currentAccountId)
|
||||
.map(({
|
||||
entryType,
|
||||
amount,
|
||||
@@ -65,7 +71,7 @@ export class TransfersTable extends React.Component {
|
||||
<td><TimeAgo date={date} title={ timeAgoTitle } /></td>
|
||||
<td colSpan="3">Account created</td>
|
||||
<td><Money amount={ initialBalance } /></td>
|
||||
<td></td>
|
||||
<td>{ description }</td>
|
||||
<td>{ status || '—' }</td>
|
||||
</tr>);
|
||||
}
|
||||
@@ -76,7 +82,7 @@ export class TransfersTable extends React.Component {
|
||||
<AccountInfo accountId={ toAccountId } /> :
|
||||
<AccountInfo accountId={ fromAccountId } />;
|
||||
|
||||
return (<tr>
|
||||
return (<tr key={ transactionId }>
|
||||
<td><TimeAgo date={date} title={ timeAgoTitle } /></td>
|
||||
<td>{ directionMarkup }</td>
|
||||
<td>{ counterAccountMarkup }</td>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Link, IndexLink} from "react-router";
|
||||
import { connect } from "react-redux";
|
||||
//import * as DefaultTheme from "redux-auth";
|
||||
import Select from "react-select";
|
||||
import AccountInfo from '../components/AccountInfo';
|
||||
import * as Modals from './modals';
|
||||
import IndexPanel from "./../components/partials/IndexPanel";
|
||||
|
||||
@@ -55,7 +56,7 @@ class MyAccounts extends React.Component {
|
||||
// return new Promise((rs, rj) => {
|
||||
setTimeout(() => {
|
||||
this.props.dispatch(A.fetchOwnAccounts(customerId)); //.then(rs, rj);
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
// });
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -81,7 +82,7 @@ class MyAccounts extends React.Component {
|
||||
return new Promise((rs, rj) => {
|
||||
setTimeout(() => {
|
||||
this.props.dispatch(A.fetchOwnAccounts(customerId)).then(rs, rj);
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -164,7 +165,7 @@ class MyAccounts extends React.Component {
|
||||
accountId, balance, description = '', title
|
||||
}, idx) => (
|
||||
<tr key={`own_${idx}`}>
|
||||
<td key={0}><Link to={`/account/${accountId}`}>{ title }</Link>{
|
||||
<td key={0}><AccountInfo accountId={accountId} />{
|
||||
(description) ? [
|
||||
(<br />),
|
||||
<span>{ description }</span>
|
||||
@@ -182,7 +183,7 @@ class MyAccounts extends React.Component {
|
||||
id
|
||||
}, idx) => (
|
||||
<tr key={`ref_${idx}`}>
|
||||
<td key={0}><Link to={`/account/${id}`}>{ title }</Link>{
|
||||
<td key={0}><AccountInfo accountId={id} />{
|
||||
(description) ? [
|
||||
(<br />),
|
||||
<span>{ description }</span>
|
||||
|
||||
Reference in New Issue
Block a user