cozy-sharing 12.0.0 → 12.1.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/CHANGELOG.md +12 -0
- package/dist/components/ConfirmTrustedRecipientsDialog.js +11 -3
- package/dist/components/ConfirmTrustedRecipientsDialog.stories.js +39 -0
- package/dist/components/Recipient/GroupRecipient.js +36 -5
- package/dist/components/Recipient/GroupRecipient.stories.js +3 -2
- package/dist/components/Recipient/GroupRecipientDetail.js +43 -0
- package/dist/components/Recipient/GroupRecipientDetail.stories.js +55 -0
- package/dist/components/Recipient/GroupRecipientDetailWithAccess.js +44 -0
- package/dist/components/Recipient/GroupRecipientDetailWithoutAccess.js +45 -0
- package/dist/components/Recipient/LinkRecipient.js +5 -1
- package/dist/components/Recipient/MemberRecipient.js +5 -1
- package/dist/components/Recipient/RecipientList.stories.js +3 -0
- package/dist/components/ShareDialogCozyToCozy.js +9 -3
- package/dist/components/ShareDialogOnlyByLink.js +12 -4
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -0
- package/dist/components/ShareModal/SharingDetailsModal.js +7 -1
- package/dist/components/WhoHasAccess.js +1 -3
- package/locales/en.json +13 -0
- package/locales/fr.json +13 -0
- package/package.json +2 -2
- package/src/components/ConfirmTrustedRecipientsDialog.jsx +24 -13
- package/src/components/ConfirmTrustedRecipientsDialog.stories.jsx +45 -0
- package/src/components/Recipient/GroupRecipient.jsx +51 -24
- package/src/components/Recipient/GroupRecipient.stories.jsx +3 -2
- package/src/components/Recipient/GroupRecipientDetail.jsx +50 -0
- package/src/components/Recipient/GroupRecipientDetail.stories.jsx +53 -0
- package/src/components/Recipient/GroupRecipientDetailWithAccess.jsx +57 -0
- package/src/components/Recipient/GroupRecipientDetailWithoutAccess.jsx +60 -0
- package/src/components/Recipient/LinkRecipient.jsx +3 -1
- package/src/components/Recipient/MemberRecipient.jsx +3 -1
- package/src/components/Recipient/RecipientList.stories.jsx +3 -0
- package/src/components/ShareDialogCozyToCozy.jsx +40 -36
- package/src/components/ShareDialogOnlyByLink.jsx +22 -8
- package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +1 -0
- package/src/components/ShareModal/SharingDetailsModal.jsx +10 -1
- package/src/components/WhoHasAccess.jsx +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import cx from 'classnames'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
4
|
+
import List from 'cozy-ui/transpiled/react/List'
|
|
3
5
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
6
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
4
7
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
5
8
|
|
|
6
9
|
import MemberRecipient from './Recipient/MemberRecipient'
|
|
@@ -11,24 +14,32 @@ import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfi
|
|
|
11
14
|
*/
|
|
12
15
|
const SharingContent = ({ recipientsToBeConfirmed, verifyRecipient }) => {
|
|
13
16
|
const { t } = useI18n()
|
|
17
|
+
const { isMobile } = useBreakpoints()
|
|
14
18
|
|
|
15
19
|
return (
|
|
16
20
|
<>
|
|
17
|
-
<Typography
|
|
21
|
+
<Typography
|
|
22
|
+
variant="body1"
|
|
23
|
+
className={cx(
|
|
24
|
+
'u-mb-half',
|
|
25
|
+
isMobile ? 'u-ph-1 u-mt-1' : 'u-ph-2 u-mt-1-half'
|
|
26
|
+
)}
|
|
27
|
+
>
|
|
18
28
|
{t(`ConfirmRecipientModal.intruction`)}
|
|
19
29
|
</Typography>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
<List className={isMobile ? 'u-mb-half' : 'u-mb-1'}>
|
|
31
|
+
{recipientsToBeConfirmed.map(recipientConfirmationData => {
|
|
32
|
+
return (
|
|
33
|
+
<MemberRecipient
|
|
34
|
+
{...recipientConfirmationData}
|
|
35
|
+
key={`key_r_${recipientConfirmationData.id}`}
|
|
36
|
+
isOwner={false}
|
|
37
|
+
recipientConfirmationData={recipientConfirmationData}
|
|
38
|
+
verifyRecipient={verifyRecipient}
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
})}
|
|
42
|
+
</List>
|
|
32
43
|
</>
|
|
33
44
|
)
|
|
34
45
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ConfirmTrustedRecipientsDialog from './ConfirmTrustedRecipientsDialog'
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
component: ConfirmTrustedRecipientsDialog,
|
|
5
|
+
args: {
|
|
6
|
+
recipientsToBeConfirmed: [
|
|
7
|
+
{
|
|
8
|
+
instance: 'https://example.com',
|
|
9
|
+
isOwner: false,
|
|
10
|
+
status: 'ready',
|
|
11
|
+
recipientConfirmationData: null,
|
|
12
|
+
verifyRecipient: () => {},
|
|
13
|
+
fadeIn: true,
|
|
14
|
+
type: 'two-way',
|
|
15
|
+
onRevoke: () => {},
|
|
16
|
+
onRevokeSelf: () => {}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default meta
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
name: 'Default',
|
|
26
|
+
args: {
|
|
27
|
+
twoStepsConfirmationMethods: {
|
|
28
|
+
getRecipientsToBeConfirmed: () => [
|
|
29
|
+
{
|
|
30
|
+
name: 'John Doe',
|
|
31
|
+
instance: 'https://example.com',
|
|
32
|
+
isOwner: false,
|
|
33
|
+
status: 'ready'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Alice Doe',
|
|
37
|
+
instance: 'https://example.com',
|
|
38
|
+
isOwner: false,
|
|
39
|
+
status: 'ready'
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
verifyRecipient: () => {}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { useClient } from 'cozy-client'
|
|
4
4
|
import Fade from 'cozy-ui/transpiled/react/Fade'
|
|
@@ -7,16 +7,21 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
7
7
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
8
8
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
9
9
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
10
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
11
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
11
12
|
|
|
13
|
+
import { GroupRecipientDetail } from './GroupRecipientDetail'
|
|
12
14
|
import { GroupRecipientPermissions } from './GroupRecipientPermissions'
|
|
13
15
|
import { FADE_IN_DURATION } from '../../helpers/recipients'
|
|
14
16
|
import { GroupAvatar } from '../Avatar/GroupAvatar'
|
|
15
17
|
|
|
16
18
|
const GroupRecipient = props => {
|
|
17
|
-
const { name, members, fadeIn } = props
|
|
19
|
+
const { name, members, fadeIn, owner } = props
|
|
18
20
|
const { t } = useI18n()
|
|
19
21
|
const client = useClient()
|
|
22
|
+
const { isMobile } = useBreakpoints()
|
|
23
|
+
|
|
24
|
+
const [isDetailOpened, setDetailOpened] = useState(false)
|
|
20
25
|
|
|
21
26
|
const nbMember = members.length
|
|
22
27
|
const nbMemberReady = members.filter(
|
|
@@ -26,30 +31,52 @@ const GroupRecipient = props => {
|
|
|
26
31
|
member => member.instance === client.options.uri
|
|
27
32
|
)
|
|
28
33
|
|
|
34
|
+
const toogleDetailOpened = () => {
|
|
35
|
+
setDetailOpened(!isDetailOpened)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const closeDetail = () => {
|
|
39
|
+
setDetailOpened(false)
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
return (
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
<>
|
|
44
|
+
<Fade in timeout={fadeIn ? FADE_IN_DURATION : 0}>
|
|
45
|
+
<ListItem
|
|
46
|
+
button
|
|
47
|
+
onClick={toogleDetailOpened}
|
|
48
|
+
gutters={isMobile ? 'default' : 'double'}
|
|
49
|
+
>
|
|
50
|
+
<ListItemIcon>
|
|
51
|
+
<GroupAvatar size="small" />
|
|
52
|
+
</ListItemIcon>
|
|
53
|
+
<ListItemText
|
|
54
|
+
primary={
|
|
55
|
+
<Typography className="u-ellipsis" variant="body1">
|
|
56
|
+
{name}
|
|
57
|
+
</Typography>
|
|
58
|
+
}
|
|
59
|
+
secondary={
|
|
60
|
+
t('GroupRecipient.secondary', { nbMember, nbMemberReady }) +
|
|
61
|
+
(isCurrentInstanceInsideMembers
|
|
62
|
+
? ` (${t('GroupRecipient.secondary_you')})`
|
|
63
|
+
: '')
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
<ListItemSecondaryAction className={isMobile ? 'u-mr-1' : 'u-mr-2'}>
|
|
67
|
+
<GroupRecipientPermissions {...props} />
|
|
68
|
+
</ListItemSecondaryAction>
|
|
69
|
+
</ListItem>
|
|
70
|
+
</Fade>
|
|
71
|
+
{isDetailOpened ? (
|
|
72
|
+
<GroupRecipientDetail
|
|
73
|
+
owner={owner}
|
|
74
|
+
name={name}
|
|
75
|
+
members={members}
|
|
76
|
+
onClose={closeDetail}
|
|
47
77
|
/>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</ListItemSecondaryAction>
|
|
51
|
-
</ListItem>
|
|
52
|
-
</Fade>
|
|
78
|
+
) : null}
|
|
79
|
+
</>
|
|
53
80
|
)
|
|
54
81
|
}
|
|
55
82
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
4
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
5
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
|
+
|
|
7
|
+
import { GroupRecipientDetailWithAccess } from './GroupRecipientDetailWithAccess'
|
|
8
|
+
import { GroupRecipientDetailWithoutAccess } from './GroupRecipientDetailWithoutAccess'
|
|
9
|
+
|
|
10
|
+
const GroupRecipientDetail = ({ name, owner, members, onClose }) => {
|
|
11
|
+
const { t } = useI18n()
|
|
12
|
+
const withAccess = members.filter(
|
|
13
|
+
member => !['revoked', 'mail-not-sent'].includes(member.status)
|
|
14
|
+
)
|
|
15
|
+
const withoutAccess = members.filter(member =>
|
|
16
|
+
['revoked', 'mail-not-sent'].includes(member.status)
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
const ownerName = owner.public_name
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Dialog
|
|
23
|
+
open
|
|
24
|
+
size="small"
|
|
25
|
+
onClose={onClose}
|
|
26
|
+
title={
|
|
27
|
+
<>
|
|
28
|
+
{name}
|
|
29
|
+
{ownerName ? (
|
|
30
|
+
<Typography variant="caption">
|
|
31
|
+
{t('GroupRecipientDetail.subtitle', { ownerName })}
|
|
32
|
+
</Typography>
|
|
33
|
+
) : null}
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
content={
|
|
37
|
+
<div className="u-flex u-stack-xs u-flex-column">
|
|
38
|
+
{withAccess.length > 0 ? (
|
|
39
|
+
<GroupRecipientDetailWithAccess withAccess={withAccess} />
|
|
40
|
+
) : null}
|
|
41
|
+
{withoutAccess.length > 0 ? (
|
|
42
|
+
<GroupRecipientDetailWithoutAccess withoutAccess={withoutAccess} />
|
|
43
|
+
) : null}
|
|
44
|
+
</div>
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { GroupRecipientDetail }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { GroupRecipientDetail } from './GroupRecipientDetail'
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
component: GroupRecipientDetail,
|
|
5
|
+
args: {
|
|
6
|
+
name: 'Family',
|
|
7
|
+
owner: {
|
|
8
|
+
public_name: 'Alice'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
export const Default = {
|
|
16
|
+
name: 'Default',
|
|
17
|
+
args: {
|
|
18
|
+
members: [
|
|
19
|
+
{
|
|
20
|
+
name: 'Alice',
|
|
21
|
+
instance: 'http://alice.cozy.localhost:8080',
|
|
22
|
+
status: 'ready'
|
|
23
|
+
},
|
|
24
|
+
{ name: 'marine@google.com', status: 'mail-not-sent' },
|
|
25
|
+
{ email: 'Martin', status: 'pending' },
|
|
26
|
+
{ name: 'Paul', status: 'revoked' }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const OnlyWithAccess = {
|
|
32
|
+
name: 'OnlyWithAccess',
|
|
33
|
+
args: {
|
|
34
|
+
members: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Alice',
|
|
37
|
+
instance: 'http://alice.cozy.localhost:8080',
|
|
38
|
+
status: 'ready'
|
|
39
|
+
},
|
|
40
|
+
{ name: 'Martin', status: 'pending' }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const OnlyWithoutAccess = {
|
|
46
|
+
name: 'OnlyWithoutAccess',
|
|
47
|
+
args: {
|
|
48
|
+
members: [
|
|
49
|
+
{ name: 'marine@google.com', status: 'mail-not-sent' },
|
|
50
|
+
{ name: 'Paul', status: 'revoked' }
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
4
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
+
import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud'
|
|
6
|
+
import List from 'cozy-ui/transpiled/react/List'
|
|
7
|
+
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
8
|
+
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
9
|
+
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
10
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
11
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
12
|
+
|
|
13
|
+
import { getInitials, getDisplayName } from '../../models'
|
|
14
|
+
|
|
15
|
+
const GroupRecipientDetailWithAccess = ({ withAccess }) => {
|
|
16
|
+
const { t } = useI18n()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<Typography variant="subtitle2">
|
|
21
|
+
{t('GroupRecipientDetail.withAccess.title')}
|
|
22
|
+
</Typography>
|
|
23
|
+
<List>
|
|
24
|
+
{withAccess.map(recipient => {
|
|
25
|
+
const name = getDisplayName(recipient)
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ListItem disableGutters key={recipient.index}>
|
|
29
|
+
<ListItemIcon>
|
|
30
|
+
<Avatar text={getInitials(recipient)} textId={name} />
|
|
31
|
+
</ListItemIcon>
|
|
32
|
+
<ListItemText
|
|
33
|
+
primary={name}
|
|
34
|
+
secondary={
|
|
35
|
+
recipient.instance ? (
|
|
36
|
+
<div className="u-flex u-flex-items-center">
|
|
37
|
+
<Icon
|
|
38
|
+
icon={ToTheCloudIcon}
|
|
39
|
+
size={10}
|
|
40
|
+
style={{
|
|
41
|
+
marginRight: '0.25rem'
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
{recipient.instance}
|
|
45
|
+
</div>
|
|
46
|
+
) : null
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
</ListItem>
|
|
50
|
+
)
|
|
51
|
+
})}
|
|
52
|
+
</List>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { GroupRecipientDetailWithAccess }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
4
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
+
import ForbiddenIcon from 'cozy-ui/transpiled/react/Icons/Forbidden'
|
|
6
|
+
import List from 'cozy-ui/transpiled/react/List'
|
|
7
|
+
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
8
|
+
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
9
|
+
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
10
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
11
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
12
|
+
|
|
13
|
+
import { getInitials, getDisplayName } from '../../models'
|
|
14
|
+
|
|
15
|
+
const GroupRecipientDetailWithoutAccess = ({ withoutAccess }) => {
|
|
16
|
+
const { t } = useI18n()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<Typography variant="subtitle2">
|
|
21
|
+
{t('GroupRecipientDetail.withoutAccess.title')}
|
|
22
|
+
</Typography>
|
|
23
|
+
<List>
|
|
24
|
+
{withoutAccess.map(recipient => {
|
|
25
|
+
const icon = recipient.status === 'revoked' ? ForbiddenIcon : null
|
|
26
|
+
const name = getDisplayName(recipient)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ListItem disableGutters key={recipient.index}>
|
|
30
|
+
<ListItemIcon>
|
|
31
|
+
<Avatar text={getInitials(recipient)} textId={name} />
|
|
32
|
+
</ListItemIcon>
|
|
33
|
+
<ListItemText
|
|
34
|
+
primary={name}
|
|
35
|
+
secondary={
|
|
36
|
+
<div className="u-flex u-flex-items-center">
|
|
37
|
+
{icon ? (
|
|
38
|
+
<Icon
|
|
39
|
+
icon={icon}
|
|
40
|
+
size={10}
|
|
41
|
+
style={{
|
|
42
|
+
marginRight: '0.25rem'
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
) : null}
|
|
46
|
+
{t(
|
|
47
|
+
`GroupRecipientDetail.withoutAccess.status.${recipient.status}`
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
</ListItem>
|
|
53
|
+
)
|
|
54
|
+
})}
|
|
55
|
+
</List>
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { GroupRecipientDetailWithoutAccess }
|
|
@@ -9,6 +9,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
|
9
9
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
10
10
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
11
11
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
12
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
12
13
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
13
14
|
|
|
14
15
|
import LinkRecipientPermissions from './LinkRecipientPermissions'
|
|
@@ -18,6 +19,7 @@ import styles from '../../styles/recipient.styl'
|
|
|
18
19
|
|
|
19
20
|
const LinkRecipient = props => {
|
|
20
21
|
const { t } = useI18n()
|
|
22
|
+
const { isMobile } = useBreakpoints()
|
|
21
23
|
|
|
22
24
|
const { recipientConfirmationData, verifyRecipient, link, fadeIn } = props
|
|
23
25
|
|
|
@@ -32,7 +34,7 @@ const LinkRecipient = props => {
|
|
|
32
34
|
|
|
33
35
|
return (
|
|
34
36
|
<Fade in timeout={fadeIn ? FADE_IN_DURATION : 0}>
|
|
35
|
-
<ListItem
|
|
37
|
+
<ListItem gutters={isMobile ? 'default' : 'double'}>
|
|
36
38
|
<ListItemIcon>
|
|
37
39
|
<Circle size="small" className={styles['link-recipient-icon-circle']}>
|
|
38
40
|
<Icon icon={LinkIcon} />
|
|
@@ -7,6 +7,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
|
7
7
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
8
8
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
9
9
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
10
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
11
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
11
12
|
|
|
12
13
|
import MemberRecipientPermissions from './MemberRecipientPermissions'
|
|
@@ -21,6 +22,7 @@ const DEFAULT_DISPLAY_NAME = 'Share.contacts.defaultDisplayName'
|
|
|
21
22
|
const MemberRecipient = props => {
|
|
22
23
|
const { t } = useI18n()
|
|
23
24
|
const client = useClient()
|
|
25
|
+
const { isMobile } = useBreakpoints()
|
|
24
26
|
|
|
25
27
|
const {
|
|
26
28
|
instance,
|
|
@@ -48,7 +50,7 @@ const MemberRecipient = props => {
|
|
|
48
50
|
|
|
49
51
|
return (
|
|
50
52
|
<Fade in timeout={fadeIn ? FADE_IN_DURATION : 0}>
|
|
51
|
-
<ListItem
|
|
53
|
+
<ListItem gutters={isMobile ? 'default' : 'double'}>
|
|
52
54
|
<ListItemIcon>
|
|
53
55
|
<MemberAvatar size="small" recipient={props} />
|
|
54
56
|
</ListItemIcon>
|
|
@@ -2,6 +2,7 @@ import cx from 'classnames'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
5
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
5
6
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
7
|
|
|
7
8
|
import { default as DumbShareByEmail } from './ShareByEmail'
|
|
@@ -39,47 +40,49 @@ const SharingContent = ({
|
|
|
39
40
|
onRevokeLink
|
|
40
41
|
}) => {
|
|
41
42
|
const { t } = useI18n()
|
|
43
|
+
const { isMobile } = useBreakpoints()
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
46
|
<div className={cx(styles['share-modal-content'])}>
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
47
|
+
<div className={cx('u-pt-1-half', isMobile ? 'u-ph-1' : 'u-ph-2')}>
|
|
48
|
+
{showShareOnlyByLink && (
|
|
49
|
+
<div className={styles['share-byemail-onlybylink']}>
|
|
50
|
+
{t(`${documentType}.share.shareByEmail.onlyByLink`, {
|
|
51
|
+
type: t(
|
|
52
|
+
`${documentType}.share.shareByEmail.type.${
|
|
53
|
+
document.type === 'directory' ? 'folder' : 'file'
|
|
54
|
+
}`
|
|
55
|
+
)
|
|
56
|
+
})}{' '}
|
|
57
|
+
<strong>
|
|
58
|
+
{t(
|
|
59
|
+
`${documentType}.share.shareByEmail.${
|
|
60
|
+
hasSharedParent ? 'hasSharedParent' : 'hasSharedChild'
|
|
61
|
+
}`
|
|
62
|
+
)}
|
|
63
|
+
</strong>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
<Typography variant="h6" className="u-mb-1-half">
|
|
67
|
+
{t('Share.contacts.whoHasAccess')}
|
|
68
|
+
</Typography>
|
|
69
|
+
{showShareByEmail && (
|
|
70
|
+
<DumbShareByEmail
|
|
71
|
+
contacts={contacts}
|
|
72
|
+
contactGroups={contactGroups}
|
|
73
|
+
createContact={createContact}
|
|
74
|
+
currentRecipients={recipients}
|
|
75
|
+
document={document}
|
|
76
|
+
documentType={documentType}
|
|
77
|
+
needsContactsPermission={needsContactsPermission}
|
|
78
|
+
onShare={onShare}
|
|
79
|
+
sharing={sharing}
|
|
80
|
+
sharingDesc={sharingDesc}
|
|
81
|
+
/>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
80
84
|
{showWhoHasAccess && (
|
|
81
85
|
<WhoHasAccess
|
|
82
|
-
className="u-mt-half"
|
|
83
86
|
document={document}
|
|
84
87
|
documentType={documentType}
|
|
85
88
|
isOwner={isOwner}
|
|
@@ -129,6 +132,7 @@ const ShareDialogCozyToCozy = ({
|
|
|
129
132
|
dialogContentOnShare={SharingContent}
|
|
130
133
|
dialogActionsOnShare={showShareByLink ? DumbShareByLink : null}
|
|
131
134
|
dialogTitleOnShare={SharingTitleFunction({ documentType, document })}
|
|
135
|
+
disableGutters
|
|
132
136
|
/>
|
|
133
137
|
)
|
|
134
138
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import cx from 'classnames'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
4
5
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
6
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
5
7
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
8
|
|
|
7
9
|
import { default as DumbShareByLink } from './ShareByLink'
|
|
@@ -22,8 +24,11 @@ const ShareDialogOnlyByLink = ({
|
|
|
22
24
|
permissions
|
|
23
25
|
}) => {
|
|
24
26
|
const { t } = useI18n()
|
|
27
|
+
const { isMobile } = useBreakpoints()
|
|
28
|
+
|
|
25
29
|
return (
|
|
26
30
|
<Dialog
|
|
31
|
+
disableGutters
|
|
27
32
|
disableEnforceFocus
|
|
28
33
|
open={true}
|
|
29
34
|
onClose={onClose}
|
|
@@ -32,11 +37,13 @@ const ShareDialogOnlyByLink = ({
|
|
|
32
37
|
})}
|
|
33
38
|
content={
|
|
34
39
|
<>
|
|
35
|
-
<Typography
|
|
40
|
+
<Typography
|
|
41
|
+
variant="h6"
|
|
42
|
+
className={cx(isMobile ? 'u-ph-1 u-mt-1' : 'u-ph-2 u-mt-1-half')}
|
|
43
|
+
>
|
|
36
44
|
{t('Share.contacts.whoHasAccess')}
|
|
37
45
|
</Typography>
|
|
38
46
|
<WhoHasAccess
|
|
39
|
-
className="u-mt-half"
|
|
40
47
|
document={document}
|
|
41
48
|
documentType={documentType}
|
|
42
49
|
isOwner={isOwner}
|
|
@@ -48,12 +55,19 @@ const ShareDialogOnlyByLink = ({
|
|
|
48
55
|
onUpdateShareLinkPermissions={onUpdateShareLinkPermissions}
|
|
49
56
|
onRevokeLink={onRevokeLink}
|
|
50
57
|
/>
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
<div
|
|
59
|
+
className={cx(
|
|
60
|
+
'u-mt-half',
|
|
61
|
+
isMobile ? 'u-ph-1 u-mb-1' : 'u-ph-2 u-mb-1-half'
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
<DumbShareByLink
|
|
65
|
+
link={link}
|
|
66
|
+
document={document}
|
|
67
|
+
documentType={documentType}
|
|
68
|
+
onEnable={onShareByLink}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
57
71
|
</>
|
|
58
72
|
}
|
|
59
73
|
/>
|