cozy-sharing 6.0.6 → 7.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ConfirmTrustedRecipientsDialog.js +1 -1
  3. package/dist/RefreshableSharings.spec.js +2 -2
  4. package/dist/ShareButton.js +1 -1
  5. package/dist/ShareButton.spec.js +1 -1
  6. package/dist/ShareButtonWithRecipients.js +3 -3
  7. package/dist/ShareModal.js +2 -2
  8. package/dist/SharedBadge.js +1 -1
  9. package/dist/SharedRecipients.js +1 -1
  10. package/dist/SharedRecipientsList.js +1 -1
  11. package/dist/SharedStatus.js +1 -1
  12. package/dist/SharingBanner/components/PublicBanner.js +1 -1
  13. package/dist/SharingBanner/components/PublicBanner.spec.js +3 -3
  14. package/dist/SharingBanner/components/SharingBanner.js +1 -1
  15. package/dist/SharingBanner/hooks/useSharingInfos.js +1 -1
  16. package/dist/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
  17. package/dist/SharingBanner/index.js +3 -3
  18. package/dist/SharingBanner/test/AppLike.js +6 -6
  19. package/dist/SharingDetailsModal.js +8 -8
  20. package/dist/SharingOwnerAvatar.js +1 -1
  21. package/dist/SharingProvider.js +2 -2
  22. package/dist/SharingProvider.spec.js +4 -4
  23. package/dist/components/ContactSuggestion.js +4 -4
  24. package/dist/components/ContactSuggestion.spec.js +2 -2
  25. package/dist/components/CozyPassFingerprintDialogContent.js +4 -4
  26. package/dist/components/CozyPassFingerprintDialogContent.spec.js +2 -2
  27. package/dist/components/EditLinkPermissionDialog.js +5 -5
  28. package/dist/components/EditLinkPermissionDialog.spec.js +2 -2
  29. package/dist/components/EditableSharingModal.js +3 -3
  30. package/dist/components/EditableSharingModal.spec.js +4 -4
  31. package/dist/components/Recipient/AvatarPlusX.js +2 -2
  32. package/dist/components/Recipient/Identity.js +2 -2
  33. package/dist/components/Recipient/LinkRecipient.js +8 -8
  34. package/dist/components/Recipient/LinkRecipientPermissions.js +5 -5
  35. package/dist/components/Recipient/OwnerIdentity.js +1 -1
  36. package/dist/components/Recipient/OwnerRecipient.js +2 -2
  37. package/dist/components/Recipient/Recipient.js +6 -6
  38. package/dist/components/Recipient/Recipient.spec.js +2 -2
  39. package/dist/components/Recipient/RecipientConfirm.js +2 -2
  40. package/dist/components/Recipient/RecipientPermissions.js +5 -5
  41. package/dist/components/Recipient/RecipientPlusX.js +2 -2
  42. package/dist/components/Recipient/RecipientStatus.js +3 -3
  43. package/dist/components/Recipient/RecipientWithoutStatus.js +1 -1
  44. package/dist/components/Recipient/RecipientsAvatars.js +2 -2
  45. package/dist/components/Recipient/RecipientsAvatars.spec.js +1 -1
  46. package/dist/components/ShareAutosuggest.js +5 -5
  47. package/dist/components/ShareAutosuggest.spec.js +1 -1
  48. package/dist/components/ShareButton.js +3 -3
  49. package/dist/components/ShareByEmail.js +6 -6
  50. package/dist/components/ShareByEmail.spec.js +2 -2
  51. package/dist/components/ShareByLink.js +7 -7
  52. package/dist/components/ShareDialogCozyToCozy.js +3 -3
  53. package/dist/components/ShareDialogCozyToCozy.spec.js +3 -3
  54. package/dist/components/ShareDialogOnlyByLink.js +1 -1
  55. package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -1
  56. package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +3 -3
  57. package/dist/components/ShareModal.js +2 -2
  58. package/dist/components/ShareModal.spec.js +2 -2
  59. package/dist/components/ShareRecipientsInput.js +2 -2
  60. package/dist/components/ShareRecipientsInput.spec.js +1 -1
  61. package/dist/components/SharedBadge.js +3 -3
  62. package/dist/components/SharedDocuments.js +2 -2
  63. package/dist/components/SharedStatus.js +2 -2
  64. package/dist/components/SharedStatus.spec.js +1 -1
  65. package/dist/components/Sharesubmit.js +1 -1
  66. package/dist/components/Sharetypeselect.js +5 -5
  67. package/dist/components/Tooltip.js +1 -1
  68. package/dist/components/WhoHasAccess.js +5 -5
  69. package/dist/components/WhoHasAccessLight.js +2 -2
  70. package/dist/getSharedDocument.js +14 -5
  71. package/dist/getSharedDocument.spec.js +81 -10
  72. package/dist/helpers/sharings.js +1 -1
  73. package/dist/helpers/successMessage.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/state.js +2 -6
  76. package/package.json +2 -2
  77. package/preprocess.js +1 -0
  78. package/src/ConfirmTrustedRecipientsDialog.jsx +1 -1
  79. package/src/RefreshableSharings.spec.jsx +2 -2
  80. package/src/ShareButton.jsx +2 -2
  81. package/src/ShareButton.spec.jsx +2 -1
  82. package/src/ShareButtonWithRecipients.jsx +5 -3
  83. package/src/ShareModal.jsx +2 -2
  84. package/src/SharedBadge.jsx +1 -1
  85. package/src/SharedRecipients.jsx +1 -1
  86. package/src/SharedRecipientsList.jsx +1 -1
  87. package/src/SharedStatus.jsx +1 -1
  88. package/src/SharingBanner/components/PublicBanner.jsx +1 -2
  89. package/src/SharingBanner/components/PublicBanner.spec.jsx +5 -3
  90. package/src/SharingBanner/components/SharingBanner.jsx +1 -1
  91. package/src/SharingBanner/hooks/useSharingInfos.jsx +1 -1
  92. package/src/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
  93. package/src/SharingBanner/index.jsx +3 -3
  94. package/src/SharingBanner/test/AppLike.jsx +7 -7
  95. package/src/SharingDetailsModal.jsx +3 -3
  96. package/src/SharingOwnerAvatar.jsx +1 -1
  97. package/src/SharingProvider.jsx +9 -9
  98. package/src/SharingProvider.spec.jsx +5 -5
  99. package/src/components/ConfirmTrustedRecipientsDialog.jsx +1 -1
  100. package/src/components/ContactSuggestion.jsx +4 -4
  101. package/src/components/ContactSuggestion.spec.jsx +2 -2
  102. package/src/components/CozyPassFingerprintDialogContent.jsx +4 -5
  103. package/src/components/CozyPassFingerprintDialogContent.spec.jsx +2 -2
  104. package/src/components/EditLinkPermissionDialog.jsx +5 -5
  105. package/src/components/EditLinkPermissionDialog.spec.jsx +3 -2
  106. package/src/components/EditableSharingModal.jsx +4 -3
  107. package/src/components/EditableSharingModal.spec.jsx +4 -4
  108. package/src/components/Recipient/AvatarPlusX.jsx +2 -2
  109. package/src/components/Recipient/Identity.jsx +2 -2
  110. package/src/components/Recipient/LinkRecipient.jsx +8 -8
  111. package/src/components/Recipient/LinkRecipientPermissions.jsx +5 -6
  112. package/src/components/Recipient/OwnerIdentity.jsx +1 -1
  113. package/src/components/Recipient/OwnerRecipient.jsx +2 -2
  114. package/src/components/Recipient/Recipient.jsx +6 -6
  115. package/src/components/Recipient/Recipient.spec.jsx +4 -2
  116. package/src/components/Recipient/RecipientAvatar.jsx +1 -1
  117. package/src/components/Recipient/RecipientConfirm.jsx +2 -2
  118. package/src/components/Recipient/RecipientPermissions.jsx +6 -6
  119. package/src/components/Recipient/RecipientPlusX.jsx +2 -2
  120. package/src/components/Recipient/RecipientStatus.jsx +3 -3
  121. package/src/components/Recipient/RecipientWithoutStatus.jsx +1 -1
  122. package/src/components/Recipient/RecipientsAvatars.jsx +3 -3
  123. package/src/components/Recipient/RecipientsAvatars.spec.jsx +2 -1
  124. package/src/components/ShareAutosuggest.jsx +5 -6
  125. package/src/components/ShareAutosuggest.spec.jsx +1 -1
  126. package/src/components/ShareButton.jsx +4 -4
  127. package/src/components/ShareByEmail.jsx +6 -7
  128. package/src/components/ShareByEmail.spec.jsx +3 -2
  129. package/src/components/ShareByLink.jsx +8 -7
  130. package/src/components/ShareDialogCozyToCozy.jsx +4 -5
  131. package/src/components/ShareDialogCozyToCozy.spec.jsx +5 -3
  132. package/src/components/ShareDialogOnlyByLink.jsx +2 -1
  133. package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +2 -1
  134. package/src/components/ShareDialogTwoStepsConfirmationContainer.spec.jsx +5 -3
  135. package/src/components/ShareModal.jsx +3 -3
  136. package/src/components/ShareModal.spec.js +4 -2
  137. package/src/components/ShareRecipientsInput.jsx +2 -2
  138. package/src/components/ShareRecipientsInput.spec.jsx +1 -1
  139. package/src/components/SharedBadge.jsx +4 -3
  140. package/src/components/SharedDocuments.jsx +3 -2
  141. package/src/components/SharedStatus.jsx +4 -3
  142. package/src/components/SharedStatus.spec.js +2 -1
  143. package/src/components/Sharesubmit.jsx +2 -1
  144. package/src/components/Sharetypeselect.jsx +5 -7
  145. package/src/components/Tooltip.jsx +2 -1
  146. package/src/components/WhoHasAccess.jsx +6 -5
  147. package/src/components/WhoHasAccessLight.jsx +3 -3
  148. package/src/components/useFetchDocumentPath.jsx +1 -0
  149. package/src/getSharedDocument.js +13 -5
  150. package/src/getSharedDocument.spec.js +26 -5
  151. package/src/helpers/permissions.js +1 -0
  152. package/src/helpers/sharings.js +1 -2
  153. package/src/helpers/successMessage.js +2 -1
  154. package/src/index.jsx +1 -1
  155. package/src/state.js +2 -6
  156. package/src/state.spec.js +0 -1
  157. package/src/withLocales.jsx +1 -0
  158. package/test/AppLike.jsx +2 -2
