cozy-sharing 4.5.8 → 4.5.10

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,25 @@
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
+ ## 4.5.10 (2022-11-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Paginated permission were not normalized ([eac18f4](https://github.com/cozy/cozy-libs/commit/eac18f4cc90bf4b06d91b7e59343bb4efcf81dcd))
12
+
13
+
14
+
15
+
16
+
17
+ ## [4.5.9](https://github.com/cozy/cozy-libs/compare/cozy-sharing@4.5.8...cozy-sharing@4.5.9) (2022-10-03)
18
+
19
+ **Note:** Version bump only for package cozy-sharing
20
+
21
+
22
+
23
+
24
+
6
25
  ## 4.5.8 (2022-10-03)
7
26
 
8
27
  **Note:** Version bump only for package cozy-sharing
@@ -610,8 +610,6 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
610
610
  key: "fetchAllSharings",
611
611
  value: function () {
612
612
  var _fetchAllSharings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
613
- var _this2 = this;
614
-
615
613
  var _this$props5, doctype, client, _yield$Promise$all, _yield$Promise$all2, sharings, permissions, apps, sharedDocIds, resp, folderPaths, filePaths;
616
614
 
617
615
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
@@ -638,11 +636,9 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
638
636
  hasLoadedAtLeastOnePage: true
639
637
  }); // eslint-disable-next-line promise/catch-or-return
640
638
 
641
- fetchNextPermissions(permissions, this.dispatch, client).then(function () {
642
- return _this2.setState({
643
- allLoaded: true
644
- });
645
- });
639
+ fetchNextPermissions(permissions, this.dispatch, this.permissionCol).then(this.setState({
640
+ allLoaded: true
641
+ }));
646
642
 
647
643
  if (!(doctype !== 'io.cozy.files')) {
648
644
  _context12.next = 13;
@@ -1,3 +1,4 @@
1
+ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import React from 'react';
3
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n';
@@ -45,7 +46,7 @@ var SharingTitle = function SharingTitle(_ref2) {
45
46
  };
46
47
 
47
48
  var ConfirmTrustedRecipientsDialog = function ConfirmTrustedRecipientsDialog(_ref3) {
48
- var props = _extends({}, _ref3);
49
+ var props = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
49
50
 
50
51
  return /*#__PURE__*/React.createElement(ShareDialogTwoStepsConfirmationContainer, _extends({}, props, {
51
52
  dialogContentOnShare: SharingContent,
@@ -10,7 +10,7 @@ import { addSharingLink } from './state';
10
10
  */
11
11
 
12
12
  export var fetchNextPermissions = /*#__PURE__*/function () {
13
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(permissions, dispatch, client) {
13
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(permissions, dispatch, permissionCol) {
14
14
  var resp;
15
15
  return _regeneratorRuntime.wrap(function _callee$(_context) {
16
16
  while (1) {
@@ -22,12 +22,12 @@ export var fetchNextPermissions = /*#__PURE__*/function () {
22
22
  }
23
23
 
24
24
  _context.next = 3;
25
- return client.getStackClient().fetchJSON('GET', permissions.links.next);
25
+ return permissionCol.fetchPermissionsByLink(permissions);
26
26
 
27
27
  case 3:
28
28
  resp = _context.sent;
29
29
  dispatch(addSharingLink(resp.data));
30
- return _context.abrupt("return", fetchNextPermissions(resp, dispatch, client));
30
+ return _context.abrupt("return", fetchNextPermissions(resp, dispatch, permissionCol));
31
31
 
32
32
  case 6:
33
33
  case "end":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "4.5.8",
3
+ "version": "4.5.10",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -28,7 +28,7 @@
28
28
  "@cozy/minilog": "^1.0.0",
29
29
  "classnames": "^2.2.6",
30
30
  "copy-text-to-clipboard": "^2.1.1",
31
- "cozy-device-helper": "^2.4.1",
31
+ "cozy-device-helper": "^2.5.0",
32
32
  "cozy-doctypes": "^1.85.4",
33
33
  "lodash": "^4.17.19",
34
34
  "react-autosuggest": "^9.4.3",
@@ -41,7 +41,7 @@
41
41
  "babel-jest": "26.6.3",
42
42
  "babel-plugin-css-modules-transform": "1.6.2",
43
43
  "babel-plugin-inline-react-svg": "1.1.2",
44
- "cozy-client": "23.19.1",
44
+ "cozy-client": "34.1.0",
45
45
  "cozy-ui": "62.1.2",
46
46
  "enzyme": "3.11.0",
47
47
  "enzyme-adapter-react-16": "1.15.6",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@material-ui/core": "4",
56
- "cozy-client": "^16",
56
+ "cozy-client": "^34.1.0",
57
57
  "cozy-realtime": "^3.11.0",
58
58
  "cozy-ui": "^45.1.0",
59
59
  "prop-types": "^15.7.2",
@@ -63,5 +63,5 @@
63
63
  "sideEffects": [
64
64
  "*.css"
65
65
  ],
66
- "gitHead": "adad3d4b00ef7cd3aafdcab927bcb7e5288d6df5"
66
+ "gitHead": "054f0d1955fa38ad3bd404d6d03c2ffd790d9bc9"
67
67
  }
@@ -186,7 +186,7 @@ export class SharingProvider extends Component {
186
186
  )
187
187
  this.setState({ hasLoadedAtLeastOnePage: true })
188
188
  // eslint-disable-next-line promise/catch-or-return
189
- fetchNextPermissions(permissions, this.dispatch, client).then(() =>
189
+ fetchNextPermissions(permissions, this.dispatch, this.permissionCol).then(
190
190
  this.setState({ allLoaded: true })
191
191
  )
192
192
  if (doctype !== 'io.cozy.files') return
@@ -6,12 +6,14 @@ import { addSharingLink } from './state'
6
6
  * @param {Function} dispatch
7
7
  * @param {Object} client
8
8
  */
9
- export const fetchNextPermissions = async (permissions, dispatch, client) => {
9
+ export const fetchNextPermissions = async (
10
+ permissions,
11
+ dispatch,
12
+ permissionCol
13
+ ) => {
10
14
  if (permissions.links && permissions.links.next) {
11
- const resp = await client
12
- .getStackClient()
13
- .fetchJSON('GET', permissions.links.next)
15
+ const resp = await permissionCol.fetchPermissionsByLink(permissions)
14
16
  dispatch(addSharingLink(resp.data))
15
- return fetchNextPermissions(resp, dispatch, client)
17
+ return fetchNextPermissions(resp, dispatch, permissionCol)
16
18
  }
17
19
  }