cozy-sharing 31.2.0 → 32.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/assets/icons/shared-drive.svg +1 -0
  3. package/dist/components/FederatedFolder/FederatedFolderModal.js +3 -2
  4. package/dist/components/FederatedFolder/FederatedFolderModal.spec.js +3 -3
  5. package/dist/components/ShareDialogCozyToCozy.js +2 -2
  6. package/dist/components/SharedDrive/EditSharedDriveModal.js +209 -0
  7. package/dist/components/SharedDrive/SharedDriveForm.js +7 -4
  8. package/dist/components/SharedDrive/SharedDriveHeader.js +60 -0
  9. package/dist/components/SharedFolder/DumbBatchSharedFolderModal.js +5 -29
  10. package/dist/index.js +1 -0
  11. package/dist/stylesheet.css +0 -8
  12. package/locales/en.json +7 -5
  13. package/locales/fr.json +7 -5
  14. package/locales/ru.json +7 -5
  15. package/locales/vi.json +7 -5
  16. package/package.json +4 -5
  17. package/src/assets/icons/shared-drive.svg +1 -0
  18. package/src/components/FederatedFolder/FederatedFolderModal.jsx +3 -2
  19. package/src/components/FederatedFolder/FederatedFolderModal.spec.jsx +3 -3
  20. package/src/components/ShareDialogCozyToCozy.jsx +2 -2
  21. package/src/components/SharedDrive/EditSharedDriveModal.jsx +160 -0
  22. package/src/components/SharedDrive/SharedDriveForm.jsx +5 -3
  23. package/src/components/SharedDrive/SharedDriveHeader.jsx +19 -0
  24. package/src/components/SharedFolder/DumbBatchSharedFolderModal.jsx +3 -26
  25. package/src/index.jsx +1 -0
  26. package/dist/components/FederatedFolder/DumbFederatedFolderModal.js +0 -64
  27. package/dist/components/SharedStatus.js +0 -61
  28. package/dist/components/SharedStatus.spec.js +0 -44
  29. package/dist/components/__snapshots__/SharedStatus.spec.js.snap +0 -94
  30. package/dist/propTypes.js +0 -26
  31. package/src/components/FederatedFolder/DumbFederatedFolderModal.jsx +0 -71
  32. package/src/components/SharedStatus.jsx +0 -50
  33. package/src/components/SharedStatus.spec.js +0 -48
  34. package/src/components/__snapshots__/SharedStatus.spec.js.snap +0 -94
  35. package/src/propTypes.js +0 -29
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [32.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@32.0.0...cozy-sharing@32.1.0) (2026-05-18)
7
+
8
+ ### Features
9
+
10
+ - Add EditSharedDriveModal ([042651b](https://github.com/cozy/cozy-libs/commit/042651b7debad197f57315f2b4c8c6d7a94a8230))
11
+ - Add SharedDriveHeader and use it in ShareDriveForm ([d47d62f](https://github.com/cozy/cozy-libs/commit/d47d62fcaf38c5673d76e1701f31f52ff198ed53))
12
+ - Uniformize "Add users" wording ([82b45f7](https://github.com/cozy/cozy-libs/commit/82b45f7d6f1ce0a6929beb02362e86034b4bd2b1))
13
+
14
+ # [32.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@31.2.0...cozy-sharing@32.0.0) (2026-05-18)
15
+
16
+ ### Features
17
+
18
+ - Remove unused propTypes.js ([299669c](https://github.com/cozy/cozy-libs/commit/299669c168b55bb8fe242b3879288bd79317a0c3))
19
+ - Removed unused SharedStatus ([e7a3b2b](https://github.com/cozy/cozy-libs/commit/e7a3b2b1cfd708a55691cbb54139cbe4458f1332))
20
+ - Update cozy-device-helper ([0ffd6d3](https://github.com/cozy/cozy-libs/commit/0ffd6d330f7760df623237d575175e159525361a))
21
+
22
+ ### BREAKING CHANGES
23
+
24
+ - You need "cozy-device-helper": ">=4.0.0" for "cozy-sharing"
25
+
6
26
  # [31.2.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@31.1.0...cozy-sharing@31.2.0) (2026-05-12)
7
27
 
8
28
  ### Bug Fixes
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="102" height="102" fill="none" viewBox="0 0 102 102"><rect width="101.617" height="101.617" fill="#f6faff" rx="50.809"/><path fill="#dcedfd" fill-rule="evenodd" d="M51.742 33.838h22.994c3.162 0 5.748 2.627 5.748 5.838v29.192c0 3.212-2.586 5.838-5.748 5.838H28.748c-3.161 0-5.748-2.626-5.748-5.838l.029-35.03c0-3.212 2.558-5.838 5.72-5.838h17.245z" clip-rule="evenodd"/><path fill="#cfddee" stroke="#cfddee" stroke-width=".709" d="M45.977 44.398h2.381c.205 0 .349.066.44.158.091.09.158.234.158.44 0 .204-.067.348-.158.44-.091.09-.235.157-.44.157h-2.381c-2.006 0-3.689 1.683-3.689 3.688V59.76c0 2.005 1.683 3.687 3.689 3.687h10.477c2.005 0 3.688-1.682 3.689-3.687V58.33c0-.205.066-.35.157-.44.091-.092.235-.158.44-.158s.349.067.44.158c.09.09.158.235.158.44v1.429c0 2.661-2.223 4.883-4.884 4.884H45.977c-2.662 0-4.884-2.223-4.884-4.884V49.28c0-2.661 2.222-4.883 4.884-4.883Zm10.731.057c.226-.112.445-.069.638.124l5.715 5.715a.567.567 0 0 1 0 .832l-5.715 5.715c-.193.193-.412.236-.638.124l-.035-.018-.038-.01c-.163-.04-.303-.223-.303-.512v-3.212h-2.26c-2.728 0-5.056 1.721-5.863 4.346l-.002.008-.003.01a.56.56 0 0 1-.513.398c-.205 0-.47-.166-.62-.447a7.8 7.8 0 0 1-.263-2.055c0-3.995 3.27-7.266 7.264-7.266h2.26v-3.212c0-.29.14-.472.303-.513l.038-.01z"/><path fill="url(#a)" d="M56.454 64.4H45.977c-2.858 0-5.239-2.382-5.239-5.24V48.685c0-2.858 2.381-5.239 5.239-5.239h2.38c.572 0 .953.381.953.953 0 .571-.38.952-.952.952h-2.381c-1.81 0-3.334 1.524-3.334 3.334V59.16c0 1.81 1.524 3.333 3.334 3.333h10.477c1.81 0 3.333-1.524 3.333-3.333v-1.429c0-.571.381-.952.953-.952.571 0 .952.38.952.952v1.429c0 2.857-2.38 5.238-5.238 5.238m-8.763-6.668c-.38 0-.762-.286-.952-.667a8.1 8.1 0 0 1-.286-2.19c0-4.191 3.429-7.62 7.62-7.62h1.904v-2.857c0-.381.191-.762.572-.858.381-.19.762-.095 1.048.191l5.714 5.715a.92.92 0 0 1 0 1.333l-5.714 5.715c-.286.286-.667.38-1.048.19-.381-.095-.572-.476-.572-.857V52.97h-1.904c-2.572 0-4.763 1.619-5.525 4.095a.915.915 0 0 1-.857.667"/><defs><linearGradient id="a" x1="51.914" x2="52.127" y1="34.694" y2="68.833" gradientUnits="userSpaceOnUse"><stop stop-color="#76afff"/><stop offset=".781" stop-color="#1d7aff"/></linearGradient></defs></svg>
@@ -6,11 +6,11 @@ import React, { useEffect, useState } from 'react';
6
6
  import { useClient } from 'cozy-client';
7
7
  import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
8
8
  import { useI18n } from 'twake-i18n';
9
- import { DumbFederatedFolderModal } from './DumbFederatedFolderModal';
10
9
  import { getOrCreateFromArray } from '../../helpers/contacts';
11
10
  import withLocales from '../../hoc/withLocales';
12
11
  import { usePendingRecipients } from '../../hooks/usePendingRecipients';
13
12
  import { useSharingContext } from '../../hooks/useSharingContext';
13
+ import { DumbBatchSharedFolderModal } from '../SharedFolder/DumbBatchSharedFolderModal';
14
14
  export var FederatedFolderModal = withLocales(function (_ref) {
15
15
  var onClose = _ref.onClose,
16
16
  existingDocument = _ref.document,
@@ -194,7 +194,7 @@ export var FederatedFolderModal = withLocales(function (_ref) {
194
194
  name: folderName
195
195
  });
196
196
  var isSharedDrive = Boolean(existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument.driveId);
197
- return /*#__PURE__*/React.createElement(DumbFederatedFolderModal, {
197
+ return /*#__PURE__*/React.createElement(DumbBatchSharedFolderModal, {
198
198
  title: modalTitle,
199
199
  document: isSending ? frozenDoc : existingDocument,
200
200
  recipients: isSending ? frozenRecipients : existingRecipients,
@@ -203,6 +203,7 @@ export var FederatedFolderModal = withLocales(function (_ref) {
203
203
  onSend: onSend,
204
204
  onClose: onClose,
205
205
  sharingLink: sharingLink,
206
+ shareLabel: t('FederatedFolder.share'),
206
207
  showShareByEmail: !isSharedDrive,
207
208
  autoOpenShareRestriction: autoOpenShareRestriction,
208
209
  showGenerateLinkButton: showGenerateLinkButton,
@@ -51,9 +51,9 @@ jest.mock('../../hooks/usePendingRecipients', function () {
51
51
  usePendingRecipients: jest.fn()
52
52
  };
53
53
  });
54
- jest.mock('./DumbFederatedFolderModal', function () {
54
+ jest.mock('../SharedFolder/DumbBatchSharedFolderModal', function () {
55
55
  return {
56
- DumbFederatedFolderModal: function DumbFederatedFolderModal(_ref) {
56
+ DumbBatchSharedFolderModal: function DumbBatchSharedFolderModal(_ref) {
57
57
  var title = _ref.title,
58
58
  recipients = _ref.recipients,
59
59
  onRevoke = _ref.onRevoke,
@@ -203,7 +203,7 @@ describe('FederatedFolderModal', function () {
203
203
  }
204
204
  }, _callee2);
205
205
  })));
206
- it('should pass sharing link to DumbFederatedFolderModal', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
206
+ it('should pass sharing link to DumbBatchSharedFolderModal', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
207
207
  var _setup3, getByTestId;
208
208
 
209
209
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -82,8 +82,8 @@ var SharingContent = function SharingContent(_ref) {
82
82
  type: t("".concat(documentType, ".share.shareByEmail.type.").concat(document.type === 'directory' ? 'folder' : 'file'))
83
83
  }), ' ', /*#__PURE__*/React.createElement("strong", null, t("".concat(documentType, ".share.shareByEmail.").concat(hasSharedParent ? 'hasSharedParent' : 'hasSharedChild')))), /*#__PURE__*/React.createElement(Typography, {
84
84
  variant: "h6",
85
- className: "u-mb-1-half"
86
- }, t('Share.contacts.whoHasAccess')), showShareByEmail && /*#__PURE__*/React.createElement(DumbShareByEmail, {
85
+ className: "u-mb-half"
86
+ }, t('Share.contacts.addUsers')), showShareByEmail && /*#__PURE__*/React.createElement(DumbShareByEmail, {
87
87
  currentRecipients: recipients,
88
88
  document: document,
89
89
  documentType: documentType,
@@ -0,0 +1,209 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+
6
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
+
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
+
10
+ import PropTypes from 'prop-types';
11
+ import React, { useState } from 'react';
12
+ import { useClient } from 'cozy-client';
13
+ import Button from 'cozy-ui/transpiled/react/Buttons';
14
+ import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
15
+ import TextField from 'cozy-ui/transpiled/react/TextField';
16
+ import Typography from 'cozy-ui/transpiled/react/Typography';
17
+ import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
18
+ import { useI18n } from 'twake-i18n';
19
+ import SharedDriveHeader from './SharedDriveHeader';
20
+ import { getOrCreateFromArray } from '../../helpers/contacts';
21
+ import withLocales from '../../hoc/withLocales';
22
+ import { usePendingRecipients } from '../../hooks/usePendingRecipients';
23
+ import { useSharingContext } from '../../hooks/useSharingContext';
24
+ import { default as DumbShareByEmail } from '../ShareByEmail';
25
+ import WhoHasAccess from '../WhoHasAccess';
26
+ export var EditSharedDriveModal = withLocales(function (_ref) {
27
+ var onClose = _ref.onClose,
28
+ document = _ref.document;
29
+ var client = useClient();
30
+
31
+ var _useI18n = useI18n(),
32
+ t = _useI18n.t;
33
+
34
+ var _useSharingContext = useSharingContext(),
35
+ share = _useSharingContext.share,
36
+ getRecipients = _useSharingContext.getRecipients,
37
+ revoke = _useSharingContext.revoke;
38
+
39
+ var _useAlert = useAlert(),
40
+ showAlert = _useAlert.showAlert;
41
+
42
+ var _usePendingRecipients = usePendingRecipients(),
43
+ pendingRecipients = _usePendingRecipients.pendingRecipients,
44
+ setPendingRecipients = _usePendingRecipients.setPendingRecipients,
45
+ selectedOption = _usePendingRecipients.selectedOption,
46
+ setSelectedOption = _usePendingRecipients.setSelectedOption;
47
+
48
+ var _useState = useState(document.name),
49
+ _useState2 = _slicedToArray(_useState, 2),
50
+ driveName = _useState2[0],
51
+ setDriveName = _useState2[1];
52
+
53
+ var _useState3 = useState(false),
54
+ _useState4 = _slicedToArray(_useState3, 2),
55
+ isSaving = _useState4[0],
56
+ setIsSaving = _useState4[1];
57
+
58
+ var onSave = /*#__PURE__*/function () {
59
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
60
+ var contacts, readWriteRecipients, readOnlyRecipients;
61
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
62
+ while (1) switch (_context.prev = _context.next) {
63
+ case 0:
64
+ if (!isSaving) {
65
+ _context.next = 2;
66
+ break;
67
+ }
68
+
69
+ return _context.abrupt("return");
70
+
71
+ case 2:
72
+ setIsSaving(true);
73
+ _context.prev = 3;
74
+ _context.next = 6;
75
+ return getOrCreateFromArray(client, pendingRecipients, function (contact) {
76
+ return client.create('io.cozy.contacts', contact);
77
+ });
78
+
79
+ case 6:
80
+ contacts = _context.sent;
81
+ readWriteRecipients = selectedOption === 'readOnly' ? [] : contacts;
82
+ readOnlyRecipients = selectedOption === 'readOnly' ? contacts : [];
83
+ _context.next = 11;
84
+ return share({
85
+ document: document,
86
+ recipients: readWriteRecipients,
87
+ readOnlyRecipients: readOnlyRecipients,
88
+ sharedDrive: true,
89
+ openSharing: false
90
+ });
91
+
92
+ case 11:
93
+ if (!((document === null || document === void 0 ? void 0 : document.name) !== driveName)) {
94
+ _context.next = 14;
95
+ break;
96
+ }
97
+
98
+ _context.next = 14;
99
+ return client.collection('io.cozy.files').update(_objectSpread(_objectSpread({}, document), {}, {
100
+ name: driveName,
101
+ _rev: document._rev || document.meta.rev
102
+ }));
103
+
104
+ case 14:
105
+ showAlert({
106
+ message: t('SharedDrive.editSharedDriveModal.successNotification'),
107
+ severity: 'success',
108
+ variant: 'filled'
109
+ });
110
+ onClose();
111
+ _context.next = 21;
112
+ break;
113
+
114
+ case 18:
115
+ _context.prev = 18;
116
+ _context.t0 = _context["catch"](3);
117
+ showAlert({
118
+ message: t('SharedDrive.editSharedDriveModal.errorNotification'),
119
+ severity: 'error',
120
+ variant: 'filled'
121
+ });
122
+
123
+ case 21:
124
+ _context.prev = 21;
125
+ setIsSaving(false);
126
+ return _context.finish(21);
127
+
128
+ case 24:
129
+ case "end":
130
+ return _context.stop();
131
+ }
132
+ }, _callee, null, [[3, 18, 21, 24]]);
133
+ }));
134
+
135
+ return function onSave() {
136
+ return _ref2.apply(this, arguments);
137
+ };
138
+ }();
139
+
140
+ var existingRecipients = document ? getRecipients(document._id) : [];
141
+ return /*#__PURE__*/React.createElement(FixedDialog, {
142
+ open: true,
143
+ disableGutters: true,
144
+ onClose: onClose,
145
+ classes: {
146
+ paper: 'u-ov-visible'
147
+ },
148
+ componentsProps: {
149
+ dialogContent: {
150
+ className: 'u-ov-visible'
151
+ }
152
+ },
153
+ content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
154
+ className: "u-ph-2 u-pt-2"
155
+ }, /*#__PURE__*/React.createElement(SharedDriveHeader, {
156
+ title: t('SharedDrive.editSharedDriveModal.title')
157
+ }), /*#__PURE__*/React.createElement(TextField, {
158
+ required: true,
159
+ label: t('SharedDrive.sharedDriveModal.nameLabel'),
160
+ variant: "outlined",
161
+ size: "small",
162
+ className: "u-w-100 u-mt-1-half u-mb-1-half",
163
+ value: driveName,
164
+ onChange: function onChange(event) {
165
+ return setDriveName(event.target.value);
166
+ }
167
+ }), /*#__PURE__*/React.createElement(Typography, {
168
+ variant: "h6",
169
+ className: "u-mb-half"
170
+ }, t('Share.contacts.addUsers')), /*#__PURE__*/React.createElement(DumbShareByEmail, {
171
+ currentRecipients: [],
172
+ documentType: "Files",
173
+ pendingRecipients: pendingRecipients,
174
+ onPendingRecipientsChange: setPendingRecipients,
175
+ selectedOption: selectedOption,
176
+ onSelectedOptionChange: setSelectedOption
177
+ })), /*#__PURE__*/React.createElement(WhoHasAccess, {
178
+ isOwner: true,
179
+ isSharedDrive: true,
180
+ recipients: existingRecipients,
181
+ document: document,
182
+ documentType: "Files",
183
+ className: "u-w-100",
184
+ onRevoke: revoke
185
+ }), /*#__PURE__*/React.createElement("div", {
186
+ className: "u-flex u-ph-2 u-pv-1"
187
+ }, /*#__PURE__*/React.createElement(Button, {
188
+ variant: "text",
189
+ label: t('SharedDrive.sharedDriveModal.cancel'),
190
+ className: "u-w-100 u-m-1",
191
+ size: "large",
192
+ onClick: onClose
193
+ }), /*#__PURE__*/React.createElement(Button, {
194
+ variant: "primary",
195
+ label: t('SharedDrive.sharedDriveModal.save'),
196
+ className: "u-w-100 u-m-1",
197
+ size: "large",
198
+ disabled: isSaving,
199
+ onClick: onSave
200
+ })))
201
+ });
202
+ });
203
+ EditSharedDriveModal.propTypes = {
204
+ onClose: PropTypes.func.isRequired,
205
+ document: PropTypes.object.isRequired,
206
+ autoOpenShareRestriction: PropTypes.bool,
207
+ showGenerateLinkButton: PropTypes.bool
208
+ };
209
+ export default EditSharedDriveModal;
@@ -6,6 +6,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography';
6
6
  import { useI18n } from 'twake-i18n';
7
7
  import withLocales from '../../hoc/withLocales';
8
8
  import { default as DumbShareByEmail } from '../ShareByEmail';
9
+ import SharedDriveHeader from './SharedDriveHeader';
9
10
  import { useSharedDrive } from './useSharedDrive';
10
11
  export var SharedDriveForm = withLocales(function (_ref) {
11
12
  var onSuccess = _ref.onSuccess,
@@ -27,18 +28,20 @@ export var SharedDriveForm = withLocales(function (_ref) {
27
28
 
28
29
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
29
30
  className: "u-ph-2"
30
- }, /*#__PURE__*/React.createElement(TextField, {
31
+ }, /*#__PURE__*/React.createElement(SharedDriveHeader, {
32
+ title: t('SharedDrive.sharedDriveModal.title')
33
+ }), /*#__PURE__*/React.createElement(TextField, {
31
34
  required: true,
32
35
  label: t('SharedDrive.sharedDriveModal.nameLabel'),
33
36
  variant: "outlined",
34
37
  size: "small",
35
- className: "u-w-100 u-mt-1-half",
38
+ className: "u-w-100 u-mt-1-half u-mb-1-half",
36
39
  value: sharedDriveName,
37
40
  onChange: handleSharedDriveNameChange
38
41
  }), /*#__PURE__*/React.createElement(Typography, {
39
42
  variant: "h6",
40
- className: "u-mt-1-half u-mb-half"
41
- }, t('SharedDrive.sharedDriveModal.addPeople')), /*#__PURE__*/React.createElement(DumbShareByEmail, {
43
+ className: "u-mb-half"
44
+ }, t('Share.contacts.addUsers')), /*#__PURE__*/React.createElement(DumbShareByEmail, {
42
45
  currentRecipients: [],
43
46
  documentType: "Files",
44
47
  pendingRecipients: pendingRecipients,
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import Icon from 'cozy-ui/transpiled/react/Icon';
3
+ import Typography from 'cozy-ui/transpiled/react/Typography';
4
+
5
+ var SharedDriveIcon = function SharedDriveIcon(props) {
6
+ return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("rect", {
7
+ width: "101.617",
8
+ height: "101.617",
9
+ fill: "#f6faff",
10
+ rx: "50.809"
11
+ }), /*#__PURE__*/React.createElement("path", {
12
+ fill: "#dcedfd",
13
+ fillRule: "evenodd",
14
+ d: "M51.742 33.838h22.994c3.162 0 5.748 2.627 5.748 5.838v29.192c0 3.212-2.586 5.838-5.748 5.838H28.748c-3.161 0-5.748-2.626-5.748-5.838l.029-35.03c0-3.212 2.558-5.838 5.72-5.838h17.245z",
15
+ clipRule: "evenodd"
16
+ }), /*#__PURE__*/React.createElement("path", {
17
+ fill: "#cfddee",
18
+ stroke: "#cfddee",
19
+ strokeWidth: ".709",
20
+ d: "M45.977 44.398h2.381c.205 0 .349.066.44.158.091.09.158.234.158.44a.605.605 0 0 1-.158.44c-.091.09-.235.157-.44.157h-2.381c-2.006 0-3.689 1.683-3.689 3.688V59.76c0 2.005 1.683 3.687 3.689 3.687h10.477c2.005 0 3.688-1.682 3.689-3.687v-1.43c0-.205.066-.35.157-.44.091-.092.235-.158.44-.158s.349.067.44.158c.09.09.158.235.158.44v1.429c0 2.661-2.223 4.883-4.884 4.884H45.977c-2.662 0-4.884-2.223-4.884-4.884V49.28c0-2.661 2.222-4.883 4.884-4.883zm10.731.057c.226-.112.445-.069.638.124l5.715 5.715a.567.567 0 0 1 0 .832l-5.715 5.715c-.193.193-.412.236-.638.124l-.035-.018-.038-.01c-.163-.04-.303-.223-.303-.512v-3.212h-2.26c-2.728 0-5.056 1.721-5.863 4.346l-.002.008-.003.01a.56.56 0 0 1-.513.398c-.205 0-.47-.166-.62-.447a7.8 7.8 0 0 1-.263-2.055c0-3.995 3.27-7.266 7.264-7.266h2.26v-3.212c0-.29.14-.472.303-.513l.038-.01z"
21
+ }), /*#__PURE__*/React.createElement("path", {
22
+ fill: "url(#a)",
23
+ d: "M56.454 64.4H45.977c-2.858 0-5.239-2.382-5.239-5.24V48.685c0-2.858 2.381-5.239 5.239-5.239h2.38c.572 0 .953.381.953.953 0 .571-.38.952-.952.952h-2.381c-1.81 0-3.334 1.524-3.334 3.334V59.16c0 1.81 1.524 3.333 3.334 3.333h10.477c1.81 0 3.333-1.524 3.333-3.333v-1.429c0-.571.381-.952.953-.952.571 0 .952.38.952.952v1.429c0 2.857-2.38 5.238-5.238 5.238m-8.763-6.668c-.38 0-.762-.286-.952-.667a8.1 8.1 0 0 1-.286-2.19c0-4.191 3.429-7.62 7.62-7.62h1.904v-2.857c0-.381.191-.762.572-.858.381-.19.762-.095 1.048.191l5.714 5.715a.92.92 0 0 1 0 1.333l-5.714 5.715c-.286.286-.667.38-1.048.19-.381-.095-.572-.476-.572-.857V52.97h-1.904c-2.572 0-4.763 1.619-5.525 4.095a.915.915 0 0 1-.857.667"
24
+ }), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
25
+ id: "a",
26
+ x1: "51.914",
27
+ x2: "52.127",
28
+ y1: "34.694",
29
+ y2: "68.833",
30
+ gradientUnits: "userSpaceOnUse"
31
+ }, /*#__PURE__*/React.createElement("stop", {
32
+ stopColor: "#76afff"
33
+ }), /*#__PURE__*/React.createElement("stop", {
34
+ offset: ".781",
35
+ stopColor: "#1d7aff"
36
+ }))));
37
+ };
38
+
39
+ SharedDriveIcon.defaultProps = {
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ width: "102",
42
+ height: "102",
43
+ fill: "none",
44
+ viewBox: "0 0 102 102"
45
+ };
46
+
47
+ var SharedDriveHeader = function SharedDriveHeader(_ref) {
48
+ var title = _ref.title;
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ className: "u-ta-center"
51
+ }, /*#__PURE__*/React.createElement(Icon, {
52
+ icon: SharedDriveIcon,
53
+ size: 72
54
+ }), /*#__PURE__*/React.createElement(Typography, {
55
+ className: "u-mt-1",
56
+ variant: "h3"
57
+ }, title));
58
+ };
59
+
60
+ export default SharedDriveHeader;
@@ -4,6 +4,7 @@ import Button from 'cozy-ui/transpiled/react/Buttons';
4
4
  import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
5
5
  import TextField from 'cozy-ui/transpiled/react/TextField';
6
6
  import Typography from 'cozy-ui/transpiled/react/Typography';
7
+ import { useI18n } from 'twake-i18n';
7
8
  import withLocales from '../../hoc/withLocales';
8
9
  import AntivirusAlert from '../AntivirusAlert';
9
10
  import { default as DumbShareByEmail } from '../ShareByEmail';
@@ -17,19 +18,13 @@ export var DumbBatchSharedFolderModal = withLocales(function (_ref) {
17
18
  recipients = _ref.recipients,
18
19
  currentRecipients = _ref.currentRecipients,
19
20
  onRevoke = _ref.onRevoke,
20
- onCreate = _ref.onCreate,
21
21
  onSend = _ref.onSend,
22
22
  onClose = _ref.onClose,
23
- onRename = _ref.onRename,
24
23
  _ref$showNameField = _ref.showNameField,
25
24
  showNameField = _ref$showNameField === void 0 ? false : _ref$showNameField,
26
25
  sharingLink = _ref.sharingLink,
27
26
  nameLabel = _ref.nameLabel,
28
- addPeopleLabel = _ref.addPeopleLabel,
29
- cancelLabel = _ref.cancelLabel,
30
- createLabel = _ref.createLabel,
31
27
  shareLabel = _ref.shareLabel,
32
- saveLabel = _ref.saveLabel,
33
28
  _ref$showShareByEmail = _ref.showShareByEmail,
34
29
  showShareByEmail = _ref$showShareByEmail === void 0 ? true : _ref$showShareByEmail,
35
30
  autoOpenShareRestriction = _ref.autoOpenShareRestriction,
@@ -39,19 +34,10 @@ export var DumbBatchSharedFolderModal = withLocales(function (_ref) {
39
34
  selectedOption = _ref.selectedOption,
40
35
  onSelectedOptionChange = _ref.onSelectedOptionChange;
41
36
 
42
- var actionButtons = function () {
43
- if (showNameField && onCreate) {
44
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
45
- variant: "secondary",
46
- label: cancelLabel,
47
- onClick: onClose
48
- }), /*#__PURE__*/React.createElement(Button, {
49
- variant: "primary",
50
- label: createLabel,
51
- onClick: onCreate
52
- }));
53
- }
37
+ var _useI18n = useI18n(),
38
+ t = _useI18n.t;
54
39
 
40
+ var actionButtons = function () {
55
41
  if (!showShareByEmail) {
56
42
  return /*#__PURE__*/React.createElement(ShareByLink, {
57
43
  link: sharingLink,
@@ -77,16 +63,6 @@ export var DumbBatchSharedFolderModal = withLocales(function (_ref) {
77
63
  }));
78
64
  }
79
65
 
80
- if (onRename) {
81
- return /*#__PURE__*/React.createElement(Button, {
82
- variant: "primary",
83
- label: saveLabel,
84
- onClick: function onClick() {
85
- return onRename(folderName);
86
- }
87
- });
88
- }
89
-
90
66
  return null;
91
67
  }();
92
68
 
@@ -118,7 +94,7 @@ export var DumbBatchSharedFolderModal = withLocales(function (_ref) {
118
94
  }), /*#__PURE__*/React.createElement(Typography, {
119
95
  variant: "h6",
120
96
  className: "u-mt-1-half u-mb-half"
121
- }, addPeopleLabel), showShareByEmail && /*#__PURE__*/React.createElement(DumbShareByEmail, {
97
+ }, t('Share.contacts.addUsers')), showShareByEmail && /*#__PURE__*/React.createElement(DumbShareByEmail, {
122
98
  currentRecipients: currentRecipients,
123
99
  document: document,
124
100
  documentType: "Files",
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ export { default as LinkRecipientLite } from './components/Recipient/LinkRecipie
15
15
  export { default as OwnerRecipientDefaultLite } from './components/Recipient/OwnerRecipientDefaultLite';
16
16
  export { SharedRecipientsList } from './SharedRecipientsList';
17
17
  export { ShareButton } from './ShareButton';
18
+ export { EditSharedDriveModal } from './components/SharedDrive/EditSharedDriveModal';
18
19
  export { SharedDriveModal } from './components/SharedDrive/SharedDriveModal';
19
20
  export { SharedDriveForm } from './components/SharedDrive/SharedDriveForm';
20
21
  export { FederatedFolderModal } from './components/FederatedFolder/FederatedFolderModal';
@@ -480,14 +480,6 @@ input[type=text] {
480
480
  .badge__shared-badge___2jGsy.badge__--with-me___3jW7R {
481
481
  background-color: #9169f2;
482
482
  }
483
- /* imported from status.styl */
484
-
485
- .status__shared-status___2HpyL {
486
- display: flex;
487
- }
488
- .status__shared-status-label___1-jvS {
489
- margin-right: 0.5rem;
490
- }
491
483
  /* imported from publicBanner.styl */
492
484
 
493
485
  .publicBanner__bannermarkdown___1dR1E {
package/locales/en.json CHANGED
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "contacts": {
40
40
  "whoHasAccess": "Who has access?",
41
+ "addUsers": "Add users",
41
42
  "permissionRequired": {
42
43
  "title": "Save your contacts in your Twake?",
43
44
  "desc": "Authorize the application to access to your Twake's contacts: you'll be able to select them next time.",
@@ -439,7 +440,6 @@
439
440
  "shareTitle": "Share \"%{name}\"",
440
441
  "successNotification": "Folder has been shared",
441
442
  "errorNotification": "Error while sharing folder",
442
- "addPeople": "Add people to the shared folder",
443
443
  "add": "Add"
444
444
  },
445
445
  "SharedDrive": {
@@ -450,11 +450,13 @@
450
450
  "cancel": "Cancel",
451
451
  "create": "Create",
452
452
  "save": "Save",
453
- "addPeople": "Add users",
454
453
  "successNotification": "Shared drive has been added",
455
- "errorNotification": "Error during shared drive creation",
456
- "successNotificationUpdate": "Your shared drive has been modified",
457
- "errorNotificationUpdate": "Error durring shared drive modification"
454
+ "errorNotification": "Error during shared drive creation"
455
+ },
456
+ "editSharedDriveModal": {
457
+ "title": "Edit shared drive",
458
+ "successNotification": "Shared drive has been modified",
459
+ "errorNotification": "Error during shared drive modification"
458
460
  }
459
461
  }
460
462
  }
package/locales/fr.json CHANGED
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "contacts": {
40
40
  "whoHasAccess": "Qui a accès ?",
41
+ "addUsers": "Ajouter des utilisateurs",
41
42
  "permissionRequired": {
42
43
  "title": "Enregistrer vos contacts dans votre Twake ?",
43
44
  "desc": "Autorisez l'application à accéder aux contacts de votre Twake : vous pourrez les sélectionner la prochaine fois.",
@@ -437,7 +438,6 @@
437
438
  "shareTitle": "Partager \"%{name}\"",
438
439
  "successNotification": "Le dossier a été partagé",
439
440
  "errorNotification": "Erreur lors du partage du dossier",
440
- "addPeople": "Ajouter des utilisateurs au dossier partagé",
441
441
  "add": "Ajouter"
442
442
  },
443
443
  "SharedDrive": {
@@ -448,11 +448,13 @@
448
448
  "cancel": "Annuler",
449
449
  "create": "Créer",
450
450
  "save": "Enregistrer",
451
- "addPeople": "Ajouter des utilisateurs",
452
451
  "successNotification": "Le drive partagé a été ajouté",
453
- "errorNotification": "Erreur lors de la création du drive partagé",
454
- "successNotificationUpdate": "Votre drive partagé a été modifié",
455
- "errorNotificationUpdate": "Erreur lors de la modification du drive partagé"
452
+ "errorNotification": "Erreur lors de la création du drive partagé"
453
+ },
454
+ "editSharedDriveModal": {
455
+ "title": "Modifier le drive partagé",
456
+ "successNotification": "Le drive partagé a été modifié",
457
+ "errorNotification": "Erreur lors de la modification du drive partagé"
456
458
  }
457
459
  }
458
460
  }
package/locales/ru.json CHANGED
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "contacts": {
40
40
  "whoHasAccess": "У кого есть доступ?",
41
+ "addUsers": "Добавить пользователей",
41
42
  "permissionRequired": {
42
43
  "title": "Сохранить контакты в вашем Twake?",
43
44
  "desc": "Разрешите приложению доступ к контактам вашего Twake: в следующий раз вы сможете выбирать их.",
@@ -439,7 +440,6 @@
439
440
  "shareTitle": "Поделиться \"%{name}\"",
440
441
  "successNotification": "Папка была расшарена",
441
442
  "errorNotification": "Ошибка при расшаривании папки",
442
- "addPeople": "Добавить людей в общую папку",
443
443
  "add": "Добавить"
444
444
  },
445
445
  "SharedDrive": {
@@ -450,11 +450,13 @@
450
450
  "cancel": "Отмена",
451
451
  "create": "Создать",
452
452
  "save": "Сохранить",
453
- "addPeople": "Добавить пользователей",
454
453
  "successNotification": "Общий диск добавлен",
455
- "errorNotification": "Ошибка при создании общего диска",
456
- "successNotificationUpdate": "Ваш общий диск был изменён",
457
- "errorNotificationUpdate": "Ошибка при модификации общего диска"
454
+ "errorNotification": "Ошибка при создании общего диска"
455
+ },
456
+ "editSharedDriveModal": {
457
+ "title": "Редактировать общий диск",
458
+ "successNotification": "Общий диск был изменён",
459
+ "errorNotification": "Ошибка при модификации общего диска"
458
460
  }
459
461
  }
460
462
  }
package/locales/vi.json CHANGED
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "contacts": {
40
40
  "whoHasAccess": "Ai có quyền truy cập?",
41
+ "addUsers": "Thêm người dùng",
41
42
  "permissionRequired": {
42
43
  "title": "Lưu danh bạ của bạn vào Twake của bạn?",
43
44
  "desc": "Cho phép ứng dụng truy cập vào danh bạ Twake của bạn: bạn sẽ có thể chọn họ vào lần sau.",
@@ -439,7 +440,6 @@
439
440
  "shareTitle": "Chia sẻ \"%{name}\"",
440
441
  "successNotification": "Thư mục đã được chia sẻ",
441
442
  "errorNotification": "Lỗi khi chia sẻ thư mục",
442
- "addPeople": "Thêm người vào thư mục được chia sẻ",
443
443
  "add": "Thêm"
444
444
  },
445
445
  "SharedDrive": {
@@ -450,11 +450,13 @@
450
450
  "cancel": "Hủy",
451
451
  "create": "Tạo",
452
452
  "save": "Lưu",
453
- "addPeople": "Thêm người dùng",
454
453
  "successNotification": "Ổ đĩa được chia sẻ đã được thêm",
455
- "errorNotification": "Lỗi trong quá trình tạo ổ đĩa được chia sẻ",
456
- "successNotificationUpdate": "Ổ đĩa được chia sẻ của bạn đã được sửa đổi",
457
- "errorNotificationUpdate": "Lỗi khi sửa đổi ổ đĩa được chia sẻ"
454
+ "errorNotification": "Lỗi trong quá trình tạo ổ đĩa được chia sẻ"
455
+ },
456
+ "editSharedDriveModal": {
457
+ "title": "Sửa ổ đĩa được chia sẻ",
458
+ "successNotification": "Ổ đĩa được chia sẻ đã được sửa đổi",
459
+ "errorNotification": "Lỗi khi sửa đổi ổ đĩa được chia sẻ"
458
460
  }
459
461
  }
460
462
  }