@eeacms/volto-eea-website-theme 1.34.0 → 2.0.0

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 (54) hide show
  1. package/.eslintrc.js +7 -2
  2. package/CHANGELOG.md +44 -20
  3. package/docker-compose.yml +1 -1
  4. package/jest-addon.config.js +3 -0
  5. package/package.json +2 -1
  6. package/src/components/manage/Blocks/LayoutSettings/index.js +3 -1
  7. package/src/components/manage/Blocks/Title/index.js +3 -1
  8. package/src/components/manage/Blocks/Title/schema.js +3 -1
  9. package/src/components/theme/Banner/View.jsx +12 -5
  10. package/src/components/theme/DraftBackground/DraftBackground.jsx +1 -0
  11. package/src/components/theme/DraftBackground/DraftBackground.test.jsx +85 -0
  12. package/src/config.js +2 -0
  13. package/src/customizations/@plone/volto-slate/blocks/Text/TextBlockView.jsx +32 -0
  14. package/src/customizations/@plone/volto-slate/editor/render.jsx +75 -0
  15. package/src/customizations/@plone/volto-slate/elementEditor/utils.js +76 -75
  16. package/src/customizations/volto/components/manage/Blocks/Grid/Edit.jsx +70 -0
  17. package/src/customizations/volto/components/manage/Blocks/Grid/View.jsx +61 -0
  18. package/src/customizations/volto/components/manage/Blocks/Grid/readme.md +1 -0
  19. package/src/customizations/volto/components/manage/Blocks/Image/Edit.jsx +82 -23
  20. package/src/customizations/volto/components/manage/Blocks/Image/Edit.test.jsx +10 -3
  21. package/src/customizations/volto/components/manage/Blocks/Image/View.jsx +110 -111
  22. package/src/customizations/volto/components/manage/Blocks/Image/schema.js +17 -2
  23. package/src/customizations/volto/components/manage/Blocks/LeadImage/Edit.jsx +35 -14
  24. package/src/customizations/volto/components/manage/Blocks/LeadImage/View.jsx +65 -79
  25. package/src/customizations/volto/components/manage/Display/Display.jsx +306 -0
  26. package/src/customizations/volto/components/manage/Display/Readme.md +1 -0
  27. package/src/customizations/volto/components/manage/Sidebar/SidebarPopup copy.jsx +82 -0
  28. package/src/customizations/volto/components/manage/Toolbar/More.jsx +541 -0
  29. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +3 -1
  30. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +24 -14
  31. package/src/customizations/volto/components/manage/Widgets/README.md +1 -0
  32. package/src/customizations/volto/components/manage/Workflow/README.txt +1 -0
  33. package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +324 -0
  34. package/src/customizations/volto/components/manage/Workflow/Workflow.test.jsx +81 -0
  35. package/src/customizations/volto/components/theme/Comments/Comments.jsx +1 -2
  36. package/src/customizations/volto/components/theme/ContactForm/ContactForm.jsx +1 -1
  37. package/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx +1 -0
  38. package/src/index.js +21 -16
  39. package/src/middleware/ok.js +4 -2
  40. package/src/middleware/voltoCustom.js +4 -2
  41. package/src/slate.js +10 -8
  42. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/README.txt +0 -1
  43. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/StyleMenu.jsx +0 -157
  44. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/utils.js +0 -168
  45. package/src/customizations/volto/components/manage/Add/Add.jsx +0 -498
  46. package/src/customizations/volto/components/manage/Add/readme.md +0 -1
  47. package/src/customizations/volto/components/manage/Contents/ContentsPropertiesModal.jsx +0 -232
  48. package/src/customizations/volto/components/manage/Form/Form.jsx +0 -810
  49. package/src/customizations/volto/components/manage/Form/Form.test.jsx +0 -1124
  50. package/src/customizations/volto/components/manage/Form/ModalForm.jsx +0 -326
  51. package/src/customizations/volto/components/manage/Sharing/Sharing.jsx +0 -528
  52. package/src/customizations/volto/components/manage/Sharing/Sharing.test.jsx +0 -72
  53. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.test.jsx +0 -193
  54. package/src/customizations/volto/components/theme/AppExtras/AppExtras.jsx +0 -27
