cozy-sharing 34.0.2 → 34.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 CHANGED
@@ -3,6 +3,12 @@
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
+ # [34.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@34.0.2...cozy-sharing@34.1.0) (2026-06-25)
7
+
8
+ ### Features
9
+
10
+ - Show text and not menu if forced readonly for groups ([24d6df8](https://github.com/cozy/cozy-libs/commit/24d6df8c6d7ad0da2f63719d264001dbf67624cc))
11
+
6
12
  ## [34.0.2](https://github.com/cozy/cozy-libs/compare/cozy-sharing@34.0.1...cozy-sharing@34.0.2) (2026-06-24)
7
13
 
8
14
  **Note:** Version bump only for package cozy-sharing
@@ -11,6 +11,7 @@ import IconButton from 'cozy-ui/transpiled/react/IconButton';
11
11
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
12
12
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
13
13
  import Spinner from 'cozy-ui/transpiled/react/Spinner';
14
+ import Typography from 'cozy-ui/transpiled/react/Typography';
14
15
  import { useI18n } from 'twake-i18n';
15
16
  import { permission } from './actions/permission';
16
17
  import { useSharingContext } from '../../hooks/useSharingContext';
@@ -19,10 +20,11 @@ import { GroupAvatar } from '../Avatar/GroupAvatar';
19
20
  var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
20
21
  var name = _ref.name,
21
22
  isOwner = _ref.isOwner,
23
+ isReadOnly = _ref.isReadOnly,
22
24
  sharingId = _ref.sharingId,
23
25
  groupIndex = _ref.groupIndex,
24
26
  _ref$read_only = _ref.read_only,
25
- isReadOnly = _ref$read_only === void 0 ? false : _ref$read_only,
27
+ read_only = _ref$read_only === void 0 ? false : _ref$read_only,
26
28
  className = _ref.className,
27
29
  isUserInsideMembers = _ref.isUserInsideMembers,
28
30
  document = _ref.document;
@@ -46,7 +48,7 @@ var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
46
48
  revoking = _useState4[0],
47
49
  setRevoking = _useState4[1];
48
50
 
49
- var shouldShowMenu = !revoking && (isOwner || isUserInsideMembers);
51
+ var shouldShowMenu = !isReadOnly && !revoking && (isOwner || isUserInsideMembers);
50
52
 
51
53
  var toggleMenu = function toggleMenu() {
52
54
  return setMenuDisplayed(!isMenuDisplayed);
@@ -94,14 +96,16 @@ var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
94
96
  };
95
97
  }();
96
98
 
97
- var type = isReadOnly ? 'one-way' : 'two-way';
99
+ var type = read_only ? 'one-way' : 'two-way';
98
100
  var actions = makeActions([permission], {
99
101
  t: t,
100
102
  type: type
101
103
  });
102
104
  return /*#__PURE__*/React.createElement("div", {
103
105
  className: className
104
- }, revoking && /*#__PURE__*/React.createElement(Spinner, null), shouldShowMenu && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownButton, {
106
+ }, revoking && /*#__PURE__*/React.createElement(Spinner, null), !shouldShowMenu && /*#__PURE__*/React.createElement(Typography, {
107
+ variant: "body2"
108
+ }, t("Share.type.".concat(type))), shouldShowMenu && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownButton, {
105
109
  ref: buttonRef,
106
110
  "aria-controls": "simple-menu",
107
111
  "aria-haspopup": "true",
@@ -27,6 +27,7 @@ var RecipientList = function RecipientList(_ref) {
27
27
  if (isGroupRecipient) {
28
28
  return /*#__PURE__*/React.createElement(GroupRecipient, _extends({}, recipient, {
29
29
  isOwner: isOwner,
30
+ isReadOnly: isReadOnly,
30
31
  key: recipient.index,
31
32
  document: document,
32
33
  documentType: documentType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "34.0.2",
3
+ "version": "34.1.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -85,5 +85,5 @@
85
85
  "sideEffects": [
86
86
  "*.css"
87
87
  ],
88
- "gitHead": "1526f0d72beb8a728568c4bccdf7e658b5c9e389"
88
+ "gitHead": "4e29033c8179810abb9897d1a9d6b90446c53f47"
89
89
  }
@@ -9,6 +9,7 @@ import IconButton from 'cozy-ui/transpiled/react/IconButton'
9
9
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
10
10
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
11
11
  import Spinner from 'cozy-ui/transpiled/react/Spinner'
12
+ import Typography from 'cozy-ui/transpiled/react/Typography'
12
13
  import { useI18n } from 'twake-i18n'
13
14
 
14
15
  import { permission } from './actions/permission'
@@ -18,9 +19,10 @@ import { GroupAvatar } from '../Avatar/GroupAvatar'
18
19
  const GroupRecipientPermissions = ({
19
20
  name,
20
21
  isOwner,
22
+ isReadOnly,
21
23
  sharingId,
22
24
  groupIndex,
23
- read_only: isReadOnly = false,
25
+ read_only = false,
24
26
  className,
25
27
  isUserInsideMembers,
26
28
  document
@@ -32,7 +34,8 @@ const GroupRecipientPermissions = ({
32
34
  const [isMenuDisplayed, setMenuDisplayed] = useState(false)
33
35
  const [revoking, setRevoking] = useState(false)
34
36
 
35
- const shouldShowMenu = !revoking && (isOwner || isUserInsideMembers)
37
+ const shouldShowMenu =
38
+ !isReadOnly && !revoking && (isOwner || isUserInsideMembers)
36
39
 
37
40
  const toggleMenu = () => setMenuDisplayed(!isMenuDisplayed)
38
41
  const hideMenu = () => setMenuDisplayed(false)
@@ -47,7 +50,7 @@ const GroupRecipientPermissions = ({
47
50
  setRevoking(false)
48
51
  }
49
52
 
50
- const type = isReadOnly ? 'one-way' : 'two-way'
53
+ const type = read_only ? 'one-way' : 'two-way'
51
54
 
52
55
  const actions = makeActions([permission], {
53
56
  t,
@@ -57,6 +60,9 @@ const GroupRecipientPermissions = ({
57
60
  return (
58
61
  <div className={className}>
59
62
  {revoking && <Spinner />}
63
+ {!shouldShowMenu && (
64
+ <Typography variant="body2">{t(`Share.type.${type}`)}</Typography>
65
+ )}
60
66
  {shouldShowMenu && (
61
67
  <>
62
68
  <DropdownButton
@@ -34,6 +34,7 @@ const RecipientList = ({
34
34
  <GroupRecipient
35
35
  {...recipient}
36
36
  isOwner={isOwner}
37
+ isReadOnly={isReadOnly}
37
38
  key={recipient.index}
38
39
  document={document}
39
40
  documentType={documentType}