Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit 3a17d06

Browse files
committed
refactor: Redux toolkit + TypeScript
1 parent 33668e4 commit 3a17d06

File tree

426 files changed

+3999
-3461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+3999
-3461
lines changed

.babelrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

babel.config.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const { fixResolvePath, getResolverAlias } = require("./webpacktools");
2+
3+
module.exports = function (api) {
4+
api.cache(true);
5+
6+
return {
7+
"presets": [
8+
"@babel/preset-react",
9+
[
10+
"@babel/preset-env",
11+
{
12+
"targets": {
13+
"browsers": [
14+
"last 2 versions"
15+
]
16+
}
17+
}
18+
]
19+
],
20+
"plugins": [
21+
"react-html-attrs",
22+
[
23+
"module-resolver",
24+
{
25+
root: ["./"],
26+
alias: getResolverAlias(__dirname),
27+
resolvePath: fixResolvePath(__dirname),
28+
},
29+
],
30+
"@babel/plugin-proposal-object-rest-spread",
31+
[
32+
"@babel/plugin-transform-runtime",
33+
{
34+
"helpers": false,
35+
"regenerator": true
36+
}
37+
],
38+
"@babel/plugin-proposal-class-properties",
39+
"@babel/plugin-proposal-nullish-coalescing-operator",
40+
"@babel/plugin-proposal-optional-chaining",
41+
"@babel/plugin-transform-react-constant-elements",
42+
"@babel/plugin-transform-react-inline-elements",
43+
"@babel/plugin-transform-react-jsx-source",
44+
"@babel/plugin-syntax-dynamic-import"
45+
],
46+
"env": {
47+
"test": {
48+
"plugins": [
49+
"babel-plugin-dynamic-import-node"
50+
]
51+
},
52+
"development": {
53+
"compact": false
54+
}
55+
}
56+
};
57+
};
58+

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,18 @@
129129
]
130130
},
131131
"dependencies": {
132+
"@manaflair/redux-batch": "^1.0.0",
133+
"@reduxjs/toolkit": "^1.2.3",
134+
"@types/lodash": "^4.14.149",
132135
"electron-localshortcut": "^3.2.1",
133136
"electron-log": "^2.2.9",
134137
"electron-settings": "^3.1.3",
135138
"fs-jetpack": "^1.0.0",
136139
"glob": "^7.1.2",
137140
"i18next": "^10.6.0",
138141
"i18next-xhr-backend": "^1.5.1",
142+
"lodash": "^4.17.15",
143+
"redux-saga": "^1.1.3",
139144
"upath": "1.0.5"
140145
},
141146
"devDependencies": {
@@ -150,9 +155,9 @@
150155
"@babel/plugin-proposal-function-sent": "^7.7.4",
151156
"@babel/plugin-proposal-json-strings": "^7.7.4",
152157
"@babel/plugin-proposal-logical-assignment-operators": "^7.7.4",
153-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
158+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
154159
"@babel/plugin-proposal-numeric-separator": "^7.7.4",
155-
"@babel/plugin-proposal-optional-chaining": "^7.7.4",
160+
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
156161
"@babel/plugin-proposal-pipeline-operator": "^7.7.4",
157162
"@babel/plugin-proposal-throw-expressions": "^7.7.4",
158163
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
@@ -169,6 +174,7 @@
169174
"@material-ui/core": "^3.9.2",
170175
"@material-ui/icons": "^3.0.2",
171176
"@material-ui/lab": "^3.0.0-alpha.30",
177+
"@rollup/plugin-typescript": "^2.1.0",
172178
"@types/jest": "^24.0.25",
173179
"@types/moxios": "^0.4.9",
174180
"@types/node": "^13.1.4",
@@ -178,6 +184,7 @@
178184
"axios": "0.18.1",
179185
"babel-loader": "^8.0.6",
180186
"babel-plugin-dynamic-import-node": "^2.3.0",
187+
"babel-plugin-module-resolver": "^4.0.0",
181188
"babel-plugin-react-html-attrs": "^2.1.0",
182189
"babel-plugin-system-import-transformer": "^3.1.0",
183190
"chart.js": "^2.7.2",
File renamed without changes.

src/react/Actions/master_card_action_info.js renamed to src/Actions/master_card_action_info.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import BunqErrorHandler from "../Functions/BunqErrorHandler";
2-
import MasterCardAction from "../Models/MasterCardAction";
1+
import BunqErrorHandler from "~functions/BunqErrorHandler";
2+
import MasterCardAction from "~models/MasterCardAction";
33

44
import { masterCardActionsSetInfo } from "./master_card_actions";
55

@@ -14,6 +14,18 @@ export function masterCardActionSetInfo(master_card_action_info, account_id, mas
1414
};
1515
}
1616

17+
export function masterCardActionInfoLoading() {
18+
return { type: "MASTER_CARD_ACTION_INFO_IS_LOADING" };
19+
}
20+
21+
export function masterCardActionInfoNotLoading() {
22+
return { type: "MASTER_CARD_ACTION_INFO_IS_NOT_LOADING" };
23+
}
24+
25+
export function masterCardActionInfoClear() {
26+
return { type: "MASTER_CARD_ACTION_INFO_CLEAR" };
27+
}
28+
1729
export function masterCardActionInfoUpdate(BunqJSClient, user_id, account_id, master_card_action_id) {
1830
const failedMessage = window.t("We failed to load the mastercard payment information");
1931

@@ -37,14 +49,4 @@ export function masterCardActionInfoUpdate(BunqJSClient, user_id, account_id, ma
3749
};
3850
}
3951

40-
export function masterCardActionInfoLoading() {
41-
return { type: "MASTER_CARD_ACTION_INFO_IS_LOADING" };
42-
}
4352

44-
export function masterCardActionInfoNotLoading() {
45-
return { type: "MASTER_CARD_ACTION_INFO_IS_NOT_LOADING" };
46-
}
47-
48-
export function masterCardActionInfoClear() {
49-
return { type: "MASTER_CARD_ACTION_INFO_CLEAR" };
50-
}

src/react/Actions/master_card_actions.js renamed to src/Actions/master_card_actions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import BunqErrorHandler from "../Functions/BunqErrorHandler";
2-
import MasterCardAction from "../Models/MasterCardAction";
1+
import MasterCardAction from "~models/MasterCardAction";
32

43
export const STORED_MASTER_CARD_ACTIONS = "BUNQDESKTOP_STORED_MASTER_CARD_ACTIONS";
54

@@ -60,7 +59,8 @@ export function masterCardActionsUpdate(
6059
})
6160
.catch(error => {
6261
dispatch(masterCardActionsNotLoading());
63-
BunqErrorHandler(dispatch, error, failedMessage);
62+
// FIXME
63+
// BunqErrorHandler(dispatch, error, failedMessage);
6464
});
6565
};
6666
}
File renamed without changes.

src/react/Actions/note_texts.js renamed to src/Actions/note_texts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BunqErrorHandler from "../Functions/BunqErrorHandler";
1+
import BunqErrorHandler from "~functions/BunqErrorHandler";
22

33
export function noteTextsSetInfo(noteTexts, event_type, user_id, account_id, event_id) {
44
return {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)