cozy-sharing 6.0.3 → 6.0.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.
- package/CHANGELOG.md +23 -0
- package/dist/SharingBanner/hooks/useSharingInfos.js +35 -37
- package/dist/SharingBanner/hooks/useSharingInfos.spec.js +40 -44
- package/dist/SharingProvider.js +351 -375
- package/dist/SharingProvider.spec.js +29 -33
- package/dist/components/CozyPassFingerprintDialogContent.spec.js +14 -16
- package/dist/components/Recipient/LinkRecipientPermissions.js +25 -27
- package/dist/components/Recipient/OwnerRecipient.js +22 -0
- package/dist/components/Recipient/OwnerRecipientDefault.js +20 -0
- package/dist/components/Recipient/Recipient.spec.js +39 -43
- package/dist/components/Recipient/RecipientPermissions.js +20 -22
- package/dist/components/Recipient/RecipientStatus.js +1 -1
- package/dist/components/ShareButton.js +0 -2
- package/dist/components/ShareByEmail.js +53 -55
- package/dist/components/ShareByEmail.spec.js +50 -52
- package/dist/components/ShareByLink.js +73 -79
- package/dist/components/ShareDialogCozyToCozy.spec.js +250 -269
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +33 -35
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +240 -266
- package/dist/components/SharedBadge.js +0 -2
- package/dist/components/WhoHasAccess.js +3 -13
- package/dist/components/badge.styl +7 -5
- package/dist/components/button.styl +11 -12
- package/dist/components/useFetchDocumentPath.js +16 -18
- package/dist/fetchNextPermissions.js +15 -17
- package/dist/getSharedDocument.js +13 -15
- package/dist/getSharedDocument.spec.js +10 -12
- package/dist/helpers/contacts.js +65 -69
- package/dist/helpers/contacts.spec.js +30 -32
- package/dist/helpers/files.js +26 -28
- package/dist/helpers/files.spec.js +54 -58
- package/dist/helpers/sharings.js +56 -60
- package/dist/helpers/synchronousJobQueue.js +19 -21
- package/dist/helpers/synchronousJobQueue.spec.js +39 -43
- package/dist/stylesheet.css +28 -820
- package/package.json +2 -2
- package/src/components/Recipient/OwnerRecipient.jsx +23 -0
- package/src/components/Recipient/OwnerRecipientDefault.jsx +29 -0
- package/src/components/Recipient/RecipientStatus.jsx +1 -1
- package/src/components/ShareDialogCozyToCozy.spec.jsx +19 -18
- package/src/components/WhoHasAccess.jsx +2 -20
- package/src/components/badge.styl +7 -5
- package/src/components/button.styl +11 -12
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
|
+
## [6.0.5](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.4...cozy-sharing@6.0.5) (2023-03-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Display always instance address as secondary text for owner ([f6c89cf](https://github.com/cozy/cozy-libs/commit/f6c89cf54d723d695f0afe0a9fe9ab44f236376e))
|
|
12
|
+
* Display correctly owner recipient when receiving sharing ([49a1c5a](https://github.com/cozy/cozy-libs/commit/49a1c5ac6aa029be3217fef93ce3f7bce6e21019))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [6.0.4](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.3...cozy-sharing@6.0.4) (2023-03-01)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* Colors for shared withMe ([17795d5](https://github.com/cozy/cozy-libs/commit/17795d586dea2b1202e9215d8a9ab745fee37f55))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [6.0.3](https://github.com/cozy/cozy-libs/compare/cozy-sharing@6.0.2...cozy-sharing@6.0.3) (2023-02-08)
|
|
7
30
|
|
|
8
31
|
**Note:** Version bump only for package cozy-sharing
|
|
@@ -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,
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
case 22:
|
|
78
|
+
_context.prev = 22;
|
|
79
|
+
setLoading(false);
|
|
80
|
+
return _context.finish(22);
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
expect(result.current.loading).toEqual(true);
|
|
101
|
+
_context.next = 8;
|
|
102
|
+
return act(function () {
|
|
103
|
+
return waitForNextUpdate();
|
|
104
|
+
});
|
|
106
105
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
expect(result.current.loading).toEqual(true);
|
|
131
|
+
_context2.next = 8;
|
|
132
|
+
return act(function () {
|
|
133
|
+
return waitForNextUpdate();
|
|
134
|
+
});
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
142
|
+
case 12:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context2.stop();
|
|
149
145
|
}
|
|
150
146
|
}, _callee2);
|
|
151
147
|
})));
|