@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
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "19.0.0-alpha.
|
|
12
|
+
"version": "19.0.0-alpha.37",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"react-animate-height": "2.0.17",
|
|
135
135
|
"react-aria-components": "^1.17.0",
|
|
136
136
|
"react-beautiful-dnd": "13.0.0",
|
|
137
|
-
"react-cookie": "
|
|
137
|
+
"react-cookie": "8.1.2",
|
|
138
138
|
"react-dates": "21.8.0",
|
|
139
139
|
"react-detect-click-outside": "1.1.1",
|
|
140
140
|
"react-dom": "18.2.0",
|
|
@@ -172,18 +172,18 @@
|
|
|
172
172
|
"slate": "0.118.1",
|
|
173
173
|
"slate-hyperscript": "0.115.0",
|
|
174
174
|
"slate-react": "0.117.4",
|
|
175
|
-
"superagent": "3.
|
|
175
|
+
"superagent": "10.3.0",
|
|
176
176
|
"tlds": "1.203.1",
|
|
177
177
|
"undoo": "0.5.0",
|
|
178
|
-
"universal-cookie": "
|
|
179
|
-
"universal-cookie-express": "
|
|
178
|
+
"universal-cookie": "8.1.2",
|
|
179
|
+
"universal-cookie-express": "8.1.2",
|
|
180
180
|
"url": "^0.11.3",
|
|
181
181
|
"use-deep-compare-effect": "1.8.1",
|
|
182
182
|
"uuid": "^14.0.0",
|
|
183
|
-
"@plone/
|
|
183
|
+
"@plone/components": "4.0.0-alpha.8",
|
|
184
|
+
"@plone/scripts": "4.0.0-alpha.8",
|
|
184
185
|
"@plone/registry": "3.0.0-alpha.12",
|
|
185
|
-
"@plone/volto-slate": "19.0.0-alpha.
|
|
186
|
-
"@plone/components": "4.0.0-alpha.8"
|
|
186
|
+
"@plone/volto-slate": "19.0.0-alpha.19"
|
|
187
187
|
},
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@babel/core": "^7.28.5",
|
|
@@ -287,11 +287,11 @@
|
|
|
287
287
|
"wait-on": "^9.0.4",
|
|
288
288
|
"webpack": "5.105.4",
|
|
289
289
|
"webpack-bundle-analyzer": "4.10.1",
|
|
290
|
-
"webpack-dev-server": "^5.2.
|
|
290
|
+
"webpack-dev-server": "^5.2.4",
|
|
291
291
|
"webpack-node-externals": "3.0.0",
|
|
292
292
|
"@plone/razzle": "1.0.0-alpha.5",
|
|
293
|
+
"@plone/types": "2.0.0-alpha.20",
|
|
293
294
|
"@plone/babel-preset-razzle": "^1.0.0-alpha.1",
|
|
294
|
-
"@plone/types": "2.0.0-alpha.19",
|
|
295
295
|
"@plone/volto-coresandbox": "1.0.0",
|
|
296
296
|
"@plone/razzle-dev-utils": "1.0.0-alpha.3"
|
|
297
297
|
},
|
|
@@ -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 config from '@plone/volto/registry';
|
|
6
7
|
import Add from './Add';
|
|
7
8
|
|
|
@@ -43,7 +44,9 @@ describe('Add', () => {
|
|
|
43
44
|
});
|
|
44
45
|
const { container } = render(
|
|
45
46
|
<Provider store={store}>
|
|
46
|
-
<
|
|
47
|
+
<CookiesProvider>
|
|
48
|
+
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
49
|
+
</CookiesProvider>
|
|
47
50
|
</Provider>,
|
|
48
51
|
);
|
|
49
52
|
expect(container).toMatchSnapshot();
|
|
@@ -70,7 +73,9 @@ describe('Add', () => {
|
|
|
70
73
|
});
|
|
71
74
|
const { container } = render(
|
|
72
75
|
<Provider store={store}>
|
|
73
|
-
<
|
|
76
|
+
<CookiesProvider>
|
|
77
|
+
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
78
|
+
</CookiesProvider>
|
|
74
79
|
</Provider>,
|
|
75
80
|
);
|
|
76
81
|
|
|
@@ -109,7 +114,9 @@ describe('Add', () => {
|
|
|
109
114
|
});
|
|
110
115
|
const { container } = render(
|
|
111
116
|
<Provider store={store}>
|
|
112
|
-
<
|
|
117
|
+
<CookiesProvider>
|
|
118
|
+
<Add location={{ pathname: '/blog', search: { type: 'Document' } }} />
|
|
119
|
+
</CookiesProvider>
|
|
113
120
|
</Provider>,
|
|
114
121
|
);
|
|
115
122
|
|
|
@@ -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
|
|
|
@@ -46,8 +47,10 @@ describe('Aliases', () => {
|
|
|
46
47
|
});
|
|
47
48
|
const { container } = render(
|
|
48
49
|
<Provider store={store}>
|
|
49
|
-
<
|
|
50
|
-
|
|
50
|
+
<CookiesProvider>
|
|
51
|
+
<Aliases location={{ pathname: '/blog/aliases' }} />
|
|
52
|
+
<div id="toolbar"></div>
|
|
53
|
+
</CookiesProvider>
|
|
51
54
|
</Provider>,
|
|
52
55
|
);
|
|
53
56
|
|
|
@@ -10,6 +10,7 @@ import { useIntl, defineMessages } from 'react-intl';
|
|
|
10
10
|
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
11
11
|
import AnimateHeight from 'react-animate-height';
|
|
12
12
|
import config from '@plone/volto/registry';
|
|
13
|
+
import { formatMessageWithFallback } from '@plone/volto/helpers/I18n/I18n';
|
|
13
14
|
import upSVG from '@plone/volto/icons/up-key.svg';
|
|
14
15
|
import downSVG from '@plone/volto/icons/down-key.svg';
|
|
15
16
|
import BlockChooserSearch from './BlockChooserSearch';
|
|
@@ -98,16 +99,10 @@ const BlockChooser = ({
|
|
|
98
99
|
}
|
|
99
100
|
const [filterValue, setFilterValue] = React.useState('');
|
|
100
101
|
|
|
101
|
-
const getFormatMessage = (message) =>
|
|
102
|
-
intl.formatMessage({
|
|
103
|
-
id: message,
|
|
104
|
-
defaultMessage: message,
|
|
105
|
-
});
|
|
106
|
-
|
|
107
102
|
function blocksAvailableFilter(blocks) {
|
|
108
103
|
return blocks.filter(
|
|
109
104
|
(block) =>
|
|
110
|
-
|
|
105
|
+
formatMessageWithFallback(intl, block.title)
|
|
111
106
|
.toLowerCase()
|
|
112
107
|
.includes(filterValue.toLowerCase()) ||
|
|
113
108
|
block.title.toLowerCase().includes(filterValue.toLowerCase()) ||
|
|
@@ -117,7 +112,7 @@ const BlockChooser = ({
|
|
|
117
112
|
function filterVariations(block) {
|
|
118
113
|
return block.variations?.filter(
|
|
119
114
|
(variation) =>
|
|
120
|
-
|
|
115
|
+
formatMessageWithFallback(intl, variation.title)
|
|
121
116
|
.toLowerCase()
|
|
122
117
|
.includes(filterValue.toLowerCase()) &&
|
|
123
118
|
!variation.title.toLowerCase().includes('default'),
|
|
@@ -145,9 +140,11 @@ const BlockChooser = ({
|
|
|
145
140
|
}}
|
|
146
141
|
>
|
|
147
142
|
<Icon name={block.icon} size="36px" />
|
|
148
|
-
{
|
|
143
|
+
{formatMessageWithFallback(intl, block.title)}
|
|
149
144
|
{filterValue && variations?.[0]?.title && (
|
|
150
|
-
<small>
|
|
145
|
+
<small>
|
|
146
|
+
{formatMessageWithFallback(intl, variations[0].title)}
|
|
147
|
+
</small>
|
|
151
148
|
)}
|
|
152
149
|
</Button>
|
|
153
150
|
</Button.Group>
|
|
@@ -149,15 +149,6 @@ export class Edit extends Component {
|
|
|
149
149
|
this.props.setUIState({ hovered: this.props.id });
|
|
150
150
|
}
|
|
151
151
|
}}
|
|
152
|
-
onFocus={(e) => {
|
|
153
|
-
// TODO: This `onFocus` steals somehow the focus from the slate block
|
|
154
|
-
// we have to investigate why this is happening
|
|
155
|
-
// Apparently, I can't see any difference in the behavior
|
|
156
|
-
// If any, we can fix it in successive iterations
|
|
157
|
-
// if (this.props.hovered !== this.props.id) {
|
|
158
|
-
// this.props.setUIState({ hovered: this.props.id });
|
|
159
|
-
// }
|
|
160
|
-
}}
|
|
161
152
|
onMouseLeave={(e) => {
|
|
162
153
|
e.preventDefault();
|
|
163
154
|
e.stopPropagation();
|
|
@@ -172,6 +163,24 @@ export class Edit extends Component {
|
|
|
172
163
|
e,
|
|
173
164
|
);
|
|
174
165
|
}}
|
|
166
|
+
// onFocus={(e) => {
|
|
167
|
+
// // TODO: This `onFocus` steals somehow the focus from the slate block
|
|
168
|
+
// // we have to investigate why this is happening
|
|
169
|
+
// // Apparently, I can't see any difference in the behavior
|
|
170
|
+
// // If any, we can fix it in successive iterations
|
|
171
|
+
// // if (this.props.hovered !== this.props.id) {
|
|
172
|
+
// // this.props.setUIState({ hovered: this.props.id });
|
|
173
|
+
// // }
|
|
174
|
+
// }}
|
|
175
|
+
onFocus={(e) => {
|
|
176
|
+
const isMultipleSelection = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
177
|
+
!this.props.selected &&
|
|
178
|
+
this.props.onSelectBlock(
|
|
179
|
+
this.props.id,
|
|
180
|
+
this.props.selected ? false : isMultipleSelection,
|
|
181
|
+
e,
|
|
182
|
+
);
|
|
183
|
+
}}
|
|
175
184
|
onKeyDown={
|
|
176
185
|
!(blockHasOwnFocusManagement || disableNewBlocks)
|
|
177
186
|
? (e) =>
|
|
@@ -218,6 +227,7 @@ export class Edit extends Component {
|
|
|
218
227
|
e.stopPropagation();
|
|
219
228
|
this.props.setUIState({ hovered: this.props.id });
|
|
220
229
|
}}
|
|
230
|
+
// Mantenha apenas este onFocus ou remova se não for necessário
|
|
221
231
|
onFocus={(e) => {
|
|
222
232
|
e.preventDefault();
|
|
223
233
|
e.stopPropagation();
|
|
@@ -245,7 +255,6 @@ export class Edit extends Component {
|
|
|
245
255
|
className={cx(`block ${type}`, { selected: this.props.selected })}
|
|
246
256
|
style={{ outline: 'none' }}
|
|
247
257
|
ref={this.blockNode}
|
|
248
|
-
// The tabIndex is required for the keyboard navigation
|
|
249
258
|
tabIndex={-1}
|
|
250
259
|
>
|
|
251
260
|
{this.props.intl.formatMessage(messages.unknownBlock, {
|
|
@@ -5,7 +5,9 @@ import includes from 'lodash/includes';
|
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
7
7
|
import { setUIState } from '@plone/volto/actions/form/form';
|
|
8
|
+
import { formatMessageWithFallback } from '@plone/volto/helpers/I18n/I18n';
|
|
8
9
|
import config from '@plone/volto/registry';
|
|
10
|
+
import { useIntl } from 'react-intl';
|
|
9
11
|
|
|
10
12
|
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
11
13
|
import dragSVG from '@plone/volto/icons/drag.svg';
|
|
@@ -34,6 +36,7 @@ export const Item = forwardRef(
|
|
|
34
36
|
},
|
|
35
37
|
ref,
|
|
36
38
|
) => {
|
|
39
|
+
const intl = useIntl();
|
|
37
40
|
const selected = useSelector((state) => state.form.ui.selected);
|
|
38
41
|
const hovered = useSelector((state) => state.form.ui.hovered);
|
|
39
42
|
const multiSelected = useSelector((state) => state.form.ui.multiSelected);
|
|
@@ -49,7 +52,11 @@ export const Item = forwardRef(
|
|
|
49
52
|
? data.required
|
|
50
53
|
: includes(config.blocks.requiredBlocks, data?.['@type']);
|
|
51
54
|
const fixed = !!data?.fixed;
|
|
52
|
-
|
|
55
|
+
const configTitle = config.blocks.blocksConfig[data?.['@type']]?.title;
|
|
56
|
+
const blockTitle =
|
|
57
|
+
data?.plaintext ||
|
|
58
|
+
formatMessageWithFallback(intl, configTitle) ||
|
|
59
|
+
data?.title;
|
|
53
60
|
return (
|
|
54
61
|
<li
|
|
55
62
|
className={classNames(
|
|
@@ -122,9 +129,7 @@ export const Item = forwardRef(
|
|
|
122
129
|
style={{ verticalAlign: 'middle' }}
|
|
123
130
|
/>
|
|
124
131
|
)}{' '}
|
|
125
|
-
{
|
|
126
|
-
config.blocks.blocksConfig[data?.['@type']]?.title ||
|
|
127
|
-
data?.title}
|
|
132
|
+
{blockTitle}
|
|
128
133
|
</span>
|
|
129
134
|
{!clone && onRemove && !required && (
|
|
130
135
|
<button
|
|
@@ -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
|
|
|
7
8
|
import { ContentsComponent as Contents } from './Contents';
|
|
8
9
|
|
|
@@ -111,10 +112,12 @@ describe('Contents', () => {
|
|
|
111
112
|
});
|
|
112
113
|
const { container } = render(
|
|
113
114
|
<Provider store={store}>
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
<CookiesProvider>
|
|
116
|
+
<MemoryRouter>
|
|
117
|
+
<Contents location={{ pathname: '/blog' }} />
|
|
118
|
+
<div id="toolbar"></div>
|
|
119
|
+
</MemoryRouter>
|
|
120
|
+
</CookiesProvider>
|
|
118
121
|
</Provider>,
|
|
119
122
|
);
|
|
120
123
|
|
|
@@ -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
|
|
|
6
7
|
import AddonsControlpanel from './AddonsControlpanel';
|
|
7
8
|
|
|
@@ -80,10 +81,12 @@ describe('AddonsControlpanel', () => {
|
|
|
80
81
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
81
82
|
const { container } = render(
|
|
82
83
|
<Provider store={store}>
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
<CookiesProvider>
|
|
85
|
+
<div>
|
|
86
|
+
<AddonsControlpanel location={{ pathname: '/blog' }} />
|
|
87
|
+
<div id="toolbar"></div>
|
|
88
|
+
</div>
|
|
89
|
+
</CookiesProvider>
|
|
87
90
|
</Provider>,
|
|
88
91
|
);
|
|
89
92
|
|
|
@@ -3,6 +3,7 @@ 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';
|
|
6
|
+
import { CookiesProvider } from 'react-cookie';
|
|
6
7
|
|
|
7
8
|
import Aliases from './Aliases';
|
|
8
9
|
import { MemoryRouter } from 'react-router';
|
|
@@ -95,10 +96,12 @@ describe('Aliases', () => {
|
|
|
95
96
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
96
97
|
const { container } = render(
|
|
97
98
|
<Provider store={store}>
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
<CookiesProvider>
|
|
100
|
+
<MemoryRouter>
|
|
101
|
+
<Aliases location={{ pathname: '/blog' }} />
|
|
102
|
+
<div id="toolbar"></div>
|
|
103
|
+
</MemoryRouter>
|
|
104
|
+
</CookiesProvider>
|
|
102
105
|
</Provider>,
|
|
103
106
|
);
|
|
104
107
|
|
|
@@ -2,6 +2,7 @@ import { getBlockTypes } from '@plone/volto/actions/blockTypes/blockTypes';
|
|
|
2
2
|
import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar';
|
|
3
3
|
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
4
4
|
import { getParentUrl, flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
5
|
+
import { formatMessageWithFallback } from '@plone/volto/helpers/I18n/I18n';
|
|
5
6
|
import { useClient } from '@plone/volto/hooks';
|
|
6
7
|
import config from '@plone/volto/registry';
|
|
7
8
|
import { useEffect } from 'react';
|
|
@@ -86,9 +87,7 @@ const BlockTypeControlpanel = (props: RouteProps) => {
|
|
|
86
87
|
return <Error error={blockTypes.error} />;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
const translatedTitle = block?.title
|
|
90
|
-
? intl.formatMessage({ id: block.title, defaultMessage: block.title })
|
|
91
|
-
: id;
|
|
90
|
+
const translatedTitle = formatMessageWithFallback(intl, block?.title) || id;
|
|
92
91
|
|
|
93
92
|
return (
|
|
94
93
|
blockTypes.loaded && (
|
|
@@ -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, Route } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import { render } from '@testing-library/react';
|
|
6
7
|
|
|
7
8
|
import ContentType from './ContentType';
|
|
@@ -58,15 +59,17 @@ describe('ContentType', () => {
|
|
|
58
59
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
59
60
|
const { container } = render(
|
|
60
61
|
<Provider store={store}>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
<CookiesProvider>
|
|
63
|
+
<MemoryRouter
|
|
64
|
+
initialEntries={['/controlpanel/dexterity-types/Document']}
|
|
65
|
+
>
|
|
66
|
+
<Route
|
|
67
|
+
path={'/controlpanel/dexterity-types/:id'}
|
|
68
|
+
component={ContentType}
|
|
69
|
+
/>
|
|
70
|
+
<div id="toolbar"></div>
|
|
71
|
+
</MemoryRouter>
|
|
72
|
+
</CookiesProvider>
|
|
70
73
|
</Provider>,
|
|
71
74
|
);
|
|
72
75
|
|
|
@@ -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, Route } from 'react-router-dom';
|
|
6
|
+
import { CookiesProvider } from 'react-cookie';
|
|
6
7
|
|
|
7
8
|
import ContentTypeLayout from './ContentTypeLayout';
|
|
8
9
|
|
|
@@ -41,15 +42,17 @@ describe('ContentTypeLayout', () => {
|
|
|
41
42
|
});
|
|
42
43
|
const { container } = render(
|
|
43
44
|
<Provider store={store}>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
<CookiesProvider>
|
|
46
|
+
<MemoryRouter
|
|
47
|
+
initialEntries={['/controlpanel/dexterity-types/Document/layout']}
|
|
48
|
+
>
|
|
49
|
+
<Route
|
|
50
|
+
path={'/controlpanel/dexterity-types/:id/layout'}
|
|
51
|
+
component={ContentTypeLayout}
|
|
52
|
+
/>
|
|
53
|
+
<div id="toolbar"></div>
|
|
54
|
+
</MemoryRouter>
|
|
55
|
+
</CookiesProvider>
|
|
53
56
|
</Provider>,
|
|
54
57
|
);
|
|
55
58
|
|
|
@@ -227,6 +227,7 @@ class ContentTypes extends Component {
|
|
|
227
227
|
addTypeError: undefined,
|
|
228
228
|
addTypeSetFormDataCallback: undefined,
|
|
229
229
|
});
|
|
230
|
+
this._addTypeTrigger?.focus();
|
|
230
231
|
toast.success(
|
|
231
232
|
<Toast
|
|
232
233
|
success
|
|
@@ -369,10 +370,13 @@ class ContentTypes extends Component {
|
|
|
369
370
|
/>
|
|
370
371
|
<ModalForm
|
|
371
372
|
open={this.state.showAddType}
|
|
372
|
-
className="modal"
|
|
373
|
+
className="modal add-content-type"
|
|
373
374
|
onSubmit={this.onAddTypeSubmit}
|
|
374
375
|
submitError={this.state.addTypeError}
|
|
375
|
-
onCancel={() =>
|
|
376
|
+
onCancel={() => {
|
|
377
|
+
this.setState({ showAddType: false });
|
|
378
|
+
this._addTypeTrigger?.focus();
|
|
379
|
+
}}
|
|
376
380
|
title={this.props.intl.formatMessage(messages.addTypeFormTitle)}
|
|
377
381
|
loading={this.props.cpanelRequest.post.loading}
|
|
378
382
|
schema={{
|
|
@@ -474,6 +478,9 @@ class ContentTypes extends Component {
|
|
|
474
478
|
aria-label={this.props.intl.formatMessage(messages.add)}
|
|
475
479
|
tabIndex={0}
|
|
476
480
|
id="toolbar-add"
|
|
481
|
+
ref={(el) => {
|
|
482
|
+
this._addTypeTrigger = el;
|
|
483
|
+
}}
|
|
477
484
|
onClick={() => {
|
|
478
485
|
this.setState({ showAddType: true });
|
|
479
486
|
}}
|
|
@@ -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, Route } from 'react-router-dom';
|
|
6
|
+
import { CookiesProvider } from 'react-cookie';
|
|
6
7
|
|
|
7
8
|
import ContentTypes from './ContentTypes';
|
|
8
9
|
|
|
@@ -84,10 +85,12 @@ describe('ContentTypes', () => {
|
|
|
84
85
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
85
86
|
const { container } = render(
|
|
86
87
|
<Provider store={store}>
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
<CookiesProvider>
|
|
89
|
+
<MemoryRouter initialEntries={['/controlpanel/dexterity-types']}>
|
|
90
|
+
<Route path={'/controlpanel/:id'} component={ContentTypes} />
|
|
91
|
+
<div id="toolbar"></div>
|
|
92
|
+
</MemoryRouter>
|
|
93
|
+
</CookiesProvider>
|
|
91
94
|
</Provider>,
|
|
92
95
|
);
|
|
93
96
|
|
|
@@ -2,6 +2,7 @@ import { render } from '@testing-library/react';
|
|
|
2
2
|
import configureStore from 'redux-mock-store';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import { MemoryRouter, Route } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import Controlpanel from './Controlpanel';
|
|
6
7
|
|
|
7
8
|
const mockStore = configureStore();
|
|
@@ -70,10 +71,12 @@ describe('Controlpanel', () => {
|
|
|
70
71
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
71
72
|
const { container } = render(
|
|
72
73
|
<Provider store={store}>
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
<CookiesProvider>
|
|
75
|
+
<MemoryRouter initialEntries={['/controlpanel/date-and-time']}>
|
|
76
|
+
<Route path={'/controlpanel/:id'} component={Controlpanel} />
|
|
77
|
+
<div id="toolbar"></div>
|
|
78
|
+
</MemoryRouter>
|
|
79
|
+
</CookiesProvider>
|
|
77
80
|
</Provider>,
|
|
78
81
|
);
|
|
79
82
|
|
|
@@ -1,6 +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 { CookiesProvider } from 'react-cookie';
|
|
4
5
|
import { render } from '@testing-library/react';
|
|
5
6
|
import configureStore from 'redux-mock-store';
|
|
6
7
|
|
|
@@ -108,10 +109,12 @@ describe('Controlpanels', () => {
|
|
|
108
109
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
109
110
|
const { container } = render(
|
|
110
111
|
<Provider store={store}>
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
<CookiesProvider>
|
|
113
|
+
<MemoryRouter>
|
|
114
|
+
<Controlpanels location={{ pathname: '/blog' }} />
|
|
115
|
+
<div id="toolbar"></div>
|
|
116
|
+
</MemoryRouter>
|
|
117
|
+
</CookiesProvider>
|
|
115
118
|
</Provider>,
|
|
116
119
|
);
|
|
117
120
|
|
|
@@ -186,10 +189,12 @@ describe('Controlpanels', () => {
|
|
|
186
189
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
187
190
|
const { container } = render(
|
|
188
191
|
<Provider store={store}>
|
|
189
|
-
<
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
<CookiesProvider>
|
|
193
|
+
<MemoryRouter>
|
|
194
|
+
<Controlpanels location={{ pathname: '/blog' }} />
|
|
195
|
+
<div id="toolbar"></div>
|
|
196
|
+
</MemoryRouter>
|
|
197
|
+
</CookiesProvider>
|
|
193
198
|
</Provider>,
|
|
194
199
|
);
|
|
195
200
|
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render, act } 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 GroupsControlpanel from './GroupsControlpanel';
|
|
@@ -41,10 +42,12 @@ describe('UsersControlpanel', () => {
|
|
|
41
42
|
const { container } = await act(async () => {
|
|
42
43
|
return render(
|
|
43
44
|
<Provider store={store}>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
<CookiesProvider>
|
|
46
|
+
<>
|
|
47
|
+
<GroupsControlpanel location={{ pathname: '/blog' }} />
|
|
48
|
+
<div id="toolbar"></div>
|
|
49
|
+
</>
|
|
50
|
+
</CookiesProvider>
|
|
48
51
|
</Provider>,
|
|
49
52
|
);
|
|
50
53
|
});
|
|
@@ -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 ModerateComments from './ModerateComments';
|
|
6
7
|
|
|
7
8
|
const mockStore = configureStore();
|
|
@@ -53,10 +54,12 @@ describe('ModerateComments', () => {
|
|
|
53
54
|
|
|
54
55
|
const { container } = render(
|
|
55
56
|
<Provider store={store}>
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
<CookiesProvider>
|
|
58
|
+
<div>
|
|
59
|
+
<ModerateComments location={{ pathname: '/blog' }} />
|
|
60
|
+
<div id="toolbar"></div>
|
|
61
|
+
</div>
|
|
62
|
+
</CookiesProvider>
|
|
60
63
|
</Provider>,
|
|
61
64
|
);
|
|
62
65
|
|
|
@@ -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
|
|
|
@@ -25,10 +26,12 @@ describe('AddRule', () => {
|
|
|
25
26
|
});
|
|
26
27
|
const { container } = render(
|
|
27
28
|
<Provider store={store}>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
<CookiesProvider>
|
|
30
|
+
<>
|
|
31
|
+
<AddRule location={{ pathname: '/controlpanel/rules/add' }} />
|
|
32
|
+
<div id="toolbar"></div>
|
|
33
|
+
</>
|
|
34
|
+
</CookiesProvider>
|
|
32
35
|
</Provider>,
|
|
33
36
|
);
|
|
34
37
|
|