1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-06-13 13:39:23 -04:00

Add direct OFX imports

This commit is contained in:
2017-06-04 16:01:42 -04:00
parent bf284dc591
commit fb59f9b3c5
13 changed files with 582 additions and 149 deletions

View File

@ -0,0 +1,47 @@
var assign = require('object-assign');
var ImportConstants = require('../constants/ImportConstants');
var UserConstants = require('../constants/UserConstants');
const initialState = {
showModal: false,
importing: false,
uploadProgress: 0,
importFinished: false,
importFailed: false,
errorMessage: null
};
module.exports = function(state = initialState, action) {
switch (action.type) {
case ImportConstants.OPEN_IMPORT_MODAL:
return assign({}, initialState, {
showModal: true
});
case ImportConstants.CLOSE_IMPORT_MODAL:
case UserConstants.USER_LOGGEDOUT:
return initialState;
case ImportConstants.BEGIN_IMPORT:
return assign({}, state, {
importing: true
});
case ImportConstants.UPDATE_IMPORT_PROGRESS:
return assign({}, state, {
uploadProgress: action.progress
});
case ImportConstants.IMPORT_FINISHED:
return assign({}, state, {
importing: false,
uploadProgress: 100,
importFinished: true
});
case ImportConstants.IMPORT_FAILED:
return assign({}, state, {
importing: false,
importFailed: true,
errorMessage: action.error
});
default:
return state;
}
};

View File

@ -11,6 +11,7 @@ var ReportReducer = require('./ReportReducer');
var SelectedReportReducer = require('./SelectedReportReducer');
var TransactionReducer = require('./TransactionReducer');
var TransactionPageReducer = require('./TransactionPageReducer');
var ImportReducer = require('./ImportReducer');
var ErrorReducer = require('./ErrorReducer');
module.exports = Redux.combineReducers({
@ -25,5 +26,6 @@ module.exports = Redux.combineReducers({
selectedReport: SelectedReportReducer,
transactions: TransactionReducer,
transactionPage: TransactionPageReducer,
imports: ImportReducer,
error: ErrorReducer
});