cozy-sharing 33.6.0 → 34.0.0
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 +16 -0
- package/dist/OpenSharingLinkButton.js +1 -1
- package/dist/SharingProvider.spec.js +242 -113
- package/dist/actions/addToCozySharingLink.js +2 -3
- package/dist/actions/createCozySharingLink.js +2 -3
- package/dist/actions/shareNative.js +2 -3
- package/dist/actions/syncToCozySharingLink.js +2 -3
- package/dist/components/Avatar/AvatarList.js +2 -3
- package/dist/components/Avatar/GroupAvatar.js +2 -3
- package/dist/components/Recipient/GroupRecipientDetailWithoutAccess.js +2 -3
- package/dist/components/Recipient/GroupRecipientPermissions.js +2 -3
- package/dist/components/Recipient/LinkRecipient.js +2 -4
- package/dist/components/Recipient/LinkRecipientLite.js +2 -3
- package/dist/components/Recipient/MemberRecipientPermissions.js +2 -3
- package/dist/components/Recipient/actions/revokeLink.js +3 -4
- package/dist/components/ShareButton.js +4 -5
- package/dist/components/ShareByLink.js +5 -7
- package/dist/components/ShareRestrictionModal/BoxDate.js +2 -3
- package/dist/components/ShareRestrictionModal/BoxEditingRights.js +3 -5
- package/dist/components/ShareRestrictionModal/BoxPassword.js +3 -5
- package/dist/components/ShareRestrictionModal/ShareRestrictionModal.js +2 -3
- package/dist/components/SharedBadge.js +2 -3
- package/dist/components/SharedDrive/SharedDriveHeader.js +1 -1
- package/dist/helpers/sharings.js +4 -6
- package/dist/state.js +4 -3
- package/dist/state.spec.js +44 -27
- package/jest.config.js +3 -2
- package/jestHelpers/mocks/twake-icons.js +23 -0
- package/package.json +4 -2
- package/src/OpenSharingLinkButton.jsx +1 -1
- package/src/SharingProvider.spec.jsx +115 -1
- package/src/actions/addToCozySharingLink.js +2 -3
- package/src/actions/createCozySharingLink.js +2 -3
- package/src/actions/shareNative.js +2 -3
- package/src/actions/syncToCozySharingLink.js +2 -3
- package/src/components/Avatar/AvatarList.jsx +2 -3
- package/src/components/Avatar/GroupAvatar.jsx +2 -3
- package/src/components/Recipient/GroupRecipientDetailWithoutAccess.jsx +2 -3
- package/src/components/Recipient/GroupRecipientPermissions.jsx +2 -3
- package/src/components/Recipient/LinkRecipient.jsx +2 -4
- package/src/components/Recipient/LinkRecipientLite.jsx +2 -3
- package/src/components/Recipient/MemberRecipientPermissions.jsx +2 -3
- package/src/components/Recipient/actions/revokeLink.js +3 -4
- package/src/components/ShareButton.jsx +4 -5
- package/src/components/ShareByLink.jsx +5 -7
- package/src/components/ShareRestrictionModal/BoxDate.jsx +2 -3
- package/src/components/ShareRestrictionModal/BoxEditingRights.jsx +3 -5
- package/src/components/ShareRestrictionModal/BoxPassword.jsx +3 -5
- package/src/components/ShareRestrictionModal/ShareRestrictionModal.jsx +2 -3
- package/src/components/SharedBadge.jsx +2 -4
- package/src/components/SharedDrive/SharedDriveHeader.jsx +1 -1
- package/src/helpers/sharings.js +5 -6
- package/src/state.js +4 -12
- package/src/state.spec.js +63 -29
package/dist/state.spec.js
CHANGED
|
@@ -4,7 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import reducer, { receiveSharings, addSharing, addSharingLink, updateSharingLink, revokeSharingLink, getRecipients, getRecipientsFromSharing, revokeRecipient, revokeSelf, updateSharing, matchingInstanceName, getSharingLink, hasSharedParent, hasSharedChild, getSharedDocIdsBySharings, getSharingType, getPermissionDocIds, getDocumentSharingType, getSharedParentPath, getExternalSharingIds, getRecipientsWithGroups } from './state';
|
|
7
|
+
import reducer, { receiveSharings, addSharing, addSharingLink, updateSharingLink, revokeSharingLink, getRecipients, getRecipientsFromSharing, revokeGroup, revokeRecipient, revokeSelf, updateSharing, matchingInstanceName, getSharingLink, hasSharedParent, hasSharedChild, getSharedDocIdsBySharings, getSharingType, getPermissionDocIds, getDocumentSharingType, getSharedParentPath, getExternalSharingIds, getRecipientsWithGroups } from './state';
|
|
8
8
|
import { SHARING_1, SHARING_2, SHARING_3, SHARING_READ_ONLY, PERM_1, PERM_2, PERM_WITHOUT_DOC, SHARING_NO_ACTIVE, SHARING_WITH_SHORTCUT, APPS } from '../__tests__/fixtures';
|
|
9
9
|
describe('Sharing state', function () {
|
|
10
10
|
it('should have a default state', function () {
|
|
@@ -106,7 +106,7 @@ describe('Sharing state', function () {
|
|
|
106
106
|
});
|
|
107
107
|
expect(state.sharings).toEqual([SHARING_1, SHARED_DRIVE_WITHOUT_RECIPIENTS]);
|
|
108
108
|
});
|
|
109
|
-
it('should
|
|
109
|
+
it('should forget shared drives without recipients when updating', function () {
|
|
110
110
|
var SHARED_DRIVE_WITHOUT_RECIPIENTS = _objectSpread(_objectSpread({}, SHARING_1), {}, {
|
|
111
111
|
id: 'shared_drive_no_recipients',
|
|
112
112
|
attributes: _objectSpread(_objectSpread({}, SHARING_1.attributes), {}, {
|
|
@@ -139,15 +139,45 @@ describe('Sharing state', function () {
|
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
var state = reducer(initialState, updateSharing(updatedSharing));
|
|
142
|
-
expect(state.byDocId).toEqual({
|
|
143
|
-
|
|
144
|
-
sharings: [SHARED_DRIVE_WITHOUT_RECIPIENTS.id],
|
|
145
|
-
permissions: []
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
expect(state.sharings).toEqual([updatedSharing]);
|
|
142
|
+
expect(state.byDocId).toEqual({});
|
|
143
|
+
expect(state.sharings).toEqual([]);
|
|
149
144
|
});
|
|
150
|
-
it('should
|
|
145
|
+
it('should forget a shared drive when revoking its last group', function () {
|
|
146
|
+
var SHARED_DRIVE_WITH_GROUP = _objectSpread(_objectSpread({}, SHARING_1), {}, {
|
|
147
|
+
id: 'shared_drive_group',
|
|
148
|
+
attributes: _objectSpread(_objectSpread({}, SHARING_1.attributes), {}, {
|
|
149
|
+
drive: true,
|
|
150
|
+
members: [{
|
|
151
|
+
status: 'owner',
|
|
152
|
+
name: 'Jane Doe',
|
|
153
|
+
email: 'jane@doe.com',
|
|
154
|
+
instance: 'http://cozy.tools:8080'
|
|
155
|
+
}],
|
|
156
|
+
groups: [{
|
|
157
|
+
name: 'Last group',
|
|
158
|
+
addedBy: 0
|
|
159
|
+
}],
|
|
160
|
+
rules: [{
|
|
161
|
+
title: 'My Shared Drive',
|
|
162
|
+
doctype: 'io.cozy.files',
|
|
163
|
+
values: ['shared_drive_group_folder'],
|
|
164
|
+
add: 'sync',
|
|
165
|
+
update: 'sync',
|
|
166
|
+
remove: 'sync'
|
|
167
|
+
}]
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
var sharedDrivePath = '/shared_drive_group_folder';
|
|
172
|
+
var initialState = reducer(reducer(undefined, receiveSharings({
|
|
173
|
+
sharings: [SHARED_DRIVE_WITH_GROUP]
|
|
174
|
+
})), addSharing(SHARED_DRIVE_WITH_GROUP, sharedDrivePath));
|
|
175
|
+
var state = reducer(initialState, revokeGroup(SHARED_DRIVE_WITH_GROUP, 0, sharedDrivePath));
|
|
176
|
+
expect(state.byDocId).toEqual({});
|
|
177
|
+
expect(state.sharings).toEqual([]);
|
|
178
|
+
expect(state.sharedPaths).toEqual([]);
|
|
179
|
+
});
|
|
180
|
+
it('should forget a shared drive when revoking last recipient', function () {
|
|
151
181
|
var SHARED_DRIVE_WITH_ONE_RECIPIENT = _objectSpread(_objectSpread({}, SHARING_1), {}, {
|
|
152
182
|
id: 'shared_drive_one_recipient',
|
|
153
183
|
attributes: _objectSpread(_objectSpread({}, SHARING_1.attributes), {}, {
|
|
@@ -178,23 +208,10 @@ describe('Sharing state', function () {
|
|
|
178
208
|
var initialState = reducer(reducer(undefined, receiveSharings({
|
|
179
209
|
sharings: [SHARED_DRIVE_WITH_ONE_RECIPIENT]
|
|
180
210
|
})), addSharing(SHARED_DRIVE_WITH_ONE_RECIPIENT, sharedDrivePath));
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
status: 'revoked'
|
|
186
|
-
})]
|
|
187
|
-
})
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var state = reducer(initialState, revokeRecipient(sharingAfterRevoke, 1, sharedDrivePath));
|
|
191
|
-
expect(state.sharedPaths).toContain(sharedDrivePath);
|
|
192
|
-
expect(state.byDocId).toEqual({
|
|
193
|
-
shared_drive_folder: {
|
|
194
|
-
sharings: [SHARED_DRIVE_WITH_ONE_RECIPIENT.id],
|
|
195
|
-
permissions: []
|
|
196
|
-
}
|
|
197
|
-
});
|
|
211
|
+
var state = reducer(initialState, revokeRecipient(SHARED_DRIVE_WITH_ONE_RECIPIENT, 1, sharedDrivePath));
|
|
212
|
+
expect(state.byDocId).toEqual({});
|
|
213
|
+
expect(state.sharings).toEqual([]);
|
|
214
|
+
expect(state.sharedPaths).toEqual([]);
|
|
198
215
|
});
|
|
199
216
|
it('should index received permissions', function () {
|
|
200
217
|
var state = reducer(undefined, receiveSharings({
|
package/jest.config.js
CHANGED
|
@@ -26,10 +26,11 @@ module.exports = {
|
|
|
26
26
|
'^cozy-client$': '<rootDir>/node_modules/cozy-client/dist/index.js',
|
|
27
27
|
'^cozy-client/dist/types$':
|
|
28
28
|
'<rootDir>/node_modules/cozy-client/dist/types.js',
|
|
29
|
-
'^twake-i18n$': '<rootDir>/../twake-i18n/dist/index.js'
|
|
29
|
+
'^twake-i18n$': '<rootDir>/../twake-i18n/dist/index.js',
|
|
30
|
+
'^@linagora/twake-icons$': '<rootDir>/jestHelpers/mocks/twake-icons.js'
|
|
30
31
|
},
|
|
31
32
|
transformIgnorePatterns: [
|
|
32
|
-
'<rootDir>/node_modules/(?!(cozy-ui|cozy-harvest-lib))'
|
|
33
|
+
'<rootDir>/node_modules/(?!(cozy-ui|cozy-harvest-lib|cozy-ui-plus))'
|
|
33
34
|
],
|
|
34
35
|
setupFilesAfterEnv: ['<rootDir>/jestHelpers/setup.js']
|
|
35
36
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const React = require('react')
|
|
2
|
+
|
|
3
|
+
const Icon = ({ icon, ...props }) =>
|
|
4
|
+
React.createElement('span', { 'data-icon': true, ...props })
|
|
5
|
+
|
|
6
|
+
const Sprite = () => null
|
|
7
|
+
|
|
8
|
+
const getFileTypeIcon = () =>
|
|
9
|
+
function FileTypeIcon() {
|
|
10
|
+
return React.createElement('svg', { 'data-filetypeicon': true })
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const proxyHandler = {
|
|
14
|
+
get: function (target, prop) {
|
|
15
|
+
if (prop in target) return target[prop]
|
|
16
|
+
if (prop === 'default') return target.Icon
|
|
17
|
+
return function IconMock(props) {
|
|
18
|
+
return React.createElement('svg', { 'data-mock-icon': prop, ...props })
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = new Proxy({ Icon, Sprite, getFileTypeIcon }, proxyHandler)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "34.0.0",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/cli": "7.16.8",
|
|
42
42
|
"@babel/core": "7.16.12",
|
|
43
|
+
"@linagora/twake-icons": "^2.6.2",
|
|
43
44
|
"@storybook/addon-essentials": "7.6.0",
|
|
44
45
|
"@storybook/addon-interactions": "7.6.0",
|
|
45
46
|
"@storybook/addon-links": "7.6.0",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"twake-i18n": "^0.4.1"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
72
|
+
"@linagora/twake-icons": ">=2.6.2",
|
|
71
73
|
"cozy-client": ">=60.28.0",
|
|
72
74
|
"cozy-device-helper": ">=4.0.0",
|
|
73
75
|
"cozy-flags": ">=4.8.1",
|
|
@@ -83,5 +85,5 @@
|
|
|
83
85
|
"sideEffects": [
|
|
84
86
|
"*.css"
|
|
85
87
|
],
|
|
86
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "99a6d19a4f3f61c99cc785c87126e3e2f0bfa646"
|
|
87
89
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Icon } from '@linagora/twake-icons'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
6
|
import { useI18n } from 'twake-i18n'
|
|
7
7
|
|
|
8
8
|
import { getIconWithlabel, openExternalLink } from './helpers/sharings'
|
|
@@ -5,7 +5,12 @@ import { createMockClient } from 'cozy-client'
|
|
|
5
5
|
|
|
6
6
|
import { SharingProvider } from './SharingProvider'
|
|
7
7
|
import SharingContext from './context'
|
|
8
|
-
import reducer, {
|
|
8
|
+
import reducer, {
|
|
9
|
+
addSharingLink,
|
|
10
|
+
getDocumentPermissions,
|
|
11
|
+
getDocumentSharing,
|
|
12
|
+
receiveSharings
|
|
13
|
+
} from './state'
|
|
9
14
|
import AppLike from '../test/AppLike'
|
|
10
15
|
|
|
11
16
|
const AppWrapper = ({ children, client, isPublic }) => {
|
|
@@ -291,6 +296,115 @@ describe('updateDocumentPermissions', () => {
|
|
|
291
296
|
})
|
|
292
297
|
})
|
|
293
298
|
|
|
299
|
+
describe('shared drive recipient revocation', () => {
|
|
300
|
+
const SHARED_DRIVE = {
|
|
301
|
+
_id: 'sharing_123',
|
|
302
|
+
id: 'sharing_123',
|
|
303
|
+
type: 'io.cozy.sharings',
|
|
304
|
+
attributes: {
|
|
305
|
+
drive: true,
|
|
306
|
+
owner: true,
|
|
307
|
+
description: 'Shared folder',
|
|
308
|
+
rules: [
|
|
309
|
+
{
|
|
310
|
+
title: 'Shared folder',
|
|
311
|
+
doctype: 'io.cozy.files',
|
|
312
|
+
values: ['folder_123'],
|
|
313
|
+
add: 'none',
|
|
314
|
+
update: 'none',
|
|
315
|
+
remove: 'none'
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
members: [
|
|
319
|
+
{
|
|
320
|
+
status: 'owner',
|
|
321
|
+
email: 'owner@cozy.local',
|
|
322
|
+
instance: 'http://cozy.local'
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
status: 'pending',
|
|
326
|
+
email: 'recipient@cozy.local',
|
|
327
|
+
instance: 'http://recipient.cozy.local'
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const NEW_SHARING = {
|
|
333
|
+
...SHARED_DRIVE,
|
|
334
|
+
_id: 'sharing_456',
|
|
335
|
+
id: 'sharing_456'
|
|
336
|
+
}
|
|
337
|
+
const document = {
|
|
338
|
+
_id: 'folder_123',
|
|
339
|
+
id: 'folder_123',
|
|
340
|
+
path: '/Shared folder'
|
|
341
|
+
}
|
|
342
|
+
const recipient = {
|
|
343
|
+
_id: 'contact_123',
|
|
344
|
+
id: 'contact_123',
|
|
345
|
+
_type: 'io.cozy.contacts',
|
|
346
|
+
email: 'recipient@cozy.local'
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
let provider
|
|
350
|
+
let sharingCol
|
|
351
|
+
|
|
352
|
+
beforeEach(() => {
|
|
353
|
+
const mockClient = createMockClient({})
|
|
354
|
+
mockClient.getStackClient = () => ({ uri: 'http://cozy.local' })
|
|
355
|
+
mockClient.collection = jest.fn().mockReturnValue({})
|
|
356
|
+
|
|
357
|
+
provider = new SharingProvider({ client: mockClient })
|
|
358
|
+
provider.state = {
|
|
359
|
+
...provider.state,
|
|
360
|
+
...reducer(undefined, receiveSharings({ sharings: [SHARED_DRIVE] }))
|
|
361
|
+
}
|
|
362
|
+
provider.dispatch = jest.fn(action => {
|
|
363
|
+
provider.state = {
|
|
364
|
+
...provider.state,
|
|
365
|
+
...reducer(provider.state, action)
|
|
366
|
+
}
|
|
367
|
+
})
|
|
368
|
+
sharingCol = {
|
|
369
|
+
addRecipients: jest.fn(),
|
|
370
|
+
create: jest.fn().mockResolvedValue({ data: NEW_SHARING }),
|
|
371
|
+
revokeRecipient: jest.fn().mockResolvedValue({})
|
|
372
|
+
}
|
|
373
|
+
provider.sharingCol = sharingCol
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
it('forgets the shared drive when revoking its last recipient', async () => {
|
|
377
|
+
await provider.revoke(document, SHARED_DRIVE.id, 1)
|
|
378
|
+
|
|
379
|
+
expect(sharingCol.revokeRecipient).toHaveBeenCalledWith(SHARED_DRIVE, 1)
|
|
380
|
+
expect(getDocumentSharing(provider.state, document.id)).toBeNull()
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
it('creates a new sharing when re-adding after the last recipient was revoked', async () => {
|
|
384
|
+
await provider.revoke(document, SHARED_DRIVE.id, 1)
|
|
385
|
+
|
|
386
|
+
await provider.share({
|
|
387
|
+
document,
|
|
388
|
+
recipients: [recipient],
|
|
389
|
+
readOnlyRecipients: [],
|
|
390
|
+
description: 'Shared folder',
|
|
391
|
+
openSharing: true,
|
|
392
|
+
sharedDrive: true
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
expect(sharingCol.addRecipients).not.toHaveBeenCalled()
|
|
396
|
+
expect(sharingCol.create).toHaveBeenCalledWith({
|
|
397
|
+
document,
|
|
398
|
+
recipients: [recipient],
|
|
399
|
+
readOnlyRecipients: [],
|
|
400
|
+
description: 'Shared folder',
|
|
401
|
+
previewPath: '/preview',
|
|
402
|
+
openSharing: true,
|
|
403
|
+
sharedDrive: true
|
|
404
|
+
})
|
|
405
|
+
})
|
|
406
|
+
})
|
|
407
|
+
|
|
294
408
|
describe('fetchSharedDriveSharingLinks', () => {
|
|
295
409
|
const PERM_DRIVE_FILE = {
|
|
296
410
|
type: 'io.cozy.permissions',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, CloudPlusOutlined } from '@linagora/twake-icons'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import CloudPlusOutlinedIcon from 'cozy-ui/transpiled/react/Icons/CloudPlusOutlined'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
7
|
|
|
@@ -35,7 +34,7 @@ export const addToCozySharingLink = ({
|
|
|
35
34
|
const label = t('Share.banner.add_to_mine', {
|
|
36
35
|
smart_count: isShortLabel ? 1 : 2
|
|
37
36
|
})
|
|
38
|
-
const icon =
|
|
37
|
+
const icon = CloudPlusOutlined
|
|
39
38
|
|
|
40
39
|
return {
|
|
41
40
|
name: 'addToCozySharingLink',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, ToTheCloud } from '@linagora/twake-icons'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
7
|
|
|
@@ -32,7 +31,7 @@ export const createCozySharingLink = ({
|
|
|
32
31
|
}) => {
|
|
33
32
|
const { t } = getActionsI18n()
|
|
34
33
|
const label = t('Share.create-cozy', { smart_count: isShortLabel ? 1 : 2 })
|
|
35
|
-
const icon =
|
|
34
|
+
const icon = ToTheCloud
|
|
36
35
|
|
|
37
36
|
return {
|
|
38
37
|
name: 'createCozySharingLink',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, Reply } from '@linagora/twake-icons'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import ReplyIcon from 'cozy-ui/transpiled/react/Icons/Reply'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
7
|
|
|
@@ -31,7 +30,7 @@ export const shareNative = ({
|
|
|
31
30
|
const { t } = getActionsI18n()
|
|
32
31
|
|
|
33
32
|
const label = t('Share.send')
|
|
34
|
-
const icon =
|
|
33
|
+
const icon = Reply
|
|
35
34
|
|
|
36
35
|
return {
|
|
37
36
|
name: 'shareNative',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, Sync } from '@linagora/twake-icons'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import SyncIcon from 'cozy-ui/transpiled/react/Icons/Sync'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
7
|
|
|
@@ -34,7 +33,7 @@ export const syncToCozySharingLink = ({
|
|
|
34
33
|
const label = t('Share.banner.sync_to_mine', {
|
|
35
34
|
smart_count: isShortLabel ? 1 : 2
|
|
36
35
|
})
|
|
37
|
-
const icon =
|
|
36
|
+
const icon = Sync
|
|
38
37
|
|
|
39
38
|
return {
|
|
40
39
|
name: 'syncToCozySharingLink',
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { Icon, Link } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
6
|
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
6
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
-
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
|
|
8
7
|
|
|
9
8
|
import { ExtraAvatar } from './ExtraAvatar'
|
|
10
9
|
import { GroupAvatar } from './GroupAvatar'
|
|
@@ -75,7 +74,7 @@ const AvatarList = ({
|
|
|
75
74
|
{link && (
|
|
76
75
|
<span data-testid="AvatarList-link">
|
|
77
76
|
<Avatar color="none" border innerBorder size={size}>
|
|
78
|
-
<Icon icon={
|
|
77
|
+
<Icon icon={Link} />
|
|
79
78
|
</Avatar>
|
|
80
79
|
</span>
|
|
81
80
|
)}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { Icon, Team } from '@linagora/twake-icons'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import TeamIcon from 'cozy-ui/transpiled/react/Icons/Team'
|
|
6
5
|
|
|
7
6
|
const GroupAvatar = ({ size, className }) => {
|
|
8
7
|
return (
|
|
9
8
|
<Avatar size={size} className={className} border>
|
|
10
|
-
<Icon icon={
|
|
9
|
+
<Icon icon={Team} />
|
|
11
10
|
</Avatar>
|
|
12
11
|
)
|
|
13
12
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, Forbidden } from '@linagora/twake-icons'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import ForbiddenIcon from 'cozy-ui/transpiled/react/Icons/Forbidden'
|
|
6
5
|
import List from 'cozy-ui/transpiled/react/List'
|
|
7
6
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
8
7
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
@@ -23,7 +22,7 @@ const GroupRecipientDetailWithoutAccess = ({ withoutAccess, isOwner }) => {
|
|
|
23
22
|
</Typography>
|
|
24
23
|
<List>
|
|
25
24
|
{withoutAccess.map(recipient => {
|
|
26
|
-
const icon = recipient.status === 'revoked' ?
|
|
25
|
+
const icon = recipient.status === 'revoked' ? Forbidden : null
|
|
27
26
|
const defaultDisplayName = t(DEFAULT_DISPLAY_NAME)
|
|
28
27
|
const name = getDisplayName(recipient, defaultDisplayName)
|
|
29
28
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { Icon, CrossCircleOutline } from '@linagora/twake-icons'
|
|
1
2
|
import React, { useState, useRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
|
|
4
5
|
import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
5
6
|
import ActionsMenuMobileHeader from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuMobileHeader'
|
|
6
7
|
import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
|
|
7
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
8
8
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
9
|
-
import CrossCircleOutlineIcon from 'cozy-ui/transpiled/react/Icons/CrossCircleOutline'
|
|
10
9
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
11
10
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
12
11
|
import Spinner from 'cozy-ui/transpiled/react/Spinner'
|
|
@@ -92,7 +91,7 @@ const GroupRecipientPermissions = ({
|
|
|
92
91
|
className="u-ml-half"
|
|
93
92
|
aria-label={t('Share.members.revoke')}
|
|
94
93
|
>
|
|
95
|
-
<Icon icon={
|
|
94
|
+
<Icon icon={CrossCircleOutline} />
|
|
96
95
|
</IconButton>
|
|
97
96
|
</>
|
|
98
97
|
)}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import { Icon, Gear, Link } from '@linagora/twake-icons'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
3
|
import React, { useState } from 'react'
|
|
3
4
|
|
|
4
5
|
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
5
6
|
import Fade from 'cozy-ui/transpiled/react/Fade'
|
|
6
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
7
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
8
|
-
import Gear from 'cozy-ui/transpiled/react/Icons/Gear'
|
|
9
|
-
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
|
|
10
8
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
11
9
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
12
10
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
@@ -100,7 +98,7 @@ const LinkRecipient = props => {
|
|
|
100
98
|
<ListItem gutters={isMobile ? 'default' : 'double'} size="small">
|
|
101
99
|
<ListItemIcon>
|
|
102
100
|
<Avatar size="m" color="none" border innerBorder>
|
|
103
|
-
<Icon icon={
|
|
101
|
+
<Icon icon={Link} />
|
|
104
102
|
</Avatar>
|
|
105
103
|
</ListItemIcon>
|
|
106
104
|
{isReadOnly ? (
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Icon, Link } from '@linagora/twake-icons'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
|
-
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
|
|
7
6
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
8
7
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
9
8
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
@@ -24,7 +23,7 @@ const LinkRecipientLite = ({ permissions, link }) => {
|
|
|
24
23
|
<ListItem size="small" ellipsis>
|
|
25
24
|
<ListItemIcon>
|
|
26
25
|
<Avatar size="m" color="none" border innerBorder>
|
|
27
|
-
<Icon icon={
|
|
26
|
+
<Icon icon={Link} />
|
|
28
27
|
</Avatar>
|
|
29
28
|
</ListItemIcon>
|
|
30
29
|
<ListItemText
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Icon, CrossCircleOutline } from '@linagora/twake-icons'
|
|
1
2
|
import React, { useState, useRef, useCallback } from 'react'
|
|
2
3
|
|
|
3
4
|
import { useClient } from 'cozy-client'
|
|
@@ -5,9 +6,7 @@ import minilog from 'cozy-minilog'
|
|
|
5
6
|
import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
|
|
6
7
|
import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
7
8
|
import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
|
|
8
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
9
9
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
10
|
-
import CrossCircleOutlineIcon from 'cozy-ui/transpiled/react/Icons/CrossCircleOutline'
|
|
11
10
|
import Spinner from 'cozy-ui/transpiled/react/Spinner'
|
|
12
11
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
13
12
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
@@ -141,7 +140,7 @@ const MemberRecipientPermissions = ({
|
|
|
141
140
|
className="u-ml-half"
|
|
142
141
|
aria-label={t('Share.members.revoke')}
|
|
143
142
|
>
|
|
144
|
-
<Icon icon={
|
|
143
|
+
<Icon icon={CrossCircleOutline} />
|
|
145
144
|
</IconButton>
|
|
146
145
|
</>
|
|
147
146
|
)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Icon, Trash } from '@linagora/twake-icons'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
7
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
@@ -13,13 +12,13 @@ const revokeLink = ({ t, handleRevocation }) => {
|
|
|
13
12
|
return {
|
|
14
13
|
name: 'revokeLink',
|
|
15
14
|
label: title,
|
|
16
|
-
icon:
|
|
15
|
+
icon: Trash,
|
|
17
16
|
action: handleRevocation,
|
|
18
17
|
Component: forwardRef(function RevokeLinkItem(props, ref) {
|
|
19
18
|
return (
|
|
20
19
|
<ActionsMenuItem {...props} ref={ref}>
|
|
21
20
|
<ListItemIcon>
|
|
22
|
-
<Icon icon={
|
|
21
|
+
<Icon icon={Trash} color="var(--errorColor)" />
|
|
23
22
|
</ListItemIcon>
|
|
24
23
|
<ListItemText
|
|
25
24
|
primary={<Typography color="error">{title}</Typography>}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Icon, Share } from '@linagora/twake-icons'
|
|
1
2
|
import classNames from 'classnames'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
|
-
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
|
|
7
6
|
|
|
8
7
|
import styles from '../styles/button.styl'
|
|
9
8
|
|
|
@@ -13,7 +12,7 @@ export const ShareButton = ({ label, onClick, className, ...props }) => (
|
|
|
13
12
|
variant="secondary"
|
|
14
13
|
className={className}
|
|
15
14
|
onClick={() => onClick()}
|
|
16
|
-
startIcon={<Icon icon={
|
|
15
|
+
startIcon={<Icon icon={Share} />}
|
|
17
16
|
label={label}
|
|
18
17
|
{...props}
|
|
19
18
|
/>
|
|
@@ -24,7 +23,7 @@ export const SharedByMeButton = ({ label, onClick, className, ...props }) => (
|
|
|
24
23
|
data-test-id="share-by-me-button"
|
|
25
24
|
className={className}
|
|
26
25
|
onClick={() => onClick()}
|
|
27
|
-
icon={<Icon icon={
|
|
26
|
+
icon={<Icon icon={Share} />}
|
|
28
27
|
label={label}
|
|
29
28
|
{...props}
|
|
30
29
|
/>
|
|
@@ -34,7 +33,7 @@ export const SharedWithMeButton = ({ label, onClick, className, ...props }) => (
|
|
|
34
33
|
<Button
|
|
35
34
|
className={classNames(styles['coz-btn-sharedWithMe'], className)}
|
|
36
35
|
onClick={() => onClick()}
|
|
37
|
-
startIcon={<Icon icon={
|
|
36
|
+
startIcon={<Icon icon={Share} />}
|
|
38
37
|
label={label}
|
|
39
38
|
{...props}
|
|
40
39
|
/>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { Icon, Copy, Link } from '@linagora/twake-icons'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
3
|
import React, { useReducer, useState } from 'react'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
6
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
6
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
-
import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy'
|
|
8
|
-
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
|
|
9
7
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
10
8
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
11
9
|
import { useI18n } from 'twake-i18n'
|
|
@@ -144,12 +142,12 @@ const ShareByLink = ({
|
|
|
144
142
|
label={t(`${documentType}.share.shareByLink.send`)}
|
|
145
143
|
variant="secondary"
|
|
146
144
|
size="medium"
|
|
147
|
-
startIcon={<Icon icon={
|
|
145
|
+
startIcon={<Icon icon={Link} />}
|
|
148
146
|
onClick={shareLink}
|
|
149
147
|
busy={isGenerating}
|
|
150
148
|
/>
|
|
151
149
|
<Button
|
|
152
|
-
label={<Icon icon={
|
|
150
|
+
label={<Icon icon={Copy} />}
|
|
153
151
|
variant="secondary"
|
|
154
152
|
size="medium"
|
|
155
153
|
onClick={generateLinkAndCopyLinkToClipboard}
|
|
@@ -162,7 +160,7 @@ const ShareByLink = ({
|
|
|
162
160
|
label={t(`${documentType}.share.shareByLink.copy`)}
|
|
163
161
|
variant="secondary"
|
|
164
162
|
size="medium"
|
|
165
|
-
startIcon={<Icon icon={
|
|
163
|
+
startIcon={<Icon icon={Link} />}
|
|
166
164
|
onClick={generateLinkAndCopyLinkToClipboard}
|
|
167
165
|
busy={isGenerating}
|
|
168
166
|
/>
|
|
@@ -172,7 +170,7 @@ const ShareByLink = ({
|
|
|
172
170
|
label={t(`${documentType}.share.shareByLink.create`)}
|
|
173
171
|
variant="secondary"
|
|
174
172
|
size="medium"
|
|
175
|
-
startIcon={<Icon icon={
|
|
173
|
+
startIcon={<Icon icon={Link} />}
|
|
176
174
|
onClick={generateLinkSilently}
|
|
177
175
|
busy={isGenerating}
|
|
178
176
|
/>
|