cozy-sharing 36.5.0 → 37.0.1

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,23 @@
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
+ ## [37.0.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@37.0.0...cozy-sharing@37.0.1) (2026-07-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **cozy-sharing:** Restore federated recipient management ([7442f26](https://github.com/cozy/cozy-libs/commit/7442f26f6cdb757d62d656f19d237d7694335c0c))
11
+
12
+ # [37.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@36.5.0...cozy-sharing@37.0.0) (2026-07-16)
13
+
14
+ ### Features
15
+
16
+ - Display correct icon and colors for group avatar ([e630c7a](https://github.com/cozy/cozy-libs/commit/e630c7a9c9cc2d3b784c3bce1848bdcbbf257c25))
17
+ - Update cozy-ui ([8d1d2a1](https://github.com/cozy/cozy-libs/commit/8d1d2a1a32963e7b1fc8efdc07ca76f3e48a430b))
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ - You need cozy-ui >= 140.5.0
22
+
6
23
  # [36.5.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@36.4.2...cozy-sharing@36.5.0) (2026-07-09)
7
24
 
8
25
  ### Features
@@ -88,7 +88,8 @@ var AvatarList = function AvatarList(_ref2) {
88
88
  "data-testid": "AvatarList-avatar".concat(recipient.status === 'owner' ? '-owner' : ''),
89
89
  key: recipient.index
90
90
  }, /*#__PURE__*/React.createElement(GroupAvatar, {
91
- size: size
91
+ size: size,
92
+ color: recipient.color
92
93
  }));
93
94
  }
94
95
 
@@ -1,16 +1,20 @@
1
- import { Icon, Team } from '@linagora/twake-icons';
2
1
  import React from 'react';
3
- import Avatar from 'cozy-ui/transpiled/react/Avatar';
2
+ import { Icon, Peoples } from '@linagora/twake-icons';
3
+ import Avatar, { colorToGradient } from 'cozy-ui/transpiled/react/Avatar';
4
+ import { COLORS } from 'cozy-ui/transpiled/react/ColorList/helpers';
5
+ var DEFAULT_COLOR = COLORS[4];
4
6
 
5
7
  var GroupAvatar = function GroupAvatar(_ref) {
6
8
  var size = _ref.size,
9
+ _ref$color = _ref.color,
10
+ color = _ref$color === void 0 ? DEFAULT_COLOR : _ref$color,
7
11
  className = _ref.className;
8
12
  return /*#__PURE__*/React.createElement(Avatar, {
9
13
  size: size,
10
- className: className,
11
- border: true
14
+ color: colorToGradient(color),
15
+ className: className
12
16
  }, /*#__PURE__*/React.createElement(Icon, {
13
- icon: Team
17
+ icon: Peoples
14
18
  }));
15
19
  };
16
20
 
@@ -18,7 +18,8 @@ export var ContactSuggestion = function ContactSuggestion(_ref) {
18
18
  return /*#__PURE__*/React.createElement(ListItem, {
19
19
  button: true
20
20
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(GroupAvatar, {
21
- size: "m"
21
+ size: "m",
22
+ color: contactOrGroup.color
22
23
  })), /*#__PURE__*/React.createElement(ListItemText, {
23
24
  primary: contactOrGroup.name,
24
25
  secondary: t('Share.members.count', {
@@ -54,6 +54,7 @@ var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
54
54
  t = _useI18n.t;
55
55
 
56
56
  var _useSharingContext = useSharingContext(),
57
+ canReshare = _useSharingContext.canReshare,
57
58
  share = _useSharingContext.share,
58
59
  getSharingById = _useSharingContext.getSharingById,
59
60
  getSharingLink = _useSharingContext.getSharingLink,
@@ -278,6 +279,7 @@ var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
278
279
  var documentPermissions = documentId ? getDocumentPermissions(documentId) : [];
279
280
  var displayedLink = existingDocument !== null && existingDocument !== void 0 && existingDocument.driveId ? getFederatedShareLink(existingDocument) : getSharingLink(existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument._id);
280
281
  var isCurrentUserOwner = documentId ? isOwner(documentId) : false;
282
+ var canManageSharing = isCurrentUserOwner || (documentId ? canReshare(documentId) : false);
281
283
 
282
284
  var handleRevokeSelf = /*#__PURE__*/function () {
283
285
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(document) {
@@ -389,6 +391,7 @@ var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
389
391
  enableCreateContact: true
390
392
  }))), /*#__PURE__*/React.createElement(WhoHasAccess, {
391
393
  isOwner: isCurrentUserOwner,
394
+ canManageSharing: canManageSharing,
392
395
  isSharedDrive: true,
393
396
  recipients: isSending ? frozenRecipients : existingRecipients,
394
397
  document: isSending ? frozenDoc : existingDocument,
@@ -19,6 +19,7 @@ var mockShareByLink = jest.fn();
19
19
  var mockRevoke = jest.fn();
20
20
  var mockRevokeSelf = jest.fn();
21
21
  var mockIsOwner = jest.fn();
22
+ var mockCanReshare = jest.fn();
22
23
  var mockGetSharingLink = jest.fn();
23
24
  var mockGetFederatedShareLink = jest.fn();
24
25
  var mockGetRecipients = jest.fn().mockReturnValue([]);
@@ -38,6 +39,7 @@ jest.mock('../../hooks/useSharingContext', function () {
38
39
  revoke: mockRevoke,
39
40
  revokeSelf: mockRevokeSelf,
40
41
  isOwner: mockIsOwner,
42
+ canReshare: mockCanReshare,
41
43
  getSharingLink: mockGetSharingLink,
42
44
  getFederatedShareLink: mockGetFederatedShareLink,
43
45
  getDocumentPermissions: mockGetDocumentPermissions,
@@ -133,6 +135,7 @@ describe('FederatedFolderModal', function () {
133
135
  mockRevoke.mockResolvedValue();
134
136
  mockRevokeSelf.mockResolvedValue();
135
137
  mockIsOwner.mockReturnValue(false);
138
+ mockCanReshare.mockReturnValue(false);
136
139
  mockGetDocumentPermissions.mockReturnValue([]);
137
140
  mockFetchSharedDriveSharingLinks.mockResolvedValue([]);
138
141
  mockGetSharingLink.mockReturnValue('https://example.com/share/abc123');
@@ -726,36 +729,73 @@ describe('FederatedFolderModal', function () {
726
729
  }
727
730
  }, _callee19);
728
731
  })));
729
- });
730
- describe('onClose callback', function () {
731
- it('should call onClose when close button is clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
732
- var _setup17, findByRole, closeButton;
732
+ it('should allow a write recipient to revoke another recipient', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
733
+ var otherRecipient, _setup17, findByLabelText;
733
734
 
734
735
  return _regeneratorRuntime.wrap(function _callee20$(_context20) {
735
736
  while (1) switch (_context20.prev = _context20.next) {
736
737
  case 0:
737
- _setup17 = setup(), findByRole = _setup17.findByRole;
738
- _context20.next = 3;
738
+ otherRecipient = {
739
+ instance: 'https://other.mycozy.cloud',
740
+ memberIndex: 2,
741
+ sharingId: 'sharing-id',
742
+ type: 'two-way'
743
+ };
744
+ mockCanReshare.mockReturnValue(true);
745
+ mockGetRecipients.mockReturnValue([otherRecipient]);
746
+ _setup17 = setup(), findByLabelText = _setup17.findByLabelText;
747
+ _context20.t0 = fireEvent;
748
+ _context20.next = 7;
749
+ return findByLabelText('Remove from sharing');
750
+
751
+ case 7:
752
+ _context20.t1 = _context20.sent;
753
+
754
+ _context20.t0.click.call(_context20.t0, _context20.t1);
755
+
756
+ _context20.next = 11;
757
+ return waitFor(function () {
758
+ expect(mockCanReshare).toHaveBeenCalledWith(mockDocument._id);
759
+ expect(mockRevoke).toHaveBeenCalledWith(mockDocument, otherRecipient.sharingId, otherRecipient.memberIndex);
760
+ expect(mockRevokeSelf).not.toHaveBeenCalled();
761
+ });
762
+
763
+ case 11:
764
+ case "end":
765
+ return _context20.stop();
766
+ }
767
+ }, _callee20);
768
+ })));
769
+ });
770
+ describe('onClose callback', function () {
771
+ it('should call onClose when close button is clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
772
+ var _setup18, findByRole, closeButton;
773
+
774
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
775
+ while (1) switch (_context21.prev = _context21.next) {
776
+ case 0:
777
+ _setup18 = setup(), findByRole = _setup18.findByRole;
778
+ _context21.next = 3;
739
779
  return findByRole('button', {
740
780
  name: /close/i
741
781
  });
742
782
 
743
783
  case 3:
744
- closeButton = _context20.sent;
784
+ closeButton = _context21.sent;
745
785
  fireEvent.click(closeButton);
746
786
  expect(mockOnClose).toHaveBeenCalled();
747
787
 
748
788
  case 6:
749
789
  case "end":
750
- return _context20.stop();
790
+ return _context21.stop();
751
791
  }
752
- }, _callee20);
792
+ }, _callee21);
753
793
  })));
