@plone/volto 18.0.0-alpha.14 → 18.0.0-alpha.16
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 +17 -0
- package/jest-setup-afterenv.js +2 -0
- package/package.json +32 -29
- package/src/components/index.js +9 -8
- 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/Edit.jsx +12 -12
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +3 -3
- package/src/components/manage/Blocks/Image/View.jsx +14 -14
- package/src/components/manage/Blocks/Image/View.test.jsx +0 -1
- package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +6 -6
- package/src/components/manage/Blocks/Search/SelectStyling.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/CheckboxFacet.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/Facets.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/SelectStyling.jsx +4 -4
- package/src/components/manage/Blocks/Table/Edit.jsx +7 -6
- package/src/components/manage/Contents/Contents.jsx +9 -9
- 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 +10 -10
- 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 +8 -8
- 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/Display/Display.jsx +2 -2
- 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/ObjectBrowserBody.jsx +10 -10
- 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/ArrayWidget.jsx +21 -21
- package/src/components/manage/Widgets/FileWidget.jsx +3 -3
- 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/RecurrenceWidget/RecurrenceWidget.jsx +2 -2
- package/src/components/manage/Widgets/ReferenceWidget.jsx +2 -2
- 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/SelectAutoComplete.jsx +6 -6
- package/src/components/manage/Widgets/SelectStyling.jsx +4 -4
- package/src/components/manage/Widgets/SelectUtils.js +2 -2
- package/src/components/manage/Widgets/UrlWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +4 -4
- package/src/components/manage/Workflow/Workflow.jsx +2 -2
- 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/components/theme/Widgets/BooleanWidget.jsx +2 -2
- package/src/config/Loadables.jsx +10 -10
- package/src/config/Views.jsx +2 -2
- package/src/config/Widgets.jsx +7 -6
- package/src/helpers/AsyncConnect/AsyncConnect.test.js +0 -2
- package/src/helpers/Blocks/Blocks.js +20 -20
- package/src/helpers/Html/Html.jsx +2 -2
- package/src/helpers/Utils/Date.js +6 -6
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +8 -8
- package/src/helpers/Utils/Utils.js +2 -2
- package/src/start-client.jsx +3 -3
- package/src/store.js +1 -1
- 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
|
@@ -12,7 +12,7 @@ import saveSVG from '@plone/volto/icons/save.svg';
|
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import React, { Component } from 'react';
|
|
14
14
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
15
|
-
import {
|
|
15
|
+
import { createPortal } from 'react-dom';
|
|
16
16
|
import { connect } from 'react-redux';
|
|
17
17
|
import { toast } from 'react-toastify';
|
|
18
18
|
import { compose } from 'redux';
|
|
@@ -283,8 +283,8 @@ class ContentTypeSchema extends Component {
|
|
|
283
283
|
onCancel={this.onCancel}
|
|
284
284
|
hideActions
|
|
285
285
|
/>
|
|
286
|
-
{this.state.isClient &&
|
|
287
|
-
|
|
286
|
+
{this.state.isClient &&
|
|
287
|
+
createPortal(
|
|
288
288
|
<Toolbar
|
|
289
289
|
pathname={this.props.pathname}
|
|
290
290
|
hideDefaultViewButtons
|
|
@@ -321,9 +321,9 @@ class ContentTypeSchema extends Component {
|
|
|
321
321
|
</Button>
|
|
322
322
|
</>
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
/>,
|
|
325
|
+
document.getElementById('toolbar'),
|
|
326
|
+
)}
|
|
327
327
|
</div>
|
|
328
328
|
);
|
|
329
329
|
}
|
|
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { getParentUrl } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import { last } from 'lodash';
|
|
14
14
|
import { Confirm, Container, Table, Button, Header } from 'semantic-ui-react';
|
|
15
15
|
import { toast } from 'react-toastify';
|
|
@@ -457,8 +457,8 @@ class ContentTypes extends Component {
|
|
|
457
457
|
</section>
|
|
458
458
|
</article>
|
|
459
459
|
</Container>
|
|
460
|
-
{this.state.isClient &&
|
|
461
|
-
|
|
460
|
+
{this.state.isClient &&
|
|
461
|
+
createPortal(
|
|
462
462
|
<Toolbar
|
|
463
463
|
pathname={this.props.pathname}
|
|
464
464
|
hideDefaultViewButtons
|
|
@@ -490,9 +490,9 @@ class ContentTypes extends Component {
|
|
|
490
490
|
</Button>
|
|
491
491
|
</>
|
|
492
492
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
/>,
|
|
494
|
+
document.getElementById('toolbar'),
|
|
495
|
+
)}
|
|
496
496
|
</Container>
|
|
497
497
|
);
|
|
498
498
|
}
|
|
@@ -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, Route } from 'react-router-dom';
|
|
@@ -8,9 +8,8 @@ import ContentTypes from './ContentTypes';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock('
|
|
12
|
-
|
|
13
|
-
}));
|
|
11
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
12
|
+
|
|
14
13
|
jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
|
|
15
14
|
|
|
16
15
|
describe('ContentTypes', () => {
|
|
@@ -60,14 +59,15 @@ describe('ContentTypes', () => {
|
|
|
60
59
|
messages: {},
|
|
61
60
|
},
|
|
62
61
|
});
|
|
63
|
-
const
|
|
62
|
+
const { container } = render(
|
|
64
63
|
<Provider store={store}>
|
|
65
64
|
<MemoryRouter initialEntries={['/controlpanel/dexterity-types']}>
|
|
66
65
|
<Route path={'/controlpanel/:id'} component={ContentTypes} />
|
|
66
|
+
<div id="toolbar"></div>
|
|
67
67
|
</MemoryRouter>
|
|
68
68
|
</Provider>,
|
|
69
69
|
);
|
|
70
|
-
|
|
71
|
-
expect(
|
|
70
|
+
|
|
71
|
+
expect(container).toMatchSnapshot();
|
|
72
72
|
});
|
|
73
73
|
});
|
|
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { withRouter } from 'react-router-dom';
|
|
11
11
|
import { Helmet } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import { Button, Container } from 'semantic-ui-react';
|
|
14
14
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
15
15
|
import { toast } from 'react-toastify';
|
|
@@ -167,8 +167,8 @@ class Controlpanel extends Component {
|
|
|
167
167
|
loading={this.props.updateRequest.loading}
|
|
168
168
|
/>
|
|
169
169
|
</Container>
|
|
170
|
-
{this.state.isClient &&
|
|
171
|
-
|
|
170
|
+
{this.state.isClient &&
|
|
171
|
+
createPortal(
|
|
172
172
|
<Toolbar
|
|
173
173
|
pathname={this.props.pathname}
|
|
174
174
|
hideDefaultViewButtons
|
|
@@ -205,9 +205,9 @@ class Controlpanel extends Component {
|
|
|
205
205
|
</Button>
|
|
206
206
|
</>
|
|
207
207
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
/>,
|
|
209
|
+
document.getElementById('toolbar'),
|
|
210
|
+
)}
|
|
211
211
|
</div>
|
|
212
212
|
);
|
|
213
213
|
}
|
|
@@ -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, Route } from 'react-router-dom';
|
|
@@ -8,9 +8,8 @@ import Controlpanel from './Controlpanel';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock('
|
|
12
|
-
|
|
13
|
-
}));
|
|
11
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
12
|
+
|
|
14
13
|
jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
|
|
15
14
|
|
|
16
15
|
describe('Controlpanel', () => {
|
|
@@ -36,14 +35,15 @@ describe('Controlpanel', () => {
|
|
|
36
35
|
messages: {},
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
|
-
const
|
|
38
|
+
const { container } = render(
|
|
40
39
|
<Provider store={store}>
|
|
41
40
|
<MemoryRouter initialEntries={['/controlpanel/date-and-time']}>
|
|
42
41
|
<Route path={'/controlpanel/:id'} component={Controlpanel} />
|
|
42
|
+
<div id="toolbar"></div>
|
|
43
43
|
</MemoryRouter>
|
|
44
44
|
</Provider>,
|
|
45
45
|
);
|
|
46
|
-
|
|
47
|
-
expect(
|
|
46
|
+
|
|
47
|
+
expect(container).toMatchSnapshot();
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -8,7 +8,7 @@ import { concat, filter, last, map, sortBy, uniqBy } from 'lodash';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
10
|
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
11
|
-
import {
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
12
|
import { connect } from 'react-redux';
|
|
13
13
|
import { Link } from 'react-router-dom';
|
|
14
14
|
import { compose } from 'redux';
|
|
@@ -260,8 +260,8 @@ function Controlpanels({
|
|
|
260
260
|
</Segment>
|
|
261
261
|
</Segment.Group>
|
|
262
262
|
</Container>
|
|
263
|
-
{isClient &&
|
|
264
|
-
|
|
263
|
+
{isClient &&
|
|
264
|
+
createPortal(
|
|
265
265
|
<Toolbar
|
|
266
266
|
pathname={pathname}
|
|
267
267
|
hideDefaultViewButtons
|
|
@@ -275,9 +275,9 @@ function Controlpanels({
|
|
|
275
275
|
/>
|
|
276
276
|
</Link>
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
/>,
|
|
279
|
+
document.getElementById('toolbar'),
|
|
280
|
+
)}
|
|
281
281
|
</div>
|
|
282
282
|
);
|
|
283
283
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Provider } from 'react-intl-redux';
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
-
import
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
5
|
import configureStore from 'redux-mock-store';
|
|
6
6
|
|
|
7
7
|
import config from '@plone/volto/registry';
|
|
@@ -9,9 +9,7 @@ import Controlpanels from './Controlpanels';
|
|
|
9
9
|
|
|
10
10
|
const mockStore = configureStore();
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
15
13
|
|
|
16
14
|
jest.mock('./VersionOverview', () =>
|
|
17
15
|
jest.fn(() => <div className="VersionOverview" />),
|
|
@@ -73,15 +71,16 @@ describe('Controlpanels', () => {
|
|
|
73
71
|
messages: {},
|
|
74
72
|
},
|
|
75
73
|
});
|
|
76
|
-
const
|
|
74
|
+
const { container } = render(
|
|
77
75
|
<Provider store={store}>
|
|
78
76
|
<MemoryRouter>
|
|
79
77
|
<Controlpanels location={{ pathname: '/blog' }} />
|
|
78
|
+
<div id="toolbar"></div>
|
|
80
79
|
</MemoryRouter>
|
|
81
80
|
</Provider>,
|
|
82
81
|
);
|
|
83
|
-
|
|
84
|
-
expect(
|
|
82
|
+
|
|
83
|
+
expect(container).toMatchSnapshot();
|
|
85
84
|
});
|
|
86
85
|
|
|
87
86
|
it('renders an additional control panel', () => {
|
|
@@ -127,14 +126,15 @@ describe('Controlpanels', () => {
|
|
|
127
126
|
component: FooComponent,
|
|
128
127
|
},
|
|
129
128
|
];
|
|
130
|
-
const
|
|
129
|
+
const { container } = render(
|
|
131
130
|
<Provider store={store}>
|
|
132
131
|
<MemoryRouter>
|
|
133
132
|
<Controlpanels location={{ pathname: '/blog' }} />
|
|
133
|
+
<div id="toolbar"></div>
|
|
134
134
|
</MemoryRouter>
|
|
135
135
|
</Provider>,
|
|
136
136
|
);
|
|
137
|
-
|
|
138
|
-
expect(
|
|
137
|
+
|
|
138
|
+
expect(container).toMatchSnapshot();
|
|
139
139
|
});
|
|
140
140
|
});
|
|
@@ -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 { Container, Divider, Message, Segment, Table } from 'semantic-ui-react';
|
|
12
12
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
|
13
13
|
|
|
@@ -216,8 +216,8 @@ class DatabaseInformation extends Component {
|
|
|
216
216
|
</Segment>
|
|
217
217
|
</Segment.Group>
|
|
218
218
|
|
|
219
|
-
{this.state.isClient &&
|
|
220
|
-
|
|
219
|
+
{this.state.isClient &&
|
|
220
|
+
createPortal(
|
|
221
221
|
<Toolbar
|
|
222
222
|
pathname={this.props.pathname}
|
|
223
223
|
hideDefaultViewButtons
|
|
@@ -234,9 +234,9 @@ class DatabaseInformation extends Component {
|
|
|
234
234
|
</Link>
|
|
235
235
|
</>
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
/>,
|
|
238
|
+
document.getElementById('toolbar'),
|
|
239
|
+
)}
|
|
240
240
|
</Container>
|
|
241
241
|
) : null;
|
|
242
242
|
}
|
|
@@ -30,7 +30,7 @@ import { find, map, pull } from 'lodash';
|
|
|
30
30
|
import PropTypes from 'prop-types';
|
|
31
31
|
import React, { Component } from 'react';
|
|
32
32
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
33
|
-
import {
|
|
33
|
+
import { createPortal } from 'react-dom';
|
|
34
34
|
import { connect } from 'react-redux';
|
|
35
35
|
|
|
36
36
|
import { toast } from 'react-toastify';
|
|
@@ -258,16 +258,16 @@ class GroupsControlpanel extends Component {
|
|
|
258
258
|
entry.id === name && !entry.roles.includes(value)
|
|
259
259
|
? [...entry.roles, value]
|
|
260
260
|
: entry.id !== name
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
? entry.roles
|
|
262
|
+
: pull(entry.roles, value),
|
|
263
263
|
})),
|
|
264
264
|
authenticatedRole:
|
|
265
265
|
name === 'AuthenticatedUsers' &&
|
|
266
266
|
!prevState.authenticatedRole.includes(value)
|
|
267
267
|
? [...prevState.authenticatedRole, value]
|
|
268
268
|
: name !== 'AuthenticatedUsers'
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
? prevState.authenticatedRole
|
|
270
|
+
: pull(prevState.authenticatedRole, value),
|
|
271
271
|
}));
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
@@ -575,8 +575,8 @@ class GroupsControlpanel extends Component {
|
|
|
575
575
|
</div>
|
|
576
576
|
</Form>
|
|
577
577
|
</Segment.Group>
|
|
578
|
-
{this.state.isClient &&
|
|
579
|
-
|
|
578
|
+
{this.state.isClient &&
|
|
579
|
+
createPortal(
|
|
580
580
|
<Toolbar
|
|
581
581
|
pathname={this.props.pathname}
|
|
582
582
|
hideDefaultViewButtons
|
|
@@ -628,9 +628,9 @@ class GroupsControlpanel extends Component {
|
|
|
628
628
|
</Button>
|
|
629
629
|
</>
|
|
630
630
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
631
|
+
/>,
|
|
632
|
+
document.getElementById('toolbar'),
|
|
633
|
+
)}
|
|
634
634
|
</Container>
|
|
635
635
|
);
|
|
636
636
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
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
|
|
|
6
6
|
import GroupsControlpanel from './GroupsControlpanel';
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
|
-
jest.mock('
|
|
10
|
-
|
|
11
|
-
}));
|
|
9
|
+
jest.mock('../../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
10
|
+
|
|
12
11
|
describe('UsersControlpanel', () => {
|
|
13
12
|
it('renders a user control component', () => {
|
|
14
13
|
const store = mockStore({
|
|
@@ -25,12 +24,13 @@ describe('UsersControlpanel', () => {
|
|
|
25
24
|
messages: {},
|
|
26
25
|
},
|
|
27
26
|
});
|
|
28
|
-
const
|
|
27
|
+
const { container } = render(
|
|
29
28
|
<Provider store={store}>
|
|
30
29
|
<GroupsControlpanel location={{ pathname: '/blog' }} />
|
|
30
|
+
<div id="toolbar"></div>
|
|
31
31
|
</Provider>,
|
|
32
32
|
);
|
|
33
|
-
|
|
34
|
-
expect(
|
|
33
|
+
|
|
34
|
+
expect(container).toMatchSnapshot();
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { getParentUrl, Helmet } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import { Container, Button, Table } from 'semantic-ui-react';
|
|
14
14
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
|
15
15
|
|
|
@@ -267,8 +267,8 @@ class ModerateComments extends Component {
|
|
|
267
267
|
</section>
|
|
268
268
|
</article>
|
|
269
269
|
</Container>
|
|
270
|
-
{this.state.isClient &&
|
|
271
|
-
|
|
270
|
+
{this.state.isClient &&
|
|
271
|
+
createPortal(
|
|
272
272
|
<Toolbar
|
|
273
273
|
pathname={this.props.pathname}
|
|
274
274
|
hideDefaultViewButtons
|
|
@@ -282,9 +282,9 @@ class ModerateComments extends Component {
|
|
|
282
282
|
/>
|
|
283
283
|
</Link>
|
|
284
284
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
/>,
|
|
286
|
+
document.getElementById('toolbar'),
|
|
287
|
+
)}
|
|
288
288
|
</div>
|
|
289
289
|
);
|
|
290
290
|
}
|
|
@@ -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,8 @@ import ModerateComments from './ModerateComments';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
jest.mock('
|
|
11
|
-
|
|
12
|
-
}));
|
|
10
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
11
|
+
|
|
13
12
|
jest.mock('../../theme/Comments/CommentEditModal', () =>
|
|
14
13
|
jest.fn(() => <div id="modal" />),
|
|
15
14
|
);
|
|
@@ -31,12 +30,13 @@ describe('ModerateComments', () => {
|
|
|
31
30
|
messages: {},
|
|
32
31
|
},
|
|
33
32
|
});
|
|
34
|
-
const
|
|
33
|
+
const { container } = render(
|
|
35
34
|
<Provider store={store}>
|
|
36
35
|
<ModerateComments location={{ pathname: '/blog' }} />
|
|
36
|
+
<div id="toolbar"></div>
|
|
37
37
|
</Provider>,
|
|
38
38
|
);
|
|
39
|
-
|
|
40
|
-
expect(
|
|
39
|
+
|
|
40
|
+
expect(container).toMatchSnapshot();
|
|
41
41
|
});
|
|
42
42
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Relations Control Panel
|
|
3
3
|
*/
|
|
4
|
-
import React, { useEffect } from 'react';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { find } from 'lodash';
|
|
6
6
|
import { useSelector } from 'react-redux';
|
|
7
|
-
import {
|
|
7
|
+
import { createPortal } from 'react-dom';
|
|
8
8
|
import { useHistory } from 'react-router';
|
|
9
9
|
import { Link, useLocation } from 'react-router-dom';
|
|
10
10
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
@@ -23,6 +23,12 @@ const RelationsControlPanel = () => {
|
|
|
23
23
|
const location = useLocation();
|
|
24
24
|
const dispatch = useDispatch();
|
|
25
25
|
|
|
26
|
+
const [isClient, setIsClient] = useState(false);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setIsClient(true);
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
26
32
|
const brokenRelations = useSelector(
|
|
27
33
|
(state) => state.relations?.stats?.data?.broken,
|
|
28
34
|
);
|
|
@@ -88,8 +94,8 @@ const RelationsControlPanel = () => {
|
|
|
88
94
|
)}
|
|
89
95
|
</div>
|
|
90
96
|
|
|
91
|
-
{
|
|
92
|
-
|
|
97
|
+
{isClient &&
|
|
98
|
+
createPortal(
|
|
93
99
|
<Toolbar
|
|
94
100
|
pathname={location.pathname}
|
|
95
101
|
hideDefaultViewButtons
|
|
@@ -104,9 +110,9 @@ const RelationsControlPanel = () => {
|
|
|
104
110
|
<Icon name={backSVG} className="contents circled" size="30px" />
|
|
105
111
|
</Link>
|
|
106
112
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
/>,
|
|
114
|
+
document.getElementById('toolbar'),
|
|
115
|
+
)}
|
|
110
116
|
</>
|
|
111
117
|
);
|
|
112
118
|
};
|
|
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import {
|
|
14
14
|
Button,
|
|
15
15
|
Checkbox,
|
|
@@ -331,8 +331,8 @@ class AddRule extends Component {
|
|
|
331
331
|
</Segment.Group>
|
|
332
332
|
</article>
|
|
333
333
|
</Container>
|
|
334
|
-
{this.state.isClient &&
|
|
335
|
-
|
|
334
|
+
{this.state.isClient &&
|
|
335
|
+
createPortal(
|
|
336
336
|
<Toolbar
|
|
337
337
|
pathname={this.props.pathname}
|
|
338
338
|
hideDefaultViewButtons
|
|
@@ -346,9 +346,9 @@ class AddRule extends Component {
|
|
|
346
346
|
/>
|
|
347
347
|
</Link>
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
/>,
|
|
350
|
+
document.getElementById('toolbar'),
|
|
351
|
+
)}
|
|
352
352
|
</div>
|
|
353
353
|
);
|
|
354
354
|
}
|
|
@@ -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,7 @@ import AddRule from './AddRule';
|
|
|
9
9
|
const middlewares = [thunk];
|
|
10
10
|
const mockStore = configureMockStore(middlewares);
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../../Toolbar/Toolbar', () => jest.fn(() => <div id="Toolbar" />));
|
|
15
13
|
|
|
16
14
|
describe('AddRule', () => {
|
|
17
15
|
it('renders rules add interface', () => {
|
|
@@ -21,12 +19,13 @@ describe('AddRule', () => {
|
|
|
21
19
|
messages: {},
|
|
22
20
|
},
|
|
23
21
|
});
|
|
24
|
-
const
|
|
22
|
+
const { container } = render(
|
|
25
23
|
<Provider store={store}>
|
|
26
24
|
<AddRule location={{ pathname: '/controlpanel/rules/add' }} />
|
|
25
|
+
<div id="toolbar"></div>
|
|
27
26
|
</Provider>,
|
|
28
27
|
);
|
|
29
|
-
|
|
30
|
-
expect(
|
|
28
|
+
|
|
29
|
+
expect(container).toMatchSnapshot();
|
|
31
30
|
});
|
|
32
31
|
});
|
|
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import {
|
|
14
14
|
Button,
|
|
15
15
|
Card,
|
|
@@ -847,8 +847,8 @@ class ConfigureRule extends Component {
|
|
|
847
847
|
action="edit"
|
|
848
848
|
/>
|
|
849
849
|
)}
|
|
850
|
-
{this.state.isClient &&
|
|
851
|
-
|
|
850
|
+
{this.state.isClient &&
|
|
851
|
+
createPortal(
|
|
852
852
|
<Toolbar
|
|
853
853
|
pathname={this.props.pathname}
|
|
854
854
|
hideDefaultViewButtons
|
|
@@ -862,9 +862,9 @@ class ConfigureRule extends Component {
|
|
|
862
862
|
/>
|
|
863
863
|
</Link>
|
|
864
864
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
865
|
+
/>,
|
|
866
|
+
document.getElementById('toolbar'),
|
|
867
|
+
)}
|
|
868
868
|
</div>
|
|
869
869
|
);
|
|
870
870
|
}
|
|
@@ -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,7 @@ import ConfigureRule from './ConfigureRule';
|
|
|
9
9
|
const middlewares = [thunk];
|
|
10
10
|
const mockStore = configureMockStore(middlewares);
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
15
13
|
|
|
16
14
|
describe('ConfigureRule', () => {
|
|
17
15
|
it('renders rules configure interface', () => {
|
|
@@ -21,14 +19,15 @@ describe('ConfigureRule', () => {
|
|
|
21
19
|
messages: {},
|
|
22
20
|
},
|
|
23
21
|
});
|
|
24
|
-
const
|
|
22
|
+
const { container } = render(
|
|
25
23
|
<Provider store={store}>
|
|
26
24
|
<ConfigureRule
|
|
27
25
|
location={{ pathname: '/controlpanel/rules/:id/configure' }}
|
|
28
26
|
/>
|
|
27
|
+
<div id="toolbar"></div>
|
|
29
28
|
</Provider>,
|
|
30
29
|
);
|
|
31
|
-
|
|
32
|
-
expect(
|
|
30
|
+
|
|
31
|
+
expect(container).toMatchSnapshot();
|
|
33
32
|
});
|
|
34
33
|
});
|