@plone/volto 18.0.0-alpha.27 → 18.0.0-alpha.28

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/cypress/support/commands.js +1 -4
  3. package/cypress/support/e2e.js +9 -0
  4. package/locales/pt_BR/LC_MESSAGES/volto.po +1 -1
  5. package/locales/pt_BR.json +1 -1
  6. package/package.json +18 -16
  7. package/src/components/index.js +104 -73
  8. package/src/components/manage/Actions/Actions.jsx +2 -1
  9. package/src/components/manage/Actions/Actions.test.jsx +1 -3
  10. package/src/components/manage/Add/Add.jsx +1 -1
  11. package/src/components/manage/Blocks/Block/DefaultEdit.jsx +1 -1
  12. package/src/components/manage/Blocks/Block/Settings.jsx +1 -1
  13. package/src/components/manage/Blocks/Block/Settings.test.jsx +2 -0
  14. package/src/components/manage/Blocks/Container/Data.jsx +1 -1
  15. package/src/components/manage/Blocks/Container/Edit.jsx +2 -1
  16. package/src/components/manage/Blocks/Image/ImageSidebar.jsx +2 -1
  17. package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +2 -0
  18. package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +2 -3
  19. package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +2 -0
  20. package/src/components/manage/Blocks/Listing/ListingData.jsx +1 -1
  21. package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +1 -1
  22. package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +2 -0
  23. package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +2 -1
  24. package/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +1 -1
  25. package/src/components/manage/Blocks/Teaser/Data.jsx +2 -1
  26. package/src/components/manage/Blocks/ToC/Edit.jsx +1 -1
  27. package/src/components/manage/Blocks/Video/VideoSidebar.jsx +1 -1
  28. package/src/components/manage/Blocks/Video/VideoSidebar.test.jsx +2 -0
  29. package/src/components/manage/ConditionalLink/ConditionalLink.jsx +1 -1
  30. package/src/components/manage/Contents/Contents.jsx +8 -8
  31. package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +1 -1
  32. package/src/components/manage/Contents/ContentsPropertiesModal.jsx +1 -1
  33. package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +1 -1
  34. package/src/components/manage/Contents/ContentsRenameModal.jsx +1 -1
  35. package/src/components/manage/Contents/ContentsRenameModal.test.jsx +1 -1
  36. package/src/components/manage/Contents/ContentsTagsModal.jsx +1 -1
  37. package/src/components/manage/Contents/ContentsTagsModal.test.jsx +1 -1
  38. package/src/components/manage/Contents/ContentsWorkflowModal.jsx +1 -1
  39. package/src/components/manage/Contents/ContentsWorkflowModal.test.jsx +1 -1
  40. package/src/components/manage/Contents/__mocks__/index.tsx +5 -0
  41. package/src/components/manage/Contents/index.tsx +64 -0
  42. package/src/components/manage/Controlpanels/Aliases.jsx +1 -1
  43. package/src/components/manage/Controlpanels/Aliases.test.jsx +1 -0
  44. package/src/components/manage/Controlpanels/ContentType.jsx +2 -1
  45. package/src/components/manage/Controlpanels/ContentType.test.jsx +1 -1
  46. package/src/components/manage/Controlpanels/ContentTypeLayout.jsx +2 -8
  47. package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +2 -1
  48. package/src/components/manage/Controlpanels/ContentTypes.jsx +3 -8
  49. package/src/components/manage/Controlpanels/Controlpanel.jsx +2 -1
  50. package/src/components/manage/Controlpanels/Controlpanel.test.jsx +1 -2
  51. package/src/components/manage/Controlpanels/Controlpanels.jsx +12 -49
  52. package/src/components/manage/Controlpanels/Controlpanels.test.jsx +36 -32
  53. package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +2 -2
  54. package/src/components/manage/Controlpanels/ModerateComments.jsx +2 -6
  55. package/src/components/manage/Controlpanels/ModerateComments.test.jsx +1 -4
  56. package/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +2 -2
  57. package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +2 -2
  58. package/src/components/manage/Controlpanels/Rules/AddRule.jsx +2 -2
  59. package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +1 -0
  60. package/src/components/manage/Controlpanels/Rules/EditRule.jsx +2 -2
  61. package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +2 -0
  62. package/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx +1 -1
  63. package/src/components/manage/Controlpanels/UndoControlpanel.jsx +2 -1
  64. package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +1 -2
  65. package/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +2 -1
  66. package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +2 -1
  67. package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +1 -1
  68. package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +2 -2
  69. package/src/components/manage/Controlpanels/index.tsx +181 -0
  70. package/src/components/manage/Diff/Diff.jsx +1 -1
  71. package/src/components/manage/Display/Display.jsx +2 -1
  72. package/src/components/manage/Display/Display.test.jsx +1 -0
  73. package/src/components/manage/Edit/Edit.jsx +1 -1
  74. package/src/components/manage/Edit/Edit.test.jsx +1 -2
  75. package/src/components/manage/Form/BlockDataForm.jsx +1 -1
  76. package/src/components/manage/Form/BlockDataForm.test.jsx +2 -0
  77. package/src/components/manage/Form/Form.jsx +4 -2
  78. package/src/components/manage/Form/Form.test.jsx +1 -1
  79. package/src/components/manage/Form/InlineForm.jsx +2 -1
  80. package/src/components/manage/Form/InlineForm.test.jsx +2 -0
  81. package/src/components/manage/Form/ModalForm.jsx +2 -1
  82. package/src/components/manage/Form/ModalForm.test.jsx +1 -1
  83. package/src/components/manage/Form/__mocks__/index.tsx +74 -0
  84. package/src/components/manage/Form/index.tsx +50 -0
  85. package/src/components/manage/Multilingual/TranslationObject.jsx +2 -1
  86. package/src/components/manage/Preferences/ChangePassword.jsx +2 -1
  87. package/src/components/manage/Preferences/ChangePassword.test.jsx +1 -0
  88. package/src/components/manage/Preferences/PersonalInformation.jsx +2 -1
  89. package/src/components/manage/Preferences/PersonalPreferences.jsx +2 -1
  90. package/src/components/manage/Preferences/PersonalPreferences.test.jsx +3 -5
  91. package/src/components/manage/Rules/index.tsx +5 -0
  92. package/src/components/manage/Toolbar/PersonalTools.jsx +2 -2
  93. package/src/components/manage/Widgets/ArrayWidget.jsx +1 -1
  94. package/src/components/manage/Widgets/ButtonsWidget.jsx +1 -1
  95. package/src/components/manage/Widgets/CheckboxWidget.jsx +1 -1
  96. package/src/components/manage/Widgets/DatetimeWidget.jsx +2 -1
  97. package/src/components/manage/Widgets/EmailWidget.jsx +1 -1
  98. package/src/components/manage/Widgets/FileWidget.jsx +2 -1
  99. package/src/components/manage/Widgets/IdWidget.jsx +2 -1
  100. package/src/components/manage/Widgets/ImageSizeWidget.jsx +1 -1
  101. package/src/components/manage/Widgets/InternalUrlWidget.jsx +3 -3
  102. package/src/components/manage/Widgets/NumberWidget.jsx +1 -1
  103. package/src/components/manage/Widgets/ObjectListWidget.jsx +2 -1
  104. package/src/components/manage/Widgets/ObjectListWidget.test.js +2 -0
  105. package/src/components/manage/Widgets/ObjectWidget.jsx +1 -2
  106. package/src/components/manage/Widgets/ObjectWidget.test.jsx +2 -0
  107. package/src/components/manage/Widgets/PasswordWidget.jsx +1 -1
  108. package/src/components/manage/Widgets/QuerySortOnWidget.jsx +1 -1
  109. package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +3 -2
  110. package/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx +12 -3
  111. package/src/components/manage/Widgets/ReferenceWidget.jsx +1 -1
  112. package/src/components/manage/Widgets/RegistryImageWidget.jsx +2 -1
  113. package/src/components/manage/Widgets/SchemaWidget.jsx +2 -5
  114. package/src/components/manage/Widgets/SelectAutoComplete.jsx +1 -1
  115. package/src/components/manage/Widgets/SelectWidget.jsx +1 -1
  116. package/src/components/manage/Widgets/TextWidget.jsx +2 -1
  117. package/src/components/manage/Widgets/TextareaWidget.jsx +1 -1
  118. package/src/components/manage/Widgets/TokenWidget.jsx +1 -1
  119. package/src/components/manage/Widgets/UrlWidget.jsx +3 -3
  120. package/src/components/manage/Widgets/VocabularyTermsWidget.jsx +5 -8
  121. package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +2 -0
  122. package/src/components/manage/Widgets/__mocks__/index.tsx +43 -0
  123. package/src/components/manage/Widgets/index.tsx +232 -0
  124. package/src/components/manage/Workflow/Workflow.jsx +2 -1
  125. package/src/components/manage/Workflow/Workflow.test.jsx +2 -3
  126. package/src/components/theme/Comments/CommentEditModal.jsx +1 -1
  127. package/src/components/theme/Comments/CommentEditModal.test.jsx +1 -3
  128. package/src/components/theme/Comments/Comments.jsx +3 -1
  129. package/src/components/theme/Comments/Comments.test.jsx +2 -0
  130. package/src/components/theme/Comments/__mocks__/index.tsx +1 -0
  131. package/src/components/theme/Comments/index.tsx +5 -0
  132. package/src/components/theme/ContactForm/ContactForm.jsx +2 -1
  133. package/src/components/theme/ContactForm/ContactForm.test.jsx +2 -0
  134. package/src/components/theme/PasswordReset/PasswordReset.jsx +1 -1
  135. package/src/components/theme/PasswordReset/RequestPasswordReset.jsx +1 -1
  136. package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +2 -0
  137. package/src/components/theme/Register/Register.jsx +2 -1
  138. package/src/components/theme/Register/Register.test.jsx +2 -0
  139. package/src/config/ControlPanels.js +1 -1
  140. package/src/config/Widgets.jsx +33 -46
  141. package/src/routes.js +22 -20
  142. package/theme/themes/pastanaga/elements/input.overrides +2 -0
  143. package/types/components/index.d.ts +11 -63
  144. package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +5 -0
  145. package/types/components/manage/ConditionalLink/ConditionalLink.d.ts +1 -1
  146. package/types/components/manage/Contents/__mocks__/index.d.ts +3 -0
  147. package/types/components/manage/Contents/index.d.ts +9 -0
  148. package/types/components/manage/Controlpanels/Controlpanels.d.ts +6 -2
  149. package/types/components/manage/Controlpanels/Relations/RelationsListing.d.ts +2 -2
  150. package/types/components/manage/Controlpanels/index.d.ts +32 -0
  151. package/types/components/manage/Form/__mocks__/index.d.ts +9 -0
  152. package/types/components/manage/Form/index.d.ts +14 -0
  153. package/types/components/manage/Rules/index.d.ts +1 -0
  154. package/types/components/manage/Widgets/RecurrenceWidget/SelectInput.d.ts +2 -34
  155. package/types/components/manage/Widgets/__mocks__/index.d.ts +34 -0
  156. package/types/components/manage/Widgets/index.d.ts +120 -0
  157. package/types/components/theme/Comments/__mocks__/index.d.ts +1 -0
  158. package/types/components/theme/Comments/index.d.ts +1 -0
  159. package/types/config/ControlPanels.d.ts +1 -1
  160. package/types/config/Loadables.d.ts +151 -9
  161. package/types/config/Views.d.ts +1 -1
  162. package/types/config/Widgets.d.ts +33 -39
