cozy-sharing 7.0.0 → 7.0.2

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 (152) hide show
  1. package/CHANGELOG.md +16 -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/helpers/sharings.js +1 -1
  71. package/dist/helpers/successMessage.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/package.json +3 -3
  74. package/preprocess.js +1 -0
  75. package/src/ConfirmTrustedRecipientsDialog.jsx +1 -1
  76. package/src/RefreshableSharings.spec.jsx +2 -2
  77. package/src/ShareButton.jsx +2 -2
  78. package/src/ShareButton.spec.jsx +2 -1
  79. package/src/ShareButtonWithRecipients.jsx +5 -3
  80. package/src/ShareModal.jsx +2 -2
  81. package/src/SharedBadge.jsx +1 -1
  82. package/src/SharedRecipients.jsx +1 -1
  83. package/src/SharedRecipientsList.jsx +1 -1
  84. package/src/SharedStatus.jsx +1 -1
  85. package/src/SharingBanner/components/PublicBanner.jsx +1 -2
  86. package/src/SharingBanner/components/PublicBanner.spec.jsx +5 -3
  87. package/src/SharingBanner/components/SharingBanner.jsx +1 -1
  88. package/src/SharingBanner/hooks/useSharingInfos.jsx +1 -1
  89. package/src/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
  90. package/src/SharingBanner/index.jsx +3 -3
  91. package/src/SharingBanner/test/AppLike.jsx +7 -7
  92. package/src/SharingDetailsModal.jsx +3 -3
  93. package/src/SharingOwnerAvatar.jsx +1 -1
  94. package/src/SharingProvider.jsx +9 -9
  95. package/src/SharingProvider.spec.jsx +5 -5
  96. package/src/components/ConfirmTrustedRecipientsDialog.jsx +1 -1
  97. package/src/components/ContactSuggestion.jsx +4 -4
  98. package/src/components/ContactSuggestion.spec.jsx +2 -2
  99. package/src/components/CozyPassFingerprintDialogContent.jsx +4 -5
  100. package/src/components/CozyPassFingerprintDialogContent.spec.jsx +2 -2
  101. package/src/components/EditLinkPermissionDialog.jsx +5 -5
  102. package/src/components/EditLinkPermissionDialog.spec.jsx +3 -2
  103. package/src/components/EditableSharingModal.jsx +4 -3
  104. package/src/components/EditableSharingModal.spec.jsx +4 -4
  105. package/src/components/Recipient/AvatarPlusX.jsx +2 -2
  106. package/src/components/Recipient/Identity.jsx +2 -2
  107. package/src/components/Recipient/LinkRecipient.jsx +8 -8
  108. package/src/components/Recipient/LinkRecipientPermissions.jsx +5 -6
  109. package/src/components/Recipient/OwnerIdentity.jsx +1 -1
  110. package/src/components/Recipient/OwnerRecipient.jsx +2 -2
  111. package/src/components/Recipient/Recipient.jsx +6 -6
  112. package/src/components/Recipient/Recipient.spec.jsx +4 -2
  113. package/src/components/Recipient/RecipientAvatar.jsx +1 -1
  114. package/src/components/Recipient/RecipientConfirm.jsx +2 -2
  115. package/src/components/Recipient/RecipientPermissions.jsx +6 -6
  116. package/src/components/Recipient/RecipientPlusX.jsx +2 -2
  117. package/src/components/Recipient/RecipientStatus.jsx +3 -3
  118. package/src/components/Recipient/RecipientWithoutStatus.jsx +1 -1
  119. package/src/components/Recipient/RecipientsAvatars.jsx +3 -3
  120. package/src/components/Recipient/RecipientsAvatars.spec.jsx +2 -1
  121. package/src/components/ShareAutosuggest.jsx +5 -6
  122. package/src/components/ShareAutosuggest.spec.jsx +1 -1
  123. package/src/components/ShareButton.jsx +4 -4
  124. package/src/components/ShareByEmail.jsx +6 -7
  125. package/src/components/ShareByEmail.spec.jsx +3 -2
  126. package/src/components/ShareByLink.jsx +8 -7
  127. package/src/components/ShareDialogCozyToCozy.jsx +4 -5
  128. package/src/components/ShareDialogCozyToCozy.spec.jsx +5 -3
  129. package/src/components/ShareDialogOnlyByLink.jsx +2 -1
  130. package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +2 -1
  131. package/src/components/ShareDialogTwoStepsConfirmationContainer.spec.jsx +5 -3
  132. package/src/components/ShareModal.jsx +3 -3
  133. package/src/components/ShareModal.spec.js +4 -2
  134. package/src/components/ShareRecipientsInput.jsx +2 -2
  135. package/src/components/ShareRecipientsInput.spec.jsx +1 -1
  136. package/src/components/SharedBadge.jsx +4 -3
  137. package/src/components/SharedDocuments.jsx +3 -2
  138. package/src/components/SharedStatus.jsx +4 -3
  139. package/src/components/SharedStatus.spec.js +2 -1
  140. package/src/components/Sharesubmit.jsx +2 -1
  141. package/src/components/Sharetypeselect.jsx +5 -7
  142. package/src/components/Tooltip.jsx +2 -1
  143. package/src/components/WhoHasAccess.jsx +6 -5
  144. package/src/components/WhoHasAccessLight.jsx +3 -3
  145. package/src/components/useFetchDocumentPath.jsx +1 -0
  146. package/src/helpers/permissions.js +1 -0
  147. package/src/helpers/sharings.js +1 -2
  148. package/src/helpers/successMessage.js +2 -1
  149. package/src/index.jsx +1 -1
  150. package/src/state.spec.js +0 -1
  151. package/src/withLocales.jsx +1 -0
  152. package/test/AppLike.jsx +2 -2
