cozy-sharing 6.0.2 → 6.0.4

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 (34) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/SharingBanner/hooks/useSharingInfos.js +35 -37
  3. package/dist/SharingBanner/hooks/useSharingInfos.spec.js +40 -44
  4. package/dist/SharingProvider.js +351 -375
  5. package/dist/SharingProvider.spec.js +29 -33
  6. package/dist/components/CozyPassFingerprintDialogContent.spec.js +14 -16
  7. package/dist/components/Recipient/LinkRecipientPermissions.js +25 -27
  8. package/dist/components/Recipient/Recipient.spec.js +39 -43
  9. package/dist/components/Recipient/RecipientPermissions.js +20 -22
  10. package/dist/components/ShareButton.js +0 -2
  11. package/dist/components/ShareByEmail.js +53 -55
  12. package/dist/components/ShareByEmail.spec.js +50 -52
  13. package/dist/components/ShareByLink.js +73 -79
  14. package/dist/components/ShareDialogCozyToCozy.spec.js +238 -264
  15. package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +33 -35
  16. package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +240 -266
  17. package/dist/components/SharedBadge.js +0 -2
  18. package/dist/components/badge.styl +7 -5
  19. package/dist/components/button.styl +11 -12
  20. package/dist/components/useFetchDocumentPath.js +16 -18
  21. package/dist/fetchNextPermissions.js +15 -17
  22. package/dist/getSharedDocument.js +13 -15
  23. package/dist/getSharedDocument.spec.js +10 -12
  24. package/dist/helpers/contacts.js +65 -69
  25. package/dist/helpers/contacts.spec.js +30 -32
  26. package/dist/helpers/files.js +26 -28
  27. package/dist/helpers/files.spec.js +54 -58
  28. package/dist/helpers/sharings.js +56 -60
  29. package/dist/helpers/synchronousJobQueue.js +19 -21
  30. package/dist/helpers/synchronousJobQueue.spec.js +39 -43
  31. package/dist/stylesheet.css +28 -820
  32. package/package.json +3 -3
  33. package/src/components/badge.styl +7 -5
  34. package/src/components/button.styl +11 -12
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
+ ## [6.0.4](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.3...cozy-sharing@6.0.4) (2023-03-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Colors for shared withMe ([17795d5](https://github.com/cozy/cozy-libs/commit/17795d586dea2b1202e9215d8a9ab745fee37f55))
12
+
13
+
14
+
15
+
16
+
17
+ ## [6.0.3](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.2...cozy-sharing@6.0.3) (2023-02-08)
18
+
19
+ **Note:** Version bump only for package cozy-sharing
20
+
21
+
22
+
23
+
24
+
6
25
  ## [6.0.2](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.1...cozy-sharing@6.0.2) (2023-02-06)
7
26
 
8
27
 
