cozy-sharing 27.1.4 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.jsx +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/OpenSharingLinkButton.js +1 -1
- package/dist/OpenSharingLinkFabButton.js +1 -1
- package/dist/ShareButton.js +1 -1
- package/dist/ShareButton.spec.js +1 -1
- package/dist/components/ConfirmTrustedRecipientsDialog.js +1 -1
- package/dist/components/ContactSuggestion.js +1 -1
- package/dist/components/CozyPassFingerprintDialogContent.js +1 -1
- package/dist/components/Recipient/GroupRecipient.js +1 -1
- package/dist/components/Recipient/GroupRecipientDetail.js +1 -1
- package/dist/components/Recipient/GroupRecipientDetailWithAccess.js +1 -1
- package/dist/components/Recipient/GroupRecipientDetailWithoutAccess.js +1 -1
- package/dist/components/Recipient/GroupRecipientPermissions.js +4 -1
- package/dist/components/Recipient/LinkRecipient.js +1 -1
- package/dist/components/Recipient/LinkRecipientLite.js +1 -1
- package/dist/components/Recipient/LinkRecipientPermissions.js +1 -1
- package/dist/components/Recipient/MemberRecipient.js +1 -1
- package/dist/components/Recipient/MemberRecipientLite.js +1 -1
- package/dist/components/Recipient/MemberRecipientPermissions.js +2 -1
- package/dist/components/Recipient/MemberRecipientStatus.js +1 -1
- package/dist/components/Recipient/RecipientConfirm.js +1 -1
- package/dist/components/ShareByEmail.js +1 -1
- package/dist/components/ShareByLink.js +1 -1
- package/dist/components/ShareDialogCozyToCozy.js +1 -1
- package/dist/components/ShareDialogOnlyByLink.js +1 -1
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -1
- package/dist/components/ShareModal/SharingDetailsModal.js +1 -1
- package/dist/components/ShareRecipientsLimitModal.js +1 -1
- package/dist/components/ShareRestrictionModal/BoxDate.js +1 -1
- package/dist/components/ShareRestrictionModal/BoxEditingRights.js +4 -1
- package/dist/components/ShareRestrictionModal/BoxPassword.js +1 -1
- package/dist/components/ShareRestrictionModal/ShareRestrictionContentModal.js +1 -1
- package/dist/components/ShareRestrictionModal/ShareRestrictionModal.js +1 -1
- package/dist/components/SharedDrive/DumbSharedDriveModal.js +14 -3
- package/dist/components/SharedDrive/SharedDriveEditModal.js +61 -3
- package/dist/components/SharedDrive/SharedDriveModal.js +1 -1
- package/dist/components/SharedDrive/SharedDriveRecipient.js +1 -1
- package/dist/components/SharedDrive/SharedDriveRecipientPermissions.js +4 -1
- package/dist/components/SharedDrive/SharedDriveRecipientStatus.js +1 -1
- package/dist/components/SharedStatus.js +1 -1
- package/dist/components/SharingBanner/components/PublicBanner.js +1 -1
- package/dist/components/SharingBanner/components/PublicBanner.spec.js +2 -2
- package/dist/components/SharingBanner/hooks/useSharingInfos.js +1 -1
- package/dist/components/SharingBanner/test/AppLike.js +1 -1
- package/dist/components/WhoHasAccess.js +1 -1
- package/dist/hoc/withLocales.js +2 -2
- package/locales/en.json +5 -1
- package/locales/fr.json +4 -1
- package/locales/ru.json +4 -1
- package/locales/vi.json +4 -1
- package/package.json +12 -10
- package/src/OpenSharingLinkButton.jsx +1 -1
- package/src/OpenSharingLinkFabButton.jsx +1 -1
- package/src/ShareButton.jsx +1 -2
- package/src/ShareButton.spec.jsx +1 -1
- package/src/components/ConfirmTrustedRecipientsDialog.jsx +1 -1
- package/src/components/ContactSuggestion.jsx +1 -1
- package/src/components/CozyPassFingerprintDialogContent.jsx +1 -1
- package/src/components/Recipient/GroupRecipient.jsx +1 -1
- package/src/components/Recipient/GroupRecipientDetail.jsx +1 -1
- package/src/components/Recipient/GroupRecipientDetailWithAccess.jsx +1 -1
- package/src/components/Recipient/GroupRecipientDetailWithoutAccess.jsx +1 -1
- package/src/components/Recipient/GroupRecipientPermissions.jsx +4 -1
- package/src/components/Recipient/LinkRecipient.jsx +1 -1
- package/src/components/Recipient/LinkRecipientLite.jsx +1 -1
- package/src/components/Recipient/LinkRecipientPermissions.jsx +1 -1
- package/src/components/Recipient/MemberRecipient.jsx +1 -1
- package/src/components/Recipient/MemberRecipientLite.jsx +1 -1
- package/src/components/Recipient/MemberRecipientPermissions.jsx +2 -1
- package/src/components/Recipient/MemberRecipientStatus.jsx +1 -1
- package/src/components/Recipient/RecipientConfirm.jsx +1 -1
- package/src/components/ShareByEmail.jsx +1 -1
- package/src/components/ShareByLink.jsx +1 -1
- package/src/components/ShareDialogCozyToCozy.jsx +1 -1
- package/src/components/ShareDialogOnlyByLink.jsx +1 -1
- package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +1 -1
- package/src/components/ShareModal/SharingDetailsModal.jsx +1 -1
- package/src/components/ShareRecipientsLimitModal.jsx +1 -1
- package/src/components/ShareRestrictionModal/BoxDate.jsx +1 -1
- package/src/components/ShareRestrictionModal/BoxEditingRights.jsx +4 -1
- package/src/components/ShareRestrictionModal/BoxPassword.jsx +1 -1
- package/src/components/ShareRestrictionModal/ShareRestrictionContentModal.jsx +1 -1
- package/src/components/ShareRestrictionModal/ShareRestrictionModal.jsx +1 -1
- package/src/components/SharedDrive/DumbSharedDriveModal.jsx +17 -3
- package/src/components/SharedDrive/SharedDriveEditModal.jsx +30 -2
- package/src/components/SharedDrive/SharedDriveModal.jsx +1 -1
- package/src/components/SharedDrive/SharedDriveRecipient.jsx +1 -1
- package/src/components/SharedDrive/SharedDriveRecipientPermissions.jsx +4 -1
- package/src/components/SharedDrive/SharedDriveRecipientStatus.jsx +1 -1
- package/src/components/SharedStatus.jsx +1 -2
- package/src/components/SharingBanner/components/PublicBanner.jsx +1 -1
- package/src/components/SharingBanner/components/PublicBanner.spec.jsx +2 -2
- package/src/components/SharingBanner/hooks/useSharingInfos.jsx +1 -1
- package/src/components/SharingBanner/test/AppLike.jsx +1 -1
- package/src/components/WhoHasAccess.jsx +1 -1
- package/src/hoc/withLocales.jsx +2 -3
- package/test/AppLike.jsx +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { useI18n } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
4
5
|
import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
|
|
5
6
|
import PaperplaneIcon from 'cozy-ui/transpiled/react/Icons/Paperplane'
|
|
6
7
|
import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud'
|
|
7
8
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
8
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
9
9
|
|
|
10
10
|
const MemberRecipientStatus = ({ status, isMe, instance, typographyProps }) => {
|
|
11
11
|
const { t } = useI18n()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
5
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
6
|
|
|
7
7
|
import modalStyles from '../../styles/share.styl'
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useState } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
6
|
import flag from 'cozy-flags'
|
|
6
7
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
7
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
8
8
|
|
|
9
9
|
import ShareRecipientsInput from './ShareRecipientsInput'
|
|
10
10
|
import { ShareRecipientsLimitModal } from './ShareRecipientsLimitModal'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useReducer } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
5
6
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
@@ -7,7 +8,6 @@ import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy'
|
|
|
7
8
|
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link'
|
|
8
9
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
9
10
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
11
11
|
|
|
12
12
|
import { ShareRestrictionModal } from './ShareRestrictionModal/ShareRestrictionModal'
|
|
13
13
|
import { copyToClipboard } from './ShareRestrictionModal/helpers'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
5
6
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
6
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
|
|
8
8
|
import { default as DumbShareByEmail } from './ShareByEmail'
|
|
9
9
|
import { default as DumbShareByLink } from './ShareByLink'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
5
6
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
6
7
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
7
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
8
8
|
|
|
9
9
|
import { default as DumbShareByLink } from './ShareByLink'
|
|
10
10
|
import WhoHasAccess from './WhoHasAccess'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
2
|
+
import { useI18n } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
4
5
|
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
5
6
|
import Spinner from 'cozy-ui/transpiled/react/Spinner'
|
|
6
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
|
|
8
8
|
import { useSafeState } from '../helpers/hooks'
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React from 'react'
|
|
4
|
+
import { useI18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
6
7
|
import Divider from 'cozy-ui/transpiled/react/Divider'
|
|
7
8
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
8
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
9
9
|
|
|
10
10
|
import { getDisplayName } from '../../models'
|
|
11
11
|
import styles from '../../styles/share.styl'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Buttons from 'cozy-ui/transpiled/react/Buttons'
|
|
5
6
|
import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
6
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
|
|
8
8
|
import { computeRecipientsLimit } from '../helpers/recipients'
|
|
9
9
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { format } from 'date-fns'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React from 'react'
|
|
4
|
+
import { useI18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import Box from 'cozy-ui/transpiled/react/Box'
|
|
6
7
|
import DatePicker from 'cozy-ui/transpiled/react/DatePicker'
|
|
@@ -12,7 +13,6 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
12
13
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
13
14
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
14
15
|
import Switch from 'cozy-ui/transpiled/react/Switch'
|
|
15
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
16
16
|
|
|
17
17
|
export const BoxDate = ({ onChange, date, toggle, onToggle }) => {
|
|
18
18
|
const { t, lang } = useI18n()
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useReducer, useRef } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
5
|
+
import { useClient } from 'cozy-client'
|
|
4
6
|
import { isDirectory as isDir } from 'cozy-client/dist/models/file'
|
|
5
7
|
import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
|
|
6
8
|
import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
@@ -12,7 +14,6 @@ import List from 'cozy-ui/transpiled/react/List'
|
|
|
12
14
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
13
15
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
14
16
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
15
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
16
17
|
|
|
17
18
|
import { useSharingContext } from '../../hooks/useSharingContext'
|
|
18
19
|
import { editPermissionLink } from '../Recipient/actions/editPermissionLink'
|
|
@@ -26,10 +27,12 @@ export const BoxEditingRights = ({ file, editingRights, setEditingRights }) => {
|
|
|
26
27
|
const buttonRef = useRef()
|
|
27
28
|
const { t } = useI18n()
|
|
28
29
|
const { documentType } = useSharingContext()
|
|
30
|
+
const client = useClient()
|
|
29
31
|
|
|
30
32
|
const isDirectory = isDir(file)
|
|
31
33
|
|
|
32
34
|
const actions = makeActions([readOnlyPermissionLink, editPermissionLink], {
|
|
35
|
+
client,
|
|
33
36
|
t,
|
|
34
37
|
editingRights,
|
|
35
38
|
setEditingRights,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useState } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Box from 'cozy-ui/transpiled/react/Box'
|
|
5
6
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
@@ -14,7 +15,6 @@ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
|
14
15
|
import Switch from 'cozy-ui/transpiled/react/Switch'
|
|
15
16
|
import TextField from 'cozy-ui/transpiled/react/TextField'
|
|
16
17
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
17
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
18
18
|
|
|
19
19
|
import { copyToClipboard } from './helpers'
|
|
20
20
|
import { checkIsPermissionHasPassword } from '../../helpers/permissions'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { addDays, isValid } from 'date-fns'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React from 'react'
|
|
4
|
+
import { useI18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import Box from 'cozy-ui/transpiled/react/Box'
|
|
6
7
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
7
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
8
8
|
|
|
9
9
|
import { BoxDate } from './BoxDate'
|
|
10
10
|
import { BoxEditingRights } from './BoxEditingRights'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { addDays } from 'date-fns'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React, { useState } from 'react'
|
|
4
|
+
import { useI18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import { generateWebLink, useClient } from 'cozy-client'
|
|
6
7
|
import flag from 'cozy-flags'
|
|
@@ -9,7 +10,6 @@ import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
|
9
10
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
10
11
|
import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
|
|
11
12
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
12
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
13
13
|
|
|
14
14
|
import { ShareRestrictionContentModal } from './ShareRestrictionContentModal'
|
|
15
15
|
import {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
5
6
|
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
6
7
|
import TextField from 'cozy-ui/transpiled/react/TextField'
|
|
7
8
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
8
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
9
9
|
|
|
10
10
|
import withLocales from '../../hoc/withLocales'
|
|
11
11
|
import { default as DumbShareByEmail } from '../ShareByEmail'
|
|
@@ -23,7 +23,9 @@ export const DumbSharedDriveModal = withLocales(
|
|
|
23
23
|
onSetType,
|
|
24
24
|
onCreate,
|
|
25
25
|
onClose,
|
|
26
|
-
onShare
|
|
26
|
+
onShare,
|
|
27
|
+
onRename,
|
|
28
|
+
originalSharedDriveName
|
|
27
29
|
}) => {
|
|
28
30
|
const { t } = useI18n()
|
|
29
31
|
|
|
@@ -92,6 +94,16 @@ export const DumbSharedDriveModal = withLocales(
|
|
|
92
94
|
/>
|
|
93
95
|
</>
|
|
94
96
|
)}
|
|
97
|
+
{onRename && (
|
|
98
|
+
<>
|
|
99
|
+
<Button
|
|
100
|
+
disabled={originalSharedDriveName === sharedDriveName}
|
|
101
|
+
variant="primary"
|
|
102
|
+
label={t('SharedDrive.sharedDriveModal.save')}
|
|
103
|
+
onClick={() => onRename(sharedDriveName)}
|
|
104
|
+
/>
|
|
105
|
+
</>
|
|
106
|
+
)}
|
|
95
107
|
</>
|
|
96
108
|
}
|
|
97
109
|
/>
|
|
@@ -110,5 +122,7 @@ DumbSharedDriveModal.propTypes = {
|
|
|
110
122
|
onSetType: PropTypes.func.isRequired,
|
|
111
123
|
onCreate: PropTypes.func.isRequired,
|
|
112
124
|
onClose: PropTypes.func.isRequired,
|
|
113
|
-
onShare: PropTypes.func.isRequired
|
|
125
|
+
onShare: PropTypes.func.isRequired,
|
|
126
|
+
onRename: PropTypes.func.isRequired,
|
|
127
|
+
originalSharedDriveName: PropTypes.string.isRequired
|
|
114
128
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
|
-
import React from 'react'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
|
-
import {
|
|
6
|
+
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
6
7
|
|
|
7
8
|
import { DumbSharedDriveModal } from './DumbSharedDriveModal'
|
|
8
9
|
import withLocales from '../../hoc/withLocales'
|
|
@@ -12,8 +13,31 @@ export const SharedDriveEditModal = withLocales(
|
|
|
12
13
|
({ document, sharing, recipients, onShare, onRevoke, onClose }) => {
|
|
13
14
|
const client = useClient()
|
|
14
15
|
const { t } = useI18n()
|
|
16
|
+
const { showAlert } = useAlert()
|
|
15
17
|
|
|
16
18
|
const createContact = contact => client.create(Contact.doctype, contact)
|
|
19
|
+
const [name, setName] = useState(sharing?.description)
|
|
20
|
+
|
|
21
|
+
const handleNameChange = event => {
|
|
22
|
+
setName(event.target.value)
|
|
23
|
+
}
|
|
24
|
+
const onRename = async value => {
|
|
25
|
+
try {
|
|
26
|
+
await client
|
|
27
|
+
.collection('io.cozy.sharings')
|
|
28
|
+
.renameSharedDrive(sharing, value)
|
|
29
|
+
showAlert({
|
|
30
|
+
message: t('SharedDrive.sharedDriveModal.successNotificationUpdate'),
|
|
31
|
+
severity: 'success'
|
|
32
|
+
})
|
|
33
|
+
onClose()
|
|
34
|
+
} catch (error) {
|
|
35
|
+
showAlert({
|
|
36
|
+
message: t('SharedDrive.sharedDriveModal.errorNotificationUpdate'),
|
|
37
|
+
severity: 'error'
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
}
|
|
17
41
|
|
|
18
42
|
return (
|
|
19
43
|
<DumbSharedDriveModal
|
|
@@ -24,6 +48,10 @@ export const SharedDriveEditModal = withLocales(
|
|
|
24
48
|
onRevoke={onRevoke}
|
|
25
49
|
onClose={onClose}
|
|
26
50
|
onShare={onShare}
|
|
51
|
+
sharedDriveName={name}
|
|
52
|
+
handleSharedDriveNameChange={handleNameChange}
|
|
53
|
+
onRename={onRename}
|
|
54
|
+
originalSharedDriveName={sharing?.description}
|
|
27
55
|
/>
|
|
28
56
|
)
|
|
29
57
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { useState } from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
6
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
6
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
|
|
8
8
|
import { DumbSharedDriveModal } from './DumbSharedDriveModal'
|
|
9
9
|
import { mergeAndDeduplicateRecipients, formatRecipients } from './helpers'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Fade from 'cozy-ui/transpiled/react/Fade'
|
|
5
6
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
@@ -7,7 +8,6 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
7
8
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
9
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
9
10
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
11
11
|
|
|
12
12
|
import SharedDriveRecipientPermissions from './SharedDriveRecipientPermissions'
|
|
13
13
|
import SharedDriveRecipientStatus from './SharedDriveRecipientStatus'
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react'
|
|
2
|
+
import { useI18n } from 'twake-i18n'
|
|
2
3
|
|
|
4
|
+
import { useClient } from 'cozy-client'
|
|
3
5
|
import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
|
|
4
6
|
import {
|
|
5
7
|
makeActions,
|
|
6
8
|
divider
|
|
7
9
|
} from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
8
10
|
import DropdownButton from 'cozy-ui/transpiled/react/DropdownButton'
|
|
9
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
10
11
|
|
|
11
12
|
import { revokeSharedDriveMember } from '../Recipient/actions/revokeSharedDriveMember'
|
|
12
13
|
import { setReadOnlySharedPermission } from '../Recipient/actions/setReadOnlySharedPermission'
|
|
@@ -20,6 +21,7 @@ const ShareDriveRecipientPermissions = ({
|
|
|
20
21
|
}) => {
|
|
21
22
|
const { t } = useI18n()
|
|
22
23
|
const buttonRef = useRef()
|
|
24
|
+
const client = useClient()
|
|
23
25
|
const [isMenuDisplayed, setMenuDisplayed] = useState(false)
|
|
24
26
|
|
|
25
27
|
const toggleMenu = () => setMenuDisplayed(!isMenuDisplayed)
|
|
@@ -46,6 +48,7 @@ const ShareDriveRecipientPermissions = ({
|
|
|
46
48
|
],
|
|
47
49
|
{
|
|
48
50
|
t,
|
|
51
|
+
client,
|
|
49
52
|
type,
|
|
50
53
|
setType,
|
|
51
54
|
handleRevocation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { useI18n } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
4
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
5
5
|
|
|
6
6
|
const SharedDriveRecipientStatus = ({ members, email }) => {
|
|
7
7
|
const { t } = useI18n()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import { SharingTooltip, TooltipRecipientList } from './Tooltip'
|
|
7
6
|
import LinkIcon from '../assets/icons/icon-link.svg'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import snarkdown from 'snarkdown'
|
|
4
|
+
import { useI18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import { useClient } from 'cozy-client'
|
|
6
7
|
import flag from 'cozy-flags'
|
|
7
8
|
import Banner from 'cozy-ui/transpiled/react/Banner'
|
|
8
9
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
9
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
10
10
|
|
|
11
11
|
import CozyHomeLinkIcon from './CozyHomeLinkIcon'
|
|
12
12
|
import styles from '../../../styles/publicBanner.styl'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { render } from '@testing-library/react'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { useClient } from 'cozy-client'
|
|
5
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
6
|
|
|
7
7
|
import { SharingBannerCozyToCozy } from './PublicBanner'
|
|
8
8
|
|
|
9
|
-
jest.mock('
|
|
9
|
+
jest.mock('twake-i18n')
|
|
10
10
|
jest.mock('cozy-client')
|
|
11
11
|
|
|
12
12
|
describe('PublicBanner', () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react'
|
|
2
2
|
|
|
3
3
|
import { useClient, models } from 'cozy-client'
|
|
4
|
+
import flag from 'cozy-flags'
|
|
4
5
|
|
|
5
6
|
import logger from '../../../logger'
|
|
6
7
|
import { buildSharingsByIdQuery } from '../../../queries/queries'
|
|
7
8
|
import getQueryParameter from '../helpers/QueryParameter'
|
|
8
|
-
import flag from 'cozy-flags'
|
|
9
9
|
|
|
10
10
|
const getSharingId = permission => {
|
|
11
11
|
const sourceId = permission.data.attributes.source_id
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Provider } from 'react-redux'
|
|
3
3
|
import { createStore } from 'redux'
|
|
4
|
+
import { I18n } from 'twake-i18n'
|
|
4
5
|
|
|
5
6
|
import { CozyProvider } from 'cozy-client'
|
|
6
7
|
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
7
|
-
import { I18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
8
8
|
|
|
9
9
|
import { AcceptingSharingProvider } from './AcceptingSharingContext'
|
|
10
10
|
import FabProvider from './FabProvider'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import List from 'cozy-ui/transpiled/react/List'
|
|
5
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
6
|
|
|
7
7
|
import LinkRecipient from './Recipient/LinkRecipient'
|
|
8
8
|
import OwnerRecipient from './Recipient/OwnerRecipient'
|
package/src/hoc/withLocales.jsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { getI18n } from 'cozy-ui/transpiled/react/providers/I18n/helpers'
|
|
2
|
+
import { I18n, translate } from 'twake-i18n'
|
|
3
|
+
import { getI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
const locales = {
|
|
7
6
|
en: require(`../../locales/en.json`),
|
package/test/AppLike.jsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { I18n } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import { CozyProvider, createMockClient } from 'cozy-client'
|
|
4
5
|
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
|
|
5
6
|
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
6
|
-
import { I18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
|
|
8
8
|
|
|
9
9
|
import langEn from '../locales/en.json'
|