@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
|
@@ -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
|
});
|
|
@@ -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
|
});
|