cozy-harvest-lib 17.0.1 → 17.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/components/AccountModalWithoutTabs/OpenOAuthWindowButton.js +1 -2
- package/dist/components/DisconnectedAccountModal.spec.js +3 -2
- package/dist/components/KonnectorConfiguration/ConfigurationTab/Contracts.js +1 -2
- package/dist/components/KonnectorConfiguration/ConfigurationTab/EditContract.js +1 -13
- package/dist/components/KonnectorConfiguration/ConfigurationTab/EditContract.spec.js +2 -31
- package/dist/components/KonnectorConfiguration/KonnectorAccountTabs.js +1 -2
- package/dist/components/OAuthForm.js +1 -2
- package/dist/components/TriggerManager.spec.js +0 -8
- package/dist/components/cards/LaunchTriggerAlert.spec.js +3 -7
- package/dist/datacards/GeoDataCard.js +9 -2
- package/dist/konnector-policies.js +1 -2
- package/dist/locales/nl_NL.json +41 -7
- package/dist/models/ConnectionFlow.spec.js +11 -30
- package/dist/policies/biWebView.js +165 -204
- package/dist/policies/biWebView.spec.js +85 -318
- package/package.json +2 -2
- package/src/components/AccountModalWithoutTabs/OpenOAuthWindowButton.jsx +1 -5
- package/src/components/DisconnectedAccountModal.spec.jsx +7 -4
- package/src/components/KonnectorConfiguration/ConfigurationTab/Contracts.jsx +7 -10
- package/src/components/KonnectorConfiguration/ConfigurationTab/EditContract.jsx +1 -25
- package/src/components/KonnectorConfiguration/ConfigurationTab/EditContract.spec.jsx +0 -25
- package/src/components/KonnectorConfiguration/KonnectorAccountTabs.jsx +1 -5
- package/src/components/OAuthForm.jsx +1 -2
- package/src/components/TriggerManager.spec.jsx +0 -12
- package/src/components/cards/LaunchTriggerAlert.spec.jsx +0 -5
- package/src/datacards/GeoDataCard.jsx +11 -2
- package/src/konnector-policies.js +3 -7
- package/src/locales/nl_NL.json +41 -7
- package/src/models/ConnectionFlow.spec.js +1 -31
- package/src/policies/biWebView.js +105 -151
- package/src/policies/biWebView.spec.js +17 -158
- package/dist/components/KonnectorConfiguration/ConfigurationTab/SyncContractSwitch.js +0 -203
- package/dist/components/KonnectorConfiguration/ConfigurationTab/SyncContractSwitch.spec.js +0 -260
- package/dist/policies/budget-insight.js +0 -855
- package/dist/policies/budget-insight.spec.js +0 -1405
- package/src/components/KonnectorConfiguration/ConfigurationTab/SyncContractSwitch.jsx +0 -144
- package/src/components/KonnectorConfiguration/ConfigurationTab/SyncContractSwitch.spec.jsx +0 -169
- package/src/policies/budget-insight.js +0 -567
- package/src/policies/budget-insight.spec.js +0 -918
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [17.2.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@17.1.0...cozy-harvest-lib@17.2.0) (2023-08-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Branch Realtime on io.cozy.timeseries.geojson ([a96c922](https://github.com/cozy/cozy-libs/commit/a96c9224575f42dffae954d79784917d3740bf7c))
|
|
12
|
+
* Translate en.json in nl_NL ([d409c6a](https://github.com/cozy/cozy-libs/commit/d409c6af89530d708e98c91effd6e2667b4a6fe9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [17.1.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@17.0.1...cozy-harvest-lib@17.1.0) (2023-08-18)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* Remove bi.webview* flag in code ([b08a22e](https://github.com/cozy/cozy-libs/commit/b08a22e8e29a79cf1fd992e9c04f253060c2029c))
|
|
24
|
+
* Remove contract edit feature ([a6547a4](https://github.com/cozy/cozy-libs/commit/a6547a47729024c24493a8269f17facc5b1c156b))
|
|
25
|
+
* Removed the use of powens bank ids -> uuids ([f2d5dec](https://github.com/cozy/cozy-libs/commit/f2d5dec165202a2e5ff02f9a1a4f87ffda283c9e))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## [17.0.1](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@17.0.0...cozy-harvest-lib@17.0.1) (2023-08-10)
|
|
7
32
|
|
|
8
33
|
|
|
@@ -3,7 +3,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { useClient } from 'cozy-client';
|
|
6
|
-
import flag from 'cozy-flags';
|
|
7
6
|
import { useWebviewIntent } from 'cozy-intent';
|
|
8
7
|
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
9
8
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
@@ -65,7 +64,7 @@ var OpenOAuthWindowButton = function OpenOAuthWindowButton(_ref) {
|
|
|
65
64
|
case 4:
|
|
66
65
|
response = _context.sent;
|
|
67
66
|
|
|
68
|
-
if (response.result === OAUTH_SERVICE_OK
|
|
67
|
+
if (response.result === OAUTH_SERVICE_OK) {
|
|
69
68
|
flow.expectTriggerLaunch();
|
|
70
69
|
}
|
|
71
70
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { CozyConfirmDialogProvider } from './CozyConfirmDialogProvider';
|
|
3
4
|
import DisconnectedAccountModal from './DisconnectedAccountModal';
|
|
4
5
|
import bankAccounts from './KonnectorConfiguration/ConfigurationTab/bank-account-fixture.json';
|
|
5
6
|
import AppLike from '../../test/AppLike';
|
|
@@ -15,10 +16,10 @@ describe('DisconnectedAccountModal', function () {
|
|
|
15
16
|
mockClient.dispatch = jest.fn();
|
|
16
17
|
var root = render( /*#__PURE__*/React.createElement(AppLike, {
|
|
17
18
|
client: mockClient
|
|
18
|
-
}, /*#__PURE__*/React.createElement(DisconnectedAccountModal, {
|
|
19
|
+
}, /*#__PURE__*/React.createElement(CozyConfirmDialogProvider, null, /*#__PURE__*/React.createElement(DisconnectedAccountModal, {
|
|
19
20
|
accounts: [bankAccounts],
|
|
20
21
|
onClose: jest.fn()
|
|
21
|
-
})));
|
|
22
|
+
}))));
|
|
22
23
|
return {
|
|
23
24
|
root: root
|
|
24
25
|
};
|
|
@@ -3,7 +3,6 @@ import compose from 'lodash/flowRight';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import CozyClient, { Q, queryConnect, RealTimeQueries } from 'cozy-client';
|
|
6
|
-
import flag from 'cozy-flags';
|
|
7
6
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
8
7
|
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme';
|
|
9
8
|
import NavigationList, { NavigationListSection, NavigationListHeader } from 'cozy-ui/transpiled/react/NavigationList';
|
|
@@ -55,7 +54,7 @@ var DumbContracts = function DumbContracts(_ref2) {
|
|
|
55
54
|
contract: contract,
|
|
56
55
|
divider: i !== contractData.length - 1
|
|
57
56
|
});
|
|
58
|
-
}),
|
|
57
|
+
}), /*#__PURE__*/React.createElement(BIContractActivationWindow, {
|
|
59
58
|
konnector: konnector,
|
|
60
59
|
account: account,
|
|
61
60
|
intentsApi: intentsApi,
|
|
@@ -20,11 +20,9 @@ import Alerter from 'cozy-ui/transpiled/react/deprecated/Alerter';
|
|
|
20
20
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button';
|
|
21
21
|
import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints';
|
|
22
22
|
import { withStyles } from 'cozy-ui/transpiled/react/styles';
|
|
23
|
-
import SyncContractSwitch from './SyncContractSwitch';
|
|
24
23
|
import { getAccountLabel, getAccountInstitutionLabel, getAccountOwners } from './bankAccountHelpers';
|
|
25
24
|
import { updateContract } from './helpers';
|
|
26
25
|
import { buildAppsByIdQuery } from '../../../helpers/queries';
|
|
27
|
-
import { findKonnectorPolicy } from '../../../konnector-policies';
|
|
28
26
|
import { useTracker, useTrackPage } from '../../hoc/tracking';
|
|
29
27
|
import withLocales from '../../hoc/withLocales';
|
|
30
28
|
|
|
@@ -85,8 +83,6 @@ var EditContract = function EditContract(props) {
|
|
|
85
83
|
var client = useClient();
|
|
86
84
|
var tracker = useTracker();
|
|
87
85
|
var contract = props.contract,
|
|
88
|
-
accountId = props.accountId,
|
|
89
|
-
konnector = props.konnector,
|
|
90
86
|
onAfterRemove = props.onAfterRemove,
|
|
91
87
|
_onSuccess = props.onSuccess,
|
|
92
88
|
onClose = props.onClose,
|
|
@@ -250,7 +246,6 @@ var EditContract = function EditContract(props) {
|
|
|
250
246
|
|
|
251
247
|
var confirmPrimaryText = t('contractForm.confirm-deletion.description');
|
|
252
248
|
var fieldVariant = isMobile ? 'default' : 'inline';
|
|
253
|
-
var policy = konnector ? findKonnectorPolicy(konnector) : null;
|
|
254
249
|
return /*#__PURE__*/React.createElement(Dialog, dialogProps, /*#__PURE__*/React.createElement(DialogCloseButton, {
|
|
255
250
|
onClick: onClose
|
|
256
251
|
}), /*#__PURE__*/React.createElement(DialogTitle, dialogTitleProps, isMobile ? /*#__PURE__*/React.createElement(DialogBackButton, {
|
|
@@ -303,14 +298,7 @@ var EditContract = function EditContract(props) {
|
|
|
303
298
|
label: t('contractForm.apply'),
|
|
304
299
|
theme: "primary",
|
|
305
300
|
className: "u-ml-0"
|
|
306
|
-
})))), /*#__PURE__*/React.createElement(Divider, null),
|
|
307
|
-
className: "u-pv-1"
|
|
308
|
-
}, /*#__PURE__*/React.createElement(SyncContractSwitch, {
|
|
309
|
-
fieldVariant: fieldVariant,
|
|
310
|
-
contract: contract,
|
|
311
|
-
accountId: accountId,
|
|
312
|
-
konnector: konnector
|
|
313
|
-
})), /*#__PURE__*/React.createElement(Divider, null)) : null, /*#__PURE__*/React.createElement(DialogContent, {
|
|
301
|
+
})))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogContent, {
|
|
314
302
|
className: "u-pv-1"
|
|
315
303
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
316
304
|
className: "u-ml-auto u-error u-ml-0 u-ph-half",
|
|
@@ -9,14 +9,6 @@ import AppLike from '../../../../test/AppLike';
|
|
|
9
9
|
jest.mock('cozy-client/dist/hooks/useQuery', function () {
|
|
10
10
|
return jest.fn();
|
|
11
11
|
});
|
|
12
|
-
jest.mock('./SyncContractSwitch', function () {
|
|
13
|
-
return function SyncContractSwitch() {
|
|
14
|
-
return /*#__PURE__*/React.createElement("input", {
|
|
15
|
-
type: "checkbox",
|
|
16
|
-
role: "sync-contract-switch"
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
12
|
describe('EditContract', function () {
|
|
21
13
|
var setup = function setup() {
|
|
22
14
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -73,27 +65,14 @@ describe('EditContract', function () {
|
|
|
73
65
|
shortLabel: 'Mes actions sociétaire'
|
|
74
66
|
}));
|
|
75
67
|
});
|
|
76
|
-
it('should show sync contract switch if the konnector policy supports it', function () {
|
|
77
|
-
var _setup3 = setup({
|
|
78
|
-
konnector: {
|
|
79
|
-
slug: 'banking-konnector',
|
|
80
|
-
partnership: {
|
|
81
|
-
domain: 'budget-insight.com'
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}),
|
|
85
|
-
root = _setup3.root;
|
|
86
|
-
|
|
87
|
-
expect(root.getByRole('sync-contract-switch')).not.toBeUndefined();
|
|
88
|
-
});
|
|
89
68
|
it('shows confirmation deletion and allows to delete contract', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
90
|
-
var
|
|
69
|
+
var _setup3, root, client, btn, confirmBtn;
|
|
91
70
|
|
|
92
71
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
93
72
|
while (1) {
|
|
94
73
|
switch (_context2.prev = _context2.next) {
|
|
95
74
|
case 0:
|
|
96
|
-
|
|
75
|
+
_setup3 = setup(), root = _setup3.root, client = _setup3.client;
|
|
97
76
|
btn = root.getByText('Remove the account');
|
|
98
77
|
fireEvent.click(btn);
|
|
99
78
|
confirmBtn = root.getByText('Confirm account deletion');
|
|
@@ -124,12 +103,4 @@ describe('EditContract', function () {
|
|
|
124
103
|
}
|
|
125
104
|
}, _callee2);
|
|
126
105
|
})));
|
|
127
|
-
it('should not show sync contract switch if the konnector policy does not support it', function () {
|
|
128
|
-
var _setup5 = setup({
|
|
129
|
-
konnector: null
|
|
130
|
-
}),
|
|
131
|
-
root = _setup5.root;
|
|
132
|
-
|
|
133
|
-
expect(root.queryByRole('sync-contract-switch')).toBe(null);
|
|
134
|
-
});
|
|
135
106
|
});
|
|
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import React, { useState, useRef, useCallback } from 'react';
|
|
7
7
|
import SwipeableViews from 'react-swipeable-views';
|
|
8
8
|
import { useClient } from 'cozy-client';
|
|
9
|
-
import flag from 'cozy-flags';
|
|
10
9
|
import { useWebviewIntent } from 'cozy-intent';
|
|
11
10
|
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
12
11
|
import Divider from 'cozy-ui/transpiled/react/Divider';
|
|
@@ -135,7 +134,7 @@ var KonnectorAccountTabs = function KonnectorAccountTabs(props) {
|
|
|
135
134
|
case 2:
|
|
136
135
|
response = _context.sent;
|
|
137
136
|
|
|
138
|
-
if (response.result === OAUTH_SERVICE_OK
|
|
137
|
+
if (response.result === OAUTH_SERVICE_OK) {
|
|
139
138
|
flow.expectTriggerLaunch();
|
|
140
139
|
}
|
|
141
140
|
|
|
@@ -6,7 +6,6 @@ import isEqual from 'lodash/isEqual';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
8
8
|
import { useClient } from 'cozy-client';
|
|
9
|
-
import flag from 'cozy-flags';
|
|
10
9
|
import { useWebviewIntent } from 'cozy-intent';
|
|
11
10
|
import { MountPointContext } from './MountPointContext';
|
|
12
11
|
import { OAUTH_SERVICE_ERROR, OAUTH_SERVICE_OK, openOAuthWindow } from './OAuthService';
|
|
@@ -97,7 +96,7 @@ export var OAuthForm = function OAuthForm(props) {
|
|
|
97
96
|
if (response.result === OAUTH_SERVICE_OK) {
|
|
98
97
|
konnectorPolicy = findKonnectorPolicy(konnector);
|
|
99
98
|
|
|
100
|
-
if (konnectorPolicy.isBIWebView
|
|
99
|
+
if (konnectorPolicy.isBIWebView) {
|
|
101
100
|
replaceHistory("/accounts/bi/success");
|
|
102
101
|
}
|
|
103
102
|
|
|
@@ -67,14 +67,6 @@ jest.mock('cozy-doctypes', function () {
|
|
|
67
67
|
CozyFolder: CozyFolder
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
jest.mock('../../src/policies/budget-insight', function () {
|
|
71
|
-
var originalBudgetInsight = jest.requireActual('../../src/policies/budget-insight');
|
|
72
|
-
return {
|
|
73
|
-
konnectorPolicy: _objectSpread(_objectSpread({}, originalBudgetInsight.konnectorPolicy), {}, {
|
|
74
|
-
onAccountCreation: jest.fn()
|
|
75
|
-
})
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
70
|
var mockVaultClient = {
|
|
79
71
|
createNewCipher: jest.fn(),
|
|
80
72
|
saveCipher: jest.fn(),
|
|
@@ -9,7 +9,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
|
|
10
10
|
import { render, waitFor, fireEvent } from '@testing-library/react';
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import flag from 'cozy-flags';
|
|
13
12
|
import { LaunchTriggerAlert } from './LaunchTriggerAlert';
|
|
14
13
|
import AppLike from '../../../test/AppLike';
|
|
15
14
|
import ConnectionFlow from '../../models/ConnectionFlow';
|
|
@@ -231,9 +230,6 @@ describe('LaunchTriggerAlert', function () {
|
|
|
231
230
|
while (1) {
|
|
232
231
|
switch (_context4.prev = _context4.next) {
|
|
233
232
|
case 0:
|
|
234
|
-
flag.mockImplementation(function (key) {
|
|
235
|
-
return key === 'harvest.bi.webview' ? true : false;
|
|
236
|
-
});
|
|
237
233
|
OpenOAuthWindowButton.mockImplementation(function () {
|
|
238
234
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "OpenOAuthWindowButton"));
|
|
239
235
|
});
|
|
@@ -241,15 +237,15 @@ describe('LaunchTriggerAlert', function () {
|
|
|
241
237
|
trigger: reconnectErrorTriggerFixture,
|
|
242
238
|
konnector: powensKonnectorFixture
|
|
243
239
|
}), root = _setup4.root;
|
|
244
|
-
_context4.next =
|
|
240
|
+
_context4.next = 4;
|
|
245
241
|
return waitFor(function () {
|
|
246
242
|
return root.getByTestId('alert-menu-button');
|
|
247
243
|
});
|
|
248
244
|
|
|
249
|
-
case
|
|
245
|
+
case 4:
|
|
250
246
|
expect(OpenOAuthWindowButton).toHaveBeenCalled();
|
|
251
247
|
|
|
252
|
-
case
|
|
248
|
+
case 5:
|
|
253
249
|
case "end":
|
|
254
250
|
return _context4.stop();
|
|
255
251
|
}
|
|
@@ -19,7 +19,7 @@ import sortBy from 'lodash/sortBy';
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import React, { useEffect, useRef, useMemo, memo } from 'react';
|
|
21
21
|
import SwipeableViews from 'react-swipeable-views';
|
|
22
|
-
import CozyClient, { Q, queryConnect, isQueryLoading, hasQueryBeenLoaded } from 'cozy-client';
|
|
22
|
+
import CozyClient, { Q, queryConnect, isQueryLoading, hasQueryBeenLoaded, RealTimeQueries } from 'cozy-client';
|
|
23
23
|
import flag from 'cozy-flags';
|
|
24
24
|
import Box from 'cozy-ui/transpiled/react/Box';
|
|
25
25
|
import Card from 'cozy-ui/transpiled/react/Card';
|
|
@@ -350,8 +350,15 @@ DataGeoDataCard.propTypes = {
|
|
|
350
350
|
konnector: PropTypes.object.isRequired,
|
|
351
351
|
accountId: PropTypes.string.isRequired
|
|
352
352
|
};
|
|
353
|
+
|
|
354
|
+
var DataGeoDataCardWithRealtime = function DataGeoDataCardWithRealtime(props) {
|
|
355
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RealTimeQueries, {
|
|
356
|
+
doctype: "io.cozy.timeseries.geojson"
|
|
357
|
+
}), /*#__PURE__*/React.createElement(DataGeoDataCard, props));
|
|
358
|
+
};
|
|
359
|
+
|
|
353
360
|
export default queryConnect({
|
|
354
361
|
timeseriesCol: function timeseriesCol(props) {
|
|
355
362
|
return makeQueryFromProps(props);
|
|
356
363
|
}
|
|
357
|
-
})(
|
|
364
|
+
})(DataGeoDataCardWithRealtime);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import logger from './logger';
|
|
2
2
|
import { konnectorPolicy as biWebViewPolicy } from './policies/biWebView';
|
|
3
|
-
import { konnectorPolicy as biKonnectorPolicy } from './policies/budget-insight';
|
|
4
3
|
import { konnectorPolicy as cliskPolicy } from './policies/clisk';
|
|
5
4
|
var defaultKonnectorPolicy = {
|
|
6
5
|
accountContainsAuth: true,
|
|
@@ -35,7 +34,7 @@ var defaultKonnectorPolicy = {
|
|
|
35
34
|
return false;
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
|
-
var policies = [cliskPolicy, biWebViewPolicy,
|
|
37
|
+
var policies = [cliskPolicy, biWebViewPolicy, defaultKonnectorPolicy].filter(Boolean);
|
|
39
38
|
logger.info('Available konnector policies', policies);
|
|
40
39
|
/**
|
|
41
40
|
* Find the konnector policy corresponding to the given konnector
|
package/dist/locales/nl_NL.json
CHANGED
|
@@ -21,7 +21,18 @@
|
|
|
21
21
|
"installFlagship": {
|
|
22
22
|
"label": "Installeer Cozy op je telefoon"
|
|
23
23
|
},
|
|
24
|
-
"
|
|
24
|
+
"cannotConnectModal": {
|
|
25
|
+
"title": "Kun je geen verbinding maken?",
|
|
26
|
+
"content": "Controleer je inloggegevens of herstel je wachtwoord op de website van [%{vendorName}](%{vendorLink}).",
|
|
27
|
+
"noAccount": "Als je nog geen account hebt, maak die dan aan op de website van [%{vendorName}](%{vendorLink})."
|
|
28
|
+
},
|
|
29
|
+
"cannotConnectLink": "Ik kan geen verbinding maken",
|
|
30
|
+
"notClientSide": "Installeer de Cozy-app op je telefoon of tablet om je %{name}-gegevens te synchroniseren.",
|
|
31
|
+
"clientSide": {
|
|
32
|
+
"title": "Koppelen aan mijn Cozy",
|
|
33
|
+
"submit": "Koppelen",
|
|
34
|
+
"description": "Koppel %{name} aan je Cozy om te synchroniseren met je account en automatisch al je gegevens op te halen."
|
|
35
|
+
}
|
|
25
36
|
},
|
|
26
37
|
"contracts": {
|
|
27
38
|
"headers": {
|
|
@@ -70,8 +81,11 @@
|
|
|
70
81
|
"card": {
|
|
71
82
|
"launchTrigger": {
|
|
72
83
|
"button": {
|
|
73
|
-
"label": "
|
|
84
|
+
"label": "Synchroniseren"
|
|
74
85
|
},
|
|
86
|
+
"configure": "Instellen",
|
|
87
|
+
"connect": "Koppelen",
|
|
88
|
+
"success": "De synchronisatie is voltooid",
|
|
75
89
|
"error": "Er is een fout opgetreden.",
|
|
76
90
|
"frequency": {
|
|
77
91
|
"label": "Frequentie:",
|
|
@@ -83,10 +97,17 @@
|
|
|
83
97
|
},
|
|
84
98
|
"lastSync": {
|
|
85
99
|
"label": "Bijwerken:",
|
|
86
|
-
"syncing": "
|
|
100
|
+
"syncing": "Gegevensherstel…",
|
|
87
101
|
"unknown": "Onbekend",
|
|
88
|
-
"afterSomeTimes": "
|
|
89
|
-
"
|
|
102
|
+
"afterSomeTimes": "%{times} geleden gesynchroniseerd",
|
|
103
|
+
"format": "DD-MM-YYYY",
|
|
104
|
+
"disconnected": "Losgekoppeld",
|
|
105
|
+
"justNow": "Zojuist gesynchroniseerd"
|
|
106
|
+
},
|
|
107
|
+
"runningAlert": {
|
|
108
|
+
"title": "Sluit de app niet!",
|
|
109
|
+
"body": "De telefoon moet aan blijven om het proces te kunnen voltooien. Je kunt echter gebruik blijven maken van de app.",
|
|
110
|
+
"button": "Ik begrijp het"
|
|
90
111
|
}
|
|
91
112
|
},
|
|
92
113
|
"appLink": {
|
|
@@ -125,6 +146,7 @@
|
|
|
125
146
|
"baseDir": "/Administratief"
|
|
126
147
|
},
|
|
127
148
|
"error": {
|
|
149
|
+
"application-not-found": "Deze app bestaat niet",
|
|
128
150
|
"reconnect-via-form": "Opnieuw koppelen",
|
|
129
151
|
"job": {
|
|
130
152
|
"DISK_QUOTA_EXCEEDED": {
|
|
@@ -217,7 +239,7 @@
|
|
|
217
239
|
},
|
|
218
240
|
"ACCOUNT_WITH_SAME_IDENTIFIER_ALREADY_DEFINED": {
|
|
219
241
|
"title": "Dit account is al toegevoegd",
|
|
220
|
-
"description": "Je
|
|
242
|
+
"description": "Je mogelijke aanpassing aan de accountlijst wordt binnen een paar minuten doorgevoerd."
|
|
221
243
|
}
|
|
222
244
|
}
|
|
223
245
|
},
|
|
@@ -381,6 +403,11 @@
|
|
|
381
403
|
"title": "%{name} koppelen",
|
|
382
404
|
"button": "Account toevoegen"
|
|
383
405
|
},
|
|
406
|
+
"deleteBIConnection": {
|
|
407
|
+
"title": "Loskoppelen",
|
|
408
|
+
"description": "Je verzoek is genoteerd en wordt over enkele ogenblikken uitgevoerd. Eerder geïmporteerde gegevens worden niet verwijderd.",
|
|
409
|
+
"confirm-deletion": "Sluiten"
|
|
410
|
+
},
|
|
384
411
|
"deleteAccount": {
|
|
385
412
|
"title": "Loskoppelen",
|
|
386
413
|
"description": "Je account wordt losgekoppeld, maar belangrijke gegevens worden bewaard",
|
|
@@ -407,7 +434,10 @@
|
|
|
407
434
|
"label": "Opnieuw koppelen"
|
|
408
435
|
},
|
|
409
436
|
"connect": {
|
|
410
|
-
"
|
|
437
|
+
"description": "Koppel %{name} aan je Cozy om te synchroniseren met je account en automatisch al je gegevens op te halen.",
|
|
438
|
+
"label": "Koppelen",
|
|
439
|
+
"submit": "Koppelen",
|
|
440
|
+
"title": "Koppelen aan mijn Cozy"
|
|
411
441
|
},
|
|
412
442
|
"window": {
|
|
413
443
|
"title": "OAuth"
|
|
@@ -511,6 +541,10 @@
|
|
|
511
541
|
"secondaryText": "Annuleren"
|
|
512
542
|
}
|
|
513
543
|
},
|
|
544
|
+
"connectionBackdrop": {
|
|
545
|
+
"connecting": "Bezig met verbinden…",
|
|
546
|
+
"progress": "We zoeken %{name} op - dit kan max. 30 seconden duren…"
|
|
547
|
+
},
|
|
514
548
|
"disconnectedAccountModal": {
|
|
515
549
|
"disconnected-help": "Dit account is losgekoppeld, maar je gegevens zijn bewaard. Als je opnieuw wilt synchroniseren, stel dan je account opnieuw in middels de knop 'Bank toevoegen'."
|
|
516
550
|
},
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
+
|
|
4
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
10
|
|
|
6
11
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -9,10 +14,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9
14
|
|
|
10
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
16
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
17
|
import EventEmitter from 'events';
|
|
17
18
|
import { waitFor } from '@testing-library/react';
|
|
18
19
|
import { Q } from 'cozy-client';
|
|
@@ -23,7 +24,6 @@ import fixtures from '../../test/fixtures';
|
|
|
23
24
|
import { saveAccount } from '../connections/accounts';
|
|
24
25
|
import { createTrigger, ensureTrigger, fetchTrigger, prepareTriggerAccount, launchTrigger } from '../connections/triggers';
|
|
25
26
|
import { KonnectorJobError } from '../helpers/konnectors';
|
|
26
|
-
import { konnectorPolicy as biKonnectorPolicy } from '../policies/budget-insight';
|
|
27
27
|
import sentryHub from '../sentry';
|
|
28
28
|
jest.mock('./konnector/KonnectorJobWatcher');
|
|
29
29
|
jest.mock('../sentry', function () {
|
|
@@ -43,14 +43,6 @@ jest.mock('../connections/files', function () {
|
|
|
43
43
|
createDirectoryByPath: jest.fn()
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
jest.mock('../policies/budget-insight', function () {
|
|
47
|
-
var originalBudgetInsight = jest.requireActual('../policies/budget-insight');
|
|
48
|
-
return {
|
|
49
|
-
konnectorPolicy: _objectSpread(_objectSpread({}, originalBudgetInsight.konnectorPolicy), {}, {
|
|
50
|
-
onAccountCreation: jest.fn()
|
|
51
|
-
})
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
46
|
KonnectorJobWatcher.prototype.watch = jest.fn();
|
|
55
47
|
jest.mock('date-fns');
|
|
56
48
|
var realtimeMock = {
|
|
@@ -1237,15 +1229,8 @@ describe('ConnectionFlow', function () {
|
|
|
1237
1229
|
|
|
1238
1230
|
var bankingAccount = _objectSpread(_objectSpread({}, fixtures.existingAccount), fixtures.bankingKonnectorAccountAttributes);
|
|
1239
1231
|
|
|
1240
|
-
var onAccountCreationResult = {
|
|
1241
|
-
auth: {
|
|
1242
|
-
bi: {
|
|
1243
|
-
connId: 7
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
};
|
|
1247
1232
|
it('should use custom konnector policy', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
1248
|
-
var _setup33, flow
|
|
1233
|
+
var _setup33, flow;
|
|
1249
1234
|
|
|
1250
1235
|
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1251
1236
|
while (1) {
|
|
@@ -1256,25 +1241,21 @@ describe('ConnectionFlow', function () {
|
|
|
1256
1241
|
_id: fixtures.updatedAccount._id
|
|
1257
1242
|
});
|
|
1258
1243
|
});
|
|
1259
|
-
biKonnectorPolicy.onAccountCreation.mockReset().mockReturnValue(onAccountCreationResult);
|
|
1260
1244
|
_setup33 = setup({
|
|
1261
1245
|
konnector: bankingKonnector
|
|
1262
|
-
}), flow = _setup33.flow
|
|
1246
|
+
}), flow = _setup33.flow;
|
|
1263
1247
|
jest.spyOn(flow, 'launch');
|
|
1264
|
-
_context31.next =
|
|
1248
|
+
_context31.next = 5;
|
|
1265
1249
|
return setupSubmit(flow, {
|
|
1266
1250
|
konnector: bankingKonnector,
|
|
1267
1251
|
account: bankingAccount,
|
|
1268
1252
|
userCredentials: fixtures.bankingKonnectorAccountAttributes.auth
|
|
1269
1253
|
});
|
|
1270
1254
|
|
|
1271
|
-
case
|
|
1272
|
-
expect(biKonnectorPolicy.onAccountCreation).toHaveBeenCalledTimes(1);
|
|
1273
|
-
expect(ensureTrigger).toHaveBeenCalledTimes(1);
|
|
1255
|
+
case 5:
|
|
1274
1256
|
expect(flow.launch).toHaveBeenCalledTimes(1);
|
|
1275
|
-
expect(saveAccount).toHaveBeenCalledWith(client, flow.konnector, onAccountCreationResult);
|
|
1276
1257
|
|
|
1277
|
-
case
|
|
1258
|
+
case 6:
|
|
1278
1259
|
case "end":
|
|
1279
1260
|
return _context31.stop();
|
|
1280
1261
|
}
|