cozy-sharing 21.2.2 → 21.3.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/SharingProvider.js +4 -3
  3. package/dist/assets/illustrations/illustration-shared-drives.svg +1 -0
  4. package/dist/components/Avatar/AvatarList.js +0 -1
  5. package/dist/components/Identity/ExtraIdentity.js +0 -1
  6. package/dist/components/Identity/Identity.js +0 -1
  7. package/dist/components/Identity/MemberIdentity.js +0 -1
  8. package/dist/components/Identity/OwnerIdentity.js +0 -1
  9. package/dist/components/Recipient/GroupRecipient.js +0 -1
  10. package/dist/components/Recipient/GroupRecipientPermissions.js +0 -4
  11. package/dist/components/Recipient/LinkRecipient.js +0 -2
  12. package/dist/components/Recipient/LinkRecipientLite.js +0 -1
  13. package/dist/components/Recipient/MemberRecipient.js +0 -1
  14. package/dist/components/Recipient/MemberRecipientPermissions.js +0 -4
  15. package/dist/components/Recipient/MemberRecipientStatus.js +4 -22
  16. package/dist/components/Recipient/RecipientList.js +15 -0
  17. package/dist/components/Recipient/actions/revokeSharedDriveMember.js +41 -0
  18. package/dist/components/Recipient/actions/setReadOnlySharedPermission.js +54 -0
  19. package/dist/components/Recipient/actions/setReadWriteSharedPermission.js +54 -0
  20. package/dist/components/ShareByEmail.js +32 -19
  21. package/dist/components/ShareDialogCozyToCozy.js +0 -2
  22. package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +0 -2
  23. package/dist/components/ShareModal.js +0 -3
  24. package/dist/components/ShareRestrictionModal/BoxEditingRights.js +0 -4
  25. package/dist/components/SharedDrive/SharedDriveModal.js +350 -0
  26. package/dist/components/SharedDrive/SharedDriveRecipient.js +61 -0
  27. package/dist/components/SharedDrive/SharedDriveRecipientPermissions.js +101 -0
  28. package/dist/components/SharedDrive/SharedDriveRecipientStatus.js +22 -0
  29. package/dist/components/SharedDrive/helpers.js +53 -0
  30. package/dist/components/WhoHasAccess.js +3 -1
  31. package/dist/components/WhoHasAccessLight.js +0 -1
  32. package/dist/index.js +1 -0
  33. package/dist/styles/autosuggest.styl +6 -2
  34. package/dist/styles/recipient.styl +0 -3
  35. package/dist/styles/shareddrive.styl +8 -0
  36. package/dist/stylesheet.css +20 -4
  37. package/locales/en.json +16 -0
  38. package/locales/fr.json +16 -0
  39. package/package.json +2 -2
  40. package/src/SharingProvider.jsx +4 -2
  41. package/src/assets/illustrations/illustration-shared-drives.svg +1 -0
  42. package/src/components/Recipient/GroupRecipient.jsx +1 -5
  43. package/src/components/Recipient/GroupRecipientPermissions.jsx +0 -4
  44. package/src/components/Recipient/LinkRecipient.jsx +1 -5
  45. package/src/components/Recipient/MemberRecipient.jsx +1 -1
  46. package/src/components/Recipient/MemberRecipientPermissions.jsx +0 -4
  47. package/src/components/Recipient/MemberRecipientStatus.jsx +7 -17
  48. package/src/components/Recipient/RecipientList.jsx +18 -0
  49. package/src/components/Recipient/actions/revokeSharedDriveMember.js +41 -0
  50. package/src/components/Recipient/actions/setReadOnlySharedPermission.js +43 -0
  51. package/src/components/Recipient/actions/setReadWriteSharedPermission.js +43 -0
  52. package/src/components/ShareByEmail.jsx +33 -23
  53. package/src/components/ShareDialogCozyToCozy.jsx +0 -2
  54. package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +0 -2
  55. package/src/components/ShareModal.jsx +0 -3
  56. package/src/components/ShareRestrictionModal/BoxEditingRights.jsx +0 -4
  57. package/src/components/SharedDrive/SharedDriveModal.jsx +196 -0
  58. package/src/components/SharedDrive/SharedDriveRecipient.jsx +62 -0
  59. package/src/components/SharedDrive/SharedDriveRecipientPermissions.jsx +77 -0
  60. package/src/components/SharedDrive/SharedDriveRecipientStatus.jsx +23 -0
  61. package/src/components/SharedDrive/helpers.js +60 -0
  62. package/src/components/WhoHasAccess.jsx +3 -1
  63. package/src/index.jsx +1 -0
  64. package/src/styles/autosuggest.styl +6 -2
  65. package/src/styles/recipient.styl +0 -3
  66. package/src/styles/shareddrive.styl +8 -0