@@ -1,15 +1,15 @@
1
- import React from 'react'
2
1
  import { mount } from 'enzyme'
2
+ import React from 'react'
3
3
 
4
4
  import { createMockClient } from 'cozy-client'
5
5
  import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
6
6
 
7
- import AppLike from '../../test/AppLike'
7
+ import { EditableSharingModal } from './EditableSharingModal'
8
8
  import { default as DumbShareModal } from './ShareModal'
9
+ import { useFetchDocumentPath } from './useFetchDocumentPath'
10
+ import AppLike from '../../test/AppLike'
9
11
  import { SharingProvider } from '../SharingProvider'
10
12
  import { receivePaths } from '../state'
11
- import { useFetchDocumentPath } from './useFetchDocumentPath'
12
- import { EditableSharingModal } from './EditableSharingModal'
13
13
 
14
14
  jest.mock('./useFetchDocumentPath', () => ({
15
15
  useFetchDocumentPath: jest.fn()
@@ -1,6 +1,6 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
1
  import uniqueId from 'lodash/uniqueId'
2
+ import PropTypes from 'prop-types'
3
+ import React from 'react'
4
4
 
5
5
  import Avatar from 'cozy-ui/transpiled/react/Avatar'
6
6
 
@@ -1,6 +1,6 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
1
  import classNames from 'classnames'
2
+ import PropTypes from 'prop-types'
3
+ import React from 'react'
4
4
 
5
5
  import styles from './recipient.styl'
6
6
 
@@ -1,20 +1,20 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
 
4
+ import Circle from 'cozy-ui/transpiled/react/Circle'
5
+ import Fade from 'cozy-ui/transpiled/react/Fade'
4
6
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
5
- import ListItem from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItem'
6
- import ListItemIcon from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItemIcon'
7
- import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
8
7
  import Icon from 'cozy-ui/transpiled/react/Icon'
9
8
  import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
10
- import Circle from 'cozy-ui/transpiled/react/Circle'
9
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
10
+ import ListItem from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItem'
11
+ import ListItemIcon from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItemIcon'
11
12
  import Typography from 'cozy-ui/transpiled/react/Typography'
12
- import Fade from 'cozy-ui/transpiled/react/Fade'
13
13
 
14
- import { FADE_IN_DURATION } from '../../helpers/recipients'
15
- import RecipientConfirm from './RecipientConfirm'
16
14
  import LinkRecipientPermissions from './LinkRecipientPermissions'
15
+ import RecipientConfirm from './RecipientConfirm'
17
16
  import styles from './recipient.styl'
17
+ import { FADE_IN_DURATION } from '../../helpers/recipients'
18
18
 
19
19
  const LinkRecipient = props => {
20
20
  const { t } = useI18n()
@@ -1,20 +1,19 @@
1
1
  import React, { useState, useRef } from 'react'
2
2
 
3
- import { useI18n } from 'cozy-ui/transpiled/react/I18n'
4
- import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
5
3
  import ActionMenu, {
6
4
  ActionMenuItem,
7
5
  ActionMenuRadio
8
6
  } from 'cozy-ui/transpiled/react/ActionMenu'
9
- import Typography from 'cozy-ui/transpiled/react/Typography'
7
+ import Alerter from 'cozy-ui/transpiled/react/Alerter'
8
+ import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
9
+ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
10
10
  import Icon from 'cozy-ui/transpiled/react/Icon'
11
11
  import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
12
- import Alerter from 'cozy-ui/transpiled/react/Alerter'
13
12
  import Spinner from 'cozy-ui/transpiled/react/Spinner'
13
+ import Typography from 'cozy-ui/transpiled/react/Typography'
14
14
 
15
- import { checkIsReadOnlyPermissions } from '../../helpers/permissions'
16
15
  import { isOnlyReadOnlyLinkAllowed } from '../../helpers/link'
17
-
16
+ import { checkIsReadOnlyPermissions } from '../../helpers/permissions'
18
17
  import logger from '../../logger'
19
18
 
20
19
  const LinkRecipientPermissions = ({
@@ -2,9 +2,9 @@ import React from 'react'
2
2
 
3
3
  import Avatar from 'cozy-ui/transpiled/react/Avatar'
4
4
 
5
+ import Identity from './Identity'
5
6
  import styles from './recipient.styl'
6
7
  import { getDisplayName, getInitials } from '../../models'
7
- import Identity from './Identity'
8
8
 
9
9
  const OwnerIdentity = ({ url, size, ...rest }) => (
10
10
  <div className={styles['avatar']}>
@@ -1,8 +1,8 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
 
4
- import Recipient from './Recipient'
5
4
  import OwnerRecipientDefault from './OwnerRecipientDefault'
5
+ import Recipient from './Recipient'
6
6
 
7
7
  const OwnerRecipient = ({ recipients }) => {
8
8
  const ownerRecipient = recipients.find(
@@ -1,20 +1,20 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
 
4
4
  import { useClient } from 'cozy-client'
5
+ import Fade from 'cozy-ui/transpiled/react/Fade'
5
6
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
7
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
6
8
  import ListItem from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItem'
7
9
  import ListItemIcon from 'cozy-ui/transpiled/react/MuiCozyTheme/ListItemIcon'
8
- import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
9
10
  import Typography from 'cozy-ui/transpiled/react/Typography'
10
- import Fade from 'cozy-ui/transpiled/react/Fade'
11
11
 
12
- import { FADE_IN_DURATION } from '../../helpers/recipients'
13
- import { getDisplayName } from '../../models'
12
+ import RecipientAvatar from './RecipientAvatar'
14
13
  import RecipientConfirm from './RecipientConfirm'
15
14
  import RecipientPermissions from './RecipientPermissions'
16
- import RecipientAvatar from './RecipientAvatar'
17
15
  import RecipientStatus from './RecipientStatus'
16
+ import { FADE_IN_DURATION } from '../../helpers/recipients'
17
+ import { getDisplayName } from '../../models'
18
18
 
19
19
  const DEFAULT_DISPLAY_NAME = 'Share.contacts.defaultDisplayName'
20
20
 
@@ -1,8 +1,10 @@
1
+ import { render, fireEvent } from '@testing-library/react'
1
2
  import React from 'react'
3
+
4
+ import { createMockClient } from 'cozy-client'
5
+
2
6
  import Recipient from './Recipient'
3
7
  import AppLike from '../../../test/AppLike'
4
- import { createMockClient } from 'cozy-client'
5
- import { render, fireEvent } from '@testing-library/react'
6
8
 
7
9
  describe('Recipient component', () => {
8
10
  const client = createMockClient({})
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import { useClient } from 'cozy-client'
3
2
 
3
+ import { useClient } from 'cozy-client'
4
4
  import Avatar from 'cozy-ui/transpiled/react/Avatar'
5
5
 
6
6
  import { getDisplayName, getInitials } from '../../models'
@@ -1,8 +1,8 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
 
4
- import { useI18n } from 'cozy-ui/transpiled/react/I18n'
5
4
  import Button from 'cozy-ui/transpiled/react/Button'
5
+ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
6
6
 
7
7
  import modalStyles from '../../share.styl'
8
8
 
@@ -1,15 +1,15 @@
1
1
  import React, { useState, useRef, useCallback } from 'react'
2
- import { useClient } from 'cozy-client'
3
2
 
4
- import { useI18n } from 'cozy-ui/transpiled/react/I18n'
5
- import Spinner from 'cozy-ui/transpiled/react/Spinner'
6
- import Typography from 'cozy-ui/transpiled/react/Typography'
7
- import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
3
+ import { useClient } from 'cozy-client'
8
4
  import ActionMenu, { ActionMenuItem } from 'cozy-ui/transpiled/react/ActionMenu'
5
+ import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
6
+ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
9
7
  import Icon from 'cozy-ui/transpiled/react/Icon'
8
+ import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
10
9
  import RenameIcon from 'cozy-ui/transpiled/react/Icons/Rename'
11
10
  import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
12
- import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
11
+ import Spinner from 'cozy-ui/transpiled/react/Spinner'
12
+ import Typography from 'cozy-ui/transpiled/react/Typography'
13
13
 
14
14
  const RecipientPermissions = ({
15
15
  isOwner,
@@ -1,10 +1,10 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
 
4
4
  import AvatarPlusX from './AvatarPlusX'
5
+ import Identity from './Identity'
5
6
  import styles from './recipient.styl'
6
7
  import { getDisplayName } from '../../models'
7
- import Identity from './Identity'
8
8
 
9
9
  const RecipientPlusX = ({ extraRecipients }, { t }) => (
10
10
  <div className={styles['recipient']}>
@@ -1,12 +1,12 @@
1
1
  import React from 'react'
2
2
 
3
3
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
4
- import { Media, Img, Bd } from 'cozy-ui/transpiled/react/Media'
5
- import Typography from 'cozy-ui/transpiled/react/Typography'
6
4
  import Icon from 'cozy-ui/transpiled/react/Icon'
5
+ import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
7
6
  import PaperplaneIcon from 'cozy-ui/transpiled/react/Icons/Paperplane'
8
7
  import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud'
9
- import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
8
+ import { Media, Img, Bd } from 'cozy-ui/transpiled/react/Media'
9
+ import Typography from 'cozy-ui/transpiled/react/Typography'
10
10
 
11
11
  import styles from './recipient.styl'
12
12
 
@@ -2,9 +2,9 @@ import React from 'react'
2
2
 
3
3
  import Avatar from 'cozy-ui/transpiled/react/Avatar'
4
4
 
5
+ import Identity from './Identity'
5
6
  import styles from './recipient.styl'
6
7
  import { getDisplayName, getInitials } from '../../models'
7
- import Identity from './Identity'
8
8
 
9
9
  const RecipientWithoutStatus = ({ instance, ...rest }) => {
10
10
  const name = getDisplayName(rest)
@@ -1,12 +1,12 @@
1
- import React from 'react'
2
1
  import cx from 'classnames'
3
- import { useClient } from 'cozy-client'
2
+ import React from 'react'
4
3
 
4
+ import { useClient } from 'cozy-client'
5
5
  import Avatar from 'cozy-ui/transpiled/react/Avatar'
6
6
  import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
7
7
 
8
- import RecipientAvatar from './RecipientAvatar'
9
8
  import AvatarPlusX from './AvatarPlusX'
9
+ import RecipientAvatar from './RecipientAvatar'
10
10
  import styles from './recipient.styl'
11
11
  import { getDisplayName } from '../../models'
12
12
 
@@ -1,6 +1,7 @@
1
+ import { render } from '@testing-library/react'
1
2
  import React from 'react'
3
+
2
4
  import { createMockClient } from 'cozy-client'
3
- import { render } from '@testing-library/react'
4
5
 
5
6
  import RecipientsAvatars, {
6
7
  MAX_DISPLAYED_RECIPIENTS,
@@ -1,14 +1,15 @@
1
- import React, { useState, useRef } from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React, { useState, useRef } from 'react'
3
3
  import Autosuggest from 'react-autosuggest'
4
4
 
5
+ import Avatar from 'cozy-ui/transpiled/react/Avatar'
6
+ import Chip from 'cozy-ui/transpiled/react/Chips'
5
7
  import { Spinner } from 'cozy-ui/transpiled/react/Spinner'
6
8
  import palette from 'cozy-ui/transpiled/react/palette'
7
- import Chip from 'cozy-ui/transpiled/react/Chips'
8
- import Avatar from 'cozy-ui/transpiled/react/Avatar'
9
9
 
10
+ import ContactSuggestion from './ContactSuggestion'
10
11
  import styles from './autosuggest.styl'
11
-
12
+ import { extractEmails, validateEmail } from '../helpers/email'
12
13
  import { getDisplayName, getInitials, Contact } from '../models'
13
14
  import {
14
15
  cozyUrlMatch,
@@ -16,8 +17,6 @@ import {
16
17
  groupNameMatch,
17
18
  fullnameMatch
18
19
  } from '../suggestionMatchers'
19
- import ContactSuggestion from './ContactSuggestion'
20
- import { extractEmails, validateEmail } from '../helpers/email'
21
20
 
22
21
  const ShareAutocomplete = ({
23
22
  loading,
@@ -1,5 +1,5 @@
1
- import React from 'react'
2
1
  import { render, fireEvent } from '@testing-library/react'
2
+ import React from 'react'
3
3
 
4
4
  import ShareAutosuggest from './ShareAutosuggest'
5
5
  import AppLike from '../../test/AppLike'
@@ -1,12 +1,12 @@
1
- import React from 'react'
2
1
  import classNames from 'classnames'
2
+ import React from 'react'
3
+
3
4
  import { Button } from 'cozy-ui/transpiled/react/Button'
5
+ import Icon from 'cozy-ui/transpiled/react/Icon'
6
+ import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
4
7
 
5
8
  import styles from './button.styl'
6
9
 
7
- import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
8
- import Icon from 'cozy-ui/transpiled/react/Icon'
9
-
10
10
  export const ShareButton = ({ label, onClick, className, ...props }) => (
11
11
  <Button
12
12
  data-test-id="share-button"
@@ -1,20 +1,19 @@
1
- import React, { useState } from 'react'
2
- import PropTypes from 'prop-types'
3
1
  import get from 'lodash/get'
2
+ import PropTypes from 'prop-types'
3
+ import React, { useState } from 'react'
4
4
 
5
5
  import { useClient } from 'cozy-client'
6
- import { useI18n } from 'cozy-ui/transpiled/react/I18n'
7
6
  import Alerter from 'cozy-ui/transpiled/react/Alerter'
7
+ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
8
8
 
9
+ import ShareRecipientsInput from './ShareRecipientsInput'
9
10
  import ShareSubmit from './Sharesubmit'
10
11
  import ShareTypeSelect from './Sharetypeselect'
11
-
12
+ import { getOrCreateFromArray } from '../helpers/contacts'
13
+ import { getSuccessMessage } from '../helpers/successMessage'
12
14
  import { Group } from '../models'
13
15
  import { contactsResponseType, groupsResponseType } from '../propTypes'
14
- import ShareRecipientsInput from './ShareRecipientsInput'
15
16
  import styles from '../share.styl'
16
- import { getSuccessMessage } from '../helpers/successMessage'
17
- import { getOrCreateFromArray } from '../helpers/contacts'
18
17
  import { isReadOnlySharing } from '../state'
19
18
 
20
19
  export const ShareByEmail = ({
@@ -1,8 +1,9 @@
1
- import React from 'react'
2
1
  import { render, fireEvent, waitFor } from '@testing-library/react'
2
+ import React from 'react'
3
+ import { act } from 'react-dom/test-utils'
4
+
3
5
  import { ShareByEmail } from './ShareByEmail'
4
6
  import AppLike from '../../test/AppLike'
5
- import { act } from 'react-dom/test-utils'
6
7
 
7
8
  jest.mock('../helpers/contacts', () => ({
8
9
  getOrCreateFromArray: (client, recipients) => recipients
@@ -1,17 +1,18 @@
1
- import React, { useState, useEffect, useCallback } from 'react'
2
- import PropTypes from 'prop-types'
3
1
  import copy from 'copy-text-to-clipboard'
4
- import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
2
+ import PropTypes from 'prop-types'
3
+ import React, { useState, useEffect, useCallback } from 'react'
4
+
5
+ import Alert from 'cozy-ui/transpiled/react/Alert'
5
6
  import Button from 'cozy-ui/transpiled/react/Buttons'
7
+ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
6
8
  import Icon from 'cozy-ui/transpiled/react/Icon'
7
- import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
8
9
  import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy'
10
+ import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
9
11
  import Snackbar from 'cozy-ui/transpiled/react/Snackbar'
10
- import Alert from 'cozy-ui/transpiled/react/Alert'
11
- import { useI18n } from 'cozy-ui/transpiled/react/I18n'
12
+ import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
12
13
 
13
- import { isOnlyReadOnlyLinkAllowed } from '../helpers/link'
14
14
  import EditLinkPermissionDialog from './EditLinkPermissionDialog'
15
+ import { isOnlyReadOnlyLinkAllowed } from '../helpers/link'
15
16
  import logger from '../logger'
16
17
 
17
18
  const ShareByLink = ({ link, document, documentType, onEnable }) => {
@@ -1,16 +1,15 @@
1
+ import cx from 'classnames'
1
2
  import React from 'react'
3
+
2
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
3
5
  import Typography from 'cozy-ui/transpiled/react/Typography'
4
6
 
5
- import { default as DumbShareByLink } from './ShareByLink'
6
7
  import { default as DumbShareByEmail } from './ShareByEmail'
8
+ import { default as DumbShareByLink } from './ShareByLink'
9
+ import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer'
7
10
  import WhoHasAccess from './WhoHasAccess'
8
-
9
- import cx from 'classnames'
10
11
  import styles from '../share.styl'
11
12
 
12
- import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer'
13
-
14
13
  /**
15
14
  * Displays the sharing interface that can be used when ShareDialogCozyToCozy is in sharing state
16
15
  */
@@ -1,9 +1,11 @@
1
+ import { act, render, fireEvent } from '@testing-library/react'
1
2
  import React from 'react'
2
- import ShareDialogCozyToCozy from './ShareDialogCozyToCozy'
3
+
4
+ import { createMockClient } from 'cozy-client'
5
+
3
6
  import { CozyPassFingerprintDialogContent } from './CozyPassFingerprintDialogContent'
7
+ import ShareDialogCozyToCozy from './ShareDialogCozyToCozy'
4
8
  import AppLike from '../../test/AppLike'
5
- import { createMockClient } from 'cozy-client'
6
- import { act, render, fireEvent } from '@testing-library/react'
7
9
 
8
10
  jest.mock('cozy-client', () => ({
9
11
  ...jest.requireActual('cozy-client'),
@@ -1,10 +1,11 @@
1
1
  import React from 'react'
2
+
2
3
  import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
3
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
5
+ import Typography from 'cozy-ui/transpiled/react/Typography'
4
6
 
5
7
  import { default as DumbShareByLink } from './ShareByLink'
6
8
  import WhoHasAccess from './WhoHasAccess'
7
- import Typography from 'cozy-ui/transpiled/react/Typography'
8
9
 
9
10
  const ShareDialogOnlyByLink = ({
10
11
  isOwner,
@@ -1,7 +1,8 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react'
2
+
3
+ import Button from 'cozy-ui/transpiled/react/Button'
2
4
  import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
3
5
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
4
- import Button from 'cozy-ui/transpiled/react/Button'
5
6
  import Spinner from 'cozy-ui/transpiled/react/Spinner'
6
7
 
7
8
  import { useSafeState } from '../helpers/hooks'
@@ -1,9 +1,11 @@
1
+ import { act, render, fireEvent } from '@testing-library/react'
1
2
  import React from 'react'
2
- import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer'
3
+
4
+ import { createMockClient } from 'cozy-client'
5
+
3
6
  import { CozyPassFingerprintDialogContent } from './CozyPassFingerprintDialogContent'
7
+ import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer'
4
8
  import AppLike from '../../test/AppLike'
5
- import { createMockClient } from 'cozy-client'
6
- import { act, render, fireEvent } from '@testing-library/react'
7
9
 
8
10
  const FakeSharingContent = ({ recipientsToBeConfirmed, verifyRecipient }) => {
9
11
  const verify = recipientConfirmationData => () => {
@@ -1,11 +1,11 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
3
- import flag from 'cozy-flags'
2
+ import React from 'react'
4
3
 
5
- import { contactsResponseType, groupsResponseType } from '../propTypes'
4
+ import flag from 'cozy-flags'
6
5
 
7
6
  import ShareDialogCozyToCozy from './ShareDialogCozyToCozy'
8
7
  import ShareDialogOnlyByLink from './ShareDialogOnlyByLink'
8
+ import { contactsResponseType, groupsResponseType } from '../propTypes'
9
9
  export const ShareModal = ({
10
10
  contacts,
11
11
  createContact,
@@ -1,8 +1,10 @@
1
- import React from 'react'
2
1
  import { render } from '@testing-library/react'
2
+ import React from 'react'
3
+
4
+ import flag from 'cozy-flags'
5
+
3
6
  import { ShareModal } from './ShareModal'
4
7
  import AppLike from '../../test/AppLike'
5
- import flag from 'cozy-flags'
6
8
 
7
9
  jest.mock('./ShareDialogCozyToCozy', () => () => <>ShareDialogCozyToCozy</>)
8
10
  jest.mock('./ShareDialogOnlyByLink', () => () => <>ShareDialogOnlyByLink</>)
@@ -1,8 +1,8 @@
1
- import React, { useState, useEffect } from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React, { useState, useEffect } from 'react'
3
3
 
4
- import { contactsResponseType, groupsResponseType } from '../propTypes'
5
4
  import ShareAutosuggest from './ShareAutosuggest'
5
+ import { contactsResponseType, groupsResponseType } from '../propTypes'
6
6
 
7
7
  const ShareRecipientsInput = ({
8
8
  contacts,
@@ -1,5 +1,5 @@
1
- import React from 'react'
2
1
  import { shallow } from 'enzyme'
2
+ import React from 'react'
3
3
 
4
4
  import ShareRecipientsInput from './ShareRecipientsInput'
5
5
 
@@ -1,10 +1,11 @@
1
- import React from 'react'
2
1
  import classNames from 'classnames'
2
+ import React from 'react'
3
+
3
4
  import Icon from 'cozy-ui/transpiled/react/Icon'
4
- import styles from './badge.styl'
5
+ import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
5
6
  import palette from 'cozy-ui/transpiled/react/palette'
6
7
 
7
- import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
8
+ import styles from './badge.styl'
8
9
 
9
10
  const SharedBadge = ({ byMe, className, small, xsmall }) => (
10
11
  <div
@@ -1,6 +1,7 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
1
  import uniq from 'lodash/uniq'
2
+ import PropTypes from 'prop-types'
3
+ import React from 'react'
4
+
4
5
  import SharingContext from '../context'
5
6
 
6
7
  export const SharedDocuments = ({ children }) => (
@@ -1,12 +1,13 @@
1
+ import cx from 'classnames'
1
2
  import React from 'react'
3
+
2
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
3
5
  import palette from 'cozy-ui/transpiled/react/palette'
4
- import { SharingTooltip, TooltipRecipientList } from './Tooltip'
5
- import cx from 'classnames'
6
6
 
7
- import { getDisplayName } from '../models'
7
+ import { SharingTooltip, TooltipRecipientList } from './Tooltip'
8
8
  import styles from './status.styl'
9
9
  import LinkIcon from '../../assets/icons/icon-link.svg'
10
+ import { getDisplayName } from '../models'
10
11
 
11
12
  export const SharedStatus = ({ className, docId, recipients, link }) => {
12
13
  const { t } = useI18n()
@@ -1,5 +1,6 @@
1
- import React from 'react'
2
1
  import { mount } from 'enzyme'
2
+ import React from 'react'
3
+
3
4
  import { SharedStatus } from './SharedStatus'
4
5
  import AppLike from '../../test/AppLike'
5
6
  describe('SharedStatus component', () => {
@@ -1,5 +1,6 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
+
3
4
  import { Button } from 'cozy-ui/transpiled/react/Button'
4
5
 
5
6
  const ShareSubmit = props => (
@@ -1,17 +1,15 @@
1
- import React from 'react'
2
1
  import cx from 'classnames'
3
2
  import PropTypes from 'prop-types'
3
+ import React from 'react'
4
4
 
5
+ import Icon from 'cozy-ui/transpiled/react/Icon'
6
+ import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'
7
+ import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check'
5
8
  import SelectBox, { components } from 'cozy-ui/transpiled/react/SelectBox'
6
9
  import palette from 'cozy-ui/transpiled/react/palette'
7
- import Icon from 'cozy-ui/transpiled/react/Icon'
8
-
9
- import styles from '../share.styl'
10
10
 
11
11
  import logger from '../logger'
12
-
13
- import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'
14
- import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check'
12
+ import styles from '../share.styl'
15
13
 
16
14
  const DropdownIndicator = props => (
17
15
  <components.DropdownIndicator {...props}>
@@ -1,6 +1,7 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
2
+ import React from 'react'
3
3
  import ReactTooltip from 'react-tooltip'
4
+
4
5
  import styles from './tooltip.styl'
5
6
 
6
7
  export const SharingTooltip = props => (