cozy-harvest-lib 12.5.0 → 12.5.2

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,29 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **harvest-lib:** Redirect when close viewer modal ([48445b4](https://github.com/cozy/cozy-libs/commit/48445b4613df85fc702f5f649711a751ff9fca81))
12
+ * **harvest-lib:** Routes order in RoutesV4 component ([a9052c0](https://github.com/cozy/cozy-libs/commit/a9052c0fa27b68aaa33f6c371f23020ee91e37da))
13
+
14
+
15
+
16
+
17
+
18
+ ## [12.5.1](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@12.5.0...cozy-harvest-lib@12.5.1) (2023-01-26)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **harvest:** Some propTypes was incorrect on LaunchTriggerAlert and ([eb5f8c1](https://github.com/cozy/cozy-libs/commit/eb5f8c1be7ab7420a59e4c3cad6c8aca09ac30eb))
24
+
25
+
26
+
27
+
28
+
6
29
  # [12.5.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@12.4.0...cozy-harvest-lib@12.5.0) (2023-01-25)
7
30
 
8
31
 
@@ -43,9 +43,9 @@ var AccountModalContentWrapper = function AccountModalContentWrapper(_ref) {
43
43
  };
44
44
 
45
45
  AccountModalContentWrapper.propTypes = {
46
- konnector: PropTypes.object.isRequired,
47
- trigger: PropTypes.object.isRequired,
48
- account: PropTypes.object.isRequired,
46
+ konnector: PropTypes.object,
47
+ trigger: PropTypes.object,
48
+ account: PropTypes.object,
49
49
  intentsApi: intentsApiProptype,
50
50
  innerAccountModalOverrides: innerAccountModalOverridesProptype
51
51
  };
@@ -7,8 +7,8 @@ import NewAccountModal from '../NewAccountModal';
7
7
  import EditAccountModal from '../EditAccountModal';
8
8
  import KonnectorSuccess from '../KonnectorSuccess';
9
9
  import HarvestModalRoot from '../HarvestModalRoot';
10
- import AccountModalWithoutTabs from '../AccountModalWithoutTabs/FovV4Router/AccountModalWithoutTabs';
11
- import AccountModalContentWrapper from '../AccountModalWithoutTabs/FovV4Router/AccountModalContentWrapper';
10
+ import AccountModalWithoutTabs from '../AccountModalWithoutTabs/ForV4Router/AccountModalWithoutTabs';
11
+ import AccountModalContentWrapper from '../AccountModalWithoutTabs/ForV4Router/AccountModalContentWrapper';
12
12
  import DataTab from '../KonnectorConfiguration/DataTab';
13
13
  import ConfigurationTab from '../KonnectorConfiguration/ConfigurationTab';
14
14
  import withAdaptiveRouter from '../hoc/withRouter';
@@ -29,11 +29,38 @@ var RoutesV4 = function RoutesV4(_ref) {
29
29
  konnector: konnectorWithTriggers
30
30
  });
31
31
  }
32
- }), flag('harvest.inappconnectors.enabled') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Route, {
33
- path: "".concat(konnectorRoot, "/accounts/:accountId"),
32
+ }), /*#__PURE__*/React.createElement(Route, {
33
+ path: "".concat(konnectorRoot, "/accounts/:accountId/edit"),
34
34
  exact: true,
35
35
  render: function render(_ref2) {
36
36
  var match = _ref2.match;
37
+ return /*#__PURE__*/React.createElement(EditAccountModal, {
38
+ konnector: konnectorWithTriggers,
39
+ accountId: match.params.accountId,
40
+ accounts: accountsAndTriggers
41
+ });
42
+ }
43
+ }), /*#__PURE__*/React.createElement(Route, {
44
+ path: "".concat(konnectorRoot, "/new"),
45
+ exact: true,
46
+ render: function render() {
47
+ return /*#__PURE__*/React.createElement(NewAccountModal, {
48
+ konnector: konnectorWithTriggers,
49
+ onSuccess: onSuccess,
50
+ onDismiss: onDismiss
51
+ });
52
+ }
53
+ }), /*#__PURE__*/React.createElement(Route, {
54
+ path: "".concat(konnectorRoot, "/viewer/:accountId/:folderToSaveId/:fileIndex"),
55
+ exact: true,
56
+ render: function render(routeComponentProps) {
57
+ return /*#__PURE__*/React.createElement(ViewerModal, routeComponentProps);
58
+ }
59
+ }), flag('harvest.inappconnectors.enabled') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Route, {
60
+ path: "".concat(konnectorRoot, "/accounts/:accountId"),
61
+ exact: true,
62
+ render: function render(_ref3) {
63
+ var match = _ref3.match;
37
64
  return /*#__PURE__*/React.createElement(AccountModalWithoutTabs, {
38
65
  konnector: konnectorWithTriggers,
39
66
  accountId: match.params.accountId,
@@ -51,8 +78,8 @@ var RoutesV4 = function RoutesV4(_ref) {
51
78
  }), /*#__PURE__*/React.createElement(Route, {
52
79
  path: "".concat(konnectorRoot, "/accounts/:accountId/config"),
53
80
  exact: true,
54
- render: function render(_ref3) {
55
- var match = _ref3.match;
81
+ render: function render(_ref4) {
82
+ var match = _ref4.match;
56
83
  return /*#__PURE__*/React.createElement(AccountModalWithoutTabs, {
57
84
  konnector: konnectorWithTriggers,
58
85
  accountId: match.params.accountId,
@@ -72,8 +99,8 @@ var RoutesV4 = function RoutesV4(_ref) {
72
99
  })) : /*#__PURE__*/React.createElement(Route, {
73
100
  path: "".concat(konnectorRoot, "/accounts/:accountId"),
74
101
  exact: true,
75
- render: function render(_ref4) {
76
- var match = _ref4.match;
102
+ render: function render(_ref5) {
103
+ var match = _ref5.match;
77
104
  return /*#__PURE__*/React.createElement(AccountModal, {
78
105
  konnector: konnectorWithTriggers,
79
106
  accountId: match.params.accountId,
@@ -83,33 +110,6 @@ var RoutesV4 = function RoutesV4(_ref) {
83
110
  showAccountSelection: !konnectorWithTriggers.clientSide
84
111
  });
85
112
  }
86
- }), /*#__PURE__*/React.createElement(Route, {
87
- path: "".concat(konnectorRoot, "/accounts/:accountId/edit"),
88
- exact: true,
89
- render: function render(_ref5) {
90
- var match = _ref5.match;
91
- return /*#__PURE__*/React.createElement(EditAccountModal, {
92
- konnector: konnectorWithTriggers,
93
- accountId: match.params.accountId,
94
- accounts: accountsAndTriggers
95
- });
96
- }
97
- }), /*#__PURE__*/React.createElement(Route, {
98
- path: "".concat(konnectorRoot, "/viewer/:accountId/:folderToSaveId/:fileIndex"),
99
- exact: true,
100
- render: function render(routeComponentProps) {
101
- return /*#__PURE__*/React.createElement(ViewerModal, routeComponentProps);
102
- }
103
- }), /*#__PURE__*/React.createElement(Route, {
104
- path: "".concat(konnectorRoot, "/new"),
105
- exact: true,
106
- render: function render() {
107
- return /*#__PURE__*/React.createElement(NewAccountModal, {
108
- konnector: konnectorWithTriggers,
109
- onSuccess: onSuccess,
110
- onDismiss: onDismiss
111
- });
112
- }
113
113
  }), !flag('harvest.inappconnectors.enabled') && /*#__PURE__*/React.createElement(Route, {
114
114
  path: "".concat(konnectorRoot, "/accounts/:accountId/success"),
115
115
  exact: true,
@@ -151,10 +151,10 @@ LaunchTriggerAlert.defaultProps = {
151
151
  };
152
152
  LaunchTriggerAlert.propTypes = {
153
153
  flow: PropTypes.object,
154
- f: PropTypes.function,
155
- t: PropTypes.function,
154
+ f: PropTypes.func,
155
+ t: PropTypes.func,
156
156
  disabled: PropTypes.bool,
157
157
  konnectorRoot: PropTypes.string,
158
- historyAction: PropTypes.function
158
+ historyAction: PropTypes.func
159
159
  };
160
160
  export default withAdaptiveRouter(LaunchTriggerAlert);
@@ -18,7 +18,7 @@ export var ViewerModal = function ViewerModal(_ref) {
18
18
  fetchStatus = _useDataCardFiles.fetchStatus;
19
19
 
20
20
  var handleCloseViewer = function handleCloseViewer() {
21
- return replaceHistory("/accounts");
21
+ return replaceHistory("/accounts/".concat(accountId));
22
22
  };
23
23
 
24
24
  var handleFileChange = function handleFileChange(_file, newIndex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "12.5.0",
3
+ "version": "12.5.2",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -88,5 +88,5 @@
88
88
  "react-router-dom": ">=4.3.1"
89
89
  },
90
90
  "sideEffects": false,
91
- "gitHead": "de1dbcd5311291ab3735ce82e961b158b2ba5c0f"
91
+ "gitHead": "375a7a11c40e30357d6215fa9a05b2a1a7f3c1f4"
92
92
  }
@@ -52,9 +52,9 @@ const AccountModalContentWrapper = ({
52
52
  }
53
53
 
54
54
  AccountModalContentWrapper.propTypes = {
55
- konnector: PropTypes.object.isRequired,
56
- trigger: PropTypes.object.isRequired,
57
- account: PropTypes.object.isRequired,
55
+ konnector: PropTypes.object,
56
+ trigger: PropTypes.object,
57
+ account: PropTypes.object,
58
58
  intentsApi: intentsApiProptype,
59
59
  innerAccountModalOverrides: innerAccountModalOverridesProptype
60
60
  }
@@ -9,8 +9,8 @@ import NewAccountModal from '../NewAccountModal'
9
9
  import EditAccountModal from '../EditAccountModal'
10
10
  import KonnectorSuccess from '../KonnectorSuccess'
11
11
  import HarvestModalRoot from '../HarvestModalRoot'
12
- import AccountModalWithoutTabs from '../AccountModalWithoutTabs/FovV4Router/AccountModalWithoutTabs'
13
- import AccountModalContentWrapper from '../AccountModalWithoutTabs/FovV4Router/AccountModalContentWrapper'
12
+ import AccountModalWithoutTabs from '../AccountModalWithoutTabs/ForV4Router/AccountModalWithoutTabs'
13
+ import AccountModalContentWrapper from '../AccountModalWithoutTabs/ForV4Router/AccountModalContentWrapper'
14
14
  import DataTab from '../KonnectorConfiguration/DataTab'
15
15
  import ConfigurationTab from '../KonnectorConfiguration/ConfigurationTab'
16
16
  import withAdaptiveRouter from '../hoc/withRouter'
@@ -35,6 +35,33 @@ const RoutesV4 = ({
35
35
  />
36
36
  )}
37
37
  />
38
+ <Route
39
+ path={`${konnectorRoot}/accounts/:accountId/edit`}
40
+ exact
41
+ render={({ match }) => (
42
+ <EditAccountModal
43
+ konnector={konnectorWithTriggers}
44
+ accountId={match.params.accountId}
45
+ accounts={accountsAndTriggers}
46
+ />
47
+ )}
48
+ />
49
+ <Route
50
+ path={`${konnectorRoot}/new`}
51
+ exact
52
+ render={() => (
53
+ <NewAccountModal
54
+ konnector={konnectorWithTriggers}
55
+ onSuccess={onSuccess}
56
+ onDismiss={onDismiss}
57
+ />
58
+ )}
59
+ />
60
+ <Route
61
+ path={`${konnectorRoot}/viewer/:accountId/:folderToSaveId/:fileIndex`}
62
+ exact
63
+ render={routeComponentProps => <ViewerModal {...routeComponentProps} />}
64
+ />
38
65
  {flag('harvest.inappconnectors.enabled') ? (
39
66
  <>
40
67
  <Route
@@ -103,33 +130,6 @@ const RoutesV4 = ({
103
130
  />
104
131
  )}
105
132
 
106
- <Route
107
- path={`${konnectorRoot}/accounts/:accountId/edit`}
108
- exact
109
- render={({ match }) => (
110
- <EditAccountModal
111
- konnector={konnectorWithTriggers}
112
- accountId={match.params.accountId}
113
- accounts={accountsAndTriggers}
114
- />
115
- )}
116
- />
117
- <Route
118
- path={`${konnectorRoot}/viewer/:accountId/:folderToSaveId/:fileIndex`}
119
- exact
120
- render={routeComponentProps => <ViewerModal {...routeComponentProps} />}
121
- />
122
- <Route
123
- path={`${konnectorRoot}/new`}
124
- exact
125
- render={() => (
126
- <NewAccountModal
127
- konnector={konnectorWithTriggers}
128
- onSuccess={onSuccess}
129
- onDismiss={onDismiss}
130
- />
131
- )}
132
- />
133
133
  {!flag('harvest.inappconnectors.enabled') && (
134
134
  <Route
135
135
  path={`${konnectorRoot}/accounts/:accountId/success`}
@@ -153,11 +153,11 @@ LaunchTriggerAlert.defaultProps = {
153
153
 
154
154
  LaunchTriggerAlert.propTypes = {
155
155
  flow: PropTypes.object,
156
- f: PropTypes.function,
157
- t: PropTypes.function,
156
+ f: PropTypes.func,
157
+ t: PropTypes.func,
158
158
  disabled: PropTypes.bool,
159
159
  konnectorRoot: PropTypes.string,
160
- historyAction: PropTypes.function
160
+ historyAction: PropTypes.func
161
161
  }
162
162
 
163
163
  export default withAdaptiveRouter(LaunchTriggerAlert)
@@ -14,7 +14,7 @@ export const ViewerModal = ({
14
14
  const { pushHistory, replaceHistory } = useContext(MountPointContext)
15
15
  const { data, fetchStatus } = useDataCardFiles(accountId, folderToSaveId)
16
16
 
17
- const handleCloseViewer = () => replaceHistory(`/accounts`)
17
+ const handleCloseViewer = () => replaceHistory(`/accounts/${accountId}`)
18
18
  const handleFileChange = (_file, newIndex) =>
19
19
  pushHistory(`/viewer/${accountId}/${folderToSaveId}/${newIndex}`)
20
20