@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
|
@@ -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';
|
|
@@ -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
|
});
|
|
@@ -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, getBaseUrl } from '@plone/volto/helpers';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import {
|
|
14
14
|
Button,
|
|
15
15
|
Checkbox,
|
|
@@ -367,8 +367,8 @@ class EditRule extends Component {
|
|
|
367
367
|
</Segment.Group>
|
|
368
368
|
</article>
|
|
369
369
|
</Container>
|
|
370
|
-
{this.state.isClient &&
|
|
371
|
-
|
|
370
|
+
{this.state.isClient &&
|
|
371
|
+
createPortal(
|
|
372
372
|
<Toolbar
|
|
373
373
|
pathname={this.props.pathname}
|
|
374
374
|
hideDefaultViewButtons
|
|
@@ -382,9 +382,9 @@ class EditRule extends Component {
|
|
|
382
382
|
/>
|
|
383
383
|
</Link>
|
|
384
384
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
/>,
|
|
386
|
+
document.getElementById('toolbar'),
|
|
387
|
+
)}
|
|
388
388
|
</div>
|
|
389
389
|
);
|
|
390
390
|
}
|
|
@@ -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 EditRule from './EditRule';
|
|
|
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('EditRule', () => {
|
|
17
15
|
it('renders rules edit interface', () => {
|
|
@@ -21,12 +19,13 @@ describe('EditRule', () => {
|
|
|
21
19
|
messages: {},
|
|
22
20
|
},
|
|
23
21
|
});
|
|
24
|
-
const
|
|
22
|
+
const { container } = render(
|
|
25
23
|
<Provider store={store}>
|
|
26
24
|
<EditRule location={{ pathname: '/controlpanel/rules/:id/edit' }} />
|
|
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
|
Checkbox,
|
|
@@ -420,8 +420,8 @@ class Rules extends Component {
|
|
|
420
420
|
</Segment.Group>
|
|
421
421
|
</article>
|
|
422
422
|
</Container>
|
|
423
|
-
{this.state.isClient &&
|
|
424
|
-
|
|
423
|
+
{this.state.isClient &&
|
|
424
|
+
createPortal(
|
|
425
425
|
<Toolbar
|
|
426
426
|
pathname={this.props.pathname}
|
|
427
427
|
hideDefaultViewButtons
|
|
@@ -435,9 +435,9 @@ class Rules extends Component {
|
|
|
435
435
|
/>
|
|
436
436
|
</Link>
|
|
437
437
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
/>,
|
|
439
|
+
document.getElementById('toolbar'),
|
|
440
|
+
)}
|
|
441
441
|
</div>
|
|
442
442
|
);
|
|
443
443
|
}
|
|
@@ -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 Rules from './Rules';
|
|
|
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('Rules', () => {
|
|
17
15
|
it('renders rules control panel control', () => {
|
|
@@ -64,12 +62,13 @@ describe('Rules', () => {
|
|
|
64
62
|
messages: {},
|
|
65
63
|
},
|
|
66
64
|
});
|
|
67
|
-
const
|
|
65
|
+
const { container } = render(
|
|
68
66
|
<Provider store={store}>
|
|
69
67
|
<Rules location={{ pathname: '/controlpanel/rules' }} />
|
|
68
|
+
<div id="toolbar"></div>
|
|
70
69
|
</Provider>,
|
|
71
70
|
);
|
|
72
|
-
|
|
73
|
-
expect(
|
|
71
|
+
|
|
72
|
+
expect(container).toMatchSnapshot();
|
|
74
73
|
});
|
|
75
74
|
});
|
|
@@ -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 VariableModal from './VariableModal';
|
|
|
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
|
|
|
16
15
|
describe('VariableModal', () => {
|
|
17
16
|
it('renders rules add interface', () => {
|
|
@@ -21,12 +20,12 @@ describe('VariableModal', () => {
|
|
|
21
20
|
messages: {},
|
|
22
21
|
},
|
|
23
22
|
});
|
|
24
|
-
const
|
|
23
|
+
const { container } = render(
|
|
25
24
|
<Provider store={store}>
|
|
26
25
|
<VariableModal location={{ pathname: '/controlpanel/rules' }} />
|
|
27
26
|
</Provider>,
|
|
28
27
|
);
|
|
29
|
-
|
|
30
|
-
expect(
|
|
28
|
+
|
|
29
|
+
expect(container).toMatchSnapshot();
|
|
31
30
|
});
|
|
32
31
|
});
|
|
@@ -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, Segment, Table, Menu, Input } from 'semantic-ui-react';
|
|
12
12
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
|
13
13
|
import { Icon, Toolbar, Form, Toast } from '@plone/volto/components';
|
|
@@ -702,8 +702,8 @@ class UndoControlpanel extends Component {
|
|
|
702
702
|
)}
|
|
703
703
|
</Segment.Group>
|
|
704
704
|
</Segment.Group>
|
|
705
|
-
{this.state.isClient &&
|
|
706
|
-
|
|
705
|
+
{this.state.isClient &&
|
|
706
|
+
createPortal(
|
|
707
707
|
<Toolbar
|
|
708
708
|
pathname={this.props.pathname}
|
|
709
709
|
hideDefaultViewButtons
|
|
@@ -720,9 +720,9 @@ class UndoControlpanel extends Component {
|
|
|
720
720
|
</Link>
|
|
721
721
|
</>
|
|
722
722
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
723
|
+
/>,
|
|
724
|
+
document.getElementById('toolbar'),
|
|
725
|
+
)}
|
|
726
726
|
</Container>
|
|
727
727
|
);
|
|
728
728
|
}
|
|
@@ -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 UndoControlpanel from './UndoControlpanel';
|
|
|
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('../Form/Form', () => jest.fn(() => <div id="form" />));
|
|
14
13
|
|
|
15
14
|
describe('UndoControlpanel', () => {
|
|
@@ -84,12 +83,13 @@ describe('UndoControlpanel', () => {
|
|
|
84
83
|
messages: {},
|
|
85
84
|
},
|
|
86
85
|
});
|
|
87
|
-
const
|
|
86
|
+
const { container } = render(
|
|
88
87
|
<Provider store={store}>
|
|
89
88
|
<UndoControlpanel location={{ pathname: '/blog' }} />
|
|
89
|
+
<div id="toolbar"></div>
|
|
90
90
|
</Provider>,
|
|
91
91
|
);
|
|
92
|
-
|
|
93
|
-
expect(
|
|
92
|
+
|
|
93
|
+
expect(container).toMatchSnapshot();
|
|
94
94
|
});
|
|
95
95
|
});
|
|
@@ -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
|
Button,
|
|
13
13
|
Container,
|
|
@@ -311,8 +311,8 @@ class UpgradeControlPanel extends Component {
|
|
|
311
311
|
) : null}
|
|
312
312
|
</Segment>
|
|
313
313
|
</Segment.Group>
|
|
314
|
-
{this.state.isClient &&
|
|
315
|
-
|
|
314
|
+
{this.state.isClient &&
|
|
315
|
+
createPortal(
|
|
316
316
|
<Toolbar
|
|
317
317
|
pathname={this.props.pathname}
|
|
318
318
|
hideDefaultViewButtons
|
|
@@ -329,9 +329,9 @@ class UpgradeControlPanel extends Component {
|
|
|
329
329
|
</Link>
|
|
330
330
|
</>
|
|
331
331
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
/>,
|
|
333
|
+
document.getElementById('toolbar'),
|
|
334
|
+
)}
|
|
335
335
|
</Container>
|
|
336
336
|
) : null;
|
|
337
337
|
}
|