cozy-harvest-lib 7.3.7 → 8.0.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,23 @@
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
+ # [8.0.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@7.3.7...cozy-harvest-lib@8.0.0) (2022-04-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cozy-harvest-lib:** Correctly handle AppLinker's onClick ([b45b2e9](https://github.com/cozy/cozy-libs/commit/b45b2e9942635bf36a78bcbf9ac3f8eacdd1fde2)), closes [cozy/cozy-ui#2015](https://github.com/cozy/cozy-ui/issues/2015)
12
+ * **cozy-harvest-lib:** Replace deprecated usage of slug in AppLinker ([24b33d7](https://github.com/cozy/cozy-libs/commit/24b33d7cf3fe26339a00d6f5279d5e92adc71bc5)), closes [cozy/cozy-ui#2015](https://github.com/cozy/cozy-ui/issues/2015)
13
+
14
+
15
+ ### BREAKING CHANGES
16
+
17
+ * **cozy-harvest-lib:** `cozy-harvest-lib` now requires `cozy-ui` version `60.6.0` or superior
18
+
19
+
20
+
21
+
22
+
6
23
  ## [7.3.7](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@7.3.6...cozy-harvest-lib@7.3.7) (2022-04-01)
7
24
 
8
25
 
@@ -18,17 +18,21 @@ var BanksLinkRedirectStore = function BanksLinkRedirectStore(_ref) {
18
18
 
19
19
  if (fetchStatus === 'loaded') {
20
20
  return /*#__PURE__*/React.createElement(AppLinker, {
21
- slug: slug,
21
+ app: {
22
+ slug: slug
23
+ },
22
24
  href: url
23
25
  }, function (_ref2) {
24
26
  var href = _ref2.href,
25
- name = _ref2.name;
27
+ name = _ref2.name,
28
+ onClick = _ref2.onClick;
26
29
  return /*#__PURE__*/React.createElement(ButtonLink, {
27
30
  icon: OpenwithIcon,
28
31
  href: href,
29
32
  label: t('account.success.banksLinkText', {
30
33
  appName: name
31
34
  }),
35
+ onClick: onClick,
32
36
  subtle: true
33
37
  });
34
38
  });
@@ -19,18 +19,22 @@ var DriveLink = /*#__PURE__*/memo(function (_ref) {
19
19
 
20
20
  if (fetchStatus === 'loaded') {
21
21
  return /*#__PURE__*/React.createElement(AppLinker, {
22
- slug: slug,
22
+ app: {
23
+ slug: slug
24
+ },
23
25
  href: url,
24
26
  nativePath: path
25
27
  }, function (_ref2) {
26
28
  var href = _ref2.href,
27
- name = _ref2.name;
29
+ name = _ref2.name,
30
+ onClick = _ref2.onClick;
28
31
  return /*#__PURE__*/React.createElement(ButtonLink, {
29
32
  icon: OpenwithIcon,
30
33
  href: href,
31
34
  label: t('account.success.driveLinkText', {
32
35
  appName: name
33
36
  }),
37
+ onClick: onClick,
34
38
  subtle: true
35
39
  });
36
40
  });
@@ -117,7 +117,9 @@ var KonnectorSuggestionModal = function KonnectorSuggestionModal(_ref) {
117
117
  }), /*#__PURE__*/React.createElement("br", null), t('suggestions.reason_bank', {
118
118
  name: name
119
119
  })), /*#__PURE__*/React.createElement(AppLinker, {
120
- slug: storeAppName,
120
+ app: {
121
+ slug: storeAppName
122
+ },
121
123
  nativePath: nativePath,
122
124
  href: generateWebLink({
123
125
  cozyUrl: cozyURL.origin,
@@ -11,11 +11,13 @@ var KonnectorUpdateButton = function KonnectorUpdateButton(_ref) {
11
11
  var disabled = _ref.disabled,
12
12
  isBlocking = _ref.isBlocking,
13
13
  href = _ref.href,
14
+ onClick = _ref.onClick,
14
15
  label = _ref.label;
15
16
  return /*#__PURE__*/React.createElement(ButtonLink, {
16
17
  disabled: disabled,
17
18
  className: "u-m-0",
18
19
  href: href,
20
+ onClick: onClick,
19
21
  icon: EyeIcon,
20
22
  label: label,
21
23
  theme: isBlocking ? 'danger' : 'secondary'
@@ -35,14 +37,18 @@ var KonnectorUpdateLinker = function KonnectorUpdateLinker(_ref2) {
35
37
  var konnectorUpdateUrl = data ? Application.getStoreInstallationURL(data, konnector) : null;
36
38
  var isReady = isLoaded && konnectorUpdateUrl;
37
39
  return isReady ? /*#__PURE__*/React.createElement(AppLinker, {
38
- slug: "store",
40
+ app: {
41
+ slug: 'store'
42
+ },
39
43
  href: konnectorUpdateUrl
40
44
  }, function (_ref3) {
41
- var href = _ref3.href;
45
+ var onClick = _ref3.onClick,
46
+ href = _ref3.href;
42
47
  return /*#__PURE__*/React.createElement(KonnectorUpdateButton, {
43
48
  href: href,
44
49
  isBlocking: isBlocking,
45
- label: label
50
+ label: label,
51
+ onClick: onClick
46
52
  });
47
53
  }) : /*#__PURE__*/React.createElement(KonnectorUpdateButton, {
48
54
  disabled: true,
@@ -32,7 +32,9 @@ export var AppLinkButton = function AppLinkButton(_ref) {
32
32
  isInstalled = _useAppLinkWithStoreF.isInstalled;
33
33
 
34
34
  return /*#__PURE__*/React.createElement(AppLinker, {
35
- slug: slug,
35
+ app: {
36
+ slug: slug
37
+ },
36
38
  nativePath: path,
37
39
  href: url || '#'
38
40
  }, function (_ref2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "7.3.7",
3
+ "version": "8.0.0",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -57,7 +57,7 @@
57
57
  "cozy-flags": "^2.8.7",
58
58
  "cozy-keys-lib": "3.8.0",
59
59
  "cozy-realtime": "^4.0.5",
60
- "cozy-ui": "57.6.0",
60
+ "cozy-ui": "60.6.0",
61
61
  "enzyme": "3.11.0",
62
62
  "enzyme-adapter-react-16": "1.15.6",
63
63
  "form-data": "3.0.0",
@@ -80,10 +80,10 @@
80
80
  "cozy-flags": ">=2.3.5",
81
81
  "cozy-keys-lib": ">=3.7.0",
82
82
  "cozy-realtime": ">=3.12.2",
83
- "cozy-ui": ">=57.6.0",
83
+ "cozy-ui": ">=60.6.0",
84
84
  "leaflet": "^1.7.1",
85
85
  "react-router-dom": "^5.0.1"
86
86
  },
87
87
  "sideEffects": false,
88
- "gitHead": "f0cc87a62171e60b8ec8e15aa92fd17db81c9921"
88
+ "gitHead": "a4b773ebd70147cfebfb8ac474205cabd23d3ef5"
89
89
  }
@@ -15,14 +15,15 @@ const BanksLinkRedirectStore = ({ client, t }) => {
15
15
 
16
16
  if (fetchStatus === 'loaded') {
17
17
  return (
18
- <AppLinker slug={slug} href={url}>
19
- {({ href, name }) => (
18
+ <AppLinker app={{ slug }} href={url}>
19
+ {({ href, name, onClick }) => (
20
20
  <ButtonLink
21
21
  icon={OpenwithIcon}
22
22
  href={href}
23
23
  label={t('account.success.banksLinkText', {
24
24
  appName: name
25
25
  })}
26
+ onClick={onClick}
26
27
  subtle
27
28
  />
28
29
  )}
@@ -15,14 +15,15 @@ const DriveLink = memo(({ folderId, client, t }) => {
15
15
 
16
16
  if (fetchStatus === 'loaded') {
17
17
  return (
18
- <AppLinker slug={slug} href={url} nativePath={path}>
19
- {({ href, name }) => (
18
+ <AppLinker app={{ slug }} href={url} nativePath={path}>
19
+ {({ href, name, onClick }) => (
20
20
  <ButtonLink
21
21
  icon={OpenwithIcon}
22
22
  href={href}
23
23
  label={t('account.success.driveLinkText', {
24
24
  appName: name
25
25
  })}
26
+ onClick={onClick}
26
27
  subtle
27
28
  />
28
29
  )}
@@ -85,7 +85,7 @@ const KonnectorSuggestionModal = ({
85
85
  </Typography>
86
86
  )}
87
87
  <AppLinker
88
- slug={storeAppName}
88
+ app={{ slug: storeAppName }}
89
89
  nativePath={nativePath}
90
90
  href={generateWebLink({
91
91
  cozyUrl: cozyURL.origin,
@@ -9,11 +9,18 @@ import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
9
9
  import { Application } from 'cozy-doctypes'
10
10
  import { appsConn } from '../connections/apps'
11
11
 
12
- const KonnectorUpdateButton = ({ disabled, isBlocking, href, label }) => (
12
+ const KonnectorUpdateButton = ({
13
+ disabled,
14
+ isBlocking,
15
+ href,
16
+ onClick,
17
+ label
18
+ }) => (
13
19
  <ButtonLink
14
20
  disabled={disabled}
15
21
  className="u-m-0"
16
22
  href={href}
23
+ onClick={onClick}
17
24
  icon={EyeIcon}
18
25
  label={label}
19
26
  theme={isBlocking ? 'danger' : 'secondary'}
@@ -29,13 +36,14 @@ const KonnectorUpdateLinker = ({ label, isBlocking, konnector }) => {
29
36
  const isReady = isLoaded && konnectorUpdateUrl
30
37
 
31
38
  return isReady ? (
32
- <AppLinker slug="store" href={konnectorUpdateUrl}>
33
- {({ href }) => {
39
+ <AppLinker app={{ slug: 'store' }} href={konnectorUpdateUrl}>
40
+ {({ onClick, href }) => {
34
41
  return (
35
42
  <KonnectorUpdateButton
36
43
  href={href}
37
44
  isBlocking={isBlocking}
38
45
  label={label}
46
+ onClick={onClick}
39
47
  />
40
48
  )
41
49
  }}
@@ -25,7 +25,7 @@ export const AppLinkButton = ({ slug, path }) => {
25
25
  path
26
26
  )
27
27
  return (
28
- <AppLinker slug={slug} nativePath={path} href={url || '#'}>
28
+ <AppLinker app={{ slug }} nativePath={path} href={url || '#'}>
29
29
  {({ onClick, href }) => (
30
30
  <ButtonLink
31
31
  onClick={fetchStatus !== 'loaded' ? onClick : null}