cozy-harvest-lib 12.5.2 → 12.7.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 CHANGED
@@ -3,6 +3,28 @@
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
+ # 12.7.0 (2023-01-31)
7
+
8
+
9
+ ### Features
10
+
11
+ * Update cozy-client and cozy-ui ([6ae3b04](https://github.com/cozy/cozy-libs/commit/6ae3b04925ae64fa30f3ec8b6e716453d0a630fe))
12
+
13
+
14
+
15
+
16
+
17
+ # [12.6.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@12.5.2...cozy-harvest-lib@12.6.0) (2023-01-31)
18
+
19
+
20
+ ### Features
21
+
22
+ * Remove the ability to close the connection backdrop ([22ab2d2](https://github.com/cozy/cozy-libs/commit/22ab2d27a46c9ea68f5007b77f340594f5283025))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [12.5.2](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@12.5.1...cozy-harvest-lib@12.5.2) (2023-01-27)
7
29
 
8
30
 
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
- import cx from 'classnames';
3
2
  import { makeStyles } from 'cozy-ui/transpiled/react/styles';
4
3
  import { useI18n } from 'cozy-ui/transpiled/react/I18n';
5
4
  import Backdrop from 'cozy-ui/transpiled/react/Backdrop';
6
- import Icon from 'cozy-ui/transpiled/react/Icon';
7
- import IconButton from 'cozy-ui/transpiled/react/IconButton';
8
- import CrossMediumIcon from 'cozy-ui/transpiled/react/Icons/CrossMedium';
9
5
  import LinearProgress from 'cozy-ui/transpiled/react/LinearProgress';
10
6
  import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme';
11
7
  import Typography from 'cozy-ui/transpiled/react/Typography';
@@ -14,15 +10,11 @@ var useStyles = makeStyles({
14
10
  position: 'fixed',
15
11
  zIndex: 'var(--zIndex-modal)',
16
12
  inset: 0
17
- },
18
- iconButton: {
19
- position: 'absolute'
20
13
  }
21
14
  });
22
15
 
23
16
  var ConnectionBackdrop = function ConnectionBackdrop(_ref) {
24
- var name = _ref.name,
25
- onClose = _ref.onClose;
17
+ var name = _ref.name;
26
18
  var styles = useStyles();
27
19
 
28
20
  var _useI18n = useI18n(),
@@ -35,13 +27,7 @@ var ConnectionBackdrop = function ConnectionBackdrop(_ref) {
35
27
  }, /*#__PURE__*/React.createElement(Backdrop, {
36
28
  open: true,
37
29
  className: "u-p-2"
38
- }, /*#__PURE__*/React.createElement(IconButton, {
39
- size: "large",
40
- onClick: onClose,
41
- className: cx('u-right-0 u-top-0 u-m-1 u-m-0-s', styles.iconButton)
42
- }, /*#__PURE__*/React.createElement(Icon, {
43
- icon: CrossMediumIcon
44
- })), /*#__PURE__*/React.createElement("div", {
30
+ }, /*#__PURE__*/React.createElement("div", {
45
31
  className: "u-w-6 u-w-100-s"
46
32
  }, /*#__PURE__*/React.createElement(Typography, {
47
33
  variant: "h4",
@@ -88,8 +88,7 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
88
88
 
89
89
  _this.state = {
90
90
  showConfirmationModal: false,
91
- showCannotConnectModal: false,
92
- showConnectionBackdrop: false
91
+ showCannotConnectModal: false
93
92
  };
94
93
  _this.inputs = {};
95
94
  _this.inputFocused = null;
@@ -101,8 +100,6 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
101
100
  _this.hideConfirmationModal = _this.hideConfirmationModal.bind(_assertThisInitialized(_this));
102
101
  _this.showCannotConnectModal = _this.showCannotConnectModal.bind(_assertThisInitialized(_this));
103
102
  _this.hideCannotConnectModal = _this.hideCannotConnectModal.bind(_assertThisInitialized(_this));
104
- _this.showConnectionBackdrop = _this.showConnectionBackdrop.bind(_assertThisInitialized(_this));
105
- _this.hideConnectionBackdrop = _this.hideConnectionBackdrop.bind(_assertThisInitialized(_this));
106
103
  return _this;
107
104
  }
108
105
  /**
@@ -221,7 +218,6 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
221
218
  form.reset(values);
222
219
  onSubmit(values);
223
220
  this.hideConfirmationModal();
224
- this.showConnectionBackdrop();
225
221
  }
226
222
  /**
227
223
  * Callback passed to `<AccountFields />` element. Called with a field name,
@@ -279,24 +275,6 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
279
275
  });
280
276
  });
281
277
  }
282
- }, {
283
- key: "showConnectionBackdrop",
284
- value: function showConnectionBackdrop() {
285
- this.setState(function (prev) {
286
- return _objectSpread(_objectSpread({}, prev), {}, {
287
- showConnectionBackdrop: true
288
- });
289
- });
290
- }
291
- }, {
292
- key: "hideConnectionBackdrop",
293
- value: function hideConnectionBackdrop() {
294
- this.setState(function (prev) {
295
- return _objectSpread(_objectSpread({}, prev), {}, {
296
- showConnectionBackdrop: false
297
- });
298
- });
299
- }
300
278
  }, {
301
279
  key: "componentDidMount",
302
280
  value: function componentDidMount() {
@@ -382,7 +360,7 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
382
360
  component: "button",
383
361
  onClick: _this3.showCannotConnectModal
384
362
  }, t('accountForm.cannotConnectLink')), /*#__PURE__*/React.createElement(Button, {
385
- busy: submitting && (!flag('harvest.inappconnectors.enabled') || !_this3.state.showConnectionBackdrop),
363
+ busy: submitting && !flag('harvest.inappconnectors.enabled'),
386
364
  className: "u-mt-2 u-mb-1-half",
387
365
  disabled: submitting || !_this3.isSubmittable({
388
366
  dirty: dirty,
@@ -396,9 +374,8 @@ export var AccountForm = /*#__PURE__*/function (_PureComponent) {
396
374
  return _this3.handleSubmit(values, form);
397
375
  },
398
376
  "data-testid": "submit-btn"
399
- }), submitting && flag('harvest.inappconnectors.enabled') && _this3.state.showConnectionBackdrop && /*#__PURE__*/React.createElement(ConnectionBackdrop, {
400
- name: name,
401
- onClose: _this3.hideConnectionBackdrop
377
+ }), submitting && flag('harvest.inappconnectors.enabled') && /*#__PURE__*/React.createElement(ConnectionBackdrop, {
378
+ name: name
402
379
  })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Media, {
403
380
  align: "top"
404
381
  }, /*#__PURE__*/React.createElement(Img, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "12.5.2",
3
+ "version": "12.7.0",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -29,8 +29,8 @@
29
29
  "@cozy/minilog": "^1.0.0",
30
30
  "@sentry/browser": "^6.0.1",
31
31
  "cozy-bi-auth": "0.0.25",
32
- "cozy-doctypes": "^1.86.1",
33
- "cozy-logger": "^1.9.1",
32
+ "cozy-doctypes": "^1.87.0",
33
+ "cozy-logger": "^1.10.0",
34
34
  "date-fns": "^1.30.1",
35
35
  "final-form": "^4.18.5",
36
36
  "lodash": "^4.17.19",
@@ -45,18 +45,18 @@
45
45
  "@babel/cli": "7.16.8",
46
46
  "@babel/core": "7.16.12",
47
47
  "@babel/register": "7.16.9",
48
- "@cozy/cli-tree": "^0.6.0",
48
+ "@cozy/cli-tree": "^0.7.0",
49
49
  "@testing-library/jest-dom": "5.16.4",
50
50
  "@testing-library/react": "10.4.9",
51
51
  "babel-jest": "26.6.3",
52
52
  "babel-plugin-inline-react-svg": "1.1.2",
53
- "babel-preset-cozy-app": "^2.0.4",
53
+ "babel-preset-cozy-app": "^2.1.0",
54
54
  "cozy-client": "^34.2.0",
55
- "cozy-device-helper": "^2.6.0",
56
- "cozy-flags": "^2.10.2",
57
- "cozy-intent": "^2.7.0",
55
+ "cozy-device-helper": "^2.7.0",
56
+ "cozy-flags": "^2.11.0",
57
+ "cozy-intent": "^2.8.0",
58
58
  "cozy-keys-lib": "^4.1.9",
59
- "cozy-realtime": "^4.2.9",
59
+ "cozy-realtime": "^4.3.0",
60
60
  "cozy-ui": "^77.9.0",
61
61
  "enzyme": "3.11.0",
62
62
  "enzyme-adapter-react-16": "1.15.6",
@@ -88,5 +88,5 @@
88
88
  "react-router-dom": ">=4.3.1"
89
89
  },
90
90
  "sideEffects": false,
91
- "gitHead": "375a7a11c40e30357d6215fa9a05b2a1a7f3c1f4"
91
+ "gitHead": "453292c639960e7a18f51799472d7d1cc06177bb"
92
92
  }
@@ -1,12 +1,8 @@
1
1
  import React from 'react'
2
- import cx from 'classnames'
3
2
 
4
3
  import { makeStyles } from 'cozy-ui/transpiled/react/styles'
5
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
6
5
  import Backdrop from 'cozy-ui/transpiled/react/Backdrop'
7
- import Icon from 'cozy-ui/transpiled/react/Icon'
8
- import IconButton from 'cozy-ui/transpiled/react/IconButton'
9
- import CrossMediumIcon from 'cozy-ui/transpiled/react/Icons/CrossMedium'
10
6
  import LinearProgress from 'cozy-ui/transpiled/react/LinearProgress'
11
7
  import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme'
12
8
  import Typography from 'cozy-ui/transpiled/react/Typography'
@@ -16,13 +12,10 @@ const useStyles = makeStyles({
16
12
  position: 'fixed',
17
13
  zIndex: 'var(--zIndex-modal)',
18
14
  inset: 0
19
- },
20
- iconButton: {
21
- position: 'absolute'
22
15
  }
23
16
  })
24
17
 
25
- const ConnectionBackdrop = ({ name, onClose }) => {
18
+ const ConnectionBackdrop = ({ name }) => {
26
19
  const styles = useStyles()
27
20
  const { t } = useI18n()
28
21
 
@@ -30,13 +23,6 @@ const ConnectionBackdrop = ({ name, onClose }) => {
30
23
  <MuiCozyTheme variant="inverted">
31
24
  <div className={styles.container}>
32
25
  <Backdrop open className="u-p-2">
33
- <IconButton
34
- size="large"
35
- onClick={onClose}
36
- className={cx('u-right-0 u-top-0 u-m-1 u-m-0-s', styles.iconButton)}
37
- >
38
- <Icon icon={CrossMediumIcon} />
39
- </IconButton>
40
26
  <div className="u-w-6 u-w-100-s">
41
27
  <Typography variant="h4" className="u-ta-center">
42
28
  {t('connectionBackdrop.connecting')}
@@ -48,8 +48,7 @@ export class AccountForm extends PureComponent {
48
48
 
49
49
  this.state = {
50
50
  showConfirmationModal: false,
51
- showCannotConnectModal: false,
52
- showConnectionBackdrop: false
51
+ showCannotConnectModal: false
53
52
  }
54
53
 
55
54
  this.inputs = {}
@@ -63,8 +62,6 @@ export class AccountForm extends PureComponent {
63
62
  this.hideConfirmationModal = this.hideConfirmationModal.bind(this)
64
63
  this.showCannotConnectModal = this.showCannotConnectModal.bind(this)
65
64
  this.hideCannotConnectModal = this.hideCannotConnectModal.bind(this)
66
- this.showConnectionBackdrop = this.showConnectionBackdrop.bind(this)
67
- this.hideConnectionBackdrop = this.hideConnectionBackdrop.bind(this)
68
65
  }
69
66
 
70
67
  /**
@@ -166,7 +163,6 @@ export class AccountForm extends PureComponent {
166
163
  form.reset(values)
167
164
  onSubmit(values)
168
165
  this.hideConfirmationModal()
169
- this.showConnectionBackdrop()
170
166
  }
171
167
 
172
168
  /**
@@ -214,14 +210,6 @@ export class AccountForm extends PureComponent {
214
210
  this.setState(prev => ({ ...prev, showCannotConnectModal: false }))
215
211
  }
216
212
 
217
- showConnectionBackdrop() {
218
- this.setState(prev => ({ ...prev, showConnectionBackdrop: true }))
219
- }
220
-
221
- hideConnectionBackdrop() {
222
- this.setState(prev => ({ ...prev, showConnectionBackdrop: false }))
223
- }
224
-
225
213
  manageSecretFieldOptions = () => {
226
214
  const secretFieldOptions = this.props.fieldOptions
227
215
  const secretInput = this.inputs[SECRET]
@@ -326,11 +314,7 @@ export class AccountForm extends PureComponent {
326
314
  </Link>
327
315
  )}
328
316
  <Button
329
- busy={
330
- submitting &&
331
- (!flag('harvest.inappconnectors.enabled') ||
332
- !this.state.showConnectionBackdrop)
333
- }
317
+ busy={submitting && !flag('harvest.inappconnectors.enabled')}
334
318
  className="u-mt-2 u-mb-1-half"
335
319
  disabled={
336
320
  submitting ||
@@ -341,14 +325,9 @@ export class AccountForm extends PureComponent {
341
325
  onClick={() => this.handleSubmit(values, form)}
342
326
  data-testid="submit-btn"
343
327
  />
344
- {submitting &&
345
- flag('harvest.inappconnectors.enabled') &&
346
- this.state.showConnectionBackdrop && (
347
- <ConnectionBackdrop
348
- name={name}
349
- onClose={this.hideConnectionBackdrop}
350
- />
351
- )}
328
+ {submitting && flag('harvest.inappconnectors.enabled') && (
329
+ <ConnectionBackdrop name={name} />
330
+ )}
352
331
  </>
353
332
  ) : (
354
333
  <>