@plone/volto 19.0.0-alpha.35 → 19.0.0-alpha.37
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 +54 -0
- package/README.md +1 -1
- package/locales/af/LC_MESSAGES/volto.po +29 -13
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +29 -13
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +29 -13
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +29 -13
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +32 -16
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +30 -14
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +29 -13
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +29 -13
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +32 -16
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +29 -13
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +25 -10
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +29 -13
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +29 -13
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +29 -13
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +67 -52
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +29 -13
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +55 -40
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +29 -13
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +30 -14
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +208 -193
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +29 -13
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +58 -43
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +29 -13
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +34 -18
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +30 -14
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +29 -13
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +29 -13
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +29 -13
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +34 -18
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +29 -13
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +29 -13
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +29 -13
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +29 -13
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +30 -14
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +29 -13
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +29 -13
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +29 -13
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +29 -13
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +29 -13
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +69 -53
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +29 -13
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +30 -14
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +30 -14
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +54 -39
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +29 -13
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +30 -15
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +30 -14
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +30 -14
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +29 -13
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +29 -13
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +29 -13
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +30 -14
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +29 -13
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +29 -13
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +31 -15
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +30 -15
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +29 -13
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +29 -13
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +29 -13
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +29 -14
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +30 -14
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +29 -13
- package/locales/vi.json +1 -1
- package/locales/volto.pot +26 -11
- package/locales/zh_CN/LC_MESSAGES/volto.po +29 -14
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +29 -13
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +29 -13
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +10 -10
- package/src/components/manage/Add/Add.test.jsx +10 -3
- package/src/components/manage/Aliases/Aliases.test.jsx +5 -2
- package/src/components/manage/BlockChooser/BlockChooser.jsx +7 -10
- package/src/components/manage/Blocks/Block/Edit.jsx +19 -10
- package/src/components/manage/Blocks/Block/Order/Item.jsx +9 -4
- package/src/components/manage/Contents/Contents.test.jsx +7 -4
- package/src/components/manage/Contents/DropZoneContent.jsx +1 -0
- package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Aliases.test.jsx +7 -4
- package/src/components/manage/Controlpanels/BlockType.tsx +2 -3
- package/src/components/manage/Controlpanels/ContentType.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypes.jsx +9 -2
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +13 -8
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +9 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +7 -4
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +58 -5
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.jsx +624 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +21 -8
- package/src/components/manage/Delete/Delete.test.jsx +13 -8
- package/src/components/manage/Diff/Diff.test.jsx +7 -4
- package/src/components/manage/Edit/Edit.test.jsx +11 -6
- package/src/components/manage/Form/Form.jsx +6 -1
- package/src/components/manage/Form/ModalForm.jsx +164 -88
- package/src/components/manage/History/History.test.jsx +15 -8
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -4
- package/src/components/manage/Multilingual/ManageTranslations.test.jsx +15 -12
- package/src/components/manage/Preferences/ChangePassword.test.jsx +7 -4
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +9 -6
- package/src/components/manage/Rules/Rules.test.jsx +5 -2
- package/src/components/manage/Sharing/Sharing.test.jsx +9 -6
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +7 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +7 -3
- package/src/components/manage/Sidebar/ObjectBrowserBody.test.jsx +52 -0
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/Sidebar.test.jsx +4 -1
- package/src/components/manage/Toolbar/Toolbar.jsx +89 -7
- package/src/components/manage/Toolbar/Toolbar.test.jsx +15 -10
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +7 -5
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +1 -0
- package/src/components/manage/Widgets/QuerystringWidget.test.jsx +3 -1
- package/src/components/manage/Widgets/TextWidget.jsx +4 -0
- package/src/components/manage/Widgets/TokenWidget.jsx +142 -186
- package/src/components/theme/App/App.test.jsx +13 -10
- package/src/components/theme/ContactForm/ContactForm.test.jsx +13 -8
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.test.jsx +6 -3
- package/src/components/theme/Search/Search.jsx +218 -328
- package/src/components/theme/Search/Search.test.jsx +14 -14
- package/src/components/theme/Sitemap/Sitemap.jsx +22 -30
- package/src/components/theme/Sitemap/Sitemap.test.jsx +18 -0
- package/src/components/theme/Unauthorized/Unauthorized.jsx +23 -30
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +6 -4
- package/src/components/theme/View/View.test.jsx +37 -24
- package/src/config/index.js +1 -0
- package/src/helpers/Api/Api.js +2 -2
- package/src/helpers/I18n/I18n.test.ts +44 -0
- package/src/helpers/I18n/I18n.ts +31 -0
- package/src/helpers/Robots/Robots.js +1 -1
- package/src/helpers/Robots/Robots.test.js +34 -0
- package/src/helpers/index.js +1 -0
- package/theme/themes/pastanaga/collections/form.overrides +21 -0
- package/theme/themes/pastanaga/elements/button.overrides +30 -3
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +2 -6
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.d.ts +1 -0
- package/types/components/manage/Controlpanels/index.d.ts +1 -1
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowserBody.test.d.ts +1 -0
- package/types/components/manage/Widgets/ImageWidget.d.ts +1 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/UrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/index.d.ts +2 -2
- package/types/components/theme/Search/Search.d.ts +1 -1
- package/types/helpers/I18n/I18n.d.ts +20 -0
- package/types/helpers/index.d.ts +1 -0
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import configureStore from 'redux-mock-store';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import { MemoryRouter } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import { waitFor, render, screen } from '@testing-library/react';
|
|
6
7
|
|
|
7
8
|
import Diff from './Diff';
|
|
@@ -75,10 +76,12 @@ describe('Diff', () => {
|
|
|
75
76
|
});
|
|
76
77
|
const { container } = render(
|
|
77
78
|
<Provider store={store}>
|
|
78
|
-
<
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
<CookiesProvider>
|
|
80
|
+
<MemoryRouter initialEntries={['/blog?one=0&two=1']}>
|
|
81
|
+
<Diff />
|
|
82
|
+
<div id="toolbar"></div>
|
|
83
|
+
</MemoryRouter>
|
|
84
|
+
</CookiesProvider>
|
|
82
85
|
</Provider>,
|
|
83
86
|
);
|
|
84
87
|
await waitFor(() => screen.getByTestId('DiffField'));
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import jwt from 'jsonwebtoken';
|
|
6
7
|
|
|
7
8
|
import { __test__ as Edit } from './Edit';
|
|
@@ -55,9 +56,11 @@ describe('Edit', () => {
|
|
|
55
56
|
});
|
|
56
57
|
const { container } = render(
|
|
57
58
|
<Provider store={store}>
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
<CookiesProvider>
|
|
60
|
+
<div id="toolbar"></div>
|
|
61
|
+
<Edit location={{ pathname: '/blog', search: {} }} />
|
|
62
|
+
<div id="sidebar"></div>
|
|
63
|
+
</CookiesProvider>
|
|
61
64
|
</Provider>,
|
|
62
65
|
);
|
|
63
66
|
|
|
@@ -104,9 +107,11 @@ describe('Edit', () => {
|
|
|
104
107
|
});
|
|
105
108
|
const { container } = render(
|
|
106
109
|
<Provider store={store}>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
<CookiesProvider>
|
|
111
|
+
<div id="toolbar"></div>
|
|
112
|
+
<Edit location={{ pathname: '/blog', search: {} }} />
|
|
113
|
+
<div id="sidebar"></div>
|
|
114
|
+
</CookiesProvider>
|
|
110
115
|
</Provider>,
|
|
111
116
|
);
|
|
112
117
|
|
|
@@ -972,7 +972,12 @@ class Form extends Component {
|
|
|
972
972
|
onTabChange={this.onTabChange}
|
|
973
973
|
activeIndex={this.state.activeIndex}
|
|
974
974
|
panes={map(schema.fieldsets, (item) => ({
|
|
975
|
-
menuItem:
|
|
975
|
+
menuItem: {
|
|
976
|
+
key: item.id,
|
|
977
|
+
content: item.title,
|
|
978
|
+
as: 'button',
|
|
979
|
+
type: 'button',
|
|
980
|
+
},
|
|
976
981
|
render: () => [
|
|
977
982
|
!settings.verticalFormTabs && this.props.title && (
|
|
978
983
|
<Segment secondary attached key={this.props.title}>
|
|
@@ -46,6 +46,14 @@ const messages = defineMessages({
|
|
|
46
46
|
id: 'Cancel',
|
|
47
47
|
defaultMessage: 'Cancel',
|
|
48
48
|
},
|
|
49
|
+
dialogOpened: {
|
|
50
|
+
id: 'Pop-up opened: {title}',
|
|
51
|
+
defaultMessage: 'Pop-up opened: {title}',
|
|
52
|
+
},
|
|
53
|
+
dialogClosed: {
|
|
54
|
+
id: 'Pop-up closed.',
|
|
55
|
+
defaultMessage: 'Pop-up closed.',
|
|
56
|
+
},
|
|
49
57
|
});
|
|
50
58
|
|
|
51
59
|
/**
|
|
@@ -54,6 +62,7 @@ const messages = defineMessages({
|
|
|
54
62
|
* @extends Component
|
|
55
63
|
*/
|
|
56
64
|
class ModalForm extends Component {
|
|
65
|
+
static idCounter = 0;
|
|
57
66
|
/**
|
|
58
67
|
* Property types.
|
|
59
68
|
* @property {Object} propTypes Property types.
|
|
@@ -110,17 +119,21 @@ class ModalForm extends Component {
|
|
|
110
119
|
*/
|
|
111
120
|
constructor(props) {
|
|
112
121
|
super(props);
|
|
122
|
+
this.headerId = `modal-title-${++ModalForm.idCounter}`;
|
|
113
123
|
this.state = {
|
|
114
124
|
currentTab: 0,
|
|
115
125
|
errors: {},
|
|
116
126
|
isFormPristine: true,
|
|
117
127
|
formData: props.formData,
|
|
118
128
|
};
|
|
129
|
+
this.modalRef = React.createRef();
|
|
130
|
+
this.announceRef = React.createRef();
|
|
119
131
|
this.selectTab = this.selectTab.bind(this);
|
|
120
132
|
this.onChangeField = this.onChangeField.bind(this);
|
|
121
133
|
this.onBlurField = this.onBlurField.bind(this);
|
|
122
134
|
this.onClickInput = this.onClickInput.bind(this);
|
|
123
135
|
this.onSubmit = this.onSubmit.bind(this);
|
|
136
|
+
this.onKeyDown = this.onKeyDown.bind(this);
|
|
124
137
|
}
|
|
125
138
|
|
|
126
139
|
/**
|
|
@@ -209,12 +222,57 @@ class ModalForm extends Component {
|
|
|
209
222
|
});
|
|
210
223
|
}
|
|
211
224
|
|
|
225
|
+
onKeyDown(event) {
|
|
226
|
+
if (event.key !== 'Tab') return;
|
|
227
|
+
const modal = document.getElementById(this.headerId)?.closest('.ui.modal');
|
|
228
|
+
if (!modal) return;
|
|
229
|
+
const focusable = modal.querySelectorAll(
|
|
230
|
+
'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',
|
|
231
|
+
);
|
|
232
|
+
if (!focusable.length) return;
|
|
233
|
+
const first = focusable[0];
|
|
234
|
+
const last = focusable[focusable.length - 1];
|
|
235
|
+
if (event.shiftKey) {
|
|
236
|
+
if (document.activeElement === first) {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
last.focus();
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
if (document.activeElement === last) {
|
|
242
|
+
event.preventDefault();
|
|
243
|
+
first.focus();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
212
248
|
/**
|
|
213
249
|
* Component did update lifecycle handler
|
|
214
250
|
* @param {Object} prevProps
|
|
215
251
|
* @param {Object} prevState
|
|
216
252
|
*/
|
|
217
|
-
|
|
253
|
+
componentWillUnmount() {
|
|
254
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
componentDidUpdate(prevProps, prevState) {
|
|
258
|
+
if (!prevProps.open && this.props.open) {
|
|
259
|
+
document.addEventListener('keydown', this.onKeyDown);
|
|
260
|
+
this.modalRef.current?.focus();
|
|
261
|
+
if (this.announceRef.current) {
|
|
262
|
+
this.announceRef.current.textContent = this.props.intl.formatMessage(
|
|
263
|
+
messages.dialogOpened,
|
|
264
|
+
{ title: this.props.title },
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (prevProps.open && !this.props.open) {
|
|
269
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
270
|
+
if (this.announceRef.current) {
|
|
271
|
+
this.announceRef.current.textContent = this.props.intl.formatMessage(
|
|
272
|
+
messages.dialogClosed,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
218
276
|
if (this.props.onChangeFormData) {
|
|
219
277
|
if (!isEqual(prevState?.formData, this.state.formData)) {
|
|
220
278
|
this.props.onChangeFormData(this.state.formData);
|
|
@@ -259,100 +317,118 @@ class ModalForm extends Component {
|
|
|
259
317
|
|
|
260
318
|
const state_errors = keys(this.state.errors).length > 0;
|
|
261
319
|
return (
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
''
|
|
320
|
+
<>
|
|
321
|
+
{/* aria-live region outside Modal so it persists through open/close cycles */}
|
|
322
|
+
<div
|
|
323
|
+
ref={this.announceRef}
|
|
324
|
+
aria-live="assertive"
|
|
325
|
+
aria-atomic="true"
|
|
326
|
+
style={{
|
|
327
|
+
position: 'absolute',
|
|
328
|
+
width: '1px',
|
|
329
|
+
height: '1px',
|
|
330
|
+
overflow: 'hidden',
|
|
331
|
+
opacity: 0,
|
|
332
|
+
}}
|
|
333
|
+
/>
|
|
334
|
+
<Modal
|
|
335
|
+
role="dialog"
|
|
336
|
+
dimmer={this.props.dimmer}
|
|
337
|
+
open={this.props.open}
|
|
338
|
+
className={this.props.className}
|
|
339
|
+
aria-labelledby={this.headerId}
|
|
340
|
+
aria-modal="true"
|
|
341
|
+
>
|
|
342
|
+
<Header id={this.headerId}>{this.props.title}</Header>
|
|
343
|
+
<Dimmer active={this.props.loading}>
|
|
344
|
+
<Loader>
|
|
345
|
+
{this.props.loadingMessage || (
|
|
346
|
+
<FormattedMessage id="Loading" defaultMessage="Loading." />
|
|
290
347
|
)}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
348
|
+
</Loader>
|
|
349
|
+
</Dimmer>
|
|
350
|
+
<Modal.Content scrolling>
|
|
351
|
+
{/* outline suppressed for programmatic focus via CSS :focus:not(:focus-visible) on .modal-focus-trap */}
|
|
352
|
+
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
|
|
353
|
+
<div ref={this.modalRef} tabIndex={-1} className="modal-focus-trap">
|
|
354
|
+
<UiForm
|
|
355
|
+
method="post"
|
|
356
|
+
onSubmit={this.onSubmit}
|
|
357
|
+
error={state_errors || Boolean(this.props.submitError)}
|
|
358
|
+
>
|
|
359
|
+
{description}
|
|
360
|
+
<Message error>
|
|
361
|
+
{state_errors ? (
|
|
362
|
+
<FormattedMessage
|
|
363
|
+
id="There were some errors."
|
|
364
|
+
defaultMessage="There were some errors."
|
|
365
|
+
/>
|
|
366
|
+
) : (
|
|
367
|
+
''
|
|
368
|
+
)}
|
|
369
|
+
<div>{this.props.submitError}</div>
|
|
370
|
+
</Message>
|
|
371
|
+
{schema.fieldsets?.length > 1 && (
|
|
372
|
+
<Menu tabular stackable>
|
|
373
|
+
{map(schema.fieldsets, (item, index) => (
|
|
374
|
+
<Menu.Item
|
|
375
|
+
name={item.id}
|
|
376
|
+
index={index}
|
|
377
|
+
key={item.id}
|
|
378
|
+
active={this.state.currentTab === index}
|
|
379
|
+
onClick={this.selectTab}
|
|
380
|
+
>
|
|
381
|
+
{item.title}
|
|
382
|
+
</Menu.Item>
|
|
383
|
+
))}
|
|
384
|
+
</Menu>
|
|
385
|
+
)}
|
|
386
|
+
{fields.map((field) => (
|
|
387
|
+
<Field
|
|
388
|
+
{...field}
|
|
389
|
+
key={field.id}
|
|
390
|
+
onBlur={this.onBlurField}
|
|
391
|
+
onClick={this.onClickInput}
|
|
392
|
+
error={this.state.errors[field.id]}
|
|
393
|
+
/>
|
|
305
394
|
))}
|
|
306
|
-
</
|
|
395
|
+
</UiForm>
|
|
396
|
+
</div>
|
|
397
|
+
</Modal.Content>
|
|
398
|
+
<Modal.Actions>
|
|
399
|
+
{onCancel && (
|
|
400
|
+
<Button
|
|
401
|
+
type="button"
|
|
402
|
+
basic
|
|
403
|
+
secondary
|
|
404
|
+
aria-label={this.props.intl.formatMessage(messages.cancel)}
|
|
405
|
+
title={this.props.intl.formatMessage(messages.cancel)}
|
|
406
|
+
onClick={onCancel}
|
|
407
|
+
>
|
|
408
|
+
<Icon name={clearSVG} className="circled" size="30px" />
|
|
409
|
+
</Button>
|
|
307
410
|
)}
|
|
308
|
-
{fields.map((field) => (
|
|
309
|
-
<Field
|
|
310
|
-
{...field}
|
|
311
|
-
key={field.id}
|
|
312
|
-
onBlur={this.onBlurField}
|
|
313
|
-
onClick={this.onClickInput}
|
|
314
|
-
error={this.state.errors[field.id]}
|
|
315
|
-
/>
|
|
316
|
-
))}
|
|
317
|
-
</UiForm>
|
|
318
|
-
</Modal.Content>
|
|
319
|
-
<Modal.Actions>
|
|
320
|
-
<Button
|
|
321
|
-
basic
|
|
322
|
-
circular
|
|
323
|
-
primary
|
|
324
|
-
floated="right"
|
|
325
|
-
aria-label={
|
|
326
|
-
this.props.submitLabel
|
|
327
|
-
? this.props.submitLabel
|
|
328
|
-
: this.props.intl.formatMessage(messages.save)
|
|
329
|
-
}
|
|
330
|
-
title={
|
|
331
|
-
this.props.submitLabel
|
|
332
|
-
? this.props.submitLabel
|
|
333
|
-
: this.props.intl.formatMessage(messages.save)
|
|
334
|
-
}
|
|
335
|
-
onClick={this.onSubmit}
|
|
336
|
-
loading={this.props.loading}
|
|
337
|
-
>
|
|
338
|
-
<Icon name={aheadSVG} className="contents circled" size="30px" />
|
|
339
|
-
</Button>
|
|
340
|
-
{onCancel && (
|
|
341
411
|
<Button
|
|
342
|
-
type="button"
|
|
343
412
|
basic
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
413
|
+
primary
|
|
414
|
+
aria-label={
|
|
415
|
+
this.props.submitLabel
|
|
416
|
+
? this.props.submitLabel
|
|
417
|
+
: this.props.intl.formatMessage(messages.save)
|
|
418
|
+
}
|
|
419
|
+
title={
|
|
420
|
+
this.props.submitLabel
|
|
421
|
+
? this.props.submitLabel
|
|
422
|
+
: this.props.intl.formatMessage(messages.save)
|
|
423
|
+
}
|
|
424
|
+
onClick={this.onSubmit}
|
|
425
|
+
loading={this.props.loading}
|
|
350
426
|
>
|
|
351
|
-
<Icon name={
|
|
427
|
+
<Icon name={aheadSVG} className="contents circled" size="30px" />
|
|
352
428
|
</Button>
|
|
353
|
-
|
|
354
|
-
</Modal
|
|
355
|
-
|
|
429
|
+
</Modal.Actions>
|
|
430
|
+
</Modal>
|
|
431
|
+
</>
|
|
356
432
|
);
|
|
357
433
|
}
|
|
358
434
|
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { StaticRouter } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import { Provider } from 'react-intl-redux';
|
|
6
7
|
import jwt from 'jsonwebtoken';
|
|
7
8
|
|
|
@@ -89,8 +90,10 @@ describe('History', () => {
|
|
|
89
90
|
});
|
|
90
91
|
const { container } = render(
|
|
91
92
|
<Provider store={store}>
|
|
92
|
-
<
|
|
93
|
-
|
|
93
|
+
<CookiesProvider>
|
|
94
|
+
<History location={{ pathname: '/blog' }} />
|
|
95
|
+
<div id="toolbar"></div>
|
|
96
|
+
</CookiesProvider>
|
|
94
97
|
</Provider>,
|
|
95
98
|
);
|
|
96
99
|
|
|
@@ -156,8 +159,10 @@ describe('History', () => {
|
|
|
156
159
|
});
|
|
157
160
|
const { container } = render(
|
|
158
161
|
<Provider store={store}>
|
|
159
|
-
<
|
|
160
|
-
|
|
162
|
+
<CookiesProvider>
|
|
163
|
+
<History location={{ pathname: '/blog' }} />
|
|
164
|
+
<div id="toolbar"></div>
|
|
165
|
+
</CookiesProvider>
|
|
161
166
|
</Provider>,
|
|
162
167
|
);
|
|
163
168
|
|
|
@@ -221,10 +226,12 @@ describe('History', () => {
|
|
|
221
226
|
});
|
|
222
227
|
const { container } = render(
|
|
223
228
|
<Provider store={store}>
|
|
224
|
-
<
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
<CookiesProvider>
|
|
230
|
+
<StaticRouter context={{}} location={'/blog'}>
|
|
231
|
+
<History location={{ pathname: '/blog' }} />
|
|
232
|
+
<div id="toolbar"></div>
|
|
233
|
+
</StaticRouter>
|
|
234
|
+
</CookiesProvider>
|
|
228
235
|
</Provider>,
|
|
229
236
|
);
|
|
230
237
|
|
|
@@ -4,6 +4,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
4
4
|
import configureMockStore from 'redux-mock-store';
|
|
5
5
|
import thunk from 'redux-thunk';
|
|
6
6
|
import { MemoryRouter } from 'react-router-dom';
|
|
7
|
+
import { CookiesProvider } from 'react-cookie';
|
|
7
8
|
|
|
8
9
|
import { __test__ as LinksToItem } from './LinksToItem';
|
|
9
10
|
|
|
@@ -102,10 +103,12 @@ describe('LinksToItem', () => {
|
|
|
102
103
|
});
|
|
103
104
|
const { container } = render(
|
|
104
105
|
<Provider store={store}>
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
<CookiesProvider>
|
|
107
|
+
<MemoryRouter>
|
|
108
|
+
<LinksToItem location={{ pathname: '/page-1/links-to-item' }} />
|
|
109
|
+
<div id="toolbar"></div>
|
|
110
|
+
</MemoryRouter>
|
|
111
|
+
</CookiesProvider>
|
|
109
112
|
</Provider>,
|
|
110
113
|
);
|
|
111
114
|
|
|
@@ -3,6 +3,7 @@ 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';
|
|
6
|
+
import { CookiesProvider } from 'react-cookie';
|
|
6
7
|
import config from '@plone/volto/registry';
|
|
7
8
|
|
|
8
9
|
import ManageTranslations from './ManageTranslations';
|
|
@@ -41,18 +42,20 @@ describe('ManageTranslations', () => {
|
|
|
41
42
|
});
|
|
42
43
|
const { container } = render(
|
|
43
44
|
<Provider store={store}>
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
<CookiesProvider>
|
|
46
|
+
<MemoryRouter>
|
|
47
|
+
<ManageTranslations
|
|
48
|
+
location={{
|
|
49
|
+
pathname: '/blog-post',
|
|
50
|
+
state: {
|
|
51
|
+
language: 'es',
|
|
52
|
+
translationOf: '/en/page-en',
|
|
53
|
+
},
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
<div id="toolbar"></div>
|
|
57
|
+
</MemoryRouter>
|
|
58
|
+
</CookiesProvider>
|
|
56
59
|
</Provider>,
|
|
57
60
|
);
|
|
58
61
|
|
|
@@ -4,6 +4,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
4
4
|
import configureStore from 'redux-mock-store';
|
|
5
5
|
import jwt from 'jsonwebtoken';
|
|
6
6
|
import { MemoryRouter } from 'react-router-dom';
|
|
7
|
+
import { CookiesProvider } from 'react-cookie';
|
|
7
8
|
|
|
8
9
|
import ChangePassword from './ChangePassword';
|
|
9
10
|
|
|
@@ -40,10 +41,12 @@ describe('ChangePassword', () => {
|
|
|
40
41
|
});
|
|
41
42
|
const { container } = render(
|
|
42
43
|
<Provider store={store}>
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
<CookiesProvider>
|
|
45
|
+
<MemoryRouter>
|
|
46
|
+
<ChangePassword location={{ pathname: '/blog' }} />
|
|
47
|
+
<div id="toolbar"></div>
|
|
48
|
+
</MemoryRouter>
|
|
49
|
+
</CookiesProvider>
|
|
47
50
|
</Provider>,
|
|
48
51
|
);
|
|
49
52
|
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Provider } from 'react-intl-redux';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { MemoryRouter } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import { render } from '@testing-library/react';
|
|
6
7
|
|
|
7
8
|
import PersonalPreferences from './PersonalPreferences';
|
|
@@ -37,12 +38,14 @@ describe('PersonalPreferences', () => {
|
|
|
37
38
|
});
|
|
38
39
|
const { container } = render(
|
|
39
40
|
<Provider store={store}>
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
<CookiesProvider>
|
|
42
|
+
<MemoryRouter>
|
|
43
|
+
<PersonalPreferences
|
|
44
|
+
location={{ pathname: '/blog' }}
|
|
45
|
+
closeMenu={() => {}}
|
|
46
|
+
/>
|
|
47
|
+
</MemoryRouter>
|
|
48
|
+
</CookiesProvider>
|
|
46
49
|
</Provider>,
|
|
47
50
|
);
|
|
48
51
|
expect(container).toMatchSnapshot();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import { CookiesProvider } from 'react-cookie';
|
|
4
5
|
import configureMockStore from 'redux-mock-store';
|
|
5
6
|
import thunk from 'redux-thunk';
|
|
6
7
|
|
|
@@ -69,8 +70,10 @@ describe('Rules', () => {
|
|
|
69
70
|
});
|
|
70
71
|
const { container } = render(
|
|
71
72
|
<Provider store={store}>
|
|
72
|
-
<
|
|
73
|
-
|
|
73
|
+
<CookiesProvider>
|
|
74
|
+
<Rules location={{ pathname: '/blog/rules' }} />
|
|
75
|
+
<div id="toolbar"></div>
|
|
76
|
+
</CookiesProvider>
|
|
74
77
|
</Provider>,
|
|
75
78
|
);
|
|
76
79
|
|
|
@@ -4,6 +4,7 @@ import configureStore from 'redux-mock-store';
|
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import jwt from 'jsonwebtoken';
|
|
6
6
|
import { MemoryRouter } from 'react-router-dom';
|
|
7
|
+
import { CookiesProvider } from 'react-cookie';
|
|
7
8
|
import { PluggablesProvider } from '@plone/volto/components/manage/Pluggable';
|
|
8
9
|
|
|
9
10
|
import Sharing from './Sharing';
|
|
@@ -60,12 +61,14 @@ describe('Sharing', () => {
|
|
|
60
61
|
|
|
61
62
|
const { container } = render(
|
|
62
63
|
<Provider store={store}>
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
<CookiesProvider>
|
|
65
|
+
<PluggablesProvider>
|
|
66
|
+
<MemoryRouter>
|
|
67
|
+
<Sharing location={{ pathname: '/blog' }} />
|
|
68
|
+
<div id="toolbar"></div>
|
|
69
|
+
</MemoryRouter>
|
|
70
|
+
</PluggablesProvider>
|
|
71
|
+
</CookiesProvider>
|
|
69
72
|
</Provider>,
|
|
70
73
|
);
|
|
71
74
|
|
|
@@ -58,6 +58,7 @@ const withObjectBrowser = (WrappedComponent) =>
|
|
|
58
58
|
selectableTypes,
|
|
59
59
|
maximumSelectionSize,
|
|
60
60
|
currentPath,
|
|
61
|
+
initialPath,
|
|
61
62
|
onlyFolderishSelectable,
|
|
62
63
|
} = {}) =>
|
|
63
64
|
this.setState(() => ({
|
|
@@ -71,6 +72,7 @@ const withObjectBrowser = (WrappedComponent) =>
|
|
|
71
72
|
selectableTypes,
|
|
72
73
|
maximumSelectionSize,
|
|
73
74
|
currentPath,
|
|
75
|
+
initialPath,
|
|
74
76
|
onlyFolderishSelectable,
|
|
75
77
|
}));
|
|
76
78
|
|
|
@@ -82,6 +84,10 @@ const withObjectBrowser = (WrappedComponent) =>
|
|
|
82
84
|
this.props.pathname ||
|
|
83
85
|
this.props.location?.pathname;
|
|
84
86
|
|
|
87
|
+
let initialPath = this.state?.initialPath
|
|
88
|
+
? getBaseUrl(this.state.initialPath)
|
|
89
|
+
: null;
|
|
90
|
+
|
|
85
91
|
return (
|
|
86
92
|
<>
|
|
87
93
|
<WrappedComponent
|
|
@@ -105,6 +111,7 @@ const withObjectBrowser = (WrappedComponent) =>
|
|
|
105
111
|
: this.props.data
|
|
106
112
|
}
|
|
107
113
|
contextURL={getBaseUrl(contextURL)}
|
|
114
|
+
initialPath={initialPath}
|
|
108
115
|
closeObjectBrowser={this.closeObjectBrowser}
|
|
109
116
|
mode={this.state.mode}
|
|
110
117
|
onSelectItem={this.state.onSelectItem}
|