@@ -40,50 +40,48 @@ export var useSharingInfos = function useSharingInfos() {
40
40
  useEffect(function () {
41
41
  var loadSharingDiscoveryLink = /*#__PURE__*/function () {
42
42
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
43
- var response, _isSharingShortcutCreated, sharingId, _getQueryParameter, sharecode, link, sharingsByIdQuery, _yield$client$query, _sharing;
43
+ var response, _isSharingShortcutCreated, sharingId, _getQueryParameter2, sharecode, link, sharingsByIdQuery, _yield$client$query2, _sharing;
44
44
 
45
45
  return _regeneratorRuntime.wrap(function _callee$(_context) {
46
- while (1) {
47
- switch (_context.prev = _context.next) {
48
- case 0:
49
- setLoading(true);
50
- _context.prev = 1;
51
- _context.next = 4;
52
- return client.collection('io.cozy.permissions').fetchOwnPermissions();
46
+ while (1) switch (_context.prev = _context.next) {
47
+ case 0:
48
+ setLoading(true);
49
+ _context.prev = 1;
50
+ _context.next = 4;
51
+ return client.collection('io.cozy.permissions').fetchOwnPermissions();
53
52
 
54
- case 4:
55
- response = _context.sent;
56
- _isSharingShortcutCreated = models.permission.isShortcutCreatedOnTheRecipientCozy(response);
57
- sharingId = getSharingId(response);
58
- _getQueryParameter = getQueryParameter(), sharecode = _getQueryParameter.sharecode;
59
- link = client.collection('io.cozy.sharings').getDiscoveryLink(sharingId, sharecode);
60
- sharingsByIdQuery = buildSharingsByIdQuery(sharingId);
61
- _context.next = 12;
62
- return client.query(sharingsByIdQuery.definition);
53
+ case 4:
54
+ response = _context.sent;
55
+ _isSharingShortcutCreated = models.permission.isShortcutCreatedOnTheRecipientCozy(response);
56
+ sharingId = getSharingId(response);
57
+ _getQueryParameter2 = getQueryParameter(), sharecode = _getQueryParameter2.sharecode;
58
+ link = client.collection('io.cozy.sharings').getDiscoveryLink(sharingId, sharecode);
59
+ sharingsByIdQuery = buildSharingsByIdQuery(sharingId);
60
+ _context.next = 12;
61
+ return client.query(sharingsByIdQuery.definition);
63
62
 
64
- case 12:
65
- _yield$client$query = _context.sent;
66
- _sharing = _yield$client$query.data;
67
- setDiscoveryLink(link);
68
- setIsSharingSharingcutCreated(_isSharingShortcutCreated);
69
- setSharing(_sharing);
70
- _context.next = 22;
71
- break;
63
+ case 12:
64
+ _yield$client$query2 = _context.sent;
65
+ _sharing = _yield$client$query2.data;
66
+ setDiscoveryLink(link);
67
+ setIsSharingSharingcutCreated(_isSharingShortcutCreated);
68
+ setSharing(_sharing);
69
+ _context.next = 22;
70
+ break;
72
71
 
73
- case 19:
74
- _context.prev = 19;
75
- _context.t0 = _context["catch"](1);
76
- logger.warn('Failed to load sharing discovery link', _context.t0);
72
+ case 19:
73
+ _context.prev = 19;
74
+ _context.t0 = _context["catch"](1);
75
+ logger.warn('Failed to load sharing discovery link', _context.t0);
77
76
 
78
- case 22:
79
- _context.prev = 22;
80
- setLoading(false);
81
- return _context.finish(22);
77
+ case 22:
78
+ _context.prev = 22;
79
+ setLoading(false);
80
+ return _context.finish(22);
82
81
 
83
- case 25:
84
- case "end":
85
- return _context.stop();
86
- }
82
+ case 25:
83
+ case "end":
84
+ return _context.stop();
87
85
  }
88
86
  }, _callee, null, [[1, 19, 22, 25]]);
89
87
  }));
@@ -89,31 +89,29 @@ describe('useSharingInfos', function () {
89
89
  var discoveryLink, _setup, result, waitForNextUpdate;
90
90
 
91
91
  return _regeneratorRuntime.wrap(function _callee$(_context) {
92
- while (1) {
93
- switch (_context.prev = _context.next) {
94
- case 0:
95
- discoveryLink = '/link';
96
- getDiscoveryLinkMock.mockReturnValue(discoveryLink);
97
- fetchOwnPermissionsMock.mockResolvedValue(mockedPermissionsWithInstance);
98
- queryMock.mockResolvedValue(mockSharing);
99
- _setup = setup(), result = _setup.result, waitForNextUpdate = _setup.waitForNextUpdate; // default state
92
+ while (1) switch (_context.prev = _context.next) {
93
+ case 0:
94
+ discoveryLink = '/link';
95
+ getDiscoveryLinkMock.mockReturnValue(discoveryLink);
96
+ fetchOwnPermissionsMock.mockResolvedValue(mockedPermissionsWithInstance);
97
+ queryMock.mockResolvedValue(mockSharing);
98
+ _setup = setup(), result = _setup.result, waitForNextUpdate = _setup.waitForNextUpdate; // default state
100
99
 
101
- expect(result.current.loading).toEqual(true);
102
- _context.next = 8;
103
- return act(function () {
104
- return waitForNextUpdate();
105
- });
100
+ expect(result.current.loading).toEqual(true);
101
+ _context.next = 8;
102
+ return act(function () {
103
+ return waitForNextUpdate();
104
+ });
106
105
 
107
- case 8:
108
- expect(result.current.loading).toEqual(false);
109
- expect(result.current.isSharingShortcutCreated).toEqual(true);
110
- expect(result.current.sharing).toEqual(mockSharing.data);
111
- expect(result.current.discoveryLink).toEqual(discoveryLink);
106
+ case 8:
107
+ expect(result.current.loading).toEqual(false);
108
+ expect(result.current.isSharingShortcutCreated).toEqual(true);
109
+ expect(result.current.sharing).toEqual(mockSharing.data);
110
+ expect(result.current.discoveryLink).toEqual(discoveryLink);
112
111
 
113
- case 12:
114
- case "end":
115
- return _context.stop();
116
- }
112
+ case 12:
113
+ case "end":
114
+ return _context.stop();
117
115
  }
118
116
  }, _callee);
119
117
  })));
@@ -121,31 +119,29 @@ describe('useSharingInfos', function () {
121
119
  var discoveryLink, _setup2, result, waitForNextUpdate;
122
120
 
123
121
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
124
- while (1) {
125
- switch (_context2.prev = _context2.next) {
126
- case 0:
127
- discoveryLink = false;
128
- getDiscoveryLinkMock.mockReturnValue(discoveryLink);
129
- fetchOwnPermissionsMock.mockResolvedValue(mockedPermissionsWithoutInstance);
130
- queryMock.mockResolvedValue(mockSharing);
131
- _setup2 = setup(), result = _setup2.result, waitForNextUpdate = _setup2.waitForNextUpdate; // default state
122
+ while (1) switch (_context2.prev = _context2.next) {
123
+ case 0:
124
+ discoveryLink = false;
125
+ getDiscoveryLinkMock.mockReturnValue(discoveryLink);
126
+ fetchOwnPermissionsMock.mockResolvedValue(mockedPermissionsWithoutInstance);
127
+ queryMock.mockResolvedValue(mockSharing);
128
+ _setup2 = setup(), result = _setup2.result, waitForNextUpdate = _setup2.waitForNextUpdate; // default state
132
129
 
133
- expect(result.current.loading).toEqual(true);
134
- _context2.next = 8;
135
- return act(function () {
136
- return waitForNextUpdate();
137
- });
130
+ expect(result.current.loading).toEqual(true);
131
+ _context2.next = 8;
132
+ return act(function () {
133
+ return waitForNextUpdate();
134
+ });
138
135
 
139
- case 8:
140
- expect(result.current.loading).toEqual(false);
141
- expect(result.current.isSharingShortcutCreated).toEqual(false);
142
- expect(result.current.sharing).toEqual(mockSharing.data);
143
- expect(result.current.discoveryLink).toEqual(discoveryLink);
136
+ case 8:
137
+ expect(result.current.loading).toEqual(false);
138
+ expect(result.current.isSharingShortcutCreated).toEqual(false);
139
+ expect(result.current.sharing).toEqual(mockSharing.data);
140
+ expect(result.current.discoveryLink).toEqual(discoveryLink);
144
141
 
145
- case 12:
146
- case "end":
147
- return _context2.stop();
148
- }
142
+ case 12:
143
+ case "end":
144
+ return _context2.stop();
149
145
  }
150
146
  }, _callee2);
151
147
  })));