cozy-harvest-lib 20.2.1 → 20.2.3
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
|
+
## [20.2.3](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@20.2.2...cozy-harvest-lib@20.2.3) (2023-11-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **harvest:** Wrap SuggestionModal with theme ([f188a1b](https://github.com/cozy/cozy-libs/commit/f188a1b623a3262e8c97852c71d4315317a8e334))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [20.2.2](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@20.2.1...cozy-harvest-lib@20.2.2) (2023-11-15)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **harvest:** Add DialogTitle to SuggestionModal ([11a1823](https://github.com/cozy/cozy-libs/commit/11a182376faeb3d8e83179c3e47e60f0089a5aea))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [20.2.1](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@20.2.0...cozy-harvest-lib@20.2.1) (2023-11-13)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -9,32 +9,29 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React, { useState } from 'react';
|
|
12
|
-
import {
|
|
13
|
-
import AppLinker
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme';
|
|
12
|
+
import { generateWebLink, useClient } from 'cozy-client';
|
|
13
|
+
import AppLinker from 'cozy-ui/transpiled/react/AppLinker';
|
|
14
|
+
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
15
|
+
import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
17
16
|
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { translate } from 'cozy-ui/transpiled/react/providers/I18n';
|
|
17
|
+
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme';
|
|
18
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
|
|
21
19
|
import DataTypes from './DataTypes';
|
|
22
20
|
import Illustration from './Illustration';
|
|
23
21
|
import { getSuggestionReason } from '../../helpers/appSuggestions';
|
|
24
22
|
import { getDataTypes, getKonnectorName } from '../../helpers/manifest';
|
|
25
23
|
|
|
26
24
|
var KonnectorSuggestionModal = function KonnectorSuggestionModal(_ref) {
|
|
27
|
-
var
|
|
28
|
-
client = _ref.client,
|
|
29
|
-
konnectorAppSuggestion = _ref.konnectorAppSuggestion,
|
|
25
|
+
var konnectorAppSuggestion = _ref.konnectorAppSuggestion,
|
|
30
26
|
konnectorManifest = _ref.konnectorManifest,
|
|
31
27
|
onClose = _ref.onClose,
|
|
32
28
|
onSilence = _ref.onSilence;
|
|
29
|
+
var slug = konnectorAppSuggestion.slug;
|
|
30
|
+
var client = useClient();
|
|
33
31
|
|
|
34
|
-
var
|
|
35
|
-
|
|
32
|
+
var _useI18n = useI18n(),
|
|
33
|
+
t = _useI18n.t;
|
|
36
34
|
|
|
37
|
-
var slug = konnectorAppSuggestion.slug;
|
|
38
35
|
var cozyURL = new URL(client.getStackClient().uri);
|
|
39
36
|
var storeAppName = 'store';
|
|
40
37
|
var nativePath = "/discover/".concat(slug);
|
|
@@ -85,73 +82,65 @@ var KonnectorSuggestionModal = function KonnectorSuggestionModal(_ref) {
|
|
|
85
82
|
};
|
|
86
83
|
}();
|
|
87
84
|
|
|
88
|
-
return /*#__PURE__*/React.createElement(
|
|
85
|
+
return /*#__PURE__*/React.createElement(CozyTheme, {
|
|
86
|
+
variant: "normal"
|
|
87
|
+
}, /*#__PURE__*/React.createElement(IllustrationDialog, {
|
|
89
88
|
open: true,
|
|
90
89
|
onClose: onClose,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "u-flex u-flex-column u-flex-items-center u-h-100"
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Illustration, {
|
|
93
|
+
alt: t('app.logo.alt', {
|
|
94
|
+
name: name
|
|
95
|
+
}),
|
|
96
|
+
app: slug
|
|
97
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
98
|
+
className: "u-mb-half",
|
|
99
|
+
variant: "h4"
|
|
100
|
+
}, t('suggestions.title', {
|
|
101
|
+
name: name
|
|
102
|
+
})), /*#__PURE__*/React.createElement(DataTypes, {
|
|
103
|
+
dataTypes: dataTypes,
|
|
104
|
+
konnectorName: name
|
|
105
|
+
}), reason === 'FOUND_TRANSACTION' && /*#__PURE__*/React.createElement(Typography, {
|
|
106
|
+
className: "u-mb-1 u-ta-center u-mt-auto",
|
|
107
|
+
variant: "caption",
|
|
108
|
+
color: "textSecondary"
|
|
109
|
+
}, t('suggestions.why', {
|
|
101
110
|
name: name
|
|
102
|
-
}),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
})), /*#__PURE__*/React.createElement(DataTypes, {
|
|
110
|
-
dataTypes: dataTypes,
|
|
111
|
-
konnectorName: name
|
|
112
|
-
}))), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement("div", {
|
|
113
|
-
className: "u-flex u-flex-column u-flex-items-center u-w-100"
|
|
114
|
-
}, reason === 'FOUND_TRANSACTION' && /*#__PURE__*/React.createElement(Typography, {
|
|
115
|
-
className: "u-mb-1",
|
|
116
|
-
variant: "caption",
|
|
117
|
-
color: "textSecondary"
|
|
118
|
-
}, t('suggestions.why', {
|
|
119
|
-
name: name
|
|
120
|
-
}), /*#__PURE__*/React.createElement("br", null), t('suggestions.reason_bank', {
|
|
121
|
-
name: name
|
|
122
|
-
})), /*#__PURE__*/React.createElement(AppLinker, {
|
|
123
|
-
app: {
|
|
124
|
-
slug: storeAppName
|
|
125
|
-
},
|
|
126
|
-
nativePath: nativePath,
|
|
127
|
-
href: generateWebLink({
|
|
128
|
-
cozyUrl: cozyURL.origin,
|
|
129
|
-
slug: storeAppName,
|
|
111
|
+
}), /*#__PURE__*/React.createElement("br", null), t('suggestions.reason_bank', {
|
|
112
|
+
name: name
|
|
113
|
+
}))),
|
|
114
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppLinker, {
|
|
115
|
+
app: {
|
|
116
|
+
slug: storeAppName
|
|
117
|
+
},
|
|
130
118
|
nativePath: nativePath,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
119
|
+
href: generateWebLink({
|
|
120
|
+
cozyUrl: cozyURL.origin,
|
|
121
|
+
slug: storeAppName,
|
|
122
|
+
nativePath: nativePath,
|
|
123
|
+
subDomainType: subDomainType
|
|
124
|
+
})
|
|
125
|
+
}, function (_ref3) {
|
|
126
|
+
var onClick = _ref3.onClick,
|
|
127
|
+
href = _ref3.href;
|
|
128
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
129
|
+
href: href,
|
|
130
|
+
onClick: onClick,
|
|
131
|
+
label: t('suggestions.install'),
|
|
132
|
+
variant: "primary"
|
|
133
|
+
});
|
|
134
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
135
|
+
variant: "secondary",
|
|
136
|
+
label: t('suggestions.silence'),
|
|
137
|
+
onClick: silenceSuggestion,
|
|
138
|
+
busy: isSilencing
|
|
139
|
+
}))
|
|
140
|
+
}));
|
|
150
141
|
};
|
|
151
142
|
|
|
152
143
|
KonnectorSuggestionModal.propTypes = {
|
|
153
|
-
t: PropTypes.func.isRequired,
|
|
154
|
-
client: PropTypes.object.isRequired,
|
|
155
144
|
konnectorAppSuggestion: PropTypes.shape({
|
|
156
145
|
// io.cozy.apps.suggestions, see https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.apps.suggestions.md
|
|
157
146
|
slug: PropTypes.string,
|
|
@@ -167,4 +156,4 @@ KonnectorSuggestionModal.propTypes = {
|
|
|
167
156
|
onClose: PropTypes.func.isRequired,
|
|
168
157
|
onSilence: PropTypes.func.isRequired
|
|
169
158
|
};
|
|
170
|
-
export default
|
|
159
|
+
export default KonnectorSuggestionModal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-harvest-lib",
|
|
3
|
-
"version": "20.2.
|
|
3
|
+
"version": "20.2.3",
|
|
4
4
|
"description": "Provides logic, modules and components for Cozy's harvest applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-router-dom": ">=4.3.1"
|
|
113
113
|
},
|
|
114
114
|
"sideEffects": false,
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "3164146a21d9137b145a3ed37d466e57acb4f63c"
|
|
116
116
|
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import AppLinker
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
DialogActions,
|
|
9
|
-
DialogContent
|
|
10
|
-
} from 'cozy-ui/transpiled/react/Dialog'
|
|
11
|
-
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme'
|
|
4
|
+
import { generateWebLink, useClient } from 'cozy-client'
|
|
5
|
+
import AppLinker from 'cozy-ui/transpiled/react/AppLinker'
|
|
6
|
+
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
7
|
+
import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
12
8
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { translate } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
9
|
+
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme'
|
|
10
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
16
11
|
|
|
17
12
|
import DataTypes from './DataTypes'
|
|
18
13
|
import Illustration from './Illustration'
|
|
@@ -20,15 +15,14 @@ import { getSuggestionReason } from '../../helpers/appSuggestions'
|
|
|
20
15
|
import { getDataTypes, getKonnectorName } from '../../helpers/manifest'
|
|
21
16
|
|
|
22
17
|
const KonnectorSuggestionModal = ({
|
|
23
|
-
t,
|
|
24
|
-
client,
|
|
25
18
|
konnectorAppSuggestion,
|
|
26
19
|
konnectorManifest,
|
|
27
20
|
onClose,
|
|
28
21
|
onSilence
|
|
29
22
|
}) => {
|
|
30
|
-
const { isMobile } = useBreakpoints()
|
|
31
23
|
const { slug } = konnectorAppSuggestion
|
|
24
|
+
const client = useClient()
|
|
25
|
+
const { t } = useI18n()
|
|
32
26
|
const cozyURL = new URL(client.getStackClient().uri)
|
|
33
27
|
const storeAppName = 'store'
|
|
34
28
|
const nativePath = `/discover/${slug}`
|
|
@@ -50,38 +44,37 @@ const KonnectorSuggestionModal = ({
|
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
return (
|
|
53
|
-
<
|
|
54
|
-
<
|
|
47
|
+
<CozyTheme variant="normal">
|
|
48
|
+
<IllustrationDialog
|
|
55
49
|
open
|
|
56
50
|
onClose={onClose}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
maxWidth="sm"
|
|
60
|
-
scroll="body"
|
|
61
|
-
>
|
|
62
|
-
<DialogCloseButton onClick={onClose} />
|
|
63
|
-
<DialogContent>
|
|
64
|
-
<div className="u-flex u-flex-column u-flex-items-center">
|
|
51
|
+
content={
|
|
52
|
+
<div className="u-flex u-flex-column u-flex-items-center u-h-100">
|
|
65
53
|
<Illustration alt={t('app.logo.alt', { name })} app={slug} />
|
|
54
|
+
|
|
66
55
|
<Typography className="u-mb-half" variant="h4">
|
|
67
56
|
{t('suggestions.title', { name })}
|
|
68
57
|
</Typography>
|
|
58
|
+
|
|
69
59
|
<DataTypes dataTypes={dataTypes} konnectorName={name} />
|
|
70
|
-
|
|
71
|
-
</DialogContent>
|
|
72
|
-
<DialogActions>
|
|
73
|
-
<div className="u-flex u-flex-column u-flex-items-center u-w-100">
|
|
60
|
+
|
|
74
61
|
{reason === 'FOUND_TRANSACTION' && (
|
|
75
62
|
<Typography
|
|
76
|
-
className="u-mb-1"
|
|
63
|
+
className="u-mb-1 u-ta-center u-mt-auto"
|
|
77
64
|
variant="caption"
|
|
78
65
|
color="textSecondary"
|
|
79
66
|
>
|
|
80
67
|
{t('suggestions.why', { name })}
|
|
68
|
+
|
|
81
69
|
<br />
|
|
70
|
+
|
|
82
71
|
{t('suggestions.reason_bank', { name })}
|
|
83
72
|
</Typography>
|
|
84
73
|
)}
|
|
74
|
+
</div>
|
|
75
|
+
}
|
|
76
|
+
actions={
|
|
77
|
+
<>
|
|
85
78
|
<AppLinker
|
|
86
79
|
app={{ slug: storeAppName }}
|
|
87
80
|
nativePath={nativePath}
|
|
@@ -93,32 +86,29 @@ const KonnectorSuggestionModal = ({
|
|
|
93
86
|
})}
|
|
94
87
|
>
|
|
95
88
|
{({ onClick, href }) => (
|
|
96
|
-
<
|
|
97
|
-
onClick={onClick}
|
|
89
|
+
<Button
|
|
98
90
|
href={href}
|
|
91
|
+
onClick={onClick}
|
|
99
92
|
label={t('suggestions.install')}
|
|
100
|
-
|
|
101
|
-
className="u-mb-half"
|
|
93
|
+
variant="primary"
|
|
102
94
|
/>
|
|
103
95
|
)}
|
|
104
96
|
</AppLinker>
|
|
97
|
+
|
|
105
98
|
<Button
|
|
106
|
-
|
|
99
|
+
variant="secondary"
|
|
107
100
|
label={t('suggestions.silence')}
|
|
108
101
|
onClick={silenceSuggestion}
|
|
109
102
|
busy={isSilencing}
|
|
110
|
-
extension="full"
|
|
111
103
|
/>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</
|
|
104
|
+
</>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
</CozyTheme>
|
|
116
108
|
)
|
|
117
109
|
}
|
|
118
110
|
|
|
119
111
|
KonnectorSuggestionModal.propTypes = {
|
|
120
|
-
t: PropTypes.func.isRequired,
|
|
121
|
-
client: PropTypes.object.isRequired,
|
|
122
112
|
konnectorAppSuggestion: PropTypes.shape({
|
|
123
113
|
// io.cozy.apps.suggestions, see https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.apps.suggestions.md
|
|
124
114
|
slug: PropTypes.string,
|
|
@@ -135,4 +125,4 @@ KonnectorSuggestionModal.propTypes = {
|
|
|
135
125
|
onSilence: PropTypes.func.isRequired
|
|
136
126
|
}
|
|
137
127
|
|
|
138
|
-
export default
|
|
128
|
+
export default KonnectorSuggestionModal
|