cozy-sharing 28.3.4 → 28.4.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 +10 -0
- package/dist/components/FederatedFolder/DumbFederatedFolderModal.js +56 -0
- package/dist/components/FederatedFolder/FederatedFolderModal.js +150 -0
- package/dist/components/FederatedFolder/FederatedFolderModal.spec.js +543 -0
- package/dist/components/Recipient/LinkRecipient.js +1 -1
- package/dist/components/ShareAutosuggest.js +4 -1
- package/dist/components/ShareByEmail.js +105 -33
- package/dist/components/ShareByEmail.spec.js +111 -9
- package/dist/components/ShareByLink.js +3 -3
- package/dist/components/ShareModal/ShareModal.js +18 -2
- package/dist/components/ShareModal.js +1 -1
- package/dist/components/ShareRecipientsInput.js +5 -2
- package/dist/components/SharedDrive/DumbSharedDriveModal.js +39 -72
- package/dist/components/SharedDrive/SharedDriveModal.js +11 -5
- package/dist/components/SharedDrive/helpers.js +28 -2
- package/dist/components/SharedFolder/DumbBatchSharedFolderModal.js +159 -0
- package/dist/components/WhoHasAccess.js +1 -1
- package/dist/index.js +1 -0
- package/locales/en.json +13 -1
- package/locales/fr.json +15 -3
- package/locales/ru.json +13 -1
- package/locales/vi.json +13 -1
- package/package.json +3 -3
- package/src/components/FederatedFolder/DumbFederatedFolderModal.jsx +62 -0
- package/src/components/FederatedFolder/FederatedFolderModal.jsx +119 -0
- package/src/components/FederatedFolder/FederatedFolderModal.spec.jsx +376 -0
- package/src/components/Recipient/LinkRecipient.jsx +1 -1
- package/src/components/ShareAutosuggest.jsx +4 -1
- package/src/components/ShareByEmail.jsx +47 -8
- package/src/components/ShareByEmail.spec.jsx +96 -6
- package/src/components/ShareByLink.jsx +7 -3
- package/src/components/ShareModal/ShareModal.jsx +16 -1
- package/src/components/ShareModal.jsx +1 -1
- package/src/components/ShareRecipientsInput.jsx +5 -2
- package/src/components/SharedDrive/DumbSharedDriveModal.jsx +38 -88
- package/src/components/SharedDrive/SharedDriveModal.jsx +14 -4
- package/src/components/SharedDrive/helpers.js +33 -2
- package/src/components/SharedFolder/DumbBatchSharedFolderModal.jsx +174 -0
- package/src/components/WhoHasAccess.jsx +1 -1
- package/src/index.jsx +1 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useI18n } from 'twake-i18n';
|
|
4
|
-
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
5
|
-
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
6
|
-
import TextField from 'cozy-ui/transpiled/react/TextField';
|
|
7
|
-
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
8
4
|
import withLocales from '../../hoc/withLocales';
|
|
9
|
-
import
|
|
10
|
-
import { default as DumbShareByEmail } from '../ShareByEmail';
|
|
11
|
-
import WhoHasAccess from '../WhoHasAccess';
|
|
5
|
+
import DumbBatchSharedFolderModal from '../SharedFolder/DumbBatchSharedFolderModal';
|
|
12
6
|
export var DumbSharedDriveModal = withLocales(function (_ref) {
|
|
13
7
|
var title = _ref.title,
|
|
14
8
|
document = _ref.document,
|
|
@@ -16,90 +10,63 @@ export var DumbSharedDriveModal = withLocales(function (_ref) {
|
|
|
16
10
|
handleSharedDriveNameChange = _ref.handleSharedDriveNameChange,
|
|
17
11
|
createContact = _ref.createContact,
|
|
18
12
|
recipients = _ref.recipients,
|
|
13
|
+
currentRecipients = _ref.currentRecipients,
|
|
19
14
|
onRevoke = _ref.onRevoke,
|
|
20
15
|
onSetType = _ref.onSetType,
|
|
21
16
|
onCreate = _ref.onCreate,
|
|
17
|
+
onSend = _ref.onSend,
|
|
22
18
|
onClose = _ref.onClose,
|
|
23
19
|
onShare = _ref.onShare,
|
|
24
|
-
onRename = _ref.onRename
|
|
20
|
+
onRename = _ref.onRename,
|
|
21
|
+
_ref$showNameField = _ref.showNameField,
|
|
22
|
+
showNameField = _ref$showNameField === void 0 ? true : _ref$showNameField,
|
|
23
|
+
sharingLink = _ref.sharingLink;
|
|
25
24
|
|
|
26
25
|
var _useI18n = useI18n(),
|
|
27
26
|
t = _useI18n.t;
|
|
28
27
|
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
30
|
-
open: true,
|
|
31
|
-
disableGutters: true,
|
|
32
|
-
onClose: onClose,
|
|
28
|
+
return /*#__PURE__*/React.createElement(DumbBatchSharedFolderModal, {
|
|
33
29
|
title: title,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
className: "u-mt-1-half u-mb-half"
|
|
57
|
-
}, t('SharedDrive.sharedDriveModal.addPeople')), /*#__PURE__*/React.createElement(DumbShareByEmail, {
|
|
58
|
-
createContact: createContact,
|
|
59
|
-
currentRecipients: [],
|
|
60
|
-
document: document,
|
|
61
|
-
documentType: "Files",
|
|
62
|
-
onShare: onShare,
|
|
63
|
-
submitLabel: t('SharedDrive.sharedDriveModal.add'),
|
|
64
|
-
showNotifications: false
|
|
65
|
-
})), /*#__PURE__*/React.createElement(WhoHasAccess, {
|
|
66
|
-
isOwner: true,
|
|
67
|
-
isSharedDrive: true,
|
|
68
|
-
recipients: recipients,
|
|
69
|
-
document: document,
|
|
70
|
-
documentType: "Files",
|
|
71
|
-
className: "u-w-100",
|
|
72
|
-
onRevoke: onRevoke,
|
|
73
|
-
onSetType: onSetType
|
|
74
|
-
})),
|
|
75
|
-
actions: /*#__PURE__*/React.createElement(React.Fragment, null, onCreate && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
76
|
-
variant: "secondary",
|
|
77
|
-
label: t('SharedDrive.sharedDriveModal.cancel'),
|
|
78
|
-
onClick: onClose
|
|
79
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
80
|
-
variant: "primary",
|
|
81
|
-
label: t('SharedDrive.sharedDriveModal.create'),
|
|
82
|
-
onClick: onCreate
|
|
83
|
-
})), onRename && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
84
|
-
variant: "primary",
|
|
85
|
-
label: t('SharedDrive.sharedDriveModal.save'),
|
|
86
|
-
onClick: function onClick() {
|
|
87
|
-
return onRename(sharedDriveName);
|
|
88
|
-
}
|
|
89
|
-
})))
|
|
30
|
+
document: document,
|
|
31
|
+
folderName: sharedDriveName,
|
|
32
|
+
handleFolderNameChange: handleSharedDriveNameChange,
|
|
33
|
+
createContact: createContact,
|
|
34
|
+
recipients: recipients,
|
|
35
|
+
currentRecipients: currentRecipients,
|
|
36
|
+
onRevoke: onRevoke,
|
|
37
|
+
onSetType: onSetType,
|
|
38
|
+
onCreate: onCreate,
|
|
39
|
+
onSend: onSend,
|
|
40
|
+
onClose: onClose,
|
|
41
|
+
onShare: onShare,
|
|
42
|
+
onRename: onRename,
|
|
43
|
+
showNameField: showNameField,
|
|
44
|
+
sharingLink: sharingLink,
|
|
45
|
+
nameLabel: t('SharedDrive.sharedDriveModal.nameLabel'),
|
|
46
|
+
addPeopleLabel: t('SharedDrive.sharedDriveModal.addPeople'),
|
|
47
|
+
addButtonLabel: t('SharedDrive.sharedDriveModal.add'),
|
|
48
|
+
cancelLabel: t('SharedDrive.sharedDriveModal.cancel'),
|
|
49
|
+
createLabel: t('SharedDrive.sharedDriveModal.create'),
|
|
50
|
+
shareLabel: t('FederatedFolder.share'),
|
|
51
|
+
saveLabel: t('SharedDrive.sharedDriveModal.save')
|
|
90
52
|
});
|
|
91
53
|
});
|
|
92
54
|
DumbSharedDriveModal.propTypes = {
|
|
93
55
|
title: PropTypes.string,
|
|
94
56
|
document: PropTypes.object,
|
|
95
57
|
sharedDriveName: PropTypes.string,
|
|
96
|
-
handleSharedDriveNameChange: PropTypes.func
|
|
58
|
+
handleSharedDriveNameChange: PropTypes.func,
|
|
97
59
|
createContact: PropTypes.func.isRequired,
|
|
98
60
|
recipients: PropTypes.array,
|
|
61
|
+
currentRecipients: PropTypes.array,
|
|
99
62
|
onRevoke: PropTypes.func.isRequired,
|
|
100
63
|
onSetType: PropTypes.func.isRequired,
|
|
101
|
-
onCreate: PropTypes.func
|
|
64
|
+
onCreate: PropTypes.func,
|
|
65
|
+
onSend: PropTypes.func,
|
|
102
66
|
onClose: PropTypes.func.isRequired,
|
|
103
67
|
onShare: PropTypes.func.isRequired,
|
|
104
|
-
onRename: PropTypes.func
|
|
105
|
-
|
|
68
|
+
onRename: PropTypes.func,
|
|
69
|
+
showNameField: PropTypes.bool,
|
|
70
|
+
sharingLink: PropTypes.string
|
|
71
|
+
};
|
|
72
|
+
export default DumbSharedDriveModal;
|
|
@@ -8,7 +8,7 @@ import { useI18n } from 'twake-i18n';
|
|
|
8
8
|
import { useClient } from 'cozy-client';
|
|
9
9
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
|
|
10
10
|
import { DumbSharedDriveModal } from './DumbSharedDriveModal';
|
|
11
|
-
import { mergeAndDeduplicateRecipients, formatRecipients } from './helpers';
|
|
11
|
+
import { mergeAndDeduplicateRecipients, formatRecipients, RECIPIENT_INDEX_PREFIX } from './helpers';
|
|
12
12
|
import withLocales from '../../hoc/withLocales';
|
|
13
13
|
import { useSharingContext } from '../../hooks/useSharingContext';
|
|
14
14
|
import { Contact } from '../../models';
|
|
@@ -77,7 +77,8 @@ export var SharedDriveModal = withLocales(function (_ref) {
|
|
|
77
77
|
document: sharedDriveFolder,
|
|
78
78
|
recipients: sharedDriveRecipients.recipients,
|
|
79
79
|
readOnlyRecipients: sharedDriveRecipients.readOnlyRecipients,
|
|
80
|
-
sharedDrive: true
|
|
80
|
+
sharedDrive: true,
|
|
81
|
+
openSharing: false
|
|
81
82
|
});
|
|
82
83
|
|
|
83
84
|
case 9:
|
|
@@ -112,7 +113,7 @@ export var SharedDriveModal = withLocales(function (_ref) {
|
|
|
112
113
|
}();
|
|
113
114
|
|
|
114
115
|
var onSetType = function onSetType(index, newType) {
|
|
115
|
-
var _id = index.split(
|
|
116
|
+
var _id = index.split(RECIPIENT_INDEX_PREFIX)[1];
|
|
116
117
|
|
|
117
118
|
if (newType === 'two-way') {
|
|
118
119
|
setSharedDriveRecipients(function (prev) {
|
|
@@ -142,7 +143,7 @@ export var SharedDriveModal = withLocales(function (_ref) {
|
|
|
142
143
|
};
|
|
143
144
|
|
|
144
145
|
var onRevoke = function onRevoke(index) {
|
|
145
|
-
var _id = index.split(
|
|
146
|
+
var _id = index.split(RECIPIENT_INDEX_PREFIX)[1];
|
|
146
147
|
setSharedDriveRecipients(function (prev) {
|
|
147
148
|
return {
|
|
148
149
|
recipients: prev.recipients.filter(function (r) {
|
|
@@ -166,11 +167,16 @@ export var SharedDriveModal = withLocales(function (_ref) {
|
|
|
166
167
|
handleSharedDriveNameChange: handleSharedDriveNameChange,
|
|
167
168
|
createContact: createContact,
|
|
168
169
|
recipients: recipients,
|
|
170
|
+
currentRecipients: [],
|
|
169
171
|
onRevoke: onRevoke,
|
|
170
172
|
onSetType: onSetType,
|
|
171
173
|
onCreate: onCreate,
|
|
174
|
+
onSend: undefined,
|
|
172
175
|
onClose: onClose,
|
|
173
|
-
onShare: onShare
|
|
176
|
+
onShare: onShare,
|
|
177
|
+
showNameField: true,
|
|
178
|
+
sharingLink: undefined,
|
|
179
|
+
document: undefined
|
|
174
180
|
});
|
|
175
181
|
});
|
|
176
182
|
SharedDriveModal.propTypes = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import { models } from 'cozy-client';
|
|
2
3
|
var ContactModel = models.contact;
|
|
4
|
+
export var RECIPIENT_INDEX_PREFIX = 'virtual-shared-drive-sharing-';
|
|
3
5
|
export var mergeAndDeduplicateRecipients = function mergeAndDeduplicateRecipients(arrays) {
|
|
4
6
|
var combinedArray = arrays.flat();
|
|
5
7
|
var seenIds = new Set();
|
|
@@ -13,11 +15,35 @@ export var mergeAndDeduplicateRecipients = function mergeAndDeduplicateRecipient
|
|
|
13
15
|
});
|
|
14
16
|
return uniqueArray;
|
|
15
17
|
};
|
|
18
|
+
export var moveRecipientToReadWrite = function moveRecipientToReadWrite(federatedRecipients, _id) {
|
|
19
|
+
var recipientToMove = federatedRecipients.readOnlyRecipients.find(function (r) {
|
|
20
|
+
return r._id === _id;
|
|
21
|
+
});
|
|
22
|
+
if (!recipientToMove) return federatedRecipients;
|
|
23
|
+
return {
|
|
24
|
+
recipients: [].concat(_toConsumableArray(federatedRecipients.recipients), [recipientToMove]),
|
|
25
|
+
readOnlyRecipients: federatedRecipients.readOnlyRecipients.filter(function (r) {
|
|
26
|
+
return r._id !== _id;
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export var moveRecipientToReadOnly = function moveRecipientToReadOnly(federatedRecipients, _id) {
|
|
31
|
+
var recipientToMove = federatedRecipients.recipients.find(function (r) {
|
|
32
|
+
return r._id === _id;
|
|
33
|
+
});
|
|
34
|
+
if (!recipientToMove) return federatedRecipients;
|
|
35
|
+
return {
|
|
36
|
+
recipients: federatedRecipients.recipients.filter(function (r) {
|
|
37
|
+
return r._id !== _id;
|
|
38
|
+
}),
|
|
39
|
+
readOnlyRecipients: [].concat(_toConsumableArray(federatedRecipients.readOnlyRecipients), [recipientToMove])
|
|
40
|
+
};
|
|
41
|
+
};
|
|
16
42
|
export var formatRecipients = function formatRecipients(sharedDriveRecipients) {
|
|
17
43
|
var recipients = [];
|
|
18
44
|
sharedDriveRecipients.recipients.forEach(function (r) {
|
|
19
45
|
recipients.push({
|
|
20
|
-
index: "
|
|
46
|
+
index: "".concat(RECIPIENT_INDEX_PREFIX).concat(r._id),
|
|
21
47
|
email: ContactModel.getPrimaryEmail(r),
|
|
22
48
|
public_name: r.displayName || r.name,
|
|
23
49
|
memberIndex: r._id,
|
|
@@ -27,7 +53,7 @@ export var formatRecipients = function formatRecipients(sharedDriveRecipients) {
|
|
|
27
53
|
});
|
|
28
54
|
sharedDriveRecipients.readOnlyRecipients.forEach(function (r) {
|
|
29
55
|
recipients.push({
|
|
30
|
-
index: "
|
|
56
|
+
index: "".concat(RECIPIENT_INDEX_PREFIX).concat(r._id),
|
|
31
57
|
email: ContactModel.getPrimaryEmail(r),
|
|
32
58
|
public_name: r.displayName || r.name,
|
|
33
59
|
memberIndex: r._id,
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
4
|
+
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
5
|
+
import TextField from 'cozy-ui/transpiled/react/TextField';
|
|
6
|
+
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
7
|
+
import withLocales from '../../hoc/withLocales';
|
|
8
|
+
import AntivirusAlert from '../AntivirusAlert';
|
|
9
|
+
import { default as DumbShareByEmail } from '../ShareByEmail';
|
|
10
|
+
import ShareByLink from '../ShareByLink';
|
|
11
|
+
import WhoHasAccess from '../WhoHasAccess';
|
|
12
|
+
export var DumbBatchSharedFolderModal = withLocales(function (_ref) {
|
|
13
|
+
var title = _ref.title,
|
|
14
|
+
document = _ref.document,
|
|
15
|
+
folderName = _ref.folderName,
|
|
16
|
+
handleFolderNameChange = _ref.handleFolderNameChange,
|
|
17
|
+
createContact = _ref.createContact,
|
|
18
|
+
recipients = _ref.recipients,
|
|
19
|
+
currentRecipients = _ref.currentRecipients,
|
|
20
|
+
onRevoke = _ref.onRevoke,
|
|
21
|
+
onSetType = _ref.onSetType,
|
|
22
|
+
onCreate = _ref.onCreate,
|
|
23
|
+
onSend = _ref.onSend,
|
|
24
|
+
onClose = _ref.onClose,
|
|
25
|
+
_onShare = _ref.onShare,
|
|
26
|
+
onRename = _ref.onRename,
|
|
27
|
+
_ref$showNameField = _ref.showNameField,
|
|
28
|
+
showNameField = _ref$showNameField === void 0 ? false : _ref$showNameField,
|
|
29
|
+
sharingLink = _ref.sharingLink,
|
|
30
|
+
nameLabel = _ref.nameLabel,
|
|
31
|
+
addPeopleLabel = _ref.addPeopleLabel,
|
|
32
|
+
addButtonLabel = _ref.addButtonLabel,
|
|
33
|
+
cancelLabel = _ref.cancelLabel,
|
|
34
|
+
createLabel = _ref.createLabel,
|
|
35
|
+
shareLabel = _ref.shareLabel,
|
|
36
|
+
saveLabel = _ref.saveLabel,
|
|
37
|
+
sharingDesc = _ref.sharingDesc;
|
|
38
|
+
var hasRecipients = Boolean(recipients === null || recipients === void 0 ? void 0 : recipients.length); // Determine action buttons based on modal mode
|
|
39
|
+
|
|
40
|
+
var actionButtons = function () {
|
|
41
|
+
if (showNameField && onCreate) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
variant: "secondary",
|
|
44
|
+
label: cancelLabel,
|
|
45
|
+
onClick: onClose
|
|
46
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
47
|
+
variant: "primary",
|
|
48
|
+
label: createLabel,
|
|
49
|
+
onClick: onCreate
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!showNameField) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ShareByLink, {
|
|
55
|
+
link: sharingLink,
|
|
56
|
+
document: document,
|
|
57
|
+
documentType: "Files"
|
|
58
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
59
|
+
variant: "primary",
|
|
60
|
+
label: shareLabel,
|
|
61
|
+
disabled: !hasRecipients || !onSend,
|
|
62
|
+
onClick: onSend
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (onRename) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
68
|
+
variant: "primary",
|
|
69
|
+
label: saveLabel,
|
|
70
|
+
onClick: function onClick() {
|
|
71
|
+
return onRename(folderName);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return null;
|
|
77
|
+
}();
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/React.createElement(FixedDialog, {
|
|
80
|
+
open: true,
|
|
81
|
+
disableGutters: true,
|
|
82
|
+
onClose: onClose,
|
|
83
|
+
title: title,
|
|
84
|
+
classes: {
|
|
85
|
+
paper: 'u-ov-visible'
|
|
86
|
+
},
|
|
87
|
+
componentsProps: {
|
|
88
|
+
dialogContent: {
|
|
89
|
+
className: 'u-ov-visible'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "u-ph-2"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(AntivirusAlert, {
|
|
95
|
+
document: document
|
|
96
|
+
}), showNameField && handleFolderNameChange && /*#__PURE__*/React.createElement(TextField, {
|
|
97
|
+
required: true,
|
|
98
|
+
label: nameLabel,
|
|
99
|
+
variant: "outlined",
|
|
100
|
+
size: "small",
|
|
101
|
+
className: "u-w-100 u-mt-1-half",
|
|
102
|
+
value: folderName !== null && folderName !== void 0 ? folderName : '',
|
|
103
|
+
onChange: handleFolderNameChange
|
|
104
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
105
|
+
variant: "h6",
|
|
106
|
+
className: "u-mt-1-half u-mb-half"
|
|
107
|
+
}, addPeopleLabel), /*#__PURE__*/React.createElement(DumbShareByEmail, {
|
|
108
|
+
createContact: createContact,
|
|
109
|
+
currentRecipients: currentRecipients,
|
|
110
|
+
document: document,
|
|
111
|
+
documentType: "Files",
|
|
112
|
+
sharedDrive: true,
|
|
113
|
+
sharingDesc: sharingDesc,
|
|
114
|
+
onShare: function onShare(params) {
|
|
115
|
+
_onShare(params);
|
|
116
|
+
},
|
|
117
|
+
submitLabel: addButtonLabel,
|
|
118
|
+
showNotifications: false
|
|
119
|
+
})), /*#__PURE__*/React.createElement(WhoHasAccess, {
|
|
120
|
+
isOwner: true,
|
|
121
|
+
isSharedDrive: true,
|
|
122
|
+
recipients: recipients,
|
|
123
|
+
document: document,
|
|
124
|
+
documentType: "Files",
|
|
125
|
+
className: "u-w-100",
|
|
126
|
+
onRevoke: onRevoke,
|
|
127
|
+
onSetType: onSetType,
|
|
128
|
+
link: sharingLink
|
|
129
|
+
})),
|
|
130
|
+
actions: actionButtons
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
DumbBatchSharedFolderModal.propTypes = {
|
|
134
|
+
title: PropTypes.string,
|
|
135
|
+
document: PropTypes.object,
|
|
136
|
+
folderName: PropTypes.string,
|
|
137
|
+
handleFolderNameChange: PropTypes.func,
|
|
138
|
+
createContact: PropTypes.func.isRequired,
|
|
139
|
+
recipients: PropTypes.array,
|
|
140
|
+
currentRecipients: PropTypes.array,
|
|
141
|
+
onRevoke: PropTypes.func.isRequired,
|
|
142
|
+
onSetType: PropTypes.func.isRequired,
|
|
143
|
+
onCreate: PropTypes.func,
|
|
144
|
+
onSend: PropTypes.func,
|
|
145
|
+
onClose: PropTypes.func.isRequired,
|
|
146
|
+
onShare: PropTypes.func.isRequired,
|
|
147
|
+
onRename: PropTypes.func,
|
|
148
|
+
showNameField: PropTypes.bool,
|
|
149
|
+
sharingLink: PropTypes.string,
|
|
150
|
+
nameLabel: PropTypes.string,
|
|
151
|
+
addPeopleLabel: PropTypes.string,
|
|
152
|
+
addButtonLabel: PropTypes.string,
|
|
153
|
+
cancelLabel: PropTypes.string,
|
|
154
|
+
createLabel: PropTypes.string,
|
|
155
|
+
shareLabel: PropTypes.string,
|
|
156
|
+
saveLabel: PropTypes.string,
|
|
157
|
+
sharingDesc: PropTypes.string.isRequired
|
|
158
|
+
};
|
|
159
|
+
export default DumbBatchSharedFolderModal;
|
|
@@ -80,7 +80,7 @@ WhoHasAccess.propTypes = {
|
|
|
80
80
|
recipientsToBeConfirmed: PropTypes.arrayOf(PropTypes.shape({
|
|
81
81
|
email: PropTypes.string.isRequired
|
|
82
82
|
})),
|
|
83
|
-
document: PropTypes.object
|
|
83
|
+
document: PropTypes.object,
|
|
84
84
|
documentType: PropTypes.string.isRequired,
|
|
85
85
|
onRevoke: PropTypes.func.isRequired,
|
|
86
86
|
onRevokeSelf: PropTypes.func,
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { default as OwnerRecipientDefaultLite } from './components/Recipient/Own
|
|
|
16
16
|
export { SharedRecipientsList } from './SharedRecipientsList';
|
|
17
17
|
export { ShareButton } from './ShareButton';
|
|
18
18
|
export { SharedDriveModal } from './components/SharedDrive/SharedDriveModal';
|
|
19
|
+
export { FederatedFolderModal } from './components/FederatedFolder/FederatedFolderModal';
|
|
19
20
|
export { ShareModal } from './components/ShareModal/ShareModal';
|
|
20
21
|
export { RefreshableSharings } from './RefreshableSharings';
|
|
21
22
|
export { CozyPassFingerprintDialogContent } from './components/CozyPassFingerprintDialogContent';
|
package/locales/en.json
CHANGED
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
"email": "Send to:",
|
|
330
330
|
"emailPlaceholder": "Enter the email address or name of the recipient",
|
|
331
331
|
"send": "Send",
|
|
332
|
+
"error": {
|
|
333
|
+
"addingRecipient": "An error occurred while adding the recipient. Please try again."
|
|
334
|
+
},
|
|
332
335
|
"singleContactSuccess": "You sent an invite to %{email}.",
|
|
333
336
|
"contactSuccess": "You sent an invite to %{smart_count} contact. |||| You sent an invite to %{smart_count} contacts.",
|
|
334
337
|
"singleGroupSuccess": "You sent an invite to the members of the %{groupName} group.",
|
|
@@ -457,6 +460,15 @@
|
|
|
457
460
|
"text": "Link to my document %{name}: |||| Link to my documents %{name}: ",
|
|
458
461
|
"title": "Link to my document %{name} |||| Link to my documents %{name}"
|
|
459
462
|
},
|
|
463
|
+
"FederatedFolder": {
|
|
464
|
+
"title": "Shared folder",
|
|
465
|
+
"share": "Share",
|
|
466
|
+
"shareTitle": "Share \"%{name}\"",
|
|
467
|
+
"successNotification": "Folder has been shared",
|
|
468
|
+
"errorNotification": "Error while sharing folder",
|
|
469
|
+
"addPeople": "Add people to the shared folder :",
|
|
470
|
+
"add": "Add"
|
|
471
|
+
},
|
|
460
472
|
"SharedDrive": {
|
|
461
473
|
"sharedDriveModal": {
|
|
462
474
|
"title": "New shared drive",
|
|
@@ -472,4 +484,4 @@
|
|
|
472
484
|
"errorNotificationUpdate": "Error durring shared drive modification"
|
|
473
485
|
}
|
|
474
486
|
}
|
|
475
|
-
}
|
|
487
|
+
}
|
package/locales/fr.json
CHANGED
|
@@ -327,6 +327,9 @@
|
|
|
327
327
|
"email": "Envoyer à :",
|
|
328
328
|
"emailPlaceholder": "Saisissez le courriel ou le nom du destinataire.",
|
|
329
329
|
"send": "Envoyer",
|
|
330
|
+
"error": {
|
|
331
|
+
"addingRecipient": "Une erreur s'est produite lors de l'ajout du destinataire. Veuillez réessayer."
|
|
332
|
+
},
|
|
330
333
|
"singleContactSuccess": "Vous avez envoyé une invitation à %{email}.",
|
|
331
334
|
"contactSuccess": "Vous avez invité %{smart_count} contact. |||| Vous avez invité %{smart_count} contacts.",
|
|
332
335
|
"singleGroupSuccess": "Vous avez invité les membres du groupe %{groupName}.",
|
|
@@ -451,10 +454,19 @@
|
|
|
451
454
|
"error": "Impossible de copier dans le presse-papier"
|
|
452
455
|
},
|
|
453
456
|
"shareFile": {
|
|
454
|
-
"error": "Problème avec la récupération du lien
|
|
455
|
-
"text": "Voici un lien vers mon document %{name}
|
|
457
|
+
"error": "Problème avec la récupération du lien : %{error}",
|
|
458
|
+
"text": "Voici un lien vers mon document %{name} : |||| Voici un lien contenant mes documents %{name} : ",
|
|
456
459
|
"title": "Lien vers mon document %{name} |||| Lien vers mes documents %{name}"
|
|
457
460
|
},
|
|
461
|
+
"FederatedFolder": {
|
|
462
|
+
"title": "Dossier partagé",
|
|
463
|
+
"share": "Partager",
|
|
464
|
+
"shareTitle": "Partager \"%{name}\"",
|
|
465
|
+
"successNotification": "Le dossier a été partagé",
|
|
466
|
+
"errorNotification": "Erreur lors du partage du dossier",
|
|
467
|
+
"addPeople": "Ajouter des utilisateurs au dossier partagé :",
|
|
468
|
+
"add": "Ajouter"
|
|
469
|
+
},
|
|
458
470
|
"SharedDrive": {
|
|
459
471
|
"sharedDriveModal": {
|
|
460
472
|
"title": "Nouveau drive partagé",
|
|
@@ -470,4 +482,4 @@
|
|
|
470
482
|
"errorNotificationUpdate": "Erreur lors de la modification du drive partagé"
|
|
471
483
|
}
|
|
472
484
|
}
|
|
473
|
-
}
|
|
485
|
+
}
|
package/locales/ru.json
CHANGED
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
"email": "Отправить:",
|
|
330
330
|
"emailPlaceholder": "Введите адрес электронной почты или имя получателя",
|
|
331
331
|
"send": "Отправить",
|
|
332
|
+
"error": {
|
|
333
|
+
"addingRecipient": "Произошла ошибка при добавлении получателя. Пожалуйста, попробуйте еще раз."
|
|
334
|
+
},
|
|
332
335
|
"singleContactSuccess": "Вы отправили приглашение на %{email}.",
|
|
333
336
|
"contactSuccess": "Вы отправили приглашение %{smart_count} контакту. |||| Вы отправили приглашение %{smart_count} контактам.",
|
|
334
337
|
"singleGroupSuccess": "Вы отправили приглашение участникам группы %{groupName}.",
|
|
@@ -457,6 +460,15 @@
|
|
|
457
460
|
"text": "Ссылка на мой документ %{name}: |||| Ссылки на мои документы %{name}: ",
|
|
458
461
|
"title": "Ссылка на мой документ %{name} |||| Ссылки на мои документы %{name}"
|
|
459
462
|
},
|
|
463
|
+
"FederatedFolder": {
|
|
464
|
+
"title": "Общая папка",
|
|
465
|
+
"share": "Поделиться",
|
|
466
|
+
"shareTitle": "Поделиться \"%{name}\"",
|
|
467
|
+
"successNotification": "Папка была расшарена",
|
|
468
|
+
"errorNotification": "Ошибка при расшаривании папки",
|
|
469
|
+
"addPeople": "Добавить людей в общую папку:",
|
|
470
|
+
"add": "Добавить"
|
|
471
|
+
},
|
|
460
472
|
"SharedDrive": {
|
|
461
473
|
"sharedDriveModal": {
|
|
462
474
|
"title": "Новый общий диск",
|
|
@@ -472,4 +484,4 @@
|
|
|
472
484
|
"errorNotificationUpdate": "Ошибка при модификации общего диска"
|
|
473
485
|
}
|
|
474
486
|
}
|
|
475
|
-
}
|
|
487
|
+
}
|
package/locales/vi.json
CHANGED
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
"email": "Gửi đến:",
|
|
330
330
|
"emailPlaceholder": "Nhập địa chỉ email hoặc tên người nhận",
|
|
331
331
|
"send": "Gửi",
|
|
332
|
+
"error": {
|
|
333
|
+
"addingRecipient": "Đã xảy ra lỗi khi thêm người nhận. Vui lòng thử lại."
|
|
334
|
+
},
|
|
332
335
|
"singleContactSuccess": "Bạn đã gửi lời mời đến %{email}.",
|
|
333
336
|
"contactSuccess": "Bạn đã gửi lời mời đến %{smart_count} liên hệ. |||| Bạn đã gửi lời mời đến %{smart_count} liên hệ.",
|
|
334
337
|
"singleGroupSuccess": "Bạn đã gửi lời mời đến các thành viên của nhóm %{groupName}.",
|
|
@@ -455,6 +458,15 @@
|
|
|
455
458
|
"text": "Liên kết đến tài liệu của tôi %{name}: |||| Liên kết đến các tài liệu của tôi %{name}: ",
|
|
456
459
|
"title": "Liên kết đến tài liệu của tôi %{name} |||| Liên kết đến các tài liệu của tôi %{name}"
|
|
457
460
|
},
|
|
461
|
+
"FederatedFolder": {
|
|
462
|
+
"title": "Thư mục chia sẻ",
|
|
463
|
+
"share": "Chia sẻ",
|
|
464
|
+
"shareTitle": "Chia sẻ \"%{name}\"",
|
|
465
|
+
"successNotification": "Thư mục đã được chia sẻ",
|
|
466
|
+
"errorNotification": "Lỗi khi chia sẻ thư mục",
|
|
467
|
+
"addPeople": "Thêm người vào thư mục được chia sẻ:",
|
|
468
|
+
"add": "Thêm"
|
|
469
|
+
},
|
|
458
470
|
"SharedDrive": {
|
|
459
471
|
"sharedDriveModal": {
|
|
460
472
|
"title": "Ổ đĩa được chia sẻ mới",
|
|
@@ -470,4 +482,4 @@
|
|
|
470
482
|
"errorNotificationUpdate": "Lỗi khi sửa đổi ổ đĩa được chia sẻ"
|
|
471
483
|
}
|
|
472
484
|
}
|
|
473
|
-
}
|
|
485
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.4.0",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"cozy-intent": "^2.30.2",
|
|
60
60
|
"cozy-minilog": "^3.10.0",
|
|
61
61
|
"cozy-ui": "^135.0.0",
|
|
62
|
-
"cozy-ui-plus": "^
|
|
62
|
+
"cozy-ui-plus": "^5.0.0",
|
|
63
63
|
"jest": "26.6.3",
|
|
64
64
|
"jest-environment-jsdom": "26.6.2",
|
|
65
65
|
"react": "16.12.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"sideEffects": [
|
|
84
84
|
"*.css"
|
|
85
85
|
],
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "b37748355413b0d3aac00988ec978687f0e607fe"
|
|
87
87
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
4
|
+
|
|
5
|
+
import withLocales from '../../hoc/withLocales'
|
|
6
|
+
import DumbBatchSharedFolderModal from '../SharedFolder/DumbBatchSharedFolderModal'
|
|
7
|
+
|
|
8
|
+
export const DumbFederatedFolderModal = withLocales(
|
|
9
|
+
({
|
|
10
|
+
title,
|
|
11
|
+
document,
|
|
12
|
+
createContact,
|
|
13
|
+
recipients,
|
|
14
|
+
readOnlyRecipients,
|
|
15
|
+
currentRecipients,
|
|
16
|
+
onRevoke,
|
|
17
|
+
onSetType,
|
|
18
|
+
onSend,
|
|
19
|
+
onClose,
|
|
20
|
+
onShare,
|
|
21
|
+
sharingLink
|
|
22
|
+
}) => {
|
|
23
|
+
const { t } = useI18n()
|
|
24
|
+
return (
|
|
25
|
+
<DumbBatchSharedFolderModal
|
|
26
|
+
title={title}
|
|
27
|
+
document={document}
|
|
28
|
+
createContact={createContact}
|
|
29
|
+
recipients={recipients}
|
|
30
|
+
readOnlyRecipients={readOnlyRecipients}
|
|
31
|
+
currentRecipients={currentRecipients}
|
|
32
|
+
onRevoke={onRevoke}
|
|
33
|
+
onSetType={onSetType}
|
|
34
|
+
onSend={onSend}
|
|
35
|
+
onClose={onClose}
|
|
36
|
+
onShare={onShare}
|
|
37
|
+
sharingLink={sharingLink}
|
|
38
|
+
showNameField={false}
|
|
39
|
+
addPeopleLabel={t('FederatedFolder.addPeople')}
|
|
40
|
+
addButtonLabel={t('FederatedFolder.add')}
|
|
41
|
+
shareLabel={t('FederatedFolder.share')}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
DumbFederatedFolderModal.propTypes = {
|
|
48
|
+
title: PropTypes.string,
|
|
49
|
+
document: PropTypes.object,
|
|
50
|
+
createContact: PropTypes.func.isRequired,
|
|
51
|
+
recipients: PropTypes.array,
|
|
52
|
+
readOnlyRecipients: PropTypes.array,
|
|
53
|
+
currentRecipients: PropTypes.array,
|
|
54
|
+
onRevoke: PropTypes.func.isRequired,
|
|
55
|
+
onSetType: PropTypes.func.isRequired,
|
|
56
|
+
onSend: PropTypes.func.isRequired,
|
|
57
|
+
onClose: PropTypes.func.isRequired,
|
|
58
|
+
onShare: PropTypes.func.isRequired,
|
|
59
|
+
sharingLink: PropTypes.string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default DumbFederatedFolderModal
|