@@ -0,0 +1,64 @@
1
+ import loadable from '@loadable/component';
2
+
3
+ export const Contents = loadable(
4
+ () =>
5
+ import(
6
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/Contents'
7
+ ),
8
+ );
9
+
10
+ export const ContentsRenameModal = loadable(
11
+ () =>
12
+ import(
13
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsRenameModal'
14
+ ),
15
+ );
16
+
17
+ export const ContentsBreadcrumbs = loadable(
18
+ () =>
19
+ import(
20
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsBreadcrumbs'
21
+ ),
22
+ );
23
+
24
+ export const ContentsIndexHeader = loadable(
25
+ () =>
26
+ import(
27
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsIndexHeader'
28
+ ),
29
+ );
30
+
31
+ export const ContentsItem = loadable(
32
+ () =>
33
+ import(
34
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsItem'
35
+ ),
36
+ );
37
+
38
+ export const ContentsUploadModal = loadable(
39
+ () =>
40
+ import(
41
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsUploadModal'
42
+ ),
43
+ );
44
+
45
+ export const ContentsPropertiesModal = loadable(
46
+ () =>
47
+ import(
48
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsPropertiesModal'
49
+ ),
50
+ );
51
+
52
+ export const ContentsWorkflowModal = loadable(
53
+ () =>
54
+ import(
55
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsWorkflowModal'
56
+ ),
57
+ );
58
+
59
+ export const ContentsTagsModal = loadable(
60
+ () =>
61
+ import(
62
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsTagsModal'
63
+ ),
64
+ );
@@ -26,7 +26,7 @@ import {
26
26
  Menu,
27
27
  } from 'semantic-ui-react';
