cozy-sharing 25.0.0 → 25.1.1

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 CHANGED
@@ -3,6 +3,22 @@
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
+ ## [25.1.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.1.0...cozy-sharing@25.1.1) (2025-04-02)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **Sharing:** Don't rely anymore on parent to show file recipients ([2e9702e](https://github.com/cozy/cozy-libs/commit/2e9702e3cd2e3863b06cef8e1c497882ba34eff3))
11
+
12
+ # [25.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.0.0...cozy-sharing@25.1.0) (2025-03-25)
13
+
14
+ ### Bug Fixes
15
+
16
+ - Missing translation ([a5d0464](https://github.com/cozy/cozy-libs/commit/a5d0464e09a1be6027b94d1d2ab9a965422f236d))
17
+
18
+ ### Features
19
+
20
+ - Dynamic title in BoxEditingRights ([909cdc4](https://github.com/cozy/cozy-libs/commit/909cdc417015c66e2e2d52ee5fb665f739b74dbf))
21
+
6
22
  # [25.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@24.0.0...cozy-sharing@25.0.0) (2025-03-17)
7
23
 
8
24
  ### Features
@@ -28,14 +28,6 @@ export var EditableSharingModal = function EditableSharingModal(_ref) {
28
28
  revokeSelf = _useSharingContext.revokeSelf,
29
29
  share = _useSharingContext.share;
30
30
 
31
- var shareFileRefId = hasSharedParent(document.path) ? document.dir_id : document._id;
32
- var recipients = getRecipients(shareFileRefId);
33
- var permissions = getDocumentPermissions(shareFileRefId);
34
- var link = getSharingLink(shareFileRefId);
35
- var sharing = getSharingForSelf(shareFileRefId);
36
-
37
- var _isOwner = isOwner(shareFileRefId);
38
-
39
31
  return /*#__PURE__*/React.createElement(ShareModal, _extends({
40
32
  createContact: function createContact(contact) {
41
33
  return client.create(Contact.doctype, contact);
@@ -44,14 +36,14 @@ export var EditableSharingModal = function EditableSharingModal(_ref) {
44
36
  documentType: documentType,
45
37
  hasSharedChild: documentPath && hasSharedChild(documentPath),
46
38
  hasSharedParent: documentPath && hasSharedParent(documentPath),
47
- isOwner: _isOwner,
48
- link: link,
39
+ isOwner: isOwner(document._id),
40
+ link: getSharingLink(document._id),
49
41
  onRevoke: revoke,
50
42
  onRevokeSelf: revokeSelf,
51
43
  onShare: share,
52
- permissions: permissions,
53
- recipients: recipients,
54
- sharing: sharing
44
+ permissions: getDocumentPermissions(document._id),
45
+ recipients: getRecipients(document._id),
46
+ sharing: getSharingForSelf(document._id)
55
47
  }, rest));
56
48
  };
57
49
  EditableSharingModal.propTypes = {
@@ -44,6 +44,7 @@ export var BoxEditingRights = function BoxEditingRights(_ref) {
44
44
  documentType: documentType,
45
45
  isDirectory: isDirectory
46
46
  });
47
+ var textPrimary = editingRights === 'readOnly' ? t('BoxEditingRights.readOnlyTitle') : t('BoxEditingRights.editTitle');
47
48
  var textSecondary = editingRights === 'readOnly' ? t('Share.permissionLink.readDescription') : t('Share.permissionLink.writeDescription');
48
49
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
49
50
  borderRadius: "0.5rem",
@@ -59,7 +60,7 @@ export var BoxEditingRights = function BoxEditingRights(_ref) {
59
60
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
60
61
  icon: PeopleIcon
61
62
  })), /*#__PURE__*/React.createElement(ListItemText, {
62
- primary: t('BoxEditingRights.text'),
63
+ primary: textPrimary,
63
64
  secondary: textSecondary
64
65
  }), /*#__PURE__*/React.createElement(ListItemIcon, {
65
66
  className: "u-mr-half"
package/locales/en.json CHANGED
@@ -425,6 +425,7 @@
425
425
  }
426
426
  },
427
427
  "ShareRestrictionModal": {
428
+ "title": "Sharing link",
428
429
  "action": {
429
430
  "confirm": "Confirm"
430
431
  },
@@ -439,9 +440,10 @@
439
440
  "text": "Limit access with a password"
440
441
  },
441
442
  "BoxEditingRights": {
443
+ "editTitle": "Editing rights",
444
+ "readOnlyTitle": "Reading rights",
442
445
  "editSubText": "People with access to the link can modify the content",
443
- "readOnlySubText": "People who have access to the link can only view the content",
444
- "text": "Editing rights"
446
+ "readOnlySubText": "People who have access to the link can only view the content"
445
447
  },
446
448
  "copyReminderContent": {
447
449
  "success": "Copied to clipboard",
package/locales/fr.json CHANGED
@@ -438,9 +438,10 @@
438
438
  "text": "Limiter l'accès par un mot de passe"
439
439
  },
440
440
  "BoxEditingRights": {
441
+ "editTitle": "Droit d'édition",
442
+ "readOnlyTitle": "Droit de lecture",
441
443
  "editSubText": "Les personnes ayant accès au lien peuvent modifier le contenu",
442
- "readOnlySubText": "Les personnes ayant accès au lien peuvent uniquement consulter le contenu",
443
- "text": "Droit d’édition"
444
+ "readOnlySubText": "Les personnes ayant accès au lien peuvent uniquement consulter le contenu"
444
445
  },
445
446
  "copyReminderContent": {
446
447
  "success": "Copié dans le presse-papier",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "25.0.0",
3
+ "version": "25.1.1",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -79,5 +79,5 @@
79
79
  "sideEffects": [
80
80
  "*.css"
81
81
  ],
82
- "gitHead": "33dab08dabe1d4d7367cc83642c749d3af9edefa"
82
+ "gitHead": "a7357320a4d5ff4adad058fc93d6b6de8978d6f2"
83
83
  }
@@ -26,15 +26,6 @@ export const EditableSharingModal = ({ document, ...rest }) => {
26
26
  share
27
27
  } = useSharingContext()
28
28
 
29
- const shareFileRefId = hasSharedParent(document.path)
30
- ? document.dir_id
31
- : document._id
32
- const recipients = getRecipients(shareFileRefId)
33
- const permissions = getDocumentPermissions(shareFileRefId)
34
- const link = getSharingLink(shareFileRefId)
35
- const sharing = getSharingForSelf(shareFileRefId)
36
- const _isOwner = isOwner(shareFileRefId)
37
-
38
29
  return (
39
30
  <ShareModal
40
31
  createContact={contact => client.create(Contact.doctype, contact)}
@@ -42,14 +33,14 @@ export const EditableSharingModal = ({ document, ...rest }) => {
42
33
  documentType={documentType}
43
34
  hasSharedChild={documentPath && hasSharedChild(documentPath)}
44
35
  hasSharedParent={documentPath && hasSharedParent(documentPath)}
45
- isOwner={_isOwner}
46
- link={link}
36
+ isOwner={isOwner(document._id)}
37
+ link={getSharingLink(document._id)}
47
38
  onRevoke={revoke}
48
39
  onRevokeSelf={revokeSelf}
49
40
  onShare={share}
50
- permissions={permissions}
51
- recipients={recipients}
52
- sharing={sharing}
41
+ permissions={getDocumentPermissions(document._id)}
42
+ recipients={getRecipients(document._id)}
43
+ sharing={getSharingForSelf(document._id)}
53
44
  {...rest}
54
45
  />
55
46
  )
@@ -37,6 +37,11 @@ export const BoxEditingRights = ({ file, editingRights, setEditingRights }) => {
37
37
  isDirectory
38
38
  })
39
39
 
40
+ const textPrimary =
41
+ editingRights === 'readOnly'
42
+ ? t('BoxEditingRights.readOnlyTitle')
43
+ : t('BoxEditingRights.editTitle')
44
+
40
45
  const textSecondary =
41
46
  editingRights === 'readOnly'
42
47
  ? t('Share.permissionLink.readDescription')
@@ -59,10 +64,7 @@ export const BoxEditingRights = ({ file, editingRights, setEditingRights }) => {
59
64
  <ListItemIcon>
60
65
  <Icon icon={PeopleIcon} />
61
66
  </ListItemIcon>
62
- <ListItemText
63
- primary={t('BoxEditingRights.text')}
64
- secondary={textSecondary}
65
- />
67
+ <ListItemText primary={textPrimary} secondary={textSecondary} />
66
68
  <ListItemIcon className="u-mr-half">
67
69
  <Icon icon={BottomIcon} />
68
70
  </ListItemIcon>