cozy-sharing 25.6.0 → 25.7.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 +13 -0
- package/dist/SharingProvider.js +3 -1
- package/dist/components/ShareRestrictionModal/ShareRestrictionModal.js +7 -2
- package/dist/helpers/link.js +11 -0
- package/package.json +4 -4
- package/src/SharingProvider.jsx +1 -1
- package/src/components/ShareRestrictionModal/ShareRestrictionModal.jsx +3 -2
- package/src/helpers/link.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.7.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.7.0...cozy-sharing@25.7.1) (2025-07-30)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- Correct link in clipboard when sharing an album ([b56a93c](https://github.com/cozy/cozy-libs/commit/b56a93c43d15a186aa1c26e382d30491b148f255))
|
|
11
|
+
|
|
12
|
+
# [25.7.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.6.0...cozy-sharing@25.7.0) (2025-07-16)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- Improve sharings retrieval performances ([87c99e0](https://github.com/cozy/cozy-libs/commit/87c99e07a427de1557120a8c3d03de573487a92d))
|
|
17
|
+
- Upgrade cozy-client for param ([b612543](https://github.com/cozy/cozy-libs/commit/b6125435b03f56d27090b8c32274bf0da560d8d4))
|
|
18
|
+
|
|
6
19
|
# [25.6.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.5.0...cozy-sharing@25.6.0) (2025-06-18)
|
|
7
20
|
|
|
8
21
|
### Features
|
package/dist/SharingProvider.js
CHANGED
|
@@ -682,7 +682,9 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
|
|
|
682
682
|
case 4:
|
|
683
683
|
_this$props = this.props, doctype = _this$props.doctype, client = _this$props.client;
|
|
684
684
|
_context13.next = 7;
|
|
685
|
-
return Promise.all([this.sharingCol.findByDoctype(doctype
|
|
685
|
+
return Promise.all([this.sharingCol.findByDoctype(doctype, {
|
|
686
|
+
withSharedDocs: false
|
|
687
|
+
}), this.permissionCol.findLinksByDoctype(doctype), client.fetchQueryAndGetFromState(fetchApps())]);
|
|
686
688
|
|
|
687
689
|
case 7:
|
|
688
690
|
_yield$Promise$all = _context13.sent;
|
|
@@ -13,6 +13,7 @@ import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
|
|
|
13
13
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
|
|
14
14
|
import { ShareRestrictionContentModal } from './ShareRestrictionContentModal';
|
|
15
15
|
import { copyToClipboard, updatePermissions, makeTTL, revokePermissions, createPermissions } from './helpers';
|
|
16
|
+
import { getAppSlugFromDocumentType } from '../../helpers/link';
|
|
16
17
|
import { checkIsPermissionHasExpiresDate, checkIsPermissionHasPassword, checkIsReadOnlyPermissions, getPermissionExpiresDate } from '../../helpers/permissions';
|
|
17
18
|
import { useSharingContext } from '../../hooks/useSharingContext';
|
|
18
19
|
var PASSWORD_MIN_LENGTH = 4;
|
|
@@ -121,7 +122,9 @@ export var ShareRestrictionModal = function ShareRestrictionModal(_ref) {
|
|
|
121
122
|
cozyUrl: client.getStackClient().uri,
|
|
122
123
|
searchParams: [['sharecode', perms.attributes.shortcodes.code]],
|
|
123
124
|
pathname: '/public',
|
|
124
|
-
slug:
|
|
125
|
+
slug: getAppSlugFromDocumentType({
|
|
126
|
+
documentType: documentType
|
|
127
|
+
}),
|
|
125
128
|
subDomainType: client.capabilities.flat_subdomains ? 'flat' : 'nested'
|
|
126
129
|
});
|
|
127
130
|
_context.next = 10;
|
|
@@ -158,7 +161,9 @@ export var ShareRestrictionModal = function ShareRestrictionModal(_ref) {
|
|
|
158
161
|
cozyUrl: client.getStackClient().uri,
|
|
159
162
|
searchParams: [['sharecode', _perms.attributes.shortcodes.code]],
|
|
160
163
|
pathname: '/public',
|
|
161
|
-
slug:
|
|
164
|
+
slug: getAppSlugFromDocumentType({
|
|
165
|
+
documentType: documentType
|
|
166
|
+
}),
|
|
162
167
|
subDomainType: client.capabilities.flat_subdomains ? 'flat' : 'nested'
|
|
163
168
|
});
|
|
164
169
|
_context.next = 21;
|
package/dist/helpers/link.js
CHANGED
|
@@ -2,4 +2,15 @@ import { DOCUMENT_TYPE } from './documentType';
|
|
|
2
2
|
export var isOnlyReadOnlyLinkAllowed = function isOnlyReadOnlyLinkAllowed(_ref) {
|
|
3
3
|
var documentType = _ref.documentType;
|
|
4
4
|
return documentType === DOCUMENT_TYPE.ALBUMS;
|
|
5
|
+
};
|
|
6
|
+
export var getAppSlugFromDocumentType = function getAppSlugFromDocumentType(_ref2) {
|
|
7
|
+
var documentType = _ref2.documentType;
|
|
8
|
+
|
|
9
|
+
switch (documentType) {
|
|
10
|
+
case DOCUMENT_TYPE.ALBUMS:
|
|
11
|
+
return 'photos';
|
|
12
|
+
|
|
13
|
+
default:
|
|
14
|
+
return 'drive';
|
|
15
|
+
}
|
|
5
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.7.1",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"babel-jest": "26.6.3",
|
|
55
55
|
"babel-plugin-css-modules-transform": "1.6.2",
|
|
56
56
|
"babel-plugin-inline-react-svg": "1.1.2",
|
|
57
|
-
"cozy-client": "^
|
|
57
|
+
"cozy-client": "^59.4.0",
|
|
58
58
|
"cozy-device-helper": "^3.7.1",
|
|
59
59
|
"cozy-intent": "^2.30.0",
|
|
60
60
|
"cozy-minilog": "^3.10.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"storybook": "7.6.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"cozy-client": ">=
|
|
70
|
+
"cozy-client": ">=59.4.0",
|
|
71
71
|
"cozy-device-helper": ">=3.7.1",
|
|
72
72
|
"cozy-intent": ">=2.29.1",
|
|
73
73
|
"cozy-minilog": ">=3.9.1",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"sideEffects": [
|
|
80
80
|
"*.css"
|
|
81
81
|
],
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "04447f2c409922ea10f0859c31536a441ca009ac"
|
|
83
83
|
}
|
package/src/SharingProvider.jsx
CHANGED
|
@@ -186,7 +186,7 @@ export class SharingProvider extends Component {
|
|
|
186
186
|
}
|
|
187
187
|
const { doctype, client } = this.props
|
|
188
188
|
const [sharings, permissions, apps] = await Promise.all([
|
|
189
|
-
this.sharingCol.findByDoctype(doctype),
|
|
189
|
+
this.sharingCol.findByDoctype(doctype, { withSharedDocs: false }),
|
|
190
190
|
this.permissionCol.findLinksByDoctype(doctype),
|
|
191
191
|
client.fetchQueryAndGetFromState(fetchApps())
|
|
192
192
|
])
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
revokePermissions,
|
|
19
19
|
createPermissions
|
|
20
20
|
} from './helpers'
|
|
21
|
+
import { getAppSlugFromDocumentType } from '../../helpers/link'
|
|
21
22
|
import {
|
|
22
23
|
checkIsPermissionHasExpiresDate,
|
|
23
24
|
checkIsPermissionHasPassword,
|
|
@@ -90,7 +91,7 @@ export const ShareRestrictionModal = ({ file, onClose }) => {
|
|
|
90
91
|
cozyUrl: client.getStackClient().uri,
|
|
91
92
|
searchParams: [['sharecode', perms.attributes.shortcodes.code]],
|
|
92
93
|
pathname: '/public',
|
|
93
|
-
slug:
|
|
94
|
+
slug: getAppSlugFromDocumentType({ documentType }),
|
|
94
95
|
subDomainType: client.capabilities.flat_subdomains ? 'flat' : 'nested'
|
|
95
96
|
})
|
|
96
97
|
await copyToClipboard(url, { t, showAlert })
|
|
@@ -112,7 +113,7 @@ export const ShareRestrictionModal = ({ file, onClose }) => {
|
|
|
112
113
|
cozyUrl: client.getStackClient().uri,
|
|
113
114
|
searchParams: [['sharecode', perms.attributes.shortcodes.code]],
|
|
114
115
|
pathname: '/public',
|
|
115
|
-
slug:
|
|
116
|
+
slug: getAppSlugFromDocumentType({ documentType }),
|
|
116
117
|
subDomainType: client.capabilities.flat_subdomains ? 'flat' : 'nested'
|
|
117
118
|
})
|
|
118
119
|
await copyToClipboard(url, { t, showAlert })
|
package/src/helpers/link.js
CHANGED
|
@@ -2,3 +2,12 @@ import { DOCUMENT_TYPE } from './documentType'
|
|
|
2
2
|
|
|
3
3
|
export const isOnlyReadOnlyLinkAllowed = ({ documentType }) =>
|
|
4
4
|
documentType === DOCUMENT_TYPE.ALBUMS
|
|
5
|
+
|
|
6
|
+
export const getAppSlugFromDocumentType = ({ documentType }) => {
|
|
7
|
+
switch (documentType) {
|
|
8
|
+
case DOCUMENT_TYPE.ALBUMS:
|
|
9
|
+
return 'photos'
|
|
10
|
+
default:
|
|
11
|
+
return 'drive'
|
|
12
|
+
}
|
|
13
|
+
}
|