28
28
  import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
29
- import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget';
29
+ import { DatetimeWidget } from '@plone/volto/components/manage/Widgets';
30
30
  import { Icon, Toolbar } from '@plone/volto/components';
31
31
 
32
32
  import backSVG from '@plone/volto/icons/back.svg';
@@ -10,6 +10,7 @@ import { MemoryRouter } from 'react-router';
10
10
  const middlewares = [thunk];
11
11
  const mockStore = configureMockStore(middlewares);
12
12
 
13
+ jest.mock('@plone/volto/components/manage/Widgets');
13
14
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
14
15
 
15
16
  describe('Aliases', () => {
@@ -13,7 +13,8 @@ import { Button, Header } from 'semantic-ui-react';
13
13
  import { defineMessages, injectIntl } from 'react-intl';
14
14
  import { toast } from 'react-toastify';
15
15
  import { last, nth, join } from 'lodash';
16
- import { Error, Form, Icon, Toolbar, Toast } from '@plone/volto/components';
16
+ import { Error, Icon, Toolbar, Toast } from '@plone/volto/components';
17
+ import { Form } from '@plone/volto/components/manage/Form';
17
18
  import { getControlpanel, updateControlpanel } from '@plone/volto/actions';
18
19
 
19
20
  import saveSVG from '@plone/volto/icons/save.svg';
@@ -8,8 +8,8 @@ import ContentType from './ContentType';
8
8
 
9
9
  const mockStore = configureStore();
10
10
 
11
+ jest.mock('@plone/volto/components/manage/Form');
11
12
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
12
- jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
13
13
 
14
14
  describe('ContentType', () => {
15
15
  it('renders dexterity content-type component', () => {
@@ -19,14 +19,8 @@ import { Button, Segment } from 'semantic-ui-react';
19
19
  import { toast } from 'react-toastify';
20
20
  import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
21
21
  import { nth, join } from 'lodash';
22
- import {
23
- Error,
24
- Form,
25
- Icon,
26
- Toolbar,
27
- Sidebar,
28
- Toast,
29
- } from '@plone/volto/components';
22
+ import { Error, Icon, Toolbar, Sidebar, Toast } from '@plone/volto/components';
23
+ import { Form } from '@plone/volto/components/manage/Form';
30
24
  import {
31
25
  getSchema,
32
26
  updateSchema,
@@ -6,7 +6,8 @@
6
6
  import { getSchema, putSchema } from '@plone/volto/actions';
7
7
  import { getParentUrl } from '@plone/volto/helpers';
8
8
  import { nth } from 'lodash';
9
- import { Error, Form, Icon, Toast, Toolbar } from '@plone/volto/components';
9
+ import { Error, Icon, Toast, Toolbar } from '@plone/volto/components';
10
+ import { Form } from '@plone/volto/components/manage/Form';
10
11
  import clearSVG from '@plone/volto/icons/clear.svg';
11
12
  import saveSVG from '@plone/volto/icons/save.svg';
12
13
  import PropTypes from 'prop-types';
@@ -14,14 +14,8 @@ import { last } from 'lodash';
14
14
  import { Confirm, Container, Table, Button, Header } from 'semantic-ui-react';
15
15
  import { toast } from 'react-toastify';
16
16
  import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
17
- import {
18
- Error,
19
- Icon,
20
- ModalForm,
21
- Toolbar,
22
- Toast,
23
- ContentTypesActions,
24
- } from '@plone/volto/components';
17
+ import { Error, Icon, Toolbar, Toast } from '@plone/volto/components';
18
+ import ContentTypesActions from '@plone/volto/components/manage/Controlpanels/ContentTypesActions';
25
19
  import {
26
20
  getControlpanel,
27
21
  postControlpanel,
@@ -31,6 +25,7 @@ import { getId } from '@plone/volto/helpers';
31
25
 
32
26
  import addSVG from '@plone/volto/icons/add-document.svg';
33
27
  import backSVG from '@plone/volto/icons/back.svg';
28
+ import { ModalForm } from '@plone/volto/components/manage/Form';
34
29
 
35
30
  const messages = defineMessages({
36
31
  add: {
@@ -14,7 +14,8 @@ import { Button, Container } from 'semantic-ui-react';
14
14
  import { defineMessages, injectIntl } from 'react-intl';
15
15
  import { toast } from 'react-toastify';
16
16
 
17
- import { Form, Icon, Toolbar, Toast } from '@plone/volto/components';
17
+ import { Icon, Toolbar, Toast } from '@plone/volto/components';
18
+ import { Form } from '@plone/volto/components/manage/Form';
18
19
  import { updateControlpanel, getControlpanel } from '@plone/volto/actions';
19
20
 
20
21
  import config from '@plone/volto/registry';
@@ -8,10 +8,9 @@ import Controlpanel from './Controlpanel';
8
8
 
9
9
  const mockStore = configureStore();
10
10
 
11
+ jest.mock('@plone/volto/components/manage/Form');
11
12
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
12
13
 
13
- jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
14
-
15
14
  describe('Controlpanel', () => {
16
15
  it('renders a controlpanel component', () => {
17
16
  const store = mockStore({
@@ -3,18 +3,15 @@
3
3
  * @module components/manage/Controlpanels/Controlpanels
4
4
  */
5
5
 
6
- import { Helmet, asyncConnect } from '@plone/volto/helpers';
6
+ import { Helmet } from '@plone/volto/helpers';
7
7
  import { concat, filter, last, map, sortBy, uniqBy } from 'lodash';
8
- import PropTypes from 'prop-types';
9
8
  import { useEffect, useState } from 'react';
10
9
  import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
11
10
  import { createPortal } from 'react-dom';
12
- import { connect } from 'react-redux';
11
+ import { useSelector } from 'react-redux';
13
12
  import { Link } from 'react-router-dom';
14
- import { compose } from 'redux';
15
13
  import { Container, Grid, Header, Message, Segment } from 'semantic-ui-react';
16
14
 
17
- import { getSystemInformation, listControlpanels } from '@plone/volto/actions';
18
15
  import { Error, Icon, Toolbar, VersionOverview } from '@plone/volto/components';
19
16
 
20
17
  import config from '@plone/volto/registry';
@@ -99,15 +96,19 @@ const messages = defineMessages({
99
96
  /**
100
97
  * Controlpanels container class.
101
98
  */
102
- function Controlpanels({
103
- controlpanels,
104
- controlpanelsRequest,
105
- systemInformation,
106
- pathname,
107
- }) {
99
+ export default function Controlpanels({ location }) {
108
100
  const intl = useIntl();
109
101
  const [isClient, setIsClient] = useState(false);
110
102
 
103
+ const { pathname } = location;
104
+ const controlpanels = useSelector(
105
+ (state) => state.controlpanels.controlpanels,
106
+ );
107
+ const controlpanelsRequest = useSelector((state) => state.controlpanels.list);
108
+ const systemInformation = useSelector(
109
+ (state) => state.controlpanels.systeminformation,
110
+ );
111
+
111
112
  useEffect(() => {
112
113
  setIsClient(true);
113
114
  }, []);
@@ -281,41 +282,3 @@ function Controlpanels({
281
282
  </div>
282
283
  );
283
284
  }
284
-
285
- /**
286
- * Property types.
287
- * @property {Object} propTypes Property types.
288
- * @static
289
- */
290
- Controlpanels.propTypes = {
291
- controlpanels: PropTypes.arrayOf(
292
- PropTypes.shape({
293
- '@id': PropTypes.string,
294
- group: PropTypes.string,
295
- title: PropTypes.string,
296
- }),
297
- ).isRequired,
298
- pathname: PropTypes.string.isRequired,
299
- };
300
-
301
- export default compose(
302
- connect((state, props) => ({
303
- controlpanels: state.controlpanels.controlpanels,
304
- controlpanelsRequest: state.controlpanels.list,
305
- pathname: props.location.pathname,
306
- systemInformation: state.controlpanels.systeminformation,
307
- })),
308
-
309
- asyncConnect([
310
- {
311
- key: 'controlpanels',
312
- promise: async ({ location, store: { dispatch } }) =>
313
- await dispatch(listControlpanels()),
314
- },
315
- {
316
- key: 'systemInformation',
317
- promise: async ({ location, store: { dispatch } }) =>
318
- await dispatch(getSystemInformation()),
319
- },
320
- ]),
321
- )(Controlpanels);
@@ -11,35 +11,37 @@ const mockStore = configureStore();
11
11
 
12
12
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
13
13
 
14
- jest.mock('./VersionOverview', () =>
15
- jest.fn(() => <div className="VersionOverview" />),
16
- );
14
+ jest.mock('@plone/volto/components/manage/Controlpanels', () => ({
15
+ VersionOverview: jest.fn(() => <div className="VersionOverview" />),
16
+ }));
17
17
 
18
18
  describe('Controlpanels', () => {
19
19
  it('renders a controlpanels component', () => {
20
20
  const store = mockStore({
21
- controlpanels: [
22
- {
23
- '@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
24
- group: 'General',
25
- title: 'Date and Time',
26
- },
27
- {
28
- '@id': 'http://localhost:8080/Plone/@controlpanels/lang',
29
- group: 'General',
30
- title: 'Language',
31
- },
32
- {
33
- '@id': 'http://localhost:8080/Plone/@controlpanels/editing',
34
- group: 'Content',
35
- title: 'Editing',
36
- },
37
- {
38
- '@id': 'http://localhost:8080/Plone/@controlpanels/security',
39
- group: 'Security',
40
- title: 'test',
41
- },
42
- ],
21
+ controlpanels: {
22
+ controlpanels: [
23
+ {
24
+ '@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
25
+ group: 'General',
26
+ title: 'Date and Time',
27
+ },
28
+ {
29
+ '@id': 'http://localhost:8080/Plone/@controlpanels/lang',
30
+ group: 'General',
31
+ title: 'Language',
32
+ },
33
+ {
34
+ '@id': 'http://localhost:8080/Plone/@controlpanels/editing',
35
+ group: 'Content',
36
+ title: 'Editing',
37
+ },
38
+ {
39
+ '@id': 'http://localhost:8080/Plone/@controlpanels/security',
40
+ group: 'Security',
41
+ title: 'test',
42
+ },
43
+ ],
44
+ },
43
45
  reduxAsyncConnect: {
44
46
  // Mocked in redux async connect as it isn't fetch client-side.
45
47
  controlpanels: [
@@ -85,13 +87,15 @@ describe('Controlpanels', () => {
85
87
 
86
88
  it('renders an additional control panel', () => {
87
89
  const store = mockStore({
88
- controlpanels: [
89
- {
90
- '@id': 'http://localhost:8080/Plone/@controlpanels/security',
91
- group: 'Security',
92
- title: 'test',
93
- },
94
- ],
90
+ controlpanels: {
91
+ controlpanels: [
92
+ {
93
+ '@id': 'http://localhost:8080/Plone/@controlpanels/security',
94
+ group: 'Security',
95
+ title: 'test',
96
+ },
97
+ ],
98
+ },
95
99
  reduxAsyncConnect: {
96
100
  // Mocked in redux async connect as it isn't fetch client-side.
97
101
  controlpanels: [
@@ -15,13 +15,13 @@ import {
15
15
  import jwtDecode from 'jwt-decode';
16
16
  import {
17
17
  Icon,
18
- ModalForm,
19
18
  Toast,
20
19
  Toolbar,
21
- RenderGroups,
22
20
  Pagination,
23
21
  Error,
24
22
  } from '@plone/volto/components';
23
+ import RenderGroups from '@plone/volto/components/manage/Controlpanels/Groups/RenderGroups';
24
+ import { ModalForm } from '@plone/volto/components/manage/Form';
25
25
  import { Link } from 'react-router-dom';
26
26
  import {
27
27
  Helmet,
@@ -14,12 +14,8 @@ import { Container, Button, Table } from 'semantic-ui-react';
14
14
  import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
15
15
 
16
16
  import { deleteComment, searchContent } from '@plone/volto/actions';
17
- import {
18
- CommentEditModal,
19
- FormattedRelativeDate,
20
- Icon,
21
- Toolbar,
22
- } from '@plone/volto/components';
17
+ import { FormattedRelativeDate, Icon, Toolbar } from '@plone/volto/components';
18
+ import { CommentEditModal } from '@plone/volto/components/theme/Comments';
23
19
 
24
20
  import backSVG from '@plone/volto/icons/back.svg';
25
21
 
@@ -7,12 +7,9 @@ import ModerateComments from './ModerateComments';
7
7
 
8
8
  const mockStore = configureStore();
9
9
 
10
+ jest.mock('@plone/volto/components/theme/Comments');
10
11
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
11
12
 
12
- jest.mock('../../theme/Comments/CommentEditModal', () =>
13
- jest.fn(() => <div id="modal" />),
14
- );
15
-
16
13
  describe('ModerateComments', () => {
17
14
  it('renders a moderate comments component', () => {
18
15
  const store = mockStore({
@@ -15,7 +15,7 @@ import {
15
15
  searchContent,
16
16
  } from '@plone/volto/actions';
17
17
 
18
- const ListingTemplate = ({
18
+ const RelationsListing = ({
19
19
  relationtype,
20
20
  query_source,
21
21
  query_target,
@@ -477,4 +477,4 @@ const ListingTemplate = ({
477
477
  </>
478
478
  );
479
479
  };
480
- export default ListingTemplate;
480
+ export default RelationsListing;
@@ -22,8 +22,8 @@ import {
22
22
  queryRelations,
23
23
  rebuildRelations,
24
24
  } from '@plone/volto/actions';
25
- import RelationsListing from './RelationsListing';
26
- import BrokenRelations from './BrokenRelations';
25
+ import RelationsListing from '@plone/volto/components/manage/Controlpanels/Relations/RelationsListing';
26
+ import BrokenRelations from '@plone/volto/components/manage/Controlpanels/Relations/BrokenRelations';
27
27
  import helpSVG from '@plone/volto/icons/help.svg';
28
28
  import clearSVG from '@plone/volto/icons/clear.svg';
29
29
  import navTreeSVG from '@plone/volto/icons/nav.svg';
@@ -19,9 +19,9 @@ import {
19
19
  Segment,
20
20
  } from 'semantic-ui-react';
21
21
  import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
22
- import { Icon, Toolbar, Field } from '@plone/volto/components';
22
+ import { Icon, Toolbar, Toast } from '@plone/volto/components';
23
+ import { Field } from '@plone/volto/components/manage/Form';
23
24
  import { toast } from 'react-toastify';
24
- import { Toast } from '@plone/volto/components';
25
25
 
26
26
  import { getContentRulesEvents, addNewRule } from '@plone/volto/actions';
27
27
 
@@ -9,6 +9,7 @@ import AddRule from './AddRule';
9
9
  const middlewares = [thunk];
10
10
  const mockStore = configureMockStore(middlewares);
11
11
 
12
+ jest.mock('@plone/volto/components/manage/Form');
12
13
  jest.mock('../../Toolbar/Toolbar', () => jest.fn(() => <div id="Toolbar" />));
13
14
 
14
15
  describe('AddRule', () => {
@@ -20,14 +20,14 @@ import {
20
20
  } from 'semantic-ui-react';
21
21
  import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
22
22
 
23
- import { Icon, Toolbar, Field } from '@plone/volto/components';
23
+ import { Icon, Toolbar, Toast } from '@plone/volto/components';
24
+ import { Field } from '@plone/volto/components/manage/Form';
24
25
  import {
25
26
  getControlPanelRule,
26
27
  editRule,
27
28
  getContentRulesEvents,
28
29
  } from '@plone/volto/actions';
29
30
  import { toast } from 'react-toastify';
30
- import { Toast } from '@plone/volto/components';
31
31
 
32
32
  import backSVG from '@plone/volto/icons/back.svg';
33
33
 
@@ -11,6 +11,8 @@ const mockStore = configureMockStore(middlewares);
11
11
 
12
12
  jest.mock('../../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
13
13
 
14
+ jest.mock('@plone/volto/components/manage/Form');
15
+
14
16
  describe('EditRule', () => {
15
17
  it('renders rules edit interface', () => {
16
18
  const store = mockStore({
@@ -6,7 +6,7 @@ import { getVocabulary } from '@plone/volto/actions';
6
6
  import { injectIntl } from 'react-intl';
7
7
  import { compose } from 'redux';
8
8
 
9
- import { ModalForm } from '@plone/volto/components';
9
+ import { ModalForm } from '@plone/volto/components/manage/Form';
10
10
 
11
11
  const setSchema = (name, choices = '') => {
12
12
  switch (name) {
@@ -10,7 +10,8 @@ import { Link } from 'react-router-dom';
10
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
- import { Icon, Toolbar, Form, Toast } from '@plone/volto/components';
13
+ import { Icon, Toolbar, Toast } from '@plone/volto/components';
14
+ import { Form } from '@plone/volto/components/manage/Form';
14
15
  import backSVG from '@plone/volto/icons/back.svg';
15
16
  import { map } from 'lodash';
16
17
  import { Helmet } from '@plone/volto/helpers';
@@ -7,10 +7,9 @@ import UndoControlpanel from './UndoControlpanel';
7
7
 
8
8
  const mockStore = configureStore();
9
9
 
10
+ jest.mock('@plone/volto/components/manage/Form');
10
11
  jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
11
12
 
12
- jest.mock('../Form/Form', () => jest.fn(() => <div id="form" />));
13
-
14
13
  describe('UndoControlpanel', () => {
15
14
  it('renders undo controlpanel component', () => {
16
15
  const store = mockStore({
@@ -25,7 +25,8 @@ import {
25
25
  runUpgrade,
26
26
  } from '@plone/volto/actions';
27
27
  import { Helmet } from '@plone/volto/helpers';
28
- import { Icon, Toast, Toolbar, VersionOverview } from '@plone/volto/components';
28
+ import { Icon, Toast, Toolbar } from '@plone/volto/components';
29
+ import { VersionOverview } from '@plone/volto/components/manage/Controlpanels';
29
30
  import backSVG from '@plone/volto/icons/back.svg';
30
31
  import { toast } from 'react-toastify';
31
32
 
@@ -8,7 +8,8 @@ import { FormattedMessage, injectIntl } from 'react-intl';
8
8
  import { Dropdown, Table, Checkbox } from 'semantic-ui-react';
9
9
  import trashSVG from '@plone/volto/icons/delete.svg';
10
10
  import editSVG from '@plone/volto/icons/editing.svg';
11
- import { Icon, ModalForm, Toast } from '@plone/volto/components';
11
+ import { Icon, Toast } from '@plone/volto/components';
12
+ import { ModalForm } from '@plone/volto/components/manage/Form';
12
13
  import { updateUser } from '@plone/volto/actions';
13
14
  import ploneSVG from '@plone/volto/icons/plone.svg';
14
15
  import { compose } from 'redux';
@@ -7,7 +7,7 @@ import { isEqual } from 'lodash';
7
7
 
8
8
  import { messages } from '@plone/volto/helpers';
9
9
  import { listGroups } from '@plone/volto/actions'; // getRegistry
10
- import UserGroupMembershipListing from './UserGroupMembershipListing';
10
+ import UserGroupMembershipListing from '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipListing';
11
11
 
12
12
  const UserGroupMembershipMatrix = ({ many_users, many_groups }) => {
13
13
  const intl = useIntl();
@@ -17,13 +17,13 @@ import {
17
17
  import jwtDecode from 'jwt-decode';
18
18
  import {
19
19
  Icon,
20
- ModalForm,
21
20
  Toast,
22
21
  Toolbar,
23
- RenderUsers,
24
22
  Pagination,
25
23
  Error,
26
24
  } from '@plone/volto/components';
25
+ import { ModalForm } from '@plone/volto/components/manage/Form';
26
+ import RenderUsers from '@plone/volto/components/manage/Controlpanels/Users/RenderUsers';
27
27
  import { Link } from 'react-router-dom';
28
28
  import {
29
29
  Helmet,