@@ -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 => (
@@ -1,13 +1,14 @@
1
- import React from 'react'
2
1
  import PropTypes from 'prop-types'
3
- import Recipient from './Recipient/Recipient'
4
- import LinkRecipient from './Recipient/LinkRecipient'
2
+ import React from 'react'
3
+
5
4
  import { useI18n } from 'cozy-ui/transpiled/react/I18n'
6
5
  import List from 'cozy-ui/transpiled/react/MuiCozyTheme/List'
7
6
 
8
- import { filterAndReworkRecipients } from '../helpers/recipients'
9
- import { usePrevious } from '../helpers/hooks'
7
+ import LinkRecipient from './Recipient/LinkRecipient'
10
8
  import OwnerRecipient from './Recipient/OwnerRecipient'
9
+ import Recipient from './Recipient/Recipient'
10
+ import { usePrevious } from '../helpers/hooks'
11
+ import { filterAndReworkRecipients } from '../helpers/recipients'
11
12
 
12
13
  /**
13
14
  * Displays a warning if some contacts are waiting for confirmation of their sharing
@@ -1,8 +1,8 @@
1
- import React from 'react'
2
1
  import cx from 'classnames'
3
- import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus'
4
- import RecipientPlusX from './Recipient/RecipientPlusX'
2
+ import React from 'react'
5
3
 
4
+ import RecipientPlusX from './Recipient/RecipientPlusX'
5
+ import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus'
6
6
  import styles from './recipient.styl'
7
7
 
8
8
  const MAX_DISPLAYED_RECIPIENTS = 2
@@ -1,4 +1,5 @@
1
1
  import { useState, useEffect } from 'react'
2
+
2
3
  import { fetchFilesPaths } from '../helpers/files'
3
4
 
4
5
  export const useFetchDocumentPath = (client, document) => {
@@ -1,4 +1,5 @@
1
1
  import get from 'lodash/get'
2
+
2
3
  import { models } from 'cozy-client'
3
4
 
4
5
  export const checkIsReadOnlyPermissions = permissions => {
@@ -1,12 +1,11 @@
1
1
  import { Q } from 'cozy-client'
2
2
 
3
+ import { fetchFilesPaths } from './files'
3
4
  import {
4
5
  updateInternalObjectFromRealtime,
5
6
  normalizeDocFromRealtime
6
7
  } from './realtime'
7
-
8
8
  import { addSharing, updateSharing } from '../state'
9
- import { fetchFilesPaths } from './files'
10
9
 
11
10
  export const getSharingObject = (internalSharing, sharing) => {
12
11
  if (internalSharing) {
@@ -1,5 +1,6 @@
1
- import { Contact } from '../models'
2
1
  import { models } from 'cozy-client'
2
+
3
+ import { Contact } from '../models'
3
4
  export const countNewRecipients = (currentRecipients, newRecipients) => {
4
5
  return newRecipients.filter(contact => {
5
6
  const email = models.contact.getPrimaryEmail(contact)
package/src/index.jsx CHANGED
@@ -1,6 +1,6 @@
1
+ import SharingProvider from './SharingProvider'
1
2
  import SharingContext from './context'
2
3
  import withLocales from './withLocales'
3
- import SharingProvider from './SharingProvider'
4
4
 
5
5
  export default SharingProvider
6
6
 
package/src/state.spec.js CHANGED
@@ -16,7 +16,6 @@ import reducer, {
16
16
  getPermissionDocIds,
17
17
  getDocumentSharingType
18
18
  } from './state'
19
-
20
19
  import {
21
20
  SHARING_1,
22
21
  SHARING_2,
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+
2
3
  import { I18n, translate } from 'cozy-ui/transpiled/react/I18n'
3
4
 
4
5
  const locales = {
package/test/AppLike.jsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
- import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
4
- import { I18n } from 'cozy-ui/transpiled/react/I18n'
5
3
  import { CozyProvider, createMockClient } from 'cozy-client'
4
+ import { I18n } from 'cozy-ui/transpiled/react/I18n'
5
+ import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
6
6
 
7
7
  import langEn from '../locales/en.json'
8
8