@@ -1,193 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@testing-library/react';
3
- import '@testing-library/jest-dom/extend-expect';
4
- import { Provider } from 'react-intl-redux';
5
- import configureStore from 'redux-mock-store';
6
- import { Router } from 'react-router-dom';
7
- import { createMemoryHistory } from 'history';
8
- import ObjectBrowserWidgetComponent from './ObjectBrowserWidget';
9
- import '@testing-library/jest-dom/extend-expect';
10
-
11
- const mockStore = configureStore();
12
- let store;
13
- let history;
14
-
15
- describe('ObjectBrowserWidgetComponent', () => {
16
- beforeEach(() => {
17
- store = mockStore({
18
- search: {
19
- subrequests: {
20
- 'testBlock-multiple': {},
21
- 'testBlock-link': {},
22
- },
23
- },
24
- intl: {
25
- locale: 'en',
26
- messages: {},
27
- },
28
- });
29
- history = createMemoryHistory();
30
- });
31
-
32
- it('renders without crashing', () => {
33
- const { container } = render(
34
- <Provider store={store}>
35
- <Router history={history}>
36
- <ObjectBrowserWidgetComponent
37
- id="my-widget"
38
- title="My widget"
39
- onChange={() => {}}
40
- openObjectBrowser={() => {}}
41
- />
42
- </Router>
43
- </Provider>,
44
- );
45
-
46
- expect(container).toBeTruthy();
47
- });
48
-
49
- it('renders without crashing with values, mode different than multiple, and description', () => {
50
- const { container } = render(
51
- <Provider store={store}>
52
- <Router history={history}>
53
- <ObjectBrowserWidgetComponent
54
- id="my-widget"
55
- title="My widget"
56
- value={[{ '@id': 'http://locahost:3000/test' }, { title: 'test2' }]}
57
- mode="custom"
58
- description="My description"
59
- onChange={() => {}}
60
- openObjectBrowser={() => {}}
61
- />
62
- </Router>
63
- </Provider>,
64
- );
65
-
66
- expect(container).toBeTruthy();
67
- });
68
-
69
- it('renders without crashing with values, mode different than multiple and triggers the cancel function', () => {
70
- const { container, getByPlaceholderText } = render(
71
- <Provider store={store}>
72
- <Router history={history}>
73
- <ObjectBrowserWidgetComponent
74
- id="my-widget"
75
- title="My widget"
76
- mode="custom"
77
- description="My description"
78
- onChange={() => {}}
79
- openObjectBrowser={() => {}}
80
- allowExternals={true}
81
- placeholder="My placeholder"
82
- />
83
- </Router>
84
- </Provider>,
85
- );
86
-
87
- fireEvent.change(getByPlaceholderText('My placeholder'), {
88
- target: { value: 'http://localhost:8080/Plone/test' },
89
- });
90
-
91
- expect(container.querySelector('button.cancel')).toBeInTheDocument();
92
- fireEvent.click(container.querySelector('button.cancel'));
93
-
94
- expect(container.querySelector('button.action')).toBeInTheDocument();
95
- fireEvent.click(container.querySelector('button.action'));
96
- });
97
-
98
- it('renders without crashing with values, mode different than multiple with placeholder and triggers the cancel function', () => {
99
- const { container, getByPlaceholderText } = render(
100
- <Provider store={store}>
101
- <Router history={history}>
102
- <ObjectBrowserWidgetComponent
103
- id="my-widget"
104
- title="My widget"
105
- mode="custom"
106
- description="My description"
107
- onChange={() => {}}
108
- openObjectBrowser={() => {}}
109
- allowExternals={true}
110
- />
111
- </Router>
112
- </Provider>,
113
- );
114
-
115
- expect(getByPlaceholderText('No items selected')).toBeInTheDocument();
116
- fireEvent.change(getByPlaceholderText('No items selected'), {
117
- target: { value: 'test' },
118
- });
119
-
120
- expect(container.querySelector('button.cancel')).toBeInTheDocument();
121
- fireEvent.click(container.querySelector('button.cancel'));
122
-
123
- expect(container.querySelector('button.action')).toBeInTheDocument();
124
-
125
- expect(container).toBeTruthy();
126
- });
127
-
128
- it('renders without crashing with values, mode different than multiple and triggers for keydown, change and submit', () => {
129
- const { container, getByPlaceholderText } = render(
130
- <Provider store={store}>
131
- <Router history={history}>
132
- <ObjectBrowserWidgetComponent
133
- id="my-widget"
134
- title="My widget"
135
- mode="custom"
136
- description="My description"
137
- onChange={() => {}}
138
- openObjectBrowser={() => {}}
139
- allowExternals={true}
140
- />
141
- </Router>
142
- </Provider>,
143
- );
144
-
145
- expect(getByPlaceholderText('No items selected')).toBeInTheDocument();
146
- fireEvent.keyDown(getByPlaceholderText('No items selected'), {
147
- key: 'Enter',
148
- code: 'Enter',
149
- charCode: 13,
150
- });
151
- fireEvent.keyDown(getByPlaceholderText('No items selected'), {
152
- key: 'Escape',
153
- code: 'Escape',
154
- charCode: 27,
155
- });
156
- fireEvent.keyDown(getByPlaceholderText('No items selected'), {
157
- key: 'A',
158
- code: 'KeyA',
159
- });
160
-
161
- fireEvent.change(getByPlaceholderText('No items selected'), {
162
- target: { value: 'http://localhost:3000/Plone/test' },
163
- });
164
-
165
- expect(container.querySelector('button.primary')).toBeInTheDocument();
166
- fireEvent.click(container.querySelector('button.primary'));
167
-
168
- fireEvent.click(container.querySelector('button.action'));
169
-
170
- expect(container).toBeTruthy();
171
- });
172
-
173
- it('renders without crashing with values, mode different than multiple and triggers for click on the Popup', () => {
174
- const { container } = render(
175
- <Provider store={store}>
176
- <Router history={history}>
177
- <ObjectBrowserWidgetComponent
178
- id="my-widget"
179
- title="My widget"
180
- value={[{ '@id': 'http://locahost:3000/test', title: 'Title 1' }]}
181
- description="My description"
182
- onChange={() => {}}
183
- openObjectBrowser={() => {}}
184
- />
185
- </Router>
186
- </Provider>,
187
- );
188
-
189
- expect(container.querySelector('.icon.right')).toBeInTheDocument();
190
- fireEvent.click(container.querySelector('.icon.right'));
191
- expect(container).toBeTruthy();
192
- });
193
- });
@@ -1,27 +0,0 @@
1
- //this should be deleted when upgraded to a volto version that supports App Extras exceptions
2
- import React from 'react';
3
- import { matchPath } from 'react-router';
4
- import config from '@plone/volto/registry';
5
-
6
- const AppExtras = (props) => {
7
- const { settings } = config;
8
- const { appExtras = [] } = settings;
9
- const { pathname } = props;
10
- const active = appExtras
11
- .map((reg) => {
12
- const excluded = matchPath(pathname, reg.exclude);
13
- if (excluded) return null;
14
- const match = matchPath(pathname, reg.match);
15
- return match ? { reg, match } : null;
16
- })
17
- .filter((reg) => reg);
18
-
19
- return active.map(({ reg: { component, props: extraProps }, match }, i) => {
20
- const Insert = component;
21
- return (
22
- <Insert key={`appextra-${i}`} match={match} {...props} {...extraProps} />
23
- );
24
- });
25
- };
26
-
27
- export default AppExtras;