@plone/volto 18.0.0-alpha.14 → 18.0.0-alpha.15
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 +6 -0
- package/jest-setup-afterenv.js +2 -0
- package/package.json +24 -20
- package/src/components/manage/Add/Add.jsx +9 -11
- package/src/components/manage/Add/Add.test.jsx +11 -13
- package/src/components/manage/Aliases/Aliases.jsx +6 -6
- package/src/components/manage/Aliases/Aliases.test.jsx +7 -7
- package/src/components/manage/BlockChooser/BlockChooser.test.jsx +0 -1
- package/src/components/manage/BlockChooser/BlockChooserButton.jsx +6 -6
- package/src/components/manage/BlockChooser/BlockChooserSearch.test.jsx +0 -1
- package/src/components/manage/Blocks/Block/Settings.test.jsx +0 -1
- package/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +20 -19
- package/src/components/manage/Blocks/Image/View.test.jsx +0 -1
- package/src/components/manage/Blocks/Table/Edit.jsx +7 -6
- package/src/components/manage/Contents/Contents.jsx +6 -6
- package/src/components/manage/Contents/Contents.test.jsx +7 -7
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +4 -4
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Aliases.jsx +6 -6
- package/src/components/manage/Controlpanels/Aliases.test.jsx +6 -7
- package/src/components/manage/Controlpanels/ContentType.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentType.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ContentTypeLayout.jsx +93 -85
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentTypes.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Controlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Controlpanels.jsx +6 -6
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -10
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +6 -6
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ModerateComments.jsx +6 -6
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +13 -7
- package/src/components/manage/Controlpanels/Rules/AddRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/EditRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/Rules.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/components/{VariableModal.test.jsx → VariableModal.test.jsx.removed} +6 -7
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +14 -8
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +7 -7
- package/src/components/manage/Delete/Delete.jsx +6 -6
- package/src/components/manage/Delete/Delete.test.jsx +10 -10
- package/src/components/manage/Diff/Diff.jsx +6 -6
- package/src/components/manage/Diff/Diff.test.jsx +2 -3
- package/src/components/manage/Edit/Edit.jsx +10 -11
- package/src/components/manage/Edit/Edit.test.jsx +14 -10
- package/src/components/manage/Form/BlockDataForm.test.jsx +0 -1
- package/src/components/manage/Form/Form.jsx +16 -8
- package/src/components/manage/Form/ModalForm.test.jsx +0 -1
- package/src/components/manage/History/History.jsx +6 -6
- package/src/components/manage/History/History.test.jsx +14 -13
- package/src/components/manage/LinksToItem/LinksToItem.jsx +78 -49
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -7
- package/src/components/manage/Multilingual/ManageTranslations.jsx +13 -7
- package/src/components/manage/Multilingual/ManageTranslations.test.jsx +6 -7
- package/src/components/manage/Preferences/ChangePassword.jsx +6 -6
- package/src/components/manage/Preferences/ChangePassword.test.jsx +6 -7
- package/src/components/manage/Preferences/PersonalInformation.test.jsx +1 -3
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +1 -3
- package/src/components/manage/Rules/Rules.jsx +6 -6
- package/src/components/manage/Rules/Rules.test.jsx +7 -7
- package/src/components/manage/Sharing/Sharing.jsx +6 -6
- package/src/components/manage/Sharing/Sharing.test.jsx +7 -7
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +1 -1
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/SidebarPopup.jsx +28 -21
- package/src/components/manage/Sidebar/SidebarPortal.jsx +7 -6
- package/src/components/manage/Widgets/FileWidget.jsx +1 -1
- package/src/components/manage/Widgets/ObjectBrowserWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/ObjectListWidget.test.js +0 -1
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +0 -1
- package/src/components/manage/Widgets/SchemaWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +5 -5
- package/src/components/manage/Widgets/UrlWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +4 -4
- package/src/components/theme/Comments/Comments.jsx +7 -8
- package/src/components/theme/Component/Component.test.jsx +0 -1
- package/src/components/theme/ContactForm/ContactForm.jsx +6 -6
- package/src/components/theme/ContactForm/ContactForm.test.jsx +12 -10
- package/src/components/theme/Footer/Footer.test.jsx +0 -1
- package/src/components/theme/Logout/Logout.test.jsx +8 -5
- package/src/components/theme/Search/Search.jsx +6 -6
- package/src/components/theme/Search/Search.test.jsx +13 -10
- package/src/components/theme/SlotRenderer/SlotRenderer.test.jsx +0 -1
- package/src/components/theme/View/View.jsx +6 -6
- package/src/components/theme/View/View.test.jsx +25 -18
- package/src/helpers/AsyncConnect/AsyncConnect.test.js +0 -2
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +8 -8
- package/src/start-client.jsx +3 -3
- package/types/components/manage/Add/Add.d.ts +1 -4
- package/types/components/manage/Aliases/Aliases.d.ts +1 -4
- package/types/components/manage/Blocks/Block/Edit.d.ts +1 -3
- package/types/components/manage/Blocks/HeroImageLeft/Edit.d.ts +1 -4
- package/types/components/manage/Blocks/Image/Edit.d.ts +1 -4
- package/types/components/manage/Contents/Contents.d.ts +2 -7
- package/types/components/manage/Contents/ContentsUploadModal.d.ts +1 -4
- package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/Aliases.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentType.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypeLayout.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypeSchema.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypes.d.ts +1 -4
- package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +1 -4
- package/types/components/manage/Controlpanels/Groups/GroupsControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/ModerateComments.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/AddRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/ConfigureRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/EditRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/Rules.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/components/VariableModal.d.ts +1 -4
- package/types/components/manage/Controlpanels/UndoControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/UpgradeControlPanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/Users/RenderUsers.d.ts +1 -4
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +1 -4
- package/types/components/manage/Display/Display.d.ts +1 -4
- package/types/components/manage/Edit/Edit.d.ts +2 -7
- package/types/components/manage/Form/BlocksToolbar.d.ts +1 -3
- package/types/components/manage/History/History.d.ts +1 -4
- package/types/components/manage/Preferences/PersonalPreferences.d.ts +1 -4
- package/types/components/manage/Rules/Rules.d.ts +1 -4
- package/types/components/manage/Sidebar/ObjectBrowserBody.d.ts +1 -4
- package/types/components/manage/Toolbar/Toolbar.d.ts +1 -4
- package/types/components/manage/Widgets/ArrayWidget.d.ts +1 -3
- package/types/components/manage/Widgets/IdWidget.d.ts +1 -4
- package/types/components/manage/Widgets/QueryWidget.d.ts +1 -3
- package/types/components/manage/Widgets/ReferenceWidget.d.ts +1 -4
- package/types/components/manage/Widgets/SchemaWidget.d.ts +1 -4
- package/types/components/manage/Widgets/SelectAutoComplete.d.ts +1 -3
- package/types/components/manage/Widgets/TokenWidget.d.ts +1 -4
- package/types/components/manage/Widgets/WysiwygWidget.d.ts +1 -4
- package/types/components/theme/Search/Search.d.ts +2 -7
- package/types/components/theme/Sitemap/Sitemap.d.ts +2 -6
- package/types/components/theme/View/View.d.ts +1 -4
- package/types/config/Widgets.d.ts +1 -3
- package/src/components/manage/Multilingual/CreateTranslation.test.jsx +0 -46
- package/src/helpers/Utils/usePagination.test.js +0 -115
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,12 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 18.0.0-alpha.15 (2024-03-01)
|
|
21
|
+
|
|
22
|
+
### Breaking
|
|
23
|
+
|
|
24
|
+
- Upgrade Volto core to use React 18.2.0 @sneridagh [#3221](https://github.com/plone/volto/issues/3221)
|
|
25
|
+
|
|
20
26
|
## 18.0.0-alpha.14 (2024-03-01)
|
|
21
27
|
|
|
22
28
|
### Breaking
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "18.0.0-alpha.
|
|
12
|
+
"version": "18.0.0-alpha.15",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
"./test-setup-config.js"
|
|
81
81
|
],
|
|
82
82
|
"globalSetup": "./global-test-setup.js",
|
|
83
|
+
"setupFilesAfterEnv": [
|
|
84
|
+
"<rootDir>/jest-setup-afterenv.js"
|
|
85
|
+
],
|
|
83
86
|
"globals": {
|
|
84
87
|
"__DEV__": true
|
|
85
88
|
},
|
|
@@ -243,7 +246,7 @@
|
|
|
243
246
|
"razzle-dev-utils": "4.2.18",
|
|
244
247
|
"razzle-plugin-scss": "4.2.18",
|
|
245
248
|
"rc-time-picker": "3.7.3",
|
|
246
|
-
"react": "
|
|
249
|
+
"react": "18.2.0",
|
|
247
250
|
"react-anchor-link-smooth-scroll": "1.0.12",
|
|
248
251
|
"react-animate-height": "2.0.17",
|
|
249
252
|
"react-beautiful-dnd": "13.0.0",
|
|
@@ -252,17 +255,16 @@
|
|
|
252
255
|
"react-detect-click-outside": "1.1.1",
|
|
253
256
|
"react-dnd": "5.0.0",
|
|
254
257
|
"react-dnd-html5-backend": "5.0.1",
|
|
255
|
-
"react-dom": "
|
|
258
|
+
"react-dom": "18.2.0",
|
|
256
259
|
"react-dropzone": "11.1.0",
|
|
257
260
|
"react-fast-compare": "2.0.4",
|
|
258
261
|
"react-image-gallery": "1.2.7",
|
|
259
262
|
"react-intersection-observer": "9.1.0",
|
|
260
263
|
"react-intl": "3.8.0",
|
|
261
|
-
"react-intl-redux": "2.
|
|
264
|
+
"react-intl-redux": "2.3.0",
|
|
262
265
|
"react-medium-image-zoom": "3.0.15",
|
|
263
266
|
"react-popper": "^2.3.0",
|
|
264
|
-
"react-
|
|
265
|
-
"react-redux": "7.2.4",
|
|
267
|
+
"react-redux": "8.1.2",
|
|
266
268
|
"react-router": "5.2.0",
|
|
267
269
|
"react-router-config": "5.1.1",
|
|
268
270
|
"react-router-dom": "5.2.0",
|
|
@@ -270,21 +272,21 @@
|
|
|
270
272
|
"react-select": "4.3.1",
|
|
271
273
|
"react-select-async-paginate": "0.5.3",
|
|
272
274
|
"react-share": "2.3.1",
|
|
273
|
-
"react-side-effect": "2.1.
|
|
275
|
+
"react-side-effect": "2.1.2",
|
|
274
276
|
"react-simple-code-editor": "0.7.1",
|
|
275
277
|
"react-sortable-hoc": "2.0.0",
|
|
276
|
-
"react-test-renderer": "
|
|
278
|
+
"react-test-renderer": "18.2.0",
|
|
277
279
|
"react-toastify": "5.4.1",
|
|
278
280
|
"react-transition-group": "4.4.5",
|
|
279
281
|
"react-virtualized": "9.22.3",
|
|
280
282
|
"redraft": "0.10.2",
|
|
281
|
-
"redux": "4.1
|
|
282
|
-
"redux-actions": "
|
|
283
|
+
"redux": "4.2.1",
|
|
284
|
+
"redux-actions": "3.0.0",
|
|
283
285
|
"redux-connect": "10.0.0",
|
|
284
|
-
"redux-devtools-extension": "2.13.
|
|
285
|
-
"redux-localstorage-simple": "2.
|
|
286
|
+
"redux-devtools-extension": "2.13.9",
|
|
287
|
+
"redux-localstorage-simple": "2.5.1",
|
|
286
288
|
"redux-mock-store": "1.5.4",
|
|
287
|
-
"redux-thunk": "2.
|
|
289
|
+
"redux-thunk": "2.4.2",
|
|
288
290
|
"rrule": "2.7.1",
|
|
289
291
|
"semantic-ui-less": "2.4.1",
|
|
290
292
|
"semantic-ui-react": "2.1.5",
|
|
@@ -314,8 +316,8 @@
|
|
|
314
316
|
"webpack-node-externals": "3.0.0",
|
|
315
317
|
"xmlrpc": "1.3.2",
|
|
316
318
|
"yarnhook": "0.5.1",
|
|
317
|
-
"@plone/registry": "1.
|
|
318
|
-
"@plone/volto-slate": "18.0.0-alpha.
|
|
319
|
+
"@plone/registry": "1.5.0",
|
|
320
|
+
"@plone/volto-slate": "18.0.0-alpha.8",
|
|
319
321
|
"@plone/scripts": "3.3.2"
|
|
320
322
|
},
|
|
321
323
|
"devDependencies": {
|
|
@@ -330,13 +332,15 @@
|
|
|
330
332
|
"@storybook/manager-webpack5": "^6.5.15",
|
|
331
333
|
"@storybook/react": "^6.5.15",
|
|
332
334
|
"@testing-library/cypress": "9.0.0",
|
|
333
|
-
"@testing-library/jest-dom": "
|
|
334
|
-
"@testing-library/react": "
|
|
335
|
+
"@testing-library/jest-dom": "6.4.1",
|
|
336
|
+
"@testing-library/react": "14.2.0",
|
|
335
337
|
"@testing-library/react-hooks": "8.0.1",
|
|
336
338
|
"@types/jest": "^29.5.8",
|
|
337
339
|
"@types/lodash": "^4.14.201",
|
|
340
|
+
"@types/react": "^18",
|
|
341
|
+
"@types/react-dom": "^18",
|
|
338
342
|
"@types/react-router-dom": "^5.3.3",
|
|
339
|
-
"@types/react-test-renderer": "18.0.
|
|
343
|
+
"@types/react-test-renderer": "18.0.7",
|
|
340
344
|
"@types/uuid": "^9.0.2",
|
|
341
345
|
"@typescript-eslint/eslint-plugin": "6.7.0",
|
|
342
346
|
"@typescript-eslint/parser": "6.7.0",
|
|
@@ -353,7 +357,7 @@
|
|
|
353
357
|
"jsonwebtoken": "9.0.0",
|
|
354
358
|
"react-docgen-typescript-plugin": "^1.0.5",
|
|
355
359
|
"react-error-overlay": "6.0.9",
|
|
356
|
-
"react-is": "^
|
|
360
|
+
"react-is": "^18.2.0",
|
|
357
361
|
"release-it": "^16.2.1",
|
|
358
362
|
"semver": "^7.5.4",
|
|
359
363
|
"tmp": "0.2.1",
|
|
@@ -363,7 +367,7 @@
|
|
|
363
367
|
"use-trace-update": "1.3.2",
|
|
364
368
|
"wait-on": "6.0.0",
|
|
365
369
|
"why": "0.6.2",
|
|
366
|
-
"@plone/types": "1.0.0-alpha.
|
|
370
|
+
"@plone/types": "1.0.0-alpha.5",
|
|
367
371
|
"@plone/volto-coresandbox": "1.0.0"
|
|
368
372
|
},
|
|
369
373
|
"volta": {
|
|
@@ -11,7 +11,7 @@ import { compose } from 'redux';
|
|
|
11
11
|
import { keys, isEmpty } from 'lodash';
|
|
12
12
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
13
13
|
import { Button, Grid, Menu } from 'semantic-ui-react';
|
|
14
|
-
import {
|
|
14
|
+
import { createPortal } from 'react-dom';
|
|
15
15
|
import { v4 as uuid } from 'uuid';
|
|
16
16
|
import qs from 'query-string';
|
|
17
17
|
import { toast } from 'react-toastify';
|
|
@@ -366,8 +366,8 @@ class Add extends Component {
|
|
|
366
366
|
}}
|
|
367
367
|
global
|
|
368
368
|
/>
|
|
369
|
-
{this.state.isClient &&
|
|
370
|
-
|
|
369
|
+
{this.state.isClient &&
|
|
370
|
+
createPortal(
|
|
371
371
|
<Toolbar
|
|
372
372
|
pathname={this.props.pathname}
|
|
373
373
|
hideDefaultViewButtons
|
|
@@ -400,14 +400,12 @@ class Add extends Component {
|
|
|
400
400
|
</Button>
|
|
401
401
|
</>
|
|
402
402
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
{visual &&
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
</Portal>
|
|
410
|
-
)}
|
|
403
|
+
/>,
|
|
404
|
+
document.getElementById('toolbar'),
|
|
405
|
+
)}
|
|
406
|
+
{visual &&
|
|
407
|
+
this.state.isClient &&
|
|
408
|
+
createPortal(<Sidebar />, document.getElementById('sidebar'))}
|
|
411
409
|
</div>
|
|
412
410
|
);
|
|
413
411
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import config from '@plone/volto/registry';
|
|
@@ -16,9 +16,8 @@ beforeAll(() => {
|
|
|
16
16
|
config.settings.loadables = {};
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
jest.mock('
|
|
20
|
-
|
|
21
|
-
}));
|
|
19
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
20
|
+
|
|
22
21
|
jest.mock('../Form/Form', () => jest.fn(() => <div className="Form" />));
|
|
23
22
|
|
|
24
23
|
describe('Add', () => {
|
|
@@ -39,13 +38,12 @@ describe('Add', () => {
|
|
|
39
38
|
messages: {},
|
|
40
39
|
},
|
|
41
40
|
});
|
|
42
|
-
const
|
|
41
|
+
const { container } = render(
|
|
43
42
|
<Provider store={store}>
|
|
44
43
|
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
45
44
|
</Provider>,
|
|
46
45
|
);
|
|
47
|
-
|
|
48
|
-
expect(json).toMatchSnapshot();
|
|
46
|
+
expect(container).toMatchSnapshot();
|
|
49
47
|
});
|
|
50
48
|
|
|
51
49
|
it('renders an add component', () => {
|
|
@@ -67,13 +65,13 @@ describe('Add', () => {
|
|
|
67
65
|
messages: {},
|
|
68
66
|
},
|
|
69
67
|
});
|
|
70
|
-
const
|
|
68
|
+
const { container } = render(
|
|
71
69
|
<Provider store={store}>
|
|
72
70
|
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
73
71
|
</Provider>,
|
|
74
72
|
);
|
|
75
|
-
|
|
76
|
-
expect(
|
|
73
|
+
|
|
74
|
+
expect(container).toMatchSnapshot();
|
|
77
75
|
});
|
|
78
76
|
|
|
79
77
|
it('renders an add component with schema', () => {
|
|
@@ -106,12 +104,12 @@ describe('Add', () => {
|
|
|
106
104
|
messages: {},
|
|
107
105
|
},
|
|
108
106
|
});
|
|
109
|
-
const
|
|
107
|
+
const { container } = render(
|
|
110
108
|
<Provider store={store}>
|
|
111
109
|
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
112
110
|
</Provider>,
|
|
113
111
|
);
|
|
114
|
-
|
|
115
|
-
expect(
|
|
112
|
+
|
|
113
|
+
expect(container).toMatchSnapshot();
|
|
116
114
|
});
|
|
117
115
|
});
|
|
@@ -8,7 +8,7 @@ import { Helmet } from '@plone/volto/helpers';
|
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
|
-
import {
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
12
|
import {
|
|
13
13
|
Button,
|
|
14
14
|
Checkbox,
|
|
@@ -317,8 +317,8 @@ class Aliases extends Component {
|
|
|
317
317
|
</Segment>
|
|
318
318
|
</Form>
|
|
319
319
|
</Segment.Group>
|
|
320
|
-
{this.state.isClient &&
|
|
321
|
-
|
|
320
|
+
{this.state.isClient &&
|
|
321
|
+
createPortal(
|
|
322
322
|
<Toolbar
|
|
323
323
|
pathname={this.props.pathname}
|
|
324
324
|
hideDefaultViewButtons
|
|
@@ -335,9 +335,9 @@ class Aliases extends Component {
|
|
|
335
335
|
/>
|
|
336
336
|
</Link>
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
/>,
|
|
339
|
+
document.getElementById('toolbar'),
|
|
340
|
+
)}
|
|
341
341
|
</Container>
|
|
342
342
|
);
|
|
343
343
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import configureMockStore from 'redux-mock-store';
|
|
5
5
|
import thunk from 'redux-thunk';
|
|
@@ -9,9 +9,8 @@ import Aliases from './Aliases';
|
|
|
9
9
|
const middlewares = [thunk];
|
|
10
10
|
const mockStore = configureMockStore(middlewares);
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
13
|
+
|
|
15
14
|
jest.mock('../Toolbar/More', () => jest.fn(() => <div className="More" />));
|
|
16
15
|
|
|
17
16
|
describe('Aliases', () => {
|
|
@@ -45,12 +44,13 @@ describe('Aliases', () => {
|
|
|
45
44
|
messages: {},
|
|
46
45
|
},
|
|
47
46
|
});
|
|
48
|
-
const
|
|
47
|
+
const { container } = render(
|
|
49
48
|
<Provider store={store}>
|
|
50
49
|
<Aliases location={{ pathname: '/blog/aliases' }} />
|
|
50
|
+
<div id="toolbar"></div>
|
|
51
51
|
</Provider>,
|
|
52
52
|
);
|
|
53
|
-
|
|
54
|
-
expect(
|
|
53
|
+
|
|
54
|
+
expect(container).toMatchSnapshot();
|
|
55
55
|
});
|
|
56
56
|
});
|
|
@@ -7,7 +7,7 @@ import config from '@plone/volto/registry';
|
|
|
7
7
|
import { Button, Ref } from 'semantic-ui-react';
|
|
8
8
|
import { defineMessages, useIntl } from 'react-intl';
|
|
9
9
|
import { usePopper } from 'react-popper';
|
|
10
|
-
import {
|
|
10
|
+
import { createPortal } from 'react-dom';
|
|
11
11
|
|
|
12
12
|
const messages = defineMessages({
|
|
13
13
|
addBlock: {
|
|
@@ -115,8 +115,8 @@ const BlockChooserButton = (props) => {
|
|
|
115
115
|
/>
|
|
116
116
|
</Ref>
|
|
117
117
|
)}
|
|
118
|
-
{addNewBlockOpened &&
|
|
119
|
-
|
|
118
|
+
{addNewBlockOpened &&
|
|
119
|
+
createPortal(
|
|
120
120
|
<div
|
|
121
121
|
ref={setPopperElement}
|
|
122
122
|
style={styles.popper}
|
|
@@ -148,9 +148,9 @@ const BlockChooserButton = (props) => {
|
|
|
148
148
|
navRoot={navRoot}
|
|
149
149
|
contentType={contentType}
|
|
150
150
|
/>
|
|
151
|
-
</div
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
</div>,
|
|
152
|
+
document.body,
|
|
153
|
+
)}
|
|
154
154
|
</>
|
|
155
155
|
);
|
|
156
156
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Settings from './Settings';
|
|
3
3
|
import { render } from '@testing-library/react';
|
|
4
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
5
4
|
import configureStore from 'redux-mock-store';
|
|
6
5
|
import config from '@plone/volto/registry';
|
|
7
6
|
import { Provider } from 'react-intl-redux';
|
|
@@ -5,7 +5,7 @@ import { BlockChooser, Icon } from '@plone/volto/components';
|
|
|
5
5
|
import { useDetectClickOutside } from '@plone/volto/helpers';
|
|
6
6
|
import addSVG from '@plone/volto/icons/add.svg';
|
|
7
7
|
import { usePopper } from 'react-popper';
|
|
8
|
-
import {
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
9
|
|
|
10
10
|
const messages = defineMessages({
|
|
11
11
|
addBlock: {
|
|
@@ -59,24 +59,25 @@ const NewBlockAddButton = (props) => {
|
|
|
59
59
|
<Icon name={addSVG} className="circled" size="24px" />
|
|
60
60
|
</Button>
|
|
61
61
|
</Ref>
|
|
62
|
-
{isOpenMenu
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
{isOpenMenu
|
|
63
|
+
? createPortal(
|
|
64
|
+
<div
|
|
65
|
+
ref={setPopperElement}
|
|
66
|
+
style={styles.popper}
|
|
67
|
+
{...attributes.popper}
|
|
68
|
+
className="container-chooser-wrapper"
|
|
69
|
+
>
|
|
70
|
+
<BlockChooser
|
|
71
|
+
onMutateBlock={onMutateBlock}
|
|
72
|
+
currentBlock={block}
|
|
73
|
+
showRestricted
|
|
74
|
+
blocksConfig={blocksConfig}
|
|
75
|
+
ref={blockChooserRef}
|
|
76
|
+
/>
|
|
77
|
+
</div>,
|
|
78
|
+
document.body,
|
|
79
|
+
)
|
|
80
|
+
: null}
|
|
80
81
|
</>
|
|
81
82
|
);
|
|
82
83
|
};
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { compose } from 'redux';
|
|
9
9
|
import { map, remove } from 'lodash';
|
|
10
10
|
import { Button, Segment, Table, Form } from 'semantic-ui-react';
|
|
11
|
-
import {
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
12
|
import cx from 'classnames';
|
|
13
13
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
|
14
14
|
|
|
@@ -670,8 +670,9 @@ class Edit extends Component {
|
|
|
670
670
|
</Table.Body>
|
|
671
671
|
</Table>
|
|
672
672
|
)}
|
|
673
|
-
{this.props.selected &&
|
|
674
|
-
|
|
673
|
+
{this.props.selected &&
|
|
674
|
+
this.state.isClient &&
|
|
675
|
+
createPortal(
|
|
675
676
|
<Form
|
|
676
677
|
method="post"
|
|
677
678
|
onSubmit={(event) => {
|
|
@@ -736,9 +737,9 @@ class Edit extends Component {
|
|
|
736
737
|
onChange={this.toggleCellType}
|
|
737
738
|
/>
|
|
738
739
|
</Segment>
|
|
739
|
-
</Form
|
|
740
|
-
|
|
741
|
-
|
|
740
|
+
</Form>,
|
|
741
|
+
document.getElementById('sidebar-properties'),
|
|
742
|
+
)}
|
|
742
743
|
</div>
|
|
743
744
|
);
|
|
744
745
|
}
|
|
@@ -7,7 +7,7 @@ import React, { Component } from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
|
-
import {
|
|
10
|
+
import { createPortal } from 'react-dom';
|
|
11
11
|
import { Link } from 'react-router-dom';
|
|
12
12
|
import {
|
|
13
13
|
Button,
|
|
@@ -2159,8 +2159,8 @@ class Contents extends Component {
|
|
|
2159
2159
|
</section>
|
|
2160
2160
|
</article>
|
|
2161
2161
|
</div>
|
|
2162
|
-
{this.state.isClient &&
|
|
2163
|
-
|
|
2162
|
+
{this.state.isClient &&
|
|
2163
|
+
createPortal(
|
|
2164
2164
|
<Toolbar
|
|
2165
2165
|
pathname={this.props.pathname}
|
|
2166
2166
|
inner={
|
|
@@ -2178,9 +2178,9 @@ class Contents extends Component {
|
|
|
2178
2178
|
/>
|
|
2179
2179
|
</Link>
|
|
2180
2180
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2181
|
+
/>,
|
|
2182
|
+
document.getElementById('toolbar'),
|
|
2183
|
+
)}
|
|
2184
2184
|
</Dimmer.Dimmable>
|
|
2185
2185
|
</Container>
|
|
2186
2186
|
) : (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import { MemoryRouter } from 'react-router-dom';
|
|
@@ -14,9 +14,8 @@ beforeAll(
|
|
|
14
14
|
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
jest.mock('
|
|
18
|
-
|
|
19
|
-
}));
|
|
17
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
18
|
+
|
|
20
19
|
jest.mock('../../theme/Pagination/Pagination', () =>
|
|
21
20
|
jest.fn(() => <div className="Pagination" />),
|
|
22
21
|
);
|
|
@@ -91,14 +90,15 @@ describe('Contents', () => {
|
|
|
91
90
|
messages: {},
|
|
92
91
|
},
|
|
93
92
|
});
|
|
94
|
-
const
|
|
93
|
+
const { container } = render(
|
|
95
94
|
<Provider store={store}>
|
|
96
95
|
<MemoryRouter>
|
|
97
96
|
<Contents location={{ pathname: '/blog' }} />
|
|
97
|
+
<div id="toolbar"></div>
|
|
98
98
|
</MemoryRouter>
|
|
99
99
|
</Provider>,
|
|
100
100
|
);
|
|
101
|
-
|
|
102
|
-
expect(
|
|
101
|
+
|
|
102
|
+
expect(container).toMatchSnapshot();
|
|
103
103
|
});
|
|
104
104
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ describe('ContentsPropertiesModal', () => {
|
|
|
23
23
|
messages: {},
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
const
|
|
26
|
+
const { container } = render(
|
|
27
27
|
<Provider store={store}>
|
|
28
28
|
<ContentsPropertiesModal
|
|
29
29
|
open
|
|
@@ -33,7 +33,7 @@ describe('ContentsPropertiesModal', () => {
|
|
|
33
33
|
/>
|
|
34
34
|
</Provider>,
|
|
35
35
|
);
|
|
36
|
-
|
|
37
|
-
expect(
|
|
36
|
+
|
|
37
|
+
expect(container).toMatchSnapshot();
|
|
38
38
|
});
|
|
39
39
|
});
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { connect } from 'react-redux';
|
|
8
8
|
import { compose } from 'redux';
|
|
9
9
|
import { Link } from 'react-router-dom';
|
|
10
|
-
import {
|
|
10
|
+
import { createPortal } from 'react-dom';
|
|
11
11
|
import {
|
|
12
12
|
Accordion,
|
|
13
13
|
Button,
|
|
@@ -550,8 +550,8 @@ class AddonsControlpanel extends Component {
|
|
|
550
550
|
)}
|
|
551
551
|
</Segment.Group>
|
|
552
552
|
|
|
553
|
-
{this.state.isClient &&
|
|
554
|
-
|
|
553
|
+
{this.state.isClient &&
|
|
554
|
+
createPortal(
|
|
555
555
|
<Toolbar
|
|
556
556
|
pathname={this.props.pathname}
|
|
557
557
|
hideDefaultViewButtons
|
|
@@ -568,9 +568,9 @@ class AddonsControlpanel extends Component {
|
|
|
568
568
|
</Link>
|
|
569
569
|
</>
|
|
570
570
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
571
|
+
/>,
|
|
572
|
+
document.getElementById('toolbar'),
|
|
573
|
+
)}
|
|
574
574
|
</Container>
|
|
575
575
|
);
|
|
576
576
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
|
|
@@ -7,9 +7,7 @@ import AddonsControlpanel from './AddonsControlpanel';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
jest.mock('
|
|
11
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
12
|
-
}));
|
|
10
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
13
11
|
|
|
14
12
|
describe('AddonsControlpanel', () => {
|
|
15
13
|
it('renders an addon control component', () => {
|
|
@@ -57,12 +55,13 @@ describe('AddonsControlpanel', () => {
|
|
|
57
55
|
messages: {},
|
|
58
56
|
},
|
|
59
57
|
});
|
|
60
|
-
const
|
|
58
|
+
const { container } = render(
|
|
61
59
|
<Provider store={store}>
|
|
62
60
|
<AddonsControlpanel location={{ pathname: '/blog' }} />
|
|
61
|
+
<div id="toolbar"></div>
|
|
63
62
|
</Provider>,
|
|
64
63
|
);
|
|
65
|
-
|
|
66
|
-
expect(
|
|
64
|
+
|
|
65
|
+
expect(container).toMatchSnapshot();
|
|
67
66
|
});
|
|
68
67
|
});
|