@plone/volto 18.12.0 → 18.12.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 +11 -0
- package/package.json +2 -2
- package/src/components/manage/Contents/ContentsUploadModal.jsx +6 -2
- package/src/components/manage/Contents/__mocks__/index.tsx +0 -1
- package/src/components/manage/Diff/Diff.test.jsx +0 -2
- package/src/components/manage/Form/__mocks__/index.tsx +0 -1
- package/src/components/manage/Widgets/__mocks__/index.tsx +0 -2
- package/src/components/theme/AppExtras/AppExtras.test.jsx +0 -2
- package/src/helpers/Api/Api.plone.rest.test.js +0 -1
- package/src/helpers/Api/Api.test.js +0 -6
- package/src/helpers/AuthToken/AuthToken.test.js +0 -1
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +0 -1
- package/test-setup-globals-vitest.js +46 -0
- package/test-setup-globals.js +2 -36
- package/tsconfig.declarations.json +1 -0
- package/vitest.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,17 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 18.12.1 (2025-04-15)
|
|
21
|
+
|
|
22
|
+
### Bugfix
|
|
23
|
+
|
|
24
|
+
- Fixed broken tests in add-ons in Volto 18.12.0. @Abhishek-17h [#6989](https://github.com/plone/volto/issues/6989)
|
|
25
|
+
|
|
26
|
+
### Internal
|
|
27
|
+
|
|
28
|
+
- Removes make commands in root of repository whose packages no longer exist. @wesleybl [#6975](https://github.com/plone/volto/issues/6975)
|
|
29
|
+
- Use `Image` from `@plone/volto/components/theme/Image/Image` instead of `semantic-ui-react` in `ContentsUploadModal`. @wesleybl [#6982](https://github.com/plone/volto/issues/6982)
|
|
30
|
+
|
|
20
31
|
## 18.12.0 (2025-04-12)
|
|
21
32
|
|
|
22
33
|
### Feature
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "18.12.
|
|
12
|
+
"version": "18.12.1",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
"webpack-dev-server": "4.11.1",
|
|
364
364
|
"webpack-node-externals": "3.0.0",
|
|
365
365
|
"why": "0.6.2",
|
|
366
|
-
"@plone/types": "1.3.
|
|
366
|
+
"@plone/types": "1.3.3",
|
|
367
367
|
"@plone/volto-coresandbox": "1.0.0"
|
|
368
368
|
},
|
|
369
369
|
"volta": {
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
Dimmer,
|
|
7
7
|
Header,
|
|
8
8
|
Icon,
|
|
9
|
-
Image,
|
|
10
9
|
Modal,
|
|
11
10
|
Table,
|
|
12
11
|
Segment,
|
|
@@ -24,6 +23,7 @@ import FormattedRelativeDate from '@plone/volto/components/theme/FormattedDate/F
|
|
|
24
23
|
import { createContent } from '@plone/volto/actions/content/content';
|
|
25
24
|
import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation';
|
|
26
25
|
import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious';
|
|
26
|
+
import Image from '@plone/volto/components/theme/Image/Image';
|
|
27
27
|
|
|
28
28
|
const Dropzone = loadable(() => import('react-dropzone'));
|
|
29
29
|
|
|
@@ -259,7 +259,11 @@ const ContentsUploadModal = (props) => {
|
|
|
259
259
|
<Table.Cell>{filesize(file.size, { round: 0 })}</Table.Cell>
|
|
260
260
|
<Table.Cell>
|
|
261
261
|
{file.type.split('/')[0] === 'image' && (
|
|
262
|
-
<Image
|
|
262
|
+
<Image
|
|
263
|
+
src={file.preview}
|
|
264
|
+
height={60}
|
|
265
|
+
className="ui image"
|
|
266
|
+
/>
|
|
263
267
|
)}
|
|
264
268
|
</Table.Cell>
|
|
265
269
|
<Table.Cell>
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
// import superagent from 'superagent';
|
|
2
2
|
import config from '@plone/volto/registry';
|
|
3
3
|
import Api from './Api';
|
|
4
|
-
import { vi } from 'vitest';
|
|
5
|
-
|
|
6
|
-
// jest.mock('react-cookie', () => ({
|
|
7
|
-
// load: jest.fn(() => 'token'),
|
|
8
|
-
// }));
|
|
9
|
-
//
|
|
10
4
|
|
|
11
5
|
vi.mock('superagent', () => ({
|
|
12
6
|
default: {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
2
|
+
import { expect, describe, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
global.describe = describe;
|
|
5
|
+
global.it = it;
|
|
6
|
+
global.expect = expect;
|
|
7
|
+
global.vi = vi;
|
|
8
|
+
|
|
9
|
+
global.__CLIENT__ = true;
|
|
10
|
+
global.__DEVELOPMENT__ = false;
|
|
11
|
+
global.__SERVER__ = false;
|
|
12
|
+
global.__TEST__ = true;
|
|
13
|
+
|
|
14
|
+
window.matchMedia =
|
|
15
|
+
window.matchMedia ||
|
|
16
|
+
function (query) {
|
|
17
|
+
return {
|
|
18
|
+
matches: query === '(min-width: 1024px)',
|
|
19
|
+
addListener: function () {},
|
|
20
|
+
removeListener: function () {},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
vi.stubGlobal(
|
|
25
|
+
'fetch',
|
|
26
|
+
vi.fn(() =>
|
|
27
|
+
Promise.resolve({
|
|
28
|
+
json: () => Promise.resolve({}),
|
|
29
|
+
text: () => Promise.resolve(''),
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
vi.stubGlobal('localStorage', {
|
|
35
|
+
getItem: vi.fn(),
|
|
36
|
+
setItem: vi.fn(),
|
|
37
|
+
removeItem: vi.fn(),
|
|
38
|
+
clear: vi.fn(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
vi.stubGlobal('sessionStorage', {
|
|
42
|
+
getItem: vi.fn(),
|
|
43
|
+
setItem: vi.fn(),
|
|
44
|
+
removeItem: vi.fn(),
|
|
45
|
+
clear: vi.fn(),
|
|
46
|
+
});
|
package/test-setup-globals.js
CHANGED
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
2
|
-
import { expect, describe, it, vi } from 'vitest';
|
|
3
|
-
|
|
4
|
-
global.describe = describe;
|
|
5
|
-
global.it = it;
|
|
6
|
-
global.expect = expect;
|
|
7
|
-
global.vi = vi;
|
|
8
|
-
|
|
9
1
|
global.__CLIENT__ = true;
|
|
10
2
|
global.__DEVELOPMENT__ = false;
|
|
11
|
-
global.__SERVER__ = false;
|
|
12
|
-
global.__TEST__ = true;
|
|
13
3
|
|
|
14
4
|
window.matchMedia =
|
|
15
5
|
window.matchMedia ||
|
|
16
|
-
function (
|
|
6
|
+
function () {
|
|
17
7
|
return {
|
|
18
|
-
matches:
|
|
8
|
+
matches: false,
|
|
19
9
|
addListener: function () {},
|
|
20
10
|
removeListener: function () {},
|
|
21
11
|
};
|
|
22
12
|
};
|
|
23
|
-
|
|
24
|
-
vi.stubGlobal(
|
|
25
|
-
'fetch',
|
|
26
|
-
vi.fn(() =>
|
|
27
|
-
Promise.resolve({
|
|
28
|
-
json: () => Promise.resolve({}),
|
|
29
|
-
text: () => Promise.resolve(''),
|
|
30
|
-
}),
|
|
31
|
-
),
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
vi.stubGlobal('localStorage', {
|
|
35
|
-
getItem: vi.fn(),
|
|
36
|
-
setItem: vi.fn(),
|
|
37
|
-
removeItem: vi.fn(),
|
|
38
|
-
clear: vi.fn(),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
vi.stubGlobal('sessionStorage', {
|
|
42
|
-
getItem: vi.fn(),
|
|
43
|
-
setItem: vi.fn(),
|
|
44
|
-
removeItem: vi.fn(),
|
|
45
|
-
clear: vi.fn(),
|
|
46
|
-
});
|
package/vitest.config.ts
CHANGED