@@ -115,9 +115,6 @@
115
115
  overflow: hidden;
116
116
  text-overflow: ellipsis;
117
117
  }
118
- .recipient__recipient-status-icon___-liGw {
119
- margin-right: 0.25rem;
120
- }
121
118
  .recipient__recipient-user___1THIU,
122
119
  .recipient__recipient-details___2fZfc {
123
120
  text-overflow: ellipsis;
@@ -446,12 +443,18 @@ input[type=text] {
446
443
  border: none;
447
444
  }
448
445
  .autosuggest__recipientsContainer___1JYxA input[type=email]:hover,
449
- .autosuggest__recipientsContainer___1JYxA input[type=email]:focus {
446
+ .autosuggest__recipientsContainer___1JYxA input[type=email]:focus,
447
+ .autosuggest__recipientsContainer___1JYxA input[type=email]:focus-visible {
450
448
  border: none;
449
+ outline: none;
451
450
  }
452
451
  .autosuggest__recipientsContainer___1JYxA input[type=email]:first-child {
453
452
  padding: 0.25rem 0.5rem;
454
453
  }
454
+ .autosuggest__recipientsContainer___1JYxA input[type=email]::placeholder {
455
+ color: var(--secondaryTextColor);
456
+ font-size: 1rem;
457
+ }
455
458
  .autosuggest__recipientChip___d5I3R {
456
459
  margin: 0.25rem 0.5rem 0.25rem 0;
457
460
  }
@@ -514,6 +517,19 @@ input[type=text] {
514
517
  .badge__shared-badge___2jGsy.badge__--with-me___3jW7R {
515
518
  background-color: #9169f2;
516
519
  }
520
+ /* imported from shareddrive.styl */
521
+
522
+ @media (max-width: 48rem) {
523
+ }
524
+ @media (max-width: 48rem) {
525
+ }
526
+ .shareddrive__shared-drive-who-has-access-wrapper___K1kbr {
527
+ border: 1px solid var(--borderMainColor);
528
+ border-radius: 0.5rem;
529
+ width: 100%;
530
+ padding: 1rem;
531
+ box-sizing: border-box;
532
+ }
517
533
  /* imported from status.styl */
518
534
 
519
535
  .status__shared-status___2HpyL {
package/locales/en.json CHANGED
@@ -387,6 +387,11 @@
387
387
  "desc": "You keep the content but it won't be updated between your Cozy anymore."
388
388
  }
389
389
  },
390
+ "RevokeSharedDriveMemberItem": {
391
+ "revoke": {
392
+ "title": "Remove"
393
+ }
394
+ },
390
395
  "GroupRecipient": {
391
396
  "secondary": "%{memberCount} member |||| %{memberCount} members",
392
397
  "secondary_you": "including you"
@@ -446,5 +451,16 @@
446
451
  "error": "Problem with link recovery: %{error}",
447
452
  "text": "Link to my document %{name}: |||| Link to my documents %{name}: ",
448
453
  "title": "Link to my document %{name} |||| Link to my documents %{name}"
454
+ },
455
+ "SharedDrive": {
456
+ "sharedDriveModal": {
457
+ "title": "New shared drive",
458
+ "nameLabel": "Drive name",
459
+ "descriptionLabel": "Description",
460
+ "add": "Add",
461
+ "create": "Create",
462
+ "successNotification": "Shared drive has been added",
463
+ "errorNotification": "Error during shared drive creation"
464
+ }
449
465
  }
450
466
  }
package/locales/fr.json CHANGED
@@ -385,6 +385,11 @@
385
385
  "desc": "Vous conservez le contenu mais il ne sera plus mis à jour entre vos Cozy."
386
386
  }
387
387
  },
388
+ "RevokeSharedDriveMemberItem": {
389
+ "revoke": {
390
+ "title": "Supprimer"
391
+ }
392
+ },
388
393
  "GroupRecipient": {
389
394
  "secondary": "%{memberCount} membre |||| %{memberCount} membres",
390
395
  "secondary_you": "dont vous"
@@ -445,5 +450,16 @@
445
450
  "error": "Problème avec la récupération du lien : %{error}",
446
451
  "text": "Voici un lien vers mon document %{name} : |||| Voici un lien contenant mes documents %{name} : ",
447
452
  "title": "Lien vers mon document %{name} |||| Lien vers mes documents %{name}"
453
+ },
454
+ "SharedDrive": {
455
+ "sharedDriveModal": {
456
+ "title": "Nouveau drive partagé",
457
+ "nameLabel": "Nom du drive partagé",
458
+ "descriptionLabel": "Description",
459
+ "add": "Ajouter",
460
+ "create": "Créer",
461
+ "successNotification": "Le drive partagé a été ajouté",
462
+ "errorNotification": "Erreur lors de la création du drive partagé"
463
+ }
448
464
  }
