cozy-sharing 3.12.1 → 3.12.5

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/ConfirmTrustedRecipientsDialog.js +2 -1
  3. package/dist/ShareButton.js +2 -1
  4. package/dist/ShareModal.js +4 -2
  5. package/dist/SharedBadge.js +2 -1
  6. package/dist/SharedRecipients.js +2 -1
  7. package/dist/SharedRecipientsList.js +2 -1
  8. package/dist/SharingBanner/hooks/useSharingInfos.js +1 -1
  9. package/dist/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
  10. package/dist/SharingOwnerAvatar.js +2 -1
  11. package/dist/SharingProvider.js +1 -1
  12. package/dist/SharingProvider.spec.js +1 -1
  13. package/dist/components/CozyPassFingerprintDialogContent.spec.js +1 -1
  14. package/dist/components/EditableSharingModal.js +2 -1
  15. package/dist/components/Recipient.js +9 -5
  16. package/dist/components/Recipient.spec.js +1 -1
  17. package/dist/components/RecipientsAvatars.spec.js +2 -1
  18. package/dist/components/ShareButton.js +6 -3
  19. package/dist/components/ShareByEmail.js +4 -4
  20. package/dist/components/ShareByEmail.spec.js +1 -1
  21. package/dist/components/ShareByLink.js +1 -1
  22. package/dist/components/ShareDialogCozyToCozy.js +2 -1
  23. package/dist/components/ShareDialogCozyToCozy.spec.js +1 -1
  24. package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -1
  25. package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +1 -1
  26. package/dist/components/useFetchDocumentPath.js +1 -1
  27. package/dist/fetchNextPermissions.js +1 -1
  28. package/dist/getSharedDocument.js +1 -1
  29. package/dist/getSharedDocument.spec.js +1 -1
  30. package/dist/helpers/contacts.js +1 -1
  31. package/dist/helpers/contacts.spec.js +1 -1
  32. package/dist/helpers/files.js +1 -1
  33. package/dist/helpers/files.spec.js +1 -1
  34. package/dist/helpers/sharings.js +1 -1
  35. package/package.json +4 -4
  36. package/preprocess.js +1 -1
  37. package/src/SharingBanner/components/SharingBanner.jsx +2 -6
  38. package/src/SharingBanner/hooks/useSharingInfos.jsx +4 -6
  39. package/src/components/ShareByEmail.jsx +3 -2
  40. package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +4 -4
  41. package/src/index.jsx +2 -6
  42. package/src/state.js +5 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
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
+ ## [3.12.5](https://github.com/cozy/cozy-libs/compare/cozy-sharing@3.12.4...cozy-sharing@3.12.5) (2021-12-02)
7
+
8
+ **Note:** Version bump only for package cozy-sharing
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.12.4](https://github.com/cozy/cozy-libs/compare/cozy-sharing@3.12.3...cozy-sharing@3.12.4) (2021-11-09)
15
+
16
+ **Note:** Version bump only for package cozy-sharing
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.12.3](https://github.com/cozy/cozy-libs/compare/cozy-sharing@3.12.2...cozy-sharing@3.12.3) (2021-10-22)
23
+
24
+ **Note:** Version bump only for package cozy-sharing
25
+
26
+
27
+
28
+
29
+
30
+ ## [3.12.2](https://github.com/cozy/cozy-libs/compare/cozy-sharing@3.12.1...cozy-sharing@3.12.2) (2021-10-07)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * Translate ShareByEmail success message ([da418c6](https://github.com/cozy/cozy-libs/commit/da418c6))
36
+
37
+
38
+
39
+
40
+
6
41
  ## [3.12.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@3.12.0...cozy-sharing@3.12.1) (2021-10-04)
7
42
 
8
43
 
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["document"];
3
4
  import React from 'react';
4
5
  import SharingContext from './context';
5
6
  import withLocales from './withLocales';
6
7
  import { default as DumbConfirmTrustedRecipientsDialog } from './components/ConfirmTrustedRecipientsDialog';
7
8
  export var ConfirmTrustedRecipientsDialog = withLocales(function (_ref) {
8
9
  var document = _ref.document,
9
- rest = _objectWithoutProperties(_ref, ["document"]);
10
+ rest = _objectWithoutProperties(_ref, _excluded);
10
11
 
11
12
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function () {
12
13
  return /*#__PURE__*/React.createElement(DumbConfirmTrustedRecipientsDialog, _extends({
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["docId", "useShortLabel"];
3
4
  import React from 'react';
4
5
  import { useI18n } from 'cozy-ui/transpiled/react/I18n';
5
6
  import SharingContext from './context';
@@ -8,7 +9,7 @@ import { default as DumbShareButton, SharedByMeButton, SharedWithMeButton } from
8
9
  export var ShareButton = withLocales(function (_ref) {
9
10
  var docId = _ref.docId,
10
11
  useShortLabel = _ref.useShortLabel,
11
- rest = _objectWithoutProperties(_ref, ["docId", "useShortLabel"]);
12
+ rest = _objectWithoutProperties(_ref, _excluded);
12
13
 
13
14
  var _useI18n = useI18n(),
14
15
  t = _useI18n.t;
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["document"],
4
+ _excluded2 = ["document"];
3
5
  import React from 'react';
4
6
  import SharingContext from './context';
5
7
  import withLocales from './withLocales';
@@ -8,7 +10,7 @@ import EditableSharingModal from './components/EditableSharingModal';
8
10
 
9
11
  var SharingModal = function SharingModal(_ref) {
10
12
  var document = _ref.document,
11
- rest = _objectWithoutProperties(_ref, ["document"]);
13
+ rest = _objectWithoutProperties(_ref, _excluded);
12
14
 
13
15
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function (_ref2) {
14
16
  var documentType = _ref2.documentType,
@@ -29,7 +31,7 @@ var SharingModal = function SharingModal(_ref) {
29
31
 
30
32
  export var ShareModal = withLocales(function (_ref3) {
31
33
  var document = _ref3.document,
32
- rest = _objectWithoutProperties(_ref3, ["document"]);
34
+ rest = _objectWithoutProperties(_ref3, _excluded2);
33
35
 
34
36
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function (_ref4) {
35
37
  var byDocId = _ref4.byDocId,
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["docId"];
3
4
  import React from 'react';
4
5
  import SharingContext from './context';
5
6
  import withLocales from './withLocales';
6
7
  import { default as DumbSharedBadge } from './components/SharedBadge';
7
8
  export var SharedBadge = withLocales(function (_ref) {
8
9
  var docId = _ref.docId,
9
- rest = _objectWithoutProperties(_ref, ["docId"]);
10
+ rest = _objectWithoutProperties(_ref, _excluded);
10
11
 
11
12
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function () {
12
13
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["docId", "onClick"];
3
4
  import React from 'react';
4
5
  import SharingContext from './context';
5
6
  import withLocales from './withLocales';
@@ -7,7 +8,7 @@ import { RecipientsAvatars } from './components/Recipient';
7
8
  export var SharedRecipients = withLocales(function (_ref) {
8
9
  var docId = _ref.docId,
9
10
  onClick = _ref.onClick,
10
- rest = _objectWithoutProperties(_ref, ["docId", "onClick"]);
11
+ rest = _objectWithoutProperties(_ref, _excluded);
11
12
 
12
13
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function () {
13
14
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["docId"];
3
4
  import React from 'react';
4
5
  import SharingContext from './context';
5
6
  import withLocales from './withLocales';
6
7
  import { default as RecipientsList } from './components/WhoHasAccessLight';
7
8
  export var SharedRecipientsList = withLocales(function (_ref) {
8
9
  var docId = _ref.docId,
9
- rest = _objectWithoutProperties(_ref, ["docId"]);
10
+ rest = _objectWithoutProperties(_ref, _excluded);
10
11
 
11
12
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function () {
12
13
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { useState, useEffect } from 'react';
5
5
  import { useClient, models } from 'cozy-client';
6
6
  import getQueryParameter from '../helpers/QueryParameter';
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import { renderHook, act } from '@testing-library/react-hooks';
5
5
  import { createMockClient } from 'cozy-client';
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["docId"];
3
4
  import React from 'react';
4
5
  import SharingContext from './context';
5
6
  import withLocales from './withLocales';
6
7
  import { RecipientAvatar } from './components/Recipient';
7
8
  export var SharingOwnerAvatar = withLocales(function (_ref) {
8
9
  var docId = _ref.docId,
9
- rest = _objectWithoutProperties(_ref, ["docId"]);
10
+ rest = _objectWithoutProperties(_ref, _excluded);
10
11
 
11
12
  return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function () {
12
13
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -1,6 +1,5 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
5
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -9,6 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
9
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
12
12
 
13
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
14
14
 
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import { mount } from 'enzyme';
5
5
  import { act } from '@testing-library/react';
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import { render } from '@testing-library/react';
5
5
  import { createMockClient } from 'cozy-client';
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["contacts", "document", "groups"];
3
4
  import React from 'react';
4
5
  import PropTypes from 'prop-types';
5
6
  import { queryConnect, useClient, Q } from 'cozy-client';
@@ -13,7 +14,7 @@ export var EditableSharingModal = function EditableSharingModal(_ref) {
13
14
  var contacts = _ref.contacts,
14
15
  document = _ref.document,
15
16
  groups = _ref.groups,
16
- rest = _objectWithoutProperties(_ref, ["contacts", "document", "groups"]);
17
+ rest = _objectWithoutProperties(_ref, _excluded);
17
18
 
18
19
  var client = useClient();
19
20
  var documentPath = useFetchDocumentPath(client, document);
@@ -1,9 +1,13 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
3
  import _extends from "@babel/runtime/helpers/extends";
5
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
6
5
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
+ var _excluded = ["recipient"],
7
+ _excluded2 = ["url", "size"],
8
+ _excluded3 = ["instance", "isOwner", "status", "recipientConfirmationData", "verifyRecipient"],
9
+ _excluded4 = ["instance"];
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
11
  import React, { useState, useCallback } from 'react';
8
12
  import PropTypes from 'prop-types';
9
13
  import cx from 'classnames';
@@ -142,7 +146,7 @@ export var RecipientsAvatars = function RecipientsAvatars(_ref2) {
142
146
  };
143
147
  export var RecipientAvatar = function RecipientAvatar(_ref3) {
144
148
  var recipient = _ref3.recipient,
145
- rest = _objectWithoutProperties(_ref3, ["recipient"]);
149
+ rest = _objectWithoutProperties(_ref3, _excluded);
146
150
 
147
151
  var client = useClient();
148
152
  /**
@@ -166,7 +170,7 @@ export var RecipientAvatar = function RecipientAvatar(_ref3) {
166
170
  export var OwnerIdentity = function OwnerIdentity(_ref4) {
167
171
  var url = _ref4.url,
168
172
  size = _ref4.size,
169
- rest = _objectWithoutProperties(_ref4, ["url", "size"]);
173
+ rest = _objectWithoutProperties(_ref4, _excluded2);
170
174
 
171
175
  return /*#__PURE__*/React.createElement("div", {
172
176
  className: styles['avatar']
@@ -369,7 +373,7 @@ var Recipient = function Recipient(props) {
369
373
  status = props.status,
370
374
  recipientConfirmationData = props.recipientConfirmationData,
371
375
  verifyRecipient = props.verifyRecipient,
372
- rest = _objectWithoutProperties(props, ["instance", "isOwner", "status", "recipientConfirmationData", "verifyRecipient"]);
376
+ rest = _objectWithoutProperties(props, _excluded3);
373
377
 
374
378
  var isMe = isOwner && status === 'owner' || instance === client.options.uri;
375
379
  var defaultDisplayName = t(DEFAULT_DISPLAY_NAME);
@@ -409,7 +413,7 @@ Recipient.propTypes = {
409
413
  export default Recipient;
410
414
  export var RecipientWithoutStatus = function RecipientWithoutStatus(_ref9) {
411
415
  var instance = _ref9.instance,
412
- rest = _objectWithoutProperties(_ref9, ["instance"]);
416
+ rest = _objectWithoutProperties(_ref9, _excluded4);
413
417
 
414
418
  var name = getDisplayName(rest);
415
419
  return /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import Recipient, { excludeMeAsOwnerFromRecipients } from './Recipient';
5
5
  import AppLike from '../../test/AppLike';
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
+ var _excluded = ["recipients", "link", "isOwner", "onClick"];
4
5
  import React from 'react';
5
6
  import { createMockClient } from 'cozy-client';
6
7
  import { render } from '@testing-library/react';
@@ -37,7 +38,7 @@ describe('RecipientsAvatars', function () {
37
38
  onClick = _ref$onClick === void 0 ? function () {
38
39
  return jest.fn();
39
40
  } : _ref$onClick,
40
- rest = _objectWithoutProperties(_ref, ["recipients", "link", "isOwner", "onClick"]);
41
+ rest = _objectWithoutProperties(_ref, _excluded);
41
42
 
42
43
  return render( /*#__PURE__*/React.createElement(AppLike, {
43
44
  client: client
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["label", "onClick", "className"],
4
+ _excluded2 = ["label", "onClick", "className"],
5
+ _excluded3 = ["label", "onClick", "className"];
3
6
  import React from 'react';
4
7
  import classNames from 'classnames';
5
8
  import { Button } from 'cozy-ui/transpiled/react';
@@ -14,7 +17,7 @@ export var ShareButton = function ShareButton(_ref) {
14
17
  var label = _ref.label,
15
18
  _onClick = _ref.onClick,
16
19
  className = _ref.className,
17
- props = _objectWithoutProperties(_ref, ["label", "onClick", "className"]);
20
+ props = _objectWithoutProperties(_ref, _excluded);
18
21
 
19
22
  return /*#__PURE__*/React.createElement(Button, _extends({
20
23
  "data-test-id": "share-button",
@@ -33,7 +36,7 @@ export var SharedByMeButton = function SharedByMeButton(_ref2) {
33
36
  var label = _ref2.label,
34
37
  _onClick2 = _ref2.onClick,
35
38
  className = _ref2.className,
36
- props = _objectWithoutProperties(_ref2, ["label", "onClick", "className"]);
39
+ props = _objectWithoutProperties(_ref2, _excluded2);
37
40
 
38
41
  return /*#__PURE__*/React.createElement(Button, _extends({
39
42
  "data-test-id": "share-by-me-button",
@@ -51,7 +54,7 @@ export var SharedWithMeButton = function SharedWithMeButton(_ref3) {
51
54
  var label = _ref3.label,
52
55
  _onClick3 = _ref3.onClick,
53
56
  className = _ref3.className,
54
- props = _objectWithoutProperties(_ref3, ["label", "onClick", "className"]);
57
+ props = _objectWithoutProperties(_ref3, _excluded3);
55
58
 
56
59
  return /*#__PURE__*/React.createElement(Button, _extends({
57
60
  className: classNames(styles['coz-btn-sharedWithMe'], className),
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -8,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
 
12
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
13
13
 
@@ -130,13 +130,13 @@ export var ShareByEmail = /*#__PURE__*/function (_Component) {
130
130
  });
131
131
 
132
132
  _defineProperty(_assertThisInitialized(_this), "share", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
133
- var _this$props, document, sharingDesc, onShare, createContact, documentType, client, _this$state, recipients, selectedOption, recipientsBefore, contacts, readWriteRecipients, readOnlyRecipients;
133
+ var _this$props, document, sharingDesc, onShare, createContact, documentType, client, t, _this$state, recipients, selectedOption, recipientsBefore, contacts, readWriteRecipients, readOnlyRecipients;
134
134
 
135
135
  return _regeneratorRuntime.wrap(function _callee$(_context) {
136
136
  while (1) {
137
137
  switch (_context.prev = _context.next) {
138
138
  case 0:
139
- _this$props = _this.props, document = _this$props.document, sharingDesc = _this$props.sharingDesc, onShare = _this$props.onShare, createContact = _this$props.createContact, documentType = _this$props.documentType, client = _this$props.client;
139
+ _this$props = _this.props, document = _this$props.document, sharingDesc = _this$props.sharingDesc, onShare = _this$props.onShare, createContact = _this$props.createContact, documentType = _this$props.documentType, client = _this$props.client, t = _this$props.t;
140
140
  _this$state = _this.state, recipients = _this$state.recipients, selectedOption = _this$state.selectedOption;
141
141
 
142
142
  if (!(recipients.length === 0)) {
@@ -182,7 +182,7 @@ export var ShareByEmail = /*#__PURE__*/function (_Component) {
182
182
  });
183
183
 
184
184
  case 15:
185
- Alerter.success.apply(Alerter, _toConsumableArray(getSuccessMessage(recipientsBefore, contacts, documentType)));
185
+ Alerter.success(t.apply(void 0, _toConsumableArray(getSuccessMessage(recipientsBefore, contacts, documentType))));
186
186
 
187
187
  _this.reset();
188
188
 
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import { mount } from 'enzyme';
5
5
  import { ShareByEmail } from './ShareByEmail';
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
12
12
 
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["showShareByLink", "documentType", "document"];
3
4
  import React from 'react';
4
5
  import { useI18n } from 'cozy-ui/transpiled/react/I18n';
5
6
  import { default as DumbShareByLink } from './ShareByLink';
@@ -119,7 +120,7 @@ var ShareDialogCozyToCozy = function ShareDialogCozyToCozy(_ref3) {
119
120
  var showShareByLink = _ref3.showShareByLink,
120
121
  documentType = _ref3.documentType,
121
122
  document = _ref3.document,
122
- props = _objectWithoutProperties(_ref3, ["showShareByLink", "documentType", "document"]);
123
+ props = _objectWithoutProperties(_ref3, _excluded);
123
124
 
124
125
  return /*#__PURE__*/React.createElement(ShareDialogTwoStepsConfirmationContainer, _extends({}, props, {
125
126
  documentType: documentType,
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6
6
 
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useCallback, useEffect, useState } from 'react';
5
5
  import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
6
6
  import { useI18n } from 'cozy-ui/transpiled/react/I18n';
@@ -1,7 +1,7 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _extends from "@babel/runtime/helpers/extends";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
 
6
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
7
7
 
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { useState, useEffect } from 'react';
5
5
  import { fetchFilesPaths } from '../helpers/files';
6
6
  export var useFetchDocumentPath = function useFetchDocumentPath(client, document) {
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { addSharingLink } from './state';
4
4
  /**
5
5
  * Fetch paginated permissions if needed and dispatch it to
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import get from 'lodash/get';
4
4
 
5
5
  var getSharedDocument = /*#__PURE__*/function () {
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import getSharedDocument from './getSharedDocument';
4
4
  describe('Getting the shared document id', function () {
5
5
  var mockClient = {
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { validateEmail } from '../helpers/email'; // Return the contact object if present
4
4
  // Else check if a contact exist with this email address, if yes return it
5
5
  // if not create it
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { getOrCreateFromArray } from './contacts';
4
4
  var findMock = jest.fn().mockReturnValueOnce({
5
5
  data: [{
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  export var fetchFilesPaths = /*#__PURE__*/function () {
4
4
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(client, doctype, files) {
5
5
  var parentDirIds, parentDirs, filePaths;
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { fetchFilesPaths } from './files';
4
4
  describe('fetchFilesPaths', function () {
5
5
  it('should handle document without path', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { Q } from 'cozy-client';
4
4
  import { updateInternalObjectFromRealtime, normalizeDocFromRealtime } from './realtime';
5
5
  import { addSharing, updateSharing } from '../state';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "3.12.1",
3
+ "version": "3.12.5",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -28,8 +28,8 @@
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": "^1.12.0",
32
- "cozy-doctypes": "^1.82.3",
31
+ "cozy-device-helper": "^1.13.1",
32
+ "cozy-doctypes": "^1.83.2",
33
33
  "lodash": "^4.17.19",
34
34
  "react-autosuggest": "^9.4.3",
35
35
  "react-tooltip": "^3.11.1",
@@ -61,5 +61,5 @@
61
61
  "sideEffects": [
62
62
  "*.css"
63
63
  ],
64
- "gitHead": "2db7d35703a855c1134a4e9e4c77f8555fa6754c"
64
+ "gitHead": "05ee034eb1fed9a27b36f6657150f347bb4ac417"
65
65
  }
package/preprocess.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const stylus = require('stylus')
2
2
  const cozyStylusPlugin = require('cozy-ui/stylus')
3
3
 
4
- const renderStylus = function(css, filename) {
4
+ const renderStylus = function (css, filename) {
5
5
  try {
6
6
  return stylus(css)
7
7
  .use(cozyStylusPlugin())
@@ -7,12 +7,8 @@ export const SharingBanner = ({ sharingInfos }) => {
7
7
  const [isOpened, setIsOpened] = useState(true)
8
8
  const onClose = useCallback(() => setIsOpened(false), [setIsOpened])
9
9
 
10
- const {
11
- loading,
12
- discoveryLink,
13
- sharing,
14
- isSharingShortcutCreated
15
- } = sharingInfos
10
+ const { loading, discoveryLink, sharing, isSharingShortcutCreated } =
11
+ sharingInfos
16
12
 
17
13
  if (loading) return null
18
14
  return (
@@ -16,9 +16,8 @@ export const useSharingInfos = () => {
16
16
  const client = useClient()
17
17
 
18
18
  const [discoveryLink, setDiscoveryLink] = useState()
19
- const [isSharingShortcutCreated, setIsSharingSharingcutCreated] = useState(
20
- false
21
- )
19
+ const [isSharingShortcutCreated, setIsSharingSharingcutCreated] =
20
+ useState(false)
22
21
  const [sharing, setSharing] = useState()
23
22
  const [loading, setLoading] = useState(true)
24
23
 
@@ -30,9 +29,8 @@ export const useSharingInfos = () => {
30
29
  .collection('io.cozy.permissions')
31
30
  .fetchOwnPermissions()
32
31
 
33
- const isSharingShortcutCreated = models.permission.isShortcutCreatedOnTheRecipientCozy(
34
- response
35
- )
32
+ const isSharingShortcutCreated =
33
+ models.permission.isShortcutCreatedOnTheRecipientCozy(response)
36
34
  const sharingId = getSharingId(response)
37
35
  const { sharecode } = getQueryParameter()
38
36
 
@@ -92,7 +92,8 @@ export class ShareByEmail extends Component {
92
92
  onShare,
93
93
  createContact,
94
94
  documentType,
95
- client
95
+ client,
96
+ t
96
97
  } = this.props
97
98
  const { recipients, selectedOption } = this.state
98
99
  if (recipients.length === 0) {
@@ -126,7 +127,7 @@ export class ShareByEmail extends Component {
126
127
  })
127
128
 
128
129
  Alerter.success(
129
- ...getSuccessMessage(recipientsBefore, contacts, documentType)
130
+ t(...getSuccessMessage(recipientsBefore, contacts, documentType))
130
131
  )
131
132
  this.reset()
132
133
  } catch (err) {
@@ -126,9 +126,8 @@ const ShareDialogTwoStepsConfirmationContainer = ({
126
126
  shouldGetRecipientsToBeConfirmed ? 'loading' : 'sharing'
127
127
  )
128
128
  const [recipientsToBeConfirmed, setRecipientsToBeConfirmed] = useSafeState([])
129
- const [recipientConfirmationData, setRecipientConfirmationData] = useState(
130
- undefined
131
- )
129
+ const [recipientConfirmationData, setRecipientConfirmationData] =
130
+ useState(undefined)
132
131
 
133
132
  const {
134
133
  confirmRecipient,
@@ -141,7 +140,8 @@ const ShareDialogTwoStepsConfirmationContainer = ({
141
140
  setStatus('loading')
142
141
 
143
142
  try {
144
- const result = await twoStepsConfirmationMethods.getRecipientsToBeConfirmed()
143
+ const result =
144
+ await twoStepsConfirmationMethods.getRecipientsToBeConfirmed()
145
145
 
146
146
  setRecipientsToBeConfirmed(result)
147
147
  setStatus('sharing')
package/src/index.jsx CHANGED
@@ -16,11 +16,7 @@ export { ShareButton } from './ShareButton'
16
16
  export { ShareModal } from './ShareModal'
17
17
  export { RefreshableSharings } from './RefreshableSharings'
18
18
  export { useFetchDocumentPath } from './components/useFetchDocumentPath'
19
- export {
20
- CozyPassFingerprintDialogContent
21
- } from './components/CozyPassFingerprintDialogContent'
19
+ export { CozyPassFingerprintDialogContent } from './components/CozyPassFingerprintDialogContent'
22
20
  export { SharingBannerPlugin } from './SharingBanner'
23
21
  export { useSharingInfos } from './SharingBanner/hooks/useSharingInfos'
24
- export {
25
- ConfirmTrustedRecipientsDialog
26
- } from './ConfirmTrustedRecipientsDialog'
22
+ export { ConfirmTrustedRecipientsDialog } from './ConfirmTrustedRecipientsDialog'
package/src/state.js CHANGED
@@ -68,9 +68,11 @@ export const revokeSharingLink = permissions => ({
68
68
  permissions
69
69
  })
70
70
  export const receivePaths = paths => ({ type: RECEIVE_PATHS, paths })
71
- export const matchingInstanceName = (instanceUri = '') => shareMember =>
72
- shareMember.instance &&
73
- shareMember.instance.toString().toLowerCase() === instanceUri.toLowerCase()
71
+ export const matchingInstanceName =
72
+ (instanceUri = '') =>
73
+ shareMember =>
74
+ shareMember.instance &&
75
+ shareMember.instance.toString().toLowerCase() === instanceUri.toLowerCase()
74
76
 
75
77
  // reducers
76
78
  const byIdInitialState = { sharings: [], permissions: [] }