cozy-sharing 28.11.0 → 28.11.2
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 +10 -0
- package/dist/components/Recipient/MemberRecipient.spec.js +5 -5
- package/dist/components/ShareByEmail.spec.js +1 -1
- package/dist/components/ShareDialogCozyToCozy.spec.js +1 -1
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +1 -1
- package/dist/components/SharingBanner/helpers/QueryParameter.spec.js +6 -21
- package/dist/components/SharingBanner/hooks/useSharingInfos.spec.js +3 -13
- package/dist/components/__snapshots__/SharedStatus.spec.js.snap +1 -1
- package/dist/styles/autosuggest.styl +1 -0
- package/dist/stylesheet.css +1 -0
- package/package.json +9 -9
- package/src/components/Recipient/MemberRecipient.spec.jsx +5 -5
- package/src/components/ShareByEmail.spec.jsx +1 -1
- package/src/components/ShareDialogCozyToCozy.spec.jsx +1 -1
- package/src/components/ShareDialogTwoStepsConfirmationContainer.spec.jsx +1 -1
- package/src/components/SharingBanner/helpers/QueryParameter.spec.js +11 -24
- package/src/components/SharingBanner/hooks/useSharingInfos.spec.js +3 -13
- package/src/components/__snapshots__/SharedStatus.spec.js.snap +1 -1
- package/src/styles/autosuggest.styl +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
## [28.11.2](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.11.1...cozy-sharing@28.11.2) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **cozy-sharing:** Force text primary color on autosuggest text ([0a20cda](https://github.com/cozy/cozy-libs/commit/0a20cda336d1aa5c3b25ffcd9423ecf6c2cddd9c))
|
|
11
|
+
|
|
12
|
+
## [28.11.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.11.0...cozy-sharing@28.11.1) (2026-03-17)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package cozy-sharing
|
|
15
|
+
|
|
6
16
|
# [28.11.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.10.0...cozy-sharing@28.11.0) (2026-03-17)
|
|
7
17
|
|
|
8
18
|
### Features
|
|
@@ -87,8 +87,8 @@ describe('MemberRecipient component', function () {
|
|
|
87
87
|
}), getByText = _setup3.getByText;
|
|
88
88
|
fireEvent.click(getByText('can change'));
|
|
89
89
|
fireEvent.click(getByText('Remove me from sharing'));
|
|
90
|
-
expect(onRevoke).not.
|
|
91
|
-
expect(onRevokeSelf).
|
|
90
|
+
expect(onRevoke).not.toHaveBeenCalled();
|
|
91
|
+
expect(onRevokeSelf).toHaveBeenCalled();
|
|
92
92
|
|
|
93
93
|
case 7:
|
|
94
94
|
case "end":
|
|
@@ -115,8 +115,8 @@ describe('MemberRecipient component', function () {
|
|
|
115
115
|
}), getByText = _setup4.getByText;
|
|
116
116
|
fireEvent.click(getByText('can change'));
|
|
117
117
|
fireEvent.click(getByText('Remove from sharing'));
|
|
118
|
-
expect(onRevoke).
|
|
119
|
-
expect(onRevokeSelf).not.
|
|
118
|
+
expect(onRevoke).toHaveBeenCalled();
|
|
119
|
+
expect(onRevokeSelf).not.toHaveBeenCalled();
|
|
120
120
|
|
|
121
121
|
case 7:
|
|
122
122
|
case "end":
|
|
@@ -179,7 +179,7 @@ describe('MemberRecipient component', function () {
|
|
|
179
179
|
getByText = _setup7.getByText;
|
|
180
180
|
|
|
181
181
|
fireEvent.click(getByText('Verify'));
|
|
182
|
-
expect(verifyRecipient).
|
|
182
|
+
expect(verifyRecipient).toHaveBeenCalledWith({
|
|
183
183
|
email: 'me@bob.cozy.localhost'
|
|
184
184
|
});
|
|
185
185
|
});
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import getQueryParameter from './QueryParameter';
|
|
2
2
|
describe('getQueryParameter', function () {
|
|
3
|
+
afterEach(function () {
|
|
4
|
+
window.history.pushState({}, '', '/');
|
|
5
|
+
});
|
|
3
6
|
it('should decode URI string', function () {
|
|
4
|
-
|
|
5
|
-
username: 'N%C3%B6%C3%A9'
|
|
6
|
-
};
|
|
7
|
-
delete window.location;
|
|
8
|
-
window.location = {
|
|
9
|
-
search: "?username=".concat(params.username)
|
|
10
|
-
};
|
|
7
|
+
window.history.pushState({}, '', '?username=N%C3%B6%C3%A9');
|
|
11
8
|
|
|
12
9
|
var _getQueryParameter = getQueryParameter(),
|
|
13
10
|
username = _getQueryParameter.username;
|
|
@@ -15,13 +12,7 @@ describe('getQueryParameter', function () {
|
|
|
15
12
|
expect(username).toBe('Nöé');
|
|
16
13
|
});
|
|
17
14
|
it('should keep string with accent unchanged', function () {
|
|
18
|
-
|
|
19
|
-
username: 'Nöé'
|
|
20
|
-
};
|
|
21
|
-
delete window.location;
|
|
22
|
-
window.location = {
|
|
23
|
-
search: "?username=".concat(params.username)
|
|
24
|
-
};
|
|
15
|
+
window.history.pushState({}, '', '?username=Nöé');
|
|
25
16
|
|
|
26
17
|
var _getQueryParameter2 = getQueryParameter(),
|
|
27
18
|
username = _getQueryParameter2.username;
|
|
@@ -29,13 +20,7 @@ describe('getQueryParameter', function () {
|
|
|
29
20
|
expect(username).toBe('Nöé');
|
|
30
21
|
});
|
|
31
22
|
it('should not modify string with special characters', function () {
|
|
32
|
-
|
|
33
|
-
sharecode: 'eyJ_hbGc/iOiJ.S3mJz-B90iu.8D0#JwCK'
|
|
34
|
-
};
|
|
35
|
-
delete window.location;
|
|
36
|
-
window.location = {
|
|
37
|
-
search: "?sharecode=".concat(params.sharecode)
|
|
38
|
-
};
|
|
23
|
+
window.history.pushState({}, '', '?sharecode=eyJ_hbGc/iOiJ.S3mJz-B90iu.8D0%23JwCK');
|
|
39
24
|
|
|
40
25
|
var _getQueryParameter3 = getQueryParameter(),
|
|
41
26
|
sharecode = _getQueryParameter3.sharecode;
|
|
@@ -6,8 +6,6 @@ import { createMockClient } from 'cozy-client';
|
|
|
6
6
|
import { useSharingInfos } from './useSharingInfos';
|
|
7
7
|
import AppLike from '../test/AppLike';
|
|
8
8
|
describe('useSharingInfos', function () {
|
|
9
|
-
var _window = window,
|
|
10
|
-
location = _window.location;
|
|
11
9
|
var mockClient = createMockClient({});
|
|
12
10
|
var fetchOwnPermissionsMock = jest.fn();
|
|
13
11
|
var getDiscoveryLinkMock = jest.fn();
|
|
@@ -76,14 +74,10 @@ describe('useSharingInfos', function () {
|
|
|
76
74
|
}]
|
|
77
75
|
};
|
|
78
76
|
beforeAll(function () {
|
|
79
|
-
|
|
80
|
-
window.location = {
|
|
81
|
-
pathname: '/preview',
|
|
82
|
-
search: '?sharecode=5FAZbBB4Iy0k'
|
|
83
|
-
};
|
|
77
|
+
window.history.pushState({}, '', '/preview?sharecode=5FAZbBB4Iy0k');
|
|
84
78
|
});
|
|
85
79
|
afterAll(function () {
|
|
86
|
-
window.
|
|
80
|
+
window.history.pushState({}, '', '/');
|
|
87
81
|
});
|
|
88
82
|
it('returns the right infos when using useSharingInfo', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
89
83
|
var addSharingLink, _setup, result, waitForNextUpdate;
|
|
@@ -146,11 +140,7 @@ describe('useSharingInfos', function () {
|
|
|
146
140
|
}, _callee2);
|
|
147
141
|
})));
|
|
148
142
|
it('returns loading false if there is nothing to do aka sharing by link', function () {
|
|
149
|
-
|
|
150
|
-
window.location = {
|
|
151
|
-
pathname: '/public',
|
|
152
|
-
search: '?sharecode=5FAZbBB4Iy0k'
|
|
153
|
-
};
|
|
143
|
+
window.history.pushState({}, '', '/public?sharecode=5FAZbBB4Iy0k');
|
|
154
144
|
|
|
155
145
|
var _setup3 = setup(),
|
|
156
146
|
result = _setup3.result;
|
package/dist/stylesheet.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "28.11.
|
|
3
|
+
"version": "28.11.2",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@cozy/minilog": "^1.0.0",
|
|
32
32
|
"classnames": "^2.5.1",
|
|
33
33
|
"cozy-device-helper": "^4.0.3",
|
|
34
|
-
"cozy-doctypes": "^1.99.
|
|
34
|
+
"cozy-doctypes": "^1.99.1",
|
|
35
35
|
"date-fns": "2.30.0",
|
|
36
36
|
"lodash": "^4.17.21",
|
|
37
37
|
"react-autosuggest": "^10.1.0",
|
|
@@ -51,22 +51,22 @@
|
|
|
51
51
|
"@testing-library/jest-dom": "5.17.0",
|
|
52
52
|
"@testing-library/react": "12.1.5",
|
|
53
53
|
"@testing-library/react-hooks": "8.0.1",
|
|
54
|
-
"babel-jest": "
|
|
54
|
+
"babel-jest": "30.3.0",
|
|
55
55
|
"babel-plugin-css-modules-transform": "1.6.2",
|
|
56
56
|
"babel-plugin-inline-react-svg": "1.1.2",
|
|
57
57
|
"cozy-client": "^60.22.0",
|
|
58
58
|
"cozy-device-helper": "^3.7.1",
|
|
59
|
-
"cozy-intent": "^2.31.
|
|
59
|
+
"cozy-intent": "^2.31.1",
|
|
60
60
|
"cozy-minilog": "^3.10.1",
|
|
61
61
|
"cozy-ui": "^135.0.0",
|
|
62
|
-
"cozy-ui-plus": "^5.3.
|
|
63
|
-
"jest": "
|
|
64
|
-
"jest-environment-jsdom": "
|
|
62
|
+
"cozy-ui-plus": "^5.3.1",
|
|
63
|
+
"jest": "30.3.0",
|
|
64
|
+
"jest-environment-jsdom": "30.3.0",
|
|
65
65
|
"react": "16.12.0",
|
|
66
66
|
"react-dom": "16.13.0",
|
|
67
67
|
"react-router": "^5.0.1",
|
|
68
68
|
"storybook": "7.6.0",
|
|
69
|
-
"twake-i18n": "^0.4.
|
|
69
|
+
"twake-i18n": "^0.4.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"cozy-client": ">=60.22.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"sideEffects": [
|
|
84
84
|
"*.css"
|
|
85
85
|
],
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "71eb651f7f5d805b8ac0af2f74cdc754d01395e2"
|
|
87
87
|
}
|
|
@@ -84,8 +84,8 @@ describe('MemberRecipient component', () => {
|
|
|
84
84
|
|
|
85
85
|
fireEvent.click(getByText('can change'))
|
|
86
86
|
fireEvent.click(getByText('Remove me from sharing'))
|
|
87
|
-
expect(onRevoke).not.
|
|
88
|
-
expect(onRevokeSelf).
|
|
87
|
+
expect(onRevoke).not.toHaveBeenCalled()
|
|
88
|
+
expect(onRevokeSelf).toHaveBeenCalled()
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
it('should call revoke if I am the owner of the sharing', async () => {
|
|
@@ -104,8 +104,8 @@ describe('MemberRecipient component', () => {
|
|
|
104
104
|
|
|
105
105
|
fireEvent.click(getByText('can change'))
|
|
106
106
|
fireEvent.click(getByText('Remove from sharing'))
|
|
107
|
-
expect(onRevoke).
|
|
108
|
-
expect(onRevokeSelf).not.
|
|
107
|
+
expect(onRevoke).toHaveBeenCalled()
|
|
108
|
+
expect(onRevokeSelf).not.toHaveBeenCalled()
|
|
109
109
|
})
|
|
110
110
|
|
|
111
111
|
it('should render confirmation actions if recipient is waiting for confirmation', () => {
|
|
@@ -163,7 +163,7 @@ describe('MemberRecipient component', () => {
|
|
|
163
163
|
|
|
164
164
|
fireEvent.click(getByText('Verify'))
|
|
165
165
|
|
|
166
|
-
expect(verifyRecipient).
|
|
166
|
+
expect(verifyRecipient).toHaveBeenCalledWith({
|
|
167
167
|
email: 'me@bob.cozy.localhost'
|
|
168
168
|
})
|
|
169
169
|
})
|
|
@@ -208,7 +208,7 @@ describe('ShareDialogCozyToCozy', () => {
|
|
|
208
208
|
const confirmRejectButton = getByText('Reject')
|
|
209
209
|
await act(async () => fireEvent.click(confirmRejectButton))
|
|
210
210
|
|
|
211
|
-
expect(rejectRecipient).
|
|
211
|
+
expect(rejectRecipient).toHaveBeenCalled()
|
|
212
212
|
})
|
|
213
213
|
})
|
|
214
214
|
|
|
@@ -229,7 +229,7 @@ describe('ShareDialogTwoStepsConfirmationContainer', () => {
|
|
|
229
229
|
const confirmRejectButton = getByText('Reject')
|
|
230
230
|
await act(async () => fireEvent.click(confirmRejectButton))
|
|
231
231
|
|
|
232
|
-
expect(rejectRecipient).
|
|
232
|
+
expect(rejectRecipient).toHaveBeenCalled()
|
|
233
233
|
})
|
|
234
234
|
})
|
|
235
235
|
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
import getQueryParameter from './QueryParameter'
|
|
2
2
|
|
|
3
3
|
describe('getQueryParameter', () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
afterEach(() => {
|
|
5
|
+
window.history.pushState({}, '', '/')
|
|
6
|
+
})
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
window.
|
|
11
|
-
search: `?username=${params.username}`
|
|
12
|
-
}
|
|
8
|
+
it('should decode URI string', () => {
|
|
9
|
+
window.history.pushState({}, '', '?username=N%C3%B6%C3%A9')
|
|
13
10
|
const { username } = getQueryParameter()
|
|
14
11
|
|
|
15
12
|
expect(username).toBe('Nöé')
|
|
16
13
|
})
|
|
17
14
|
|
|
18
15
|
it('should keep string with accent unchanged', () => {
|
|
19
|
-
|
|
20
|
-
username: 'Nöé'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
delete window.location
|
|
24
|
-
window.location = {
|
|
25
|
-
search: `?username=${params.username}`
|
|
26
|
-
}
|
|
16
|
+
window.history.pushState({}, '', '?username=Nöé')
|
|
27
17
|
const { username } = getQueryParameter()
|
|
28
18
|
|
|
29
19
|
expect(username).toBe('Nöé')
|
|
30
20
|
})
|
|
31
21
|
|
|
32
22
|
it('should not modify string with special characters', () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
window.location = {
|
|
39
|
-
search: `?sharecode=${params.sharecode}`
|
|
40
|
-
}
|
|
23
|
+
window.history.pushState(
|
|
24
|
+
{},
|
|
25
|
+
'',
|
|
26
|
+
'?sharecode=eyJ_hbGc/iOiJ.S3mJz-B90iu.8D0%23JwCK'
|
|
27
|
+
)
|
|
41
28
|
const { sharecode } = getQueryParameter()
|
|
42
29
|
|
|
43
30
|
expect(sharecode).toBe('eyJ_hbGc/iOiJ.S3mJz-B90iu.8D0#JwCK')
|
|
@@ -7,8 +7,6 @@ import { useSharingInfos } from './useSharingInfos'
|
|
|
7
7
|
import AppLike from '../test/AppLike'
|
|
8
8
|
|
|
9
9
|
describe('useSharingInfos', () => {
|
|
10
|
-
const { location } = window
|
|
11
|
-
|
|
12
10
|
const mockClient = createMockClient({})
|
|
13
11
|
const fetchOwnPermissionsMock = jest.fn()
|
|
14
12
|
const getDiscoveryLinkMock = jest.fn()
|
|
@@ -70,14 +68,10 @@ describe('useSharingInfos', () => {
|
|
|
70
68
|
]
|
|
71
69
|
}
|
|
72
70
|
beforeAll(() => {
|
|
73
|
-
|
|
74
|
-
window.location = {
|
|
75
|
-
pathname: '/preview',
|
|
76
|
-
search: '?sharecode=5FAZbBB4Iy0k'
|
|
77
|
-
}
|
|
71
|
+
window.history.pushState({}, '', '/preview?sharecode=5FAZbBB4Iy0k')
|
|
78
72
|
})
|
|
79
73
|
afterAll(() => {
|
|
80
|
-
window.
|
|
74
|
+
window.history.pushState({}, '', '/')
|
|
81
75
|
})
|
|
82
76
|
|
|
83
77
|
it('returns the right infos when using useSharingInfo', async () => {
|
|
@@ -113,11 +107,7 @@ describe('useSharingInfos', () => {
|
|
|
113
107
|
})
|
|
114
108
|
|
|
115
109
|
it('returns loading false if there is nothing to do aka sharing by link', () => {
|
|
116
|
-
|
|
117
|
-
window.location = {
|
|
118
|
-
pathname: '/public',
|
|
119
|
-
search: '?sharecode=5FAZbBB4Iy0k'
|
|
120
|
-
}
|
|
110
|
+
window.history.pushState({}, '', '/public?sharecode=5FAZbBB4Iy0k')
|
|
121
111
|
const { result } = setup()
|
|
122
112
|
expect(result.current.loading).toEqual(false)
|
|
123
113
|
})
|