cozy-sharing 4.5.10 → 4.6.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,17 @@
|
|
|
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
|
+
# [4.6.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@4.5.10...cozy-sharing@4.6.0) (2022-11-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Reactivate sharing cozy to cozy for notes ([d54138e](https://github.com/cozy/cozy-libs/commit/d54138e29ed2d966f8b1da4b4b4caae2b17a3264))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 4.5.10 (2022-11-09)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -52,7 +52,9 @@ describe('EditableSharingModal', function () {
|
|
|
52
52
|
|
|
53
53
|
it('will set to false the shared parent / child if the document has no path', function () {
|
|
54
54
|
var _setup = setup({
|
|
55
|
-
document: {
|
|
55
|
+
document: {
|
|
56
|
+
attributes: {}
|
|
57
|
+
}
|
|
56
58
|
}),
|
|
57
59
|
component = _setup.component;
|
|
58
60
|
|
|
@@ -66,7 +68,8 @@ describe('EditableSharingModal', function () {
|
|
|
66
68
|
|
|
67
69
|
var _setup2 = setup({
|
|
68
70
|
document: {
|
|
69
|
-
path: '/a'
|
|
71
|
+
path: '/a',
|
|
72
|
+
attributes: {}
|
|
70
73
|
}
|
|
71
74
|
}),
|
|
72
75
|
component = _setup2.component;
|
|
@@ -81,7 +84,9 @@ describe('EditableSharingModal', function () {
|
|
|
81
84
|
});
|
|
82
85
|
it('will set to true the sharedChild if a child is shared and the document path fetched latter', function () {
|
|
83
86
|
var _setup3 = setup({
|
|
84
|
-
document: {
|
|
87
|
+
document: {
|
|
88
|
+
attributes: {}
|
|
89
|
+
}
|
|
85
90
|
}),
|
|
86
91
|
component = _setup3.component;
|
|
87
92
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import flag from 'cozy-flags';
|
|
3
4
|
import { contactsResponseType, groupsResponseType } from '../propTypes';
|
|
4
5
|
import ShareDialogCozyToCozy from './ShareDialogCozyToCozy';
|
|
5
6
|
import ShareDialogOnlyByLink from './ShareDialogOnlyByLink';
|
|
@@ -27,11 +28,12 @@ export var ShareModal = function ShareModal(_ref) {
|
|
|
27
28
|
sharing = _ref.sharing,
|
|
28
29
|
sharingDesc = _ref.sharingDesc,
|
|
29
30
|
twoStepsConfirmationMethods = _ref.twoStepsConfirmationMethods;
|
|
30
|
-
var
|
|
31
|
+
var showShareCozyToCozyForNotes = flag('notes.sharing-cozy-to-cozy') !== null && flag('notes.sharing-cozy-to-cozy') && documentType === 'Notes';
|
|
32
|
+
var showShareByEmail = showShareCozyToCozyForNotes && documentType !== 'Albums' && !hasSharedParent && !hasSharedChild;
|
|
31
33
|
var showShareByLink = documentType !== 'Organizations';
|
|
32
34
|
var showShareOnlyByLink = hasSharedParent || hasSharedChild;
|
|
33
35
|
var showWhoHasAccess = documentType !== 'Albums';
|
|
34
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, (
|
|
36
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (!showShareCozyToCozyForNotes || documentType === 'Albums') && /*#__PURE__*/React.createElement(ShareDialogOnlyByLink, {
|
|
35
37
|
document: document,
|
|
36
38
|
documentType: documentType,
|
|
37
39
|
link: link,
|
|
@@ -40,7 +42,7 @@ export var ShareModal = function ShareModal(_ref) {
|
|
|
40
42
|
onShareByLink: onShareByLink,
|
|
41
43
|
onUpdateShareLinkPermissions: onUpdateShareLinkPermissions,
|
|
42
44
|
permissions: permissions
|
|
43
|
-
}),
|
|
45
|
+
}), showShareCozyToCozyForNotes && documentType !== 'Albums' && /*#__PURE__*/React.createElement(ShareDialogCozyToCozy, {
|
|
44
46
|
contacts: contacts,
|
|
45
47
|
createContact: createContact,
|
|
46
48
|
document: document,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"sideEffects": [
|
|
64
64
|
"*.css"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "e216ec318820e96f5ee5ff6108ce77033d4d5c3e"
|
|
67
67
|
}
|
|
@@ -44,7 +44,11 @@ describe('EditableSharingModal', () => {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
it('will set to false the shared parent / child if the document has no path', () => {
|
|
47
|
-
const { component } = setup({
|
|
47
|
+
const { component } = setup({
|
|
48
|
+
document: {
|
|
49
|
+
attributes: {}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
48
52
|
|
|
49
53
|
const mod = component.find(DumbShareModal)
|
|
50
54
|
expect(mod.length).toBe(1)
|
|
@@ -54,7 +58,12 @@ describe('EditableSharingModal', () => {
|
|
|
54
58
|
|
|
55
59
|
it('will set to true the sharedChild if a child is shared and document has path from the beginning', () => {
|
|
56
60
|
useFetchDocumentPath.mockReturnValue(['/a'])
|
|
57
|
-
const { component } = setup({
|
|
61
|
+
const { component } = setup({
|
|
62
|
+
document: {
|
|
63
|
+
path: '/a',
|
|
64
|
+
attributes: {}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
58
67
|
|
|
59
68
|
const provider = component.find(SharingProvider)
|
|
60
69
|
provider.instance().dispatch(receivePaths(['/a/b']))
|
|
@@ -68,7 +77,11 @@ describe('EditableSharingModal', () => {
|
|
|
68
77
|
})
|
|
69
78
|
|
|
70
79
|
it('will set to true the sharedChild if a child is shared and the document path fetched latter', () => {
|
|
71
|
-
const { component } = setup({
|
|
80
|
+
const { component } = setup({
|
|
81
|
+
document: {
|
|
82
|
+
attributes: {}
|
|
83
|
+
}
|
|
84
|
+
})
|
|
72
85
|
useFetchDocumentPath.mockReturnValue(['/a'])
|
|
73
86
|
|
|
74
87
|
const provider = component.find(SharingProvider)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
+
import flag from 'cozy-flags'
|
|
3
4
|
|
|
4
5
|
import { contactsResponseType, groupsResponseType } from '../propTypes'
|
|
5
6
|
|
|
@@ -29,8 +30,13 @@ export const ShareModal = ({
|
|
|
29
30
|
sharingDesc,
|
|
30
31
|
twoStepsConfirmationMethods
|
|
31
32
|
}) => {
|
|
33
|
+
const showShareCozyToCozyForNotes =
|
|
34
|
+
flag('notes.sharing-cozy-to-cozy') !== null &&
|
|
35
|
+
flag('notes.sharing-cozy-to-cozy') &&
|
|
36
|
+
documentType === 'Notes'
|
|
37
|
+
|
|
32
38
|
const showShareByEmail =
|
|
33
|
-
|
|
39
|
+
showShareCozyToCozyForNotes &&
|
|
34
40
|
documentType !== 'Albums' &&
|
|
35
41
|
!hasSharedParent &&
|
|
36
42
|
!hasSharedChild
|
|
@@ -40,7 +46,7 @@ export const ShareModal = ({
|
|
|
40
46
|
|
|
41
47
|
return (
|
|
42
48
|
<>
|
|
43
|
-
{(
|
|
49
|
+
{(!showShareCozyToCozyForNotes || documentType === 'Albums') && (
|
|
44
50
|
<ShareDialogOnlyByLink
|
|
45
51
|
document={document}
|
|
46
52
|
documentType={documentType}
|
|
@@ -52,7 +58,7 @@ export const ShareModal = ({
|
|
|
52
58
|
permissions={permissions}
|
|
53
59
|
/>
|
|
54
60
|
)}
|
|
55
|
-
{
|
|
61
|
+
{showShareCozyToCozyForNotes && documentType !== 'Albums' && (
|
|
56
62
|
<ShareDialogCozyToCozy
|
|
57
63
|
contacts={contacts}
|
|
58
64
|
createContact={createContact}
|