449
465
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "21.2.2",
3
+ "version": "21.3.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -78,5 +78,5 @@
78
78
  "sideEffects": [
79
79
  "*.css"
80
80
  ],
81
- "gitHead": "b257fb0f869d9797d5222aa8481e7035a890aeb4"
81
+ "gitHead": "0731c882716cb96e44a44e1a57f6554fd45065bf"
82
82
  }
@@ -225,7 +225,8 @@ export class SharingProvider extends Component {
225
225
  recipients,
226
226
  readOnlyRecipients,
227
227
  description,
228
- openSharing
228
+ openSharing,
229
+ sharedDrive
229
230
  }) => {
230
231
  const { client, doctype } = this.props
231
232
  const sharing = getDocumentSharing(this.state, document.id)
@@ -249,7 +250,8 @@ export class SharingProvider extends Component {
249
250
  readOnlyRecipients,
250
251
  description,
251
252
  previewPath,
252
- openSharing
253
+ openSharing,
254
+ sharedDrive
253
255
  })
254
256
 
255
257
  this.dispatch(
@@ -0,0 +1 @@
1
+ <svg width="200" height="136" viewBox="0 0 200 136" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M161 14.592c-1.888.222-7.568-.664-15.182-5.982-9.518-6.647-13.847-8.724-22.434-4.183C115 8.86 115.227 23.012 115 27" stroke="#CEBEF7" stroke-width="4" stroke-linecap="round"/><path d="M165.844 92c5.431-3.51 16.097-12.335 15.315-19.555-.977-9.025-12.708-11.281-22.81-10.78-10.101.502-17.596 4.513-28.349 1.504" stroke="#B9F6F7" stroke-width="4" stroke-linecap="round"/><path d="M23.495 72c-.329 4.729-2.425 21.765 5.479 27.308 9.88 6.928 23.668-1.244 30.831-5.203C66.97 90.146 79.072 83.217 85 85.527" stroke="#FFD799" stroke-width="4" stroke-linecap="round"/><circle cx="100" cy="64" fill="#297EF2" r="48"/><circle cx="148" cy="104" r="24" fill="#B9F6F7"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148 106c-4.418 0-8-4.029-8-9 0-4.97 3.582-9 8-9s8 4.03 8 9c0 4.971-3.582 9-8 9Zm-16 10c0-2 4-8 8-8s2 2 8 2 4-2 8-2 8 6 8 8 0 4-2 4h-28c-2 0-2-2-2-4Z" fill="#38D1D3"/><circle cx="148" cy="104" r="20" stroke="#B9F6F7" stroke-width="8"/><circle cx="24" cy="65" r="24" fill="#FFD799"/><path fill-rule="evenodd" clip-rule="evenodd" d="M24 67c-4.418 0-8-4.03-8-9s3.582-9 8-9 8 4.03 8 9-3.582 9-8 9ZM8 77c0-2 4-8 8-8s2 2 8 2 4-2 8-2 8 6 8 8 0 4-2 4H10c-2 0-2-2-2-4Z" fill="#FF9300"/><circle cx="24" cy="65" r="20" stroke="#FFD799" stroke-width="8"/><circle cx="172" cy="28" r="24" fill="#CEBEF7"/><path fill-rule="evenodd" clip-rule="evenodd" d="M172 30c-4.418 0-8-4.03-8-9s3.582-9 8-9 8 4.03 8 9-3.582 9-8 9Zm-16 10c0-2 4-8 8-8s2 2 8 2 4-2 8-2 8 6 8 8 0 4-2 4h-28c-2 0-2-2-2-4Z" fill="#855CEA"/><circle cx="172" cy="28" r="20" stroke="#CEBEF7" stroke-width="8"/><path d="M66.418 133.29a81.818 81.818 0 0 0 16.142 2.244c16.166.948 38.758.424 48.325-1.346 9.567-1.771 10.083-4.465-14.448-5.812-20.925-1.147-45.26.474-50.362 2.894-1.52.648-1.447 1.371.343 2.02Z" fill="#BBD9FD"/><path d="M80.198 64.752a6 6 0 0 1 4.686-2.252h30.232c1.823 0 3.547.828 4.685 2.252l3.213 4.015c.638.798.986 1.79.986 2.812V76H76v-4.421a4.5 4.5 0 0 1 .986-2.812l3.212-4.015ZM80.198 43.752a6 6 0 0 1 4.686-2.252h30.232c1.823 0 3.547.828 4.685 2.252l3.213 4.015c.638.798.986 1.79.986 2.811V55H76v-4.422a4.5 4.5 0 0 1 .986-2.81l3.212-4.016Z" fill="#fff"/><path d="M76 71.5a3 3 0 0 1 3-3h42a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H79a3 3 0 0 1-3-3v-12ZM76 50.5a3 3 0 0 1 3-3h42a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H79a3 3 0 0 1-3-3v-12Z" fill="#B2D3FF"/><path d="M88 77.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM88 56.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" fill="#fff"/><path d="M194.751 99.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.211.06 0 .182.06.364.06.607.061 1.757 2.785 1.757 2.664 0 0-.182 0-.364-.061-.546.303-.121.666-.121.969-.242ZM48.112 111.445c1.212-.045 1.17-1.968-.043-1.968-.216 0-.433 0-.65.134v-.627c-.043-.537-.389-.984-.952-.984-.476 0-.995.447-.952.984v.537H45.3c-.13-.044-.217 0-.347 0-.649 0-.952.671-.952 1.164 0 .492.26.715.65.85.259.134.562.044.865.044 0 .135.043.269.043.448.044 1.297 1.992 1.297 1.905 0 0-.134 0-.269-.043-.403.216-.089.476-.089.692-.179ZM176.04 97.024c.121.424.424.788.666.97.666.424 1.695.303 2.179-.425.484-.666.545-1.757-.484-2.363-.908-.546-1.998.06-2.301 1.03-.121.242-.121.485-.06.788Z" fill="#BBD9FD"/><path d="M185.045 86.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.545-2.363-.908-.546-1.998.06-2.301 1.03-.06.242-.06.545 0 .788ZM28.09 29.576c1.695-.06 1.634-2.667-.061-2.667-.303 0-.605 0-.908.182V26.243c-.06-.788-.545-1.394-1.332-1.394-.666 0-1.392.606-1.332 1.333v.727h-.303c-.181-.06-.302 0-.484 0-.908 0-1.332.91-1.332 1.576 0 .667.364.97.908 1.152.364.181.787.06 1.211.06 0 .182.06.364.06.606.061 1.758 2.785 1.758 2.664 0 0-.182 0-.364-.06-.545.303 0 .666-.06.968-.182ZM78.751 8.667C80.446 8.607 80.386 6 78.691 6c-.303 0-.606 0-.909.182v-.849C77.722 4.606 77.239 4 76.451 4c-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.21.06 0 .182.061.364.061.607.06 1.757 2.785 1.757 2.664 0 0-.182 0-.364-.06-.546.302-.121.665-.121.968-.242Z" fill="#3281EE"/><path d="M107.751 10.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.211.06 0 .182.06.364.06.606.061 1.758 2.785 1.758 2.664 0 0-.181 0-.363-.061-.545.303-.06.666-.121.969-.242ZM21.612 7.879h-1.634v-1.03c0-2.304-3.633-2.304-3.572 0 0 .424 0 .848.06 1.272-.181 0-.847-.06-.968-.121-2.18-.727-3.148 2.727-.969 3.454.545.182 1.574.182 2.119.182v.788c0 2.303 3.632 2.303 3.572 0v-.97c.484 0 .968-.06 1.513-.06 2.18.06 2.18-3.515-.12-3.515ZM8.9 32.485c.12.424.423.788.665.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.485-2.363-.908-.546-1.998.06-2.3 1.03-.121.242-.121.546-.06.788ZM44.04 41.024c.12.424.424.788.666.97.666.424 1.695.303 2.179-.425.484-.666.545-1.757-.484-2.363-.908-.546-1.998.06-2.3 1.03-.122.242-.122.546-.061.788ZM58.066 16.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.485-2.363-.908-.546-1.998.06-2.3 1.03a.87.87 0 0 0-.061.788Z" fill="#BBD9FD"/><path d="M43.89 7.576c.12.424.423.788.666.97.666.424 1.695.302 2.179-.425.484-.667.545-1.757-.545-2.363-.908-.546-1.998.06-2.3 1.03-.06.242-.06.545 0 .788ZM84.026 28.97c.12.424.424.787.666.969.666.424 1.695.303 2.18-.424.483-.667.544-1.758-.546-2.364-.908-.545-1.997.06-2.3 1.03a1.73 1.73 0 0 0 0 .788Z" fill="#3281EE"/><path d="M20.04 107.024c.12.424.424.788.666.97.666.424 1.695.303 2.179-.425.484-.666.545-1.757-.484-2.363-.908-.546-1.998.06-2.3 1.03-.122.242-.122.546-.061.788ZM5.04 88.024c.12.424.424.788.666.97.666.424 1.695.303 2.179-.425.484-.666.545-1.757-.484-2.363-.908-.546-1.998.06-2.3 1.03-.122.242-.122.545-.061.788Z" fill="#BBD9FD"/><path d="M191.311 54.758h-1.634v-1.03c0-2.304-3.632-2.304-3.572 0 0 .423 0 .848.061 1.272-.182 0-.848-.06-.969-.121-2.179-.727-3.148 2.727-.969 3.454.545.182 1.574.182 2.119.182v.788c0 2.303 3.633 2.303 3.572 0v-.97c.484 0 .969-.06 1.513-.06 2.24.06 2.24-3.515-.121-3.515Z" fill="#3281EE"/><path d="M136.045 21.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.545-2.363-.908-.546-1.998.06-2.301 1.03-.06.242-.06.485 0 .788Z" fill="#BBD9FD"/><path d="M129.045 10.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.545-1.757-.545-2.363-.908-.546-1.998.06-2.301 1.03-.06.242-.06.546 0 .788ZM46.07 26.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.546-2.363-.908-.546-1.997.06-2.3 1.03-.06.242-.121.546 0 .788ZM11.751 99.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.21.06 0 .182.061.364.061.607.06 1.757 2.785 1.757 2.664 0 0-.182 0-.364-.06-.546.363-.06.665-.121.968-.242ZM164.751 74.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.211.06 0 .182.06.364.06.606.061 1.758 2.785 1.758 2.664 0 0-.181 0-.363-.061-.545.364-.06.666-.121.969-.242ZM153.045 56.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.545-1.757-.545-2.363-.908-.546-1.998.06-2.301 1.03-.06.242-.06.546 0 .788Z" fill="#3281EE"/><path d="M193.07 73.024c.121.424.424.788.666.97.666.424 1.695.303 2.179-.425.484-.666.545-1.757-.545-2.363-.908-.546-1.997.06-2.3 1.03-.061.242-.121.545 0 .788ZM194.751 7.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.211.06 0 .182.06.364.06.607.061 1.757 2.785 1.757 2.664 0 0-.182 0-.364-.061-.546.303-.121.666-.182.969-.242Z" fill="#BBD9FD"/><path d="M49.751 89.667c1.695-.06 1.635-2.667-.06-2.667-.303 0-.606 0-.909.182v-.849c-.06-.727-.544-1.333-1.331-1.333-.666 0-1.393.606-1.332 1.333v.728h-.303c-.181-.061-.303 0-.484 0-.908 0-1.332.909-1.332 1.575 0 .667.363.97.908 1.152.363.182.787.06 1.21.06 0 .182.061.364.061.606.06 1.758 2.785 1.758 2.664 0 0-.181 0-.363-.06-.545.302-.121.665-.182.968-.242ZM59.045 105.024c.121.424.424.788.666.97.666.424 1.695.303 2.18-.425.484-.666.544-1.757-.545-2.363-.908-.546-1.998.06-2.3 1.03-.061.243-.061.546 0 .788Z" fill="#3281EE"/></svg>
@@ -55,11 +55,7 @@ const GroupRecipient = props => {
55
55
  <GroupAvatar size="small" />
56
56
  </ListItemIcon>
57
57
  <ListItemText
58
- primary={
59
- <Typography className="u-ellipsis" variant="body1">
60
- {name}
61
- </Typography>
62
- }
58
+ primary={<Typography variant="body1">{name}</Typography>}
63
59
  secondary={getGroupRecipientSecondaryText({
64
60
  t,
65
61
  nbMember,
@@ -76,10 +76,6 @@ const GroupRecipientPermissions = ({
76
76
  ref={buttonRef}
77
77
  open={isMenuDisplayed}
78
78
  actions={actions}
79
- anchorOrigin={{
80
- vertical: 'bottom',
81
- horizontal: 'right'
82
- }}
83
79
  autoClose
84
80
  onClose={hideMenu}
85
81
  >
@@ -65,11 +65,7 @@ const LinkRecipient = props => {
65
65
  </Circle>
66
66
  </ListItemIcon>
67
67
  <ListItemText
68
- primary={
69
- <Typography className="u-ellipsis" variant="body1">
70
- {textPrimary}
71
- </Typography>
72
- }
68
+ primary={<Typography variant="body1">{textPrimary}</Typography>}
73
69
  secondary={textSecondary}
74
70
  />
75
71
  {RightPart}
@@ -57,7 +57,7 @@ const MemberRecipient = props => {
57
57
  </ListItemIcon>
58
58
  <ListItemText
59
59
  primary={
60
- <Typography className="u-ellipsis" variant="body1">
60
+ <Typography variant="body1">
61
61
  {isMe ? t('Share.recipients.you') : name}
62
62
  </Typography>
63
63
  }
@@ -84,10 +84,6 @@ const MemberRecipientPermissions = ({
84
84
  ref={buttonRef}
85
85
  open={isMenuDisplayed}
86
86
  actions={actions}
87
- anchorOrigin={{
88
- vertical: 'bottom',
89
- horizontal: 'right'
90
- }}
91
87
  autoClose
92
88
  onClose={hideMenu}
93
89
  />
@@ -5,11 +5,8 @@ import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
5
5
  import PaperplaneIcon from 'cozy-ui/transpiled/react/Icons/Paperplane'
6
6
  import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud'
7
7
  import Typography from 'cozy-ui/transpiled/react/Typography'
8
- import { Media, Img, Bd } from 'cozy-ui/transpiled/react/deprecated/Media'
9
8
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
10
9
 
11
- import styles from '../../styles/recipient.styl'
12
-
13
10
  const MemberRecipientStatus = ({ status, isMe, instance, typographyProps }) => {
14
11
  const { t } = useI18n()
15
12
 
@@ -32,20 +29,13 @@ const MemberRecipientStatus = ({ status, isMe, instance, typographyProps }) => {
32
29
  }
33
30
 
34
31
  return (
35
- <Media>
36
- <Img className={styles['recipient-status-icon']}>
37
- <Icon icon={icon} size={10} />
38
- </Img>
39
- <Bd>
40
- <Typography
41
- variant="caption"
42
- color="textSecondary"
43
- {...typographyProps}
44
- >
45
- {text}
46
- </Typography>
47
- </Bd>
48
- </Media>
32
+ <div className="u-flex u-flex-items-center">
33
+ <Icon icon={icon} size={10} />
34
+ &nbsp;
35
+ <Typography variant="caption" color="textSecondary" {...typographyProps}>
36
+ {text}
37
+ </Typography>
38
+ </div>
49
39
  )
50
40
  }
51
41
 
@@ -4,6 +4,7 @@ import { GroupRecipient } from './GroupRecipient'
4
4
  import MemberRecipient from './MemberRecipient'
5
5
  import { usePrevious } from '../../helpers/hooks'
6
6
  import { filterAndReworkRecipients } from '../../helpers/recipients'
7
+ import SharedDriveRecipient from '../SharedDrive/SharedDriveRecipient'
7
8
 
8
9
  const RecipientList = ({
9
10
  recipients,
@@ -13,6 +14,7 @@ const RecipientList = ({
13
14
  documentType,
14
15
  onRevoke,
15
16
  onRevokeSelf,
17
+ onSetType,
16
18
  verifyRecipient
17
19
  }) => {
18
20
  const previousRecipients = usePrevious(recipients)
@@ -26,6 +28,22 @@ const RecipientList = ({
26
28
  user => user.email === recipient.email
27
29
  )
28
30
 
31
+ const isSharedDriveRecipient = recipient?.index
32
+ ?.toString()
33
+ .startsWith('virtual-shared-drive')
34
+
35
+ if (isSharedDriveRecipient) {
36
+ return (
37
+ <SharedDriveRecipient
38
+ {...recipient}
39
+ key={recipient.index}
40
+ onRevoke={onRevoke}
41
+ onSetType={onSetType}
42
+ fadeIn={recipient.hasBeenJustAdded}
43
+ />
44
+ )
45
+ }
46
+
29
47
  const isGroupRecipient = recipient.members
30
48
  if (isGroupRecipient) {
31
49
  return (
@@ -0,0 +1,41 @@
1
+ import React, { forwardRef } from 'react'
2
+
3
+ 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
+ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
7
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
8
+ import Typography from 'cozy-ui/transpiled/react/Typography'
9
+
10
+ const makeComponent = title => {
11
+ const Component = forwardRef((props, ref) => {
12
+ return (
13
+ <ActionsMenuItem {...props} ref={ref}>
14
+ <ListItemIcon>
15
+ <Icon icon={TrashIcon} color="var(--errorColor)" />
16
+ </ListItemIcon>
17
+ <ListItemText
18
+ primary={<Typography color="error">{title}</Typography>}
19
+ />
20
+ </ActionsMenuItem>
21
+ )
22
+ })
23
+
24
+ Component.displayName = 'RevokeSharedDriveMember'
25
+
26
+ return Component
27
+ }
28
+
29
+ const revokeSharedDriveMember = ({ t, handleRevocation }) => {
30
+ const title = t(`RevokeSharedDriveMemberItem.revoke.title`)
31
+
32
+ return {
33
+ name: 'revokeSharedDriveMember',
34
+ label: title,
35
+ action: () => {
36
+ handleRevocation()
37
+ },
38
+ Component: makeComponent(title)
39
+ }
40
+ }
41
+ export { revokeSharedDriveMember }
@@ -0,0 +1,43 @@
1
+ import React, { forwardRef } from 'react'
2
+
3
+ import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
4
+ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
5
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
6
+ import Radios from 'cozy-ui/transpiled/react/Radios'
7
+
8
+ const makeComponent = ({ label, type, onClick }) => {
9
+ const Component = forwardRef((props, ref) => {
10
+ return (
11
+ <ActionsMenuItem {...props} ref={ref} button={false} onClick={onClick}>
12
+ <ListItemIcon>
13
+ <Radios checked={type === 'one-way'} />
14
+ </ListItemIcon>
15
+ <ListItemText primary={label} />
16
+ </ActionsMenuItem>
17
+ )
18
+ })
19
+ Component.displayName = 'SetReadOnlySharedPermission'
20
+
21
+ return Component
22
+ }
23
+
24
+ /**
25
+ * @param {function} t - translation function
26
+ * @param {string} type - current editing rights
27
+ * @param {function} setType - function to set editing rights
28
+ */
29
+ export const setReadOnlySharedPermission = ({ t, type, setType }) => {
30
+ const label = t('Share.type.one-way')
31
+
32
+ const onClick = () => {
33
+ setType('one-way')
34
+ }
35
+
36
+ return {
37
+ name: 'setReadOnlySharedPermission',
38
+ label,
39
+ icon: null,
40
+ action: onClick,
41
+ Component: makeComponent({ label, type, onClick })
42
+ }
43
+ }
@@ -0,0 +1,43 @@
1
+ import React, { forwardRef } from 'react'
2
+
3
+ import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'
4
+ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
5
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
6
+ import Radios from 'cozy-ui/transpiled/react/Radios'
7
+
8
+ const makeComponent = ({ label, type, onClick }) => {
9
+ const Component = forwardRef((props, ref) => {
10
+ return (
11
+ <ActionsMenuItem {...props} ref={ref} button={false} onClick={onClick}>
12
+ <ListItemIcon>
13
+ <Radios checked={type === 'two-way'} />
14
+ </ListItemIcon>
15
+ <ListItemText primary={label} />
16
+ </ActionsMenuItem>
17
+ )
18
+ })
19
+ Component.displayName = 'SetReadWriteSharedPermission'
20
+
21
+ return Component
22
+ }
23
+
24
+ /**
25
+ * @param {function} t - translation function
26
+ * @param {string} type - current editing rights
27
+ * @param {function} setType - function to set editing rights
28
+ */
29
+ export const setReadWriteSharedPermission = ({ t, type, setType }) => {
30
+ const label = t('Share.type.two-way')
31
+
32
+ const onClick = () => {
33
+ setType('two-way')
34
+ }
35
+
36
+ return {
37
+ name: 'setReadWriteSharedPermission',
38
+ label,
39
+ icon: null,
40
+ action: onClick,
41
+ Component: makeComponent({ label, type, onClick })
42
+ }
43
+ }
@@ -27,7 +27,9 @@ export const ShareByEmail = ({
27
27
  createContact,
28
28
  documentType,
29
29
  currentRecipients,
30
- sharing
30
+ sharing,
31
+ submitLabel,
32
+ showNotifications = true
31
33
  }) => {
32
34
  const client = useClient()
33
35
  const { t } = useI18n()
@@ -96,27 +98,31 @@ export const ShareByEmail = ({
96
98
  openSharing: readWriteRecipients.length > 0
97
99
  })
98
100
 
99
- showAlert({
100
- message: t(
101
- ...getSuccessMessage(recipientsBefore, contacts, documentType)
102
- ),
103
- severity: 'success',
104
- variant: 'filled'
105
- })
101
+ if (showNotifications) {
102
+ showAlert({
103
+ message: t(
104
+ ...getSuccessMessage(recipientsBefore, contacts, documentType)
105
+ ),
106
+ severity: 'success',
107
+ variant: 'filled'
108
+ })
109
+ }
106
110
  } catch (err) {
107
- showAlert({
108
- message: t(
109
- ...getErrorMessage({
110
- t,
111
- err,
112
- documentType,
113
- recipients,
114
- selectedOption
115
- })
116
- ),
117
- severity: 'error',
118
- variant: 'filled'
119
- })
111
+ if (showNotifications) {
112
+ showAlert({
113
+ message: t(
114
+ ...getErrorMessage({
115
+ t,
116
+ err,
117
+ documentType,
118
+ recipients,
119
+ selectedOption
120
+ })
121
+ ),
122
+ severity: 'error',
123
+ variant: 'filled'
124
+ })
125
+ }
120
126
  } finally {
121
127
  reset()
122
128
  }
@@ -166,7 +172,7 @@ export const ShareByEmail = ({
166
172
  onChange={onChange}
167
173
  />
168
174
  <ShareSubmit
169
- label={t(`${documentType}.share.shareByEmail.send`)}
175
+ label={submitLabel || t(`${documentType}.share.shareByEmail.send`)}
170
176
  onSubmit={share}
171
177
  loading={loading}
172
178
  disabled={recipients.length === 0}
@@ -191,7 +197,11 @@ ShareByEmail.propTypes = {
191
197
  onShare: PropTypes.func.isRequired,
192
198
  createContact: PropTypes.func.isRequired,
193
199
  // We can display this component without having created the sharing yet
194
- sharing: PropTypes.object
200
+ sharing: PropTypes.object,
201
+ // Customize the label of the button that submit contacts
202
+ submitLabel: PropTypes.string,
203
+ // Display success or error notifications
204
+ showNotifications: PropTypes.bool
195
205
  }
196
206
 
197
207
  export default ShareByEmail
@@ -20,7 +20,6 @@ const SharingContent = ({
20
20
  documentType,
21
21
  hasSharedParent,
22
22
  isOwner,
23
- needsContactsPermission,
24
23
  onRevoke,
25
24
  onRevokeSelf,
26
25
  onShare,
@@ -68,7 +67,6 @@ const SharingContent = ({
68
67
  currentRecipients={recipients}
69
68
  document={document}
70
69
  documentType={documentType}
71
- needsContactsPermission={needsContactsPermission}
72
70
  onShare={onShare}
73
71
  sharing={sharing}
74
72
  sharingDesc={sharingDesc}
@@ -92,7 +92,6 @@ const ShareDialogTwoStepsConfirmationContainer = ({
92
92
  hasSharedParent,
93
93
  isOwner,
94
94
  link,
95
- needsContactsPermission,
96
95
  onClose,
97
96
  onRevoke,
98
97
  onRevokeLink,
@@ -208,7 +207,6 @@ const ShareDialogTwoStepsConfirmationContainer = ({
208
207
  documentType={documentType}
209
208
  hasSharedParent={hasSharedParent}
210
209
  isOwner={isOwner}
211
- needsContactsPermission={needsContactsPermission}
212
210
  onRevoke={onRevoke}
213
211
  onRevokeSelf={onRevokeSelf}
214
212
  onShare={onShare}
@@ -12,7 +12,6 @@ export const ShareModal = ({
12
12
  hasSharedParent,
13
13
  isOwner,
14
14
  link,
15
- needsContactsPermission,
16
15
  onClose,
17
16
  onRevoke,
18
17
  onRevokeSelf,
@@ -50,7 +49,6 @@ export const ShareModal = ({
50
49
  hasSharedParent={hasSharedParent}
51
50
  isOwner={isOwner}
52
51
  link={link}
53
- needsContactsPermission={needsContactsPermission}
54
52
  onClose={onClose}
55
53
  onRevoke={onRevoke}
56
54
  onRevokeSelf={onRevokeSelf}
@@ -78,7 +76,6 @@ ShareModal.propTypes = {
78
76
  hasSharedParent: PropTypes.bool,
79
77
  isOwner: PropTypes.bool,
80
78
  link: PropTypes.string,
81
- needsContactsPermission: PropTypes.bool,
82
79
  onClose: PropTypes.func.isRequired,
83
80
  onRevoke: PropTypes.func.isRequired,
84
81
  onShare: PropTypes.func.isRequired,
@@ -73,10 +73,6 @@ export const BoxEditingRights = ({ file, editingRights, setEditingRights }) => {
73
73
  open={isMenuDisplayed}
74
74
  docs={[file]}
75
75
  actions={actions}
76
- anchorOrigin={{
77
- vertical: 'bottom',
78
- horizontal: 'right'
79
- }}
80
76
  autoClose
81
77
  onClose={toggleMenuDisplayed}
82
78
  />