754
- it('should ask confirmation when close button is clicked with pending recipients', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
755
- var _setup18, getByRole, findByRole, getByText, closeButton;
794
+ it('should ask confirmation when close button is clicked with pending recipients', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
795
+ var _setup19, getByRole, findByRole, getByText, closeButton;
756
796
 
757
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
758
- while (1) switch (_context21.prev = _context21.next) {
797
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
798
+ while (1) switch (_context22.prev = _context22.next) {
759
799
  case 0:
760
800
  usePendingRecipients.mockReturnValue({
761
801
  pendingRecipients: [{
@@ -766,14 +806,14 @@ describe('FederatedFolderModal', function () {
766
806
  selectedOption: 'readWrite',
767
807
  setSelectedOption: jest.fn()
768
808
  });
769
- _setup18 = setup(), getByRole = _setup18.getByRole, findByRole = _setup18.findByRole, getByText = _setup18.getByText;
770
- _context21.next = 4;
809
+ _setup19 = setup(), getByRole = _setup19.getByRole, findByRole = _setup19.findByRole, getByText = _setup19.getByText;
810
+ _context22.next = 4;
771
811
  return findByRole('button', {
772
812
  name: /close/i
773
813
  });
774
814
 
775
815
  case 4:
776
- closeButton = _context21.sent;
816
+ closeButton = _context22.sent;
777
817
  fireEvent.click(closeButton);
778
818
  expect(getByText("Discard the changes you haven't saved?")).toBeTruthy();
779
819
  expect(mockOnClose).not.toHaveBeenCalled();
@@ -784,15 +824,15 @@ describe('FederatedFolderModal', function () {
784
824
 
785
825
  case 10:
786
826
  case "end":
787
- return _context21.stop();
827
+ return _context22.stop();
788
828
  }
789
- }, _callee21);
829
+ }, _callee22);
790
830
  })));
791
- it('should close after discard confirmation', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
792
- var _setup19, getByRole, findByRole, getByText, closeButton;
831
+ it('should close after discard confirmation', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
832
+ var _setup20, getByRole, findByRole, getByText, closeButton;
793
833
 
794
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
795
- while (1) switch (_context22.prev = _context22.next) {
834
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
835
+ while (1) switch (_context23.prev = _context23.next) {
796
836
  case 0:
797
837
  usePendingRecipients.mockReturnValue({
798
838
  pendingRecipients: [{
@@ -803,14 +843,14 @@ describe('FederatedFolderModal', function () {
803
843
  selectedOption: 'readWrite',
804
844
  setSelectedOption: jest.fn()
805
845
  });
806
- _setup19 = setup(), getByRole = _setup19.getByRole, findByRole = _setup19.findByRole, getByText = _setup19.getByText;
807
- _context22.next = 4;
846
+ _setup20 = setup(), getByRole = _setup20.getByRole, findByRole = _setup20.findByRole, getByText = _setup20.getByText;
847
+ _context23.next = 4;
808
848
  return findByRole('button', {
809
849
  name: /close/i
810
850
  });
811
851
 
812
852
  case 4:
813
- closeButton = _context22.sent;
853
+ closeButton = _context23.sent;
814
854
  fireEvent.click(closeButton);
815
855
  expect(getByText("Discard the changes you haven't saved?")).toBeTruthy();
816
856
  fireEvent.click(getByRole('button', {
@@ -820,9 +860,9 @@ describe('FederatedFolderModal', function () {
820
860
 
821
861
  case 9:
822
862
  case "end":
823
- return _context22.stop();
863
+ return _context23.stop();
824
864
  }
825
- }, _callee22);
865
+ }, _callee23);
826
866
  })));
827
867
  });
828
868
  });
@@ -17,6 +17,7 @@ import { GroupAvatar } from '../Avatar/GroupAvatar';
17
17
 
18
18
  var GroupRecipient = function GroupRecipient(props) {
19
19
  var name = props.name,
20
+ color = props.color,
20
21
  members = props.members,
21
22
  fadeIn = props.fadeIn,
22
23
  owner = props.owner,
@@ -60,7 +61,8 @@ var GroupRecipient = function GroupRecipient(props) {
60
61
  gutters: isMobile ? 'default' : 'double',
61
62
  size: "small"
62
63
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(GroupAvatar, {
63
- size: "m"
64
+ size: "m",
65
+ color: color
64
66
  })), /*#__PURE__*/React.createElement(ListItemText, {
65
67
  primary: /*#__PURE__*/React.createElement(Typography, {
66
68
  variant: "body1"
@@ -1,8 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- import { Icon, CrossCircleOutline } from '@linagora/twake-icons';
5
4
  import React, { useState, useRef } from 'react';
5
+ import { Icon, CrossCircleOutline } from '@linagora/twake-icons';
6
6
  import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu';
7
7
  import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions';
8
8
  import ActionsMenuMobileHeader from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuMobileHeader';
@@ -19,6 +19,7 @@ import { GroupAvatar } from '../Avatar/GroupAvatar';
19
19
 
20
20
  var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
21
21
  var name = _ref.name,
22
+ color = _ref.color,
22
23
  isOwner = _ref.isOwner,
23
24
  isReadOnly = _ref.isReadOnly,
24
25
  sharingId = _ref.sharingId,
@@ -118,7 +119,8 @@ var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
118
119
  autoClose: true,
119
120
  onClose: hideMenu
120
121
  }, /*#__PURE__*/React.createElement(ActionsMenuMobileHeader, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(GroupAvatar, {
121
- size: "m"
122
+ size: "m",
123
+ color: color
122
124
  })), /*#__PURE__*/React.createElement(ListItemText, {
123
125
  primary: name,
124
126
  primaryTypographyProps: {
@@ -188,7 +188,8 @@ var ShareAutosuggest = function ShareAutosuggest(_ref) {
188
188
  id: "recipient_".concat(idx),
189
189
  key: "key_recipient_".concat(idx),
190
190
  avatar: isContactGroup ? /*#__PURE__*/React.createElement(GroupAvatar, {
191
- size: "xs"
191
+ size: "xs",
192
+ color: recipient.color
192
193
  }) : /*#__PURE__*/React.createElement(Avatar, {
193
194
  size: "xs"
194
195
  }, avatarText),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "36.5.0",
3
+ "version": "37.0.1",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -58,8 +58,8 @@
58
58
  "cozy-device-helper": "^4.0.0",
59
59
  "cozy-intent": "^2.31.1",
60
60
  "cozy-minilog": "^3.10.1",
61
- "cozy-ui": "^139.0.2",
62
- "cozy-ui-plus": "^12.0.1",
61
+ "cozy-ui": "^140.5.0",
62
+ "cozy-ui-plus": "^12.0.3",
63
63
  "jest": "30.3.0",
64
64
  "jest-environment-jsdom": "30.3.0",
65
65
  "react": "16.12.0",
@@ -75,7 +75,7 @@
75
75
  "cozy-flags": ">=4.8.1",
76
76
  "cozy-intent": ">=2.29.1",
77
77
  "cozy-minilog": ">=3.9.1",
78
- "cozy-ui": ">=139.0.2",
78
+ "cozy-ui": ">=140.5.0",
79
79
  "cozy-ui-plus": ">=6.0.0",
80
80
  "prop-types": ">=15.7.2",
81
81
  "react": ">=16.12.0",
@@ -85,5 +85,5 @@
85
85
  "sideEffects": [
86
86
  "*.css"
87
87
  ],
88
- "gitHead": "8f766c3da5a35109325e1a3451e78e7c1b30e515"
88
+ "gitHead": "6326a5cba450641157e2f03754a99a38cc634d5a"
89
89
  }
@@ -92,7 +92,7 @@ const AvatarList = ({
92
92
  }`}
93
93
  key={recipient.index}
94
94
  >
95
- <GroupAvatar size={size} />
95
+ <GroupAvatar size={size} color={recipient.color} />
96
96
  </span>
97
97
  )
98
98
  }
@@ -1,12 +1,15 @@
1
- import { Icon, Team } from '@linagora/twake-icons'
2
1
  import React from 'react'
3
2
 
4
- import Avatar from 'cozy-ui/transpiled/react/Avatar'
3
+ import { Icon, Peoples } from '@linagora/twake-icons'
4
+ import Avatar, { colorToGradient } from 'cozy-ui/transpiled/react/Avatar'
5
+ import { COLORS } from 'cozy-ui/transpiled/react/ColorList/helpers'
5
6
 
6
- const GroupAvatar = ({ size, className }) => {
7
+ const DEFAULT_COLOR = COLORS[4]
8
+
9
+ const GroupAvatar = ({ size, color = DEFAULT_COLOR, className }) => {
7
10
  return (
8
- <Avatar size={size} className={className} border>
9
- <Icon icon={Team} />
11
+ <Avatar size={size} color={colorToGradient(color)} className={className}>
12
+ <Icon icon={Peoples} />
10
13
  </Avatar>
11
14
  )
12
15
  }
@@ -18,7 +18,7 @@ export const ContactSuggestion = ({ contactOrGroup }) => {
18
18
  return (
19
19
  <ListItem button>
20
20
  <ListItemIcon>
21
- <GroupAvatar size="m" />
21
+ <GroupAvatar size="m" color={contactOrGroup.color} />
22
22
  </ListItemIcon>
23
23
  <ListItemText
24
24
  primary={contactOrGroup.name}
@@ -35,6 +35,7 @@ const FederatedFolderModalContent = ({
35
35
  const client = useClient()
36
36
  const { t } = useI18n()
37
37
  const {
38
+ canReshare,
38
39
  share,
39
40
  getSharingById,
40
41
  getSharingLink,
@@ -224,6 +225,8 @@ const FederatedFolderModalContent = ({
224
225
  ? getFederatedShareLink(existingDocument)
225
226
  : getSharingLink(existingDocument?._id)
226
227
  const isCurrentUserOwner = documentId ? isOwner(documentId) : false
228
+ const canManageSharing =
229
+ isCurrentUserOwner || (documentId ? canReshare(documentId) : false)
227
230
 
228
231
  const handleRevokeSelf = async document => {
229
232
  await revokeSelf(document)
@@ -323,6 +326,7 @@ const FederatedFolderModalContent = ({
323
326
  </div>
324
327
  <WhoHasAccess
325
328
  isOwner={isCurrentUserOwner}
329
+ canManageSharing={canManageSharing}
326
330
  isSharedDrive
327
331
  recipients={isSending ? frozenRecipients : existingRecipients}
328
332
  document={isSending ? frozenDoc : existingDocument}
@@ -13,6 +13,7 @@ const mockShareByLink = jest.fn()
13
13
  const mockRevoke = jest.fn()
14
14
  const mockRevokeSelf = jest.fn()
15
15
  const mockIsOwner = jest.fn()
16
+ const mockCanReshare = jest.fn()
16
17
  const mockGetSharingLink = jest.fn()
17
18
  const mockGetFederatedShareLink = jest.fn()
18
19
  const mockGetRecipients = jest.fn().mockReturnValue([])
@@ -31,6 +32,7 @@ jest.mock('../../hooks/useSharingContext', () => ({
31
32
  revoke: mockRevoke,
32
33
  revokeSelf: mockRevokeSelf,
33
34
  isOwner: mockIsOwner,
35
+ canReshare: mockCanReshare,
34
36
  getSharingLink: mockGetSharingLink,
35
37
  getFederatedShareLink: mockGetFederatedShareLink,
36
38
  getDocumentPermissions: mockGetDocumentPermissions,
@@ -109,6 +111,7 @@ describe('FederatedFolderModal', () => {
109
111
  mockRevoke.mockResolvedValue()
110
112
  mockRevokeSelf.mockResolvedValue()
111
113
  mockIsOwner.mockReturnValue(false)
114
+ mockCanReshare.mockReturnValue(false)
112
115
  mockGetDocumentPermissions.mockReturnValue([])
113
116
  mockFetchSharedDriveSharingLinks.mockResolvedValue([])
114
117
  mockGetSharingLink.mockReturnValue('https://example.com/share/abc123')
@@ -472,6 +475,31 @@ describe('FederatedFolderModal', () => {
472
475
  expect(onRevokeSuccess).toHaveBeenCalledWith(mockDocument)
473
476
  })
474
477
  })
478
+
479
+ it('should allow a write recipient to revoke another recipient', async () => {
480
+ const otherRecipient = {
481
+ instance: 'https://other.mycozy.cloud',
482
+ memberIndex: 2,
483
+ sharingId: 'sharing-id',
484
+ type: 'two-way'
485
+ }
486
+ mockCanReshare.mockReturnValue(true)
487
+ mockGetRecipients.mockReturnValue([otherRecipient])
488
+
489
+ const { findByLabelText } = setup()
490
+
491
+ fireEvent.click(await findByLabelText('Remove from sharing'))
492
+
493
+ await waitFor(() => {
494
+ expect(mockCanReshare).toHaveBeenCalledWith(mockDocument._id)
495
+ expect(mockRevoke).toHaveBeenCalledWith(
496
+ mockDocument,
497
+ otherRecipient.sharingId,
498
+ otherRecipient.memberIndex
499
+ )
500
+ expect(mockRevokeSelf).not.toHaveBeenCalled()
501
+ })
502
+ })
475
503
  })
476
504
 
477
505
  describe('onClose callback', () => {
@@ -19,7 +19,7 @@ import {
19
19
  import { GroupAvatar } from '../Avatar/GroupAvatar'
20
20
 
21
21
  const GroupRecipient = props => {
22
- const { name, members, fadeIn, owner, isOwner } = props
22
+ const { name, color, members, fadeIn, owner, isOwner } = props
23
23
  const { t } = useI18n()
24
24
  const client = useClient()
25
25
  const { isMobile } = useBreakpoints()
@@ -52,7 +52,7 @@ const GroupRecipient = props => {
52
52
  size="small"
53
53
  >
54
54
  <ListItemIcon>
55
- <GroupAvatar size="m" />
55
+ <GroupAvatar size="m" color={color} />
56
56
  </ListItemIcon>
57
57
  <ListItemText
58
58
  primary={<Typography variant="body1">{name}</Typography>}
@@ -1,6 +1,6 @@
1
- import { Icon, CrossCircleOutline } from '@linagora/twake-icons'
2
1
  import React, { useState, useRef } from 'react'
3
2
 
3
+ import { Icon, CrossCircleOutline } from '@linagora/twake-icons'
4
4
  import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
5
5
  import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
6
6
  import ActionsMenuMobileHeader from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuMobileHeader'
@@ -18,6 +18,7 @@ import { GroupAvatar } from '../Avatar/GroupAvatar'
18
18
 
19
19
  const GroupRecipientPermissions = ({
20
20
  name,
21
+ color,
21
22
  isOwner,
22
23
  isReadOnly,
23
24
  sharingId,
@@ -83,7 +84,7 @@ const GroupRecipientPermissions = ({
83
84
  >
84
85
  <ActionsMenuMobileHeader>
85
86
  <ListItemIcon>
86
- <GroupAvatar size="m" />
87
+ <GroupAvatar size="m" color={color} />
87
88
  </ListItemIcon>
88
89
  <ListItemText
89
90
  primary={name}
@@ -161,7 +161,7 @@ const ShareAutosuggest = ({
161
161
  key={`key_recipient_${idx}`}
162
162
  avatar={
163
163
  isContactGroup ? (
164
- <GroupAvatar size="xs" />
164
+ <GroupAvatar size="xs" color={recipient.color} />
165
165
  ) : (
166
166
  <Avatar size="xs">{avatarText}</Avatar>
167
167
  )