@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
|
@@ -144,8 +144,8 @@ const Facets = (props) => {
|
|
|
144
144
|
? intl.formatMessage(messages.showFilters)
|
|
145
145
|
: intl.formatMessage(messages.moreFilters)
|
|
146
146
|
: advancedFilters === 2
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
? intl.formatMessage(messages.hideFilters)
|
|
148
|
+
: intl.formatMessage(messages.lessFilters)}
|
|
149
149
|
</Button>
|
|
150
150
|
</Grid.Column>
|
|
151
151
|
)}
|
|
@@ -48,8 +48,8 @@ export const customSelectStyles = {
|
|
|
48
48
|
color: state.isSelected
|
|
49
49
|
? '#007bc1'
|
|
50
50
|
: state.isFocused
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
? '#4a4a4a'
|
|
52
|
+
: 'inherit',
|
|
53
53
|
':active': {
|
|
54
54
|
backgroundColor: null,
|
|
55
55
|
},
|
|
@@ -98,8 +98,8 @@ export const sortOnSelectStyles = {
|
|
|
98
98
|
color: state.isSelected
|
|
99
99
|
? '#007bc1'
|
|
100
100
|
: state.isFocused
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
? '#4a4a4a'
|
|
102
|
+
: 'inherit',
|
|
103
103
|
':active': {
|
|
104
104
|
backgroundColor: null,
|
|
105
105
|
},
|
|
@@ -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,
|
|
@@ -1989,9 +1989,9 @@ class Contents extends Component {
|
|
|
1989
1989
|
this.state.selected.length === 0
|
|
1990
1990
|
? checkboxUncheckedSVG
|
|
1991
1991
|
: this.state.selected.length ===
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1992
|
+
this.state.items.length
|
|
1993
|
+
? checkboxCheckedSVG
|
|
1994
|
+
: checkboxIndeterminateSVG
|
|
1995
1995
|
}
|
|
1996
1996
|
color={
|
|
1997
1997
|
this.state.selected.length > 0
|
|
@@ -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
|
});
|
|
@@ -10,7 +10,7 @@ import { compose } from 'redux';
|
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers';
|
|
12
12
|
import { removeAliases, addAliases, getAliases } from '@plone/volto/actions';
|
|
13
|
-
import {
|
|
13
|
+
import { createPortal } from 'react-dom';
|
|
14
14
|
import {
|
|
15
15
|
Container,
|
|
16
16
|
Button,
|
|
@@ -652,8 +652,8 @@ class Aliases extends Component {
|
|
|
652
652
|
</Segment.Group>
|
|
653
653
|
</article>
|
|
654
654
|
</Container>
|
|
655
|
-
{this.state.isClient &&
|
|
656
|
-
|
|
655
|
+
{this.state.isClient &&
|
|
656
|
+
createPortal(
|
|
657
657
|
<Toolbar
|
|
658
658
|
pathname={this.props.pathname}
|
|
659
659
|
hideDefaultViewButtons
|
|
@@ -667,9 +667,9 @@ class Aliases extends Component {
|
|
|
667
667
|
/>
|
|
668
668
|
</Link>
|
|
669
669
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
670
|
+
/>,
|
|
671
|
+
document.getElementById('toolbar'),
|
|
672
|
+
)}
|
|
673
673
|
</div>
|
|
674
674
|
);
|
|
675
675
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureMockStore from 'redux-mock-store';
|
|
4
4
|
import thunk from 'redux-thunk';
|
|
5
5
|
import { Provider } from 'react-intl-redux';
|
|
@@ -10,9 +10,7 @@ import { MemoryRouter } from 'react-router';
|
|
|
10
10
|
const middlewares = [thunk];
|
|
11
11
|
const mockStore = configureMockStore(middlewares);
|
|
12
12
|
|
|
13
|
-
jest.mock('
|
|
14
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
15
|
-
}));
|
|
13
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
16
14
|
|
|
17
15
|
describe('Aliases', () => {
|
|
18
16
|
it('renders an aliases control component', () => {
|
|
@@ -59,14 +57,15 @@ describe('Aliases', () => {
|
|
|
59
57
|
messages: {},
|
|
60
58
|
},
|
|
61
59
|
});
|
|
62
|
-
const
|
|
60
|
+
const { container } = render(
|
|
63
61
|
<Provider store={store}>
|
|
64
62
|
<MemoryRouter>
|
|
65
63
|
<Aliases location={{ pathname: '/blog' }} />
|
|
64
|
+
<div id="toolbar"></div>
|
|
66
65
|
</MemoryRouter>
|
|
67
66
|
</Provider>,
|
|
68
67
|
);
|
|
69
|
-
|
|
70
|
-
expect(
|
|
68
|
+
|
|
69
|
+
expect(container).toMatchSnapshot();
|
|
71
70
|
});
|
|
72
71
|
});
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { getParentUrl } from '@plone/volto/helpers';
|
|
11
|
-
import {
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
12
|
import { Button, Header } from 'semantic-ui-react';
|
|
13
13
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
14
14
|
import { toast } from 'react-toastify';
|
|
@@ -210,8 +210,8 @@ class ContentType extends Component {
|
|
|
210
210
|
hideActions
|
|
211
211
|
loading={this.props.cpanelRequest.update.loading}
|
|
212
212
|
/>
|
|
213
|
-
{this.state.isClient &&
|
|
214
|
-
|
|
213
|
+
{this.state.isClient &&
|
|
214
|
+
createPortal(
|
|
215
215
|
<Toolbar
|
|
216
216
|
pathname={this.props.pathname}
|
|
217
217
|
hideDefaultViewButtons
|
|
@@ -248,9 +248,9 @@ class ContentType extends Component {
|
|
|
248
248
|
</Button>
|
|
249
249
|
</>
|
|
250
250
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
/>,
|
|
252
|
+
document.getElementById('toolbar'),
|
|
253
|
+
)}
|
|
254
254
|
</div>
|
|
255
255
|
);
|
|
256
256
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import renderer from 'react-test-renderer';
|
|
3
2
|
import configureStore from 'redux-mock-store';
|
|
4
3
|
import { Provider } from 'react-intl-redux';
|
|
5
4
|
import { MemoryRouter, Route } from 'react-router-dom';
|
|
5
|
+
import { render } from '@testing-library/react';
|
|
6
6
|
|
|
7
7
|
import ContentType from './ContentType';
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock('
|
|
12
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
13
|
-
}));
|
|
11
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
14
12
|
jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
|
|
15
13
|
|
|
16
14
|
describe('ContentType', () => {
|
|
@@ -35,7 +33,8 @@ describe('ContentType', () => {
|
|
|
35
33
|
messages: {},
|
|
36
34
|
},
|
|
37
35
|
});
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
const { container } = render(
|
|
39
38
|
<Provider store={store}>
|
|
40
39
|
<MemoryRouter
|
|
41
40
|
initialEntries={['/controlpanel/dexterity-types/Document']}
|
|
@@ -44,10 +43,11 @@ describe('ContentType', () => {
|
|
|
44
43
|
path={'/controlpanel/dexterity-types/:id'}
|
|
45
44
|
component={ContentType}
|
|
46
45
|
/>
|
|
46
|
+
<div id="toolbar"></div>
|
|
47
47
|
</MemoryRouter>
|
|
48
48
|
</Provider>,
|
|
49
49
|
);
|
|
50
|
-
|
|
51
|
-
expect(
|
|
50
|
+
|
|
51
|
+
expect(container).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
53
|
});
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getBlocksFieldname,
|
|
15
15
|
getBlocksLayoutFieldname,
|
|
16
16
|
} from '@plone/volto/helpers';
|
|
17
|
-
import {
|
|
17
|
+
import { createPortal } from 'react-dom';
|
|
18
18
|
import { Button, Segment } from 'semantic-ui-react';
|
|
19
19
|
import { toast } from 'react-toastify';
|
|
20
20
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|
@@ -343,26 +343,30 @@ class ContentTypeLayout extends Component {
|
|
|
343
343
|
content={this.props.intl.formatMessage(messages.enable)}
|
|
344
344
|
/>
|
|
345
345
|
</Segment>
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
346
|
+
{this.state.isClient &&
|
|
347
|
+
createPortal(
|
|
348
|
+
<Toolbar
|
|
349
|
+
pathname={this.props.pathname}
|
|
350
|
+
hideDefaultViewButtons
|
|
351
|
+
inner={
|
|
352
|
+
<>
|
|
353
|
+
<Link
|
|
354
|
+
className="item"
|
|
355
|
+
to="#"
|
|
356
|
+
onClick={() => this.onCancel()}
|
|
357
|
+
>
|
|
358
|
+
<Icon
|
|
359
|
+
name={backSVG}
|
|
360
|
+
size="30px"
|
|
361
|
+
className="contents circled"
|
|
362
|
+
title={this.props.intl.formatMessage(messages.back)}
|
|
363
|
+
/>
|
|
364
|
+
</Link>
|
|
365
|
+
</>
|
|
366
|
+
}
|
|
367
|
+
/>,
|
|
368
|
+
document.getElementById('toolbar'),
|
|
369
|
+
)}
|
|
366
370
|
</>
|
|
367
371
|
);
|
|
368
372
|
}
|
|
@@ -392,26 +396,30 @@ class ContentTypeLayout extends Component {
|
|
|
392
396
|
content={this.props.intl.formatMessage(messages.enable)}
|
|
393
397
|
/>
|
|
394
398
|
</Segment>
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
399
|
+
{this.state.isClient &&
|
|
400
|
+
createPortal(
|
|
401
|
+
<Toolbar
|
|
402
|
+
pathname={this.props.pathname}
|
|
403
|
+
hideDefaultViewButtons
|
|
404
|
+
inner={
|
|
405
|
+
<>
|
|
406
|
+
<Link
|
|
407
|
+
className="item"
|
|
408
|
+
to="#"
|
|
409
|
+
onClick={() => this.onCancel()}
|
|
410
|
+
>
|
|
411
|
+
<Icon
|
|
412
|
+
name={backSVG}
|
|
413
|
+
size="30px"
|
|
414
|
+
className="contents circled"
|
|
415
|
+
title={this.props.intl.formatMessage(messages.back)}
|
|
416
|
+
/>
|
|
417
|
+
</Link>
|
|
418
|
+
</>
|
|
419
|
+
}
|
|
420
|
+
/>,
|
|
421
|
+
document.getElementById('toolbar'),
|
|
422
|
+
)}
|
|
415
423
|
</>
|
|
416
424
|
);
|
|
417
425
|
}
|
|
@@ -449,50 +457,50 @@ class ContentTypeLayout extends Component {
|
|
|
449
457
|
visual={this.state.visual}
|
|
450
458
|
hideActions
|
|
451
459
|
/>
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
460
|
+
{this.state.isClient &&
|
|
461
|
+
createPortal(
|
|
462
|
+
<Sidebar settingsTab={true} documentTab={false} />,
|
|
463
|
+
document.getElementById('sidebar'),
|
|
464
|
+
)}
|
|
465
|
+
{this.state.isClient &&
|
|
466
|
+
createPortal(
|
|
467
|
+
<Toolbar
|
|
468
|
+
pathname={this.props.pathname}
|
|
469
|
+
hideDefaultViewButtons
|
|
470
|
+
inner={
|
|
471
|
+
<>
|
|
472
|
+
<Button
|
|
473
|
+
id="toolbar-save"
|
|
474
|
+
className="save"
|
|
475
|
+
aria-label={this.props.intl.formatMessage(messages.save)}
|
|
476
|
+
onClick={() => this.form.current.onSubmit()}
|
|
477
|
+
disabled={this.props.schemaRequest.update.loading}
|
|
478
|
+
loading={this.props.schemaRequest.update.loading}
|
|
479
|
+
>
|
|
480
|
+
<Icon
|
|
481
|
+
name={saveSVG}
|
|
482
|
+
className="circled"
|
|
483
|
+
size="30px"
|
|
484
|
+
title={this.props.intl.formatMessage(messages.save)}
|
|
485
|
+
/>
|
|
486
|
+
</Button>
|
|
487
|
+
<Button
|
|
488
|
+
className="cancel"
|
|
489
|
+
aria-label={this.props.intl.formatMessage(messages.cancel)}
|
|
490
|
+
onClick={() => this.onCancel()}
|
|
491
|
+
>
|
|
492
|
+
<Icon
|
|
493
|
+
name={clearSVG}
|
|
494
|
+
className="circled"
|
|
495
|
+
size="30px"
|
|
496
|
+
title={this.props.intl.formatMessage(messages.cancel)}
|
|
497
|
+
/>
|
|
498
|
+
</Button>
|
|
499
|
+
</>
|
|
500
|
+
}
|
|
501
|
+
/>,
|
|
502
|
+
document.getElementById('toolbar'),
|
|
503
|
+
)}
|
|
496
504
|
</div>
|
|
497
505
|
);
|
|
498
506
|
}
|
|
@@ -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 ContentTypeLayout from './ContentTypeLayout';
|
|
|
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('ContentTypeLayout', () => {
|
|
@@ -38,7 +37,7 @@ describe('ContentTypeLayout', () => {
|
|
|
38
37
|
schema: null,
|
|
39
38
|
},
|
|
40
39
|
});
|
|
41
|
-
const
|
|
40
|
+
const { container } = render(
|
|
42
41
|
<Provider store={store}>
|
|
43
42
|
<MemoryRouter
|
|
44
43
|
initialEntries={['/controlpanel/dexterity-types/Document/layout']}
|
|
@@ -47,10 +46,11 @@ describe('ContentTypeLayout', () => {
|
|
|
47
46
|
path={'/controlpanel/dexterity-types/:id/layout'}
|
|
48
47
|
component={ContentTypeLayout}
|
|
49
48
|
/>
|
|
49
|
+
<div id="toolbar"></div>
|
|
50
50
|
</MemoryRouter>
|
|
51
51
|
</Provider>,
|
|
52
52
|
);
|
|
53
|
-
|
|
54
|
-
expect(
|
|
53
|
+
|
|
54
|
+
expect(container).toMatchSnapshot();
|
|
55
55
|
});
|
|
56
56
|
});
|