@plone/volto 16.30.2 → 16.30.3
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.draft +4 -6
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +8 -0
- package/cypress/support/commands.js +60 -3
- package/locales/ca/LC_MESSAGES/volto.po +902 -902
- package/locales/de/LC_MESSAGES/volto.po +900 -900
- package/locales/en/LC_MESSAGES/volto.po +899 -899
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +903 -903
- package/locales/eu/LC_MESSAGES/volto.po +899 -899
- package/locales/fi/LC_MESSAGES/volto.po +905 -905
- package/locales/fr/LC_MESSAGES/volto.po +909 -909
- package/locales/it/LC_MESSAGES/volto.po +899 -899
- package/locales/ja/LC_MESSAGES/volto.po +902 -902
- package/locales/nl/LC_MESSAGES/volto.po +902 -902
- package/locales/pt/LC_MESSAGES/volto.po +902 -902
- package/locales/pt_BR/LC_MESSAGES/volto.po +903 -903
- package/locales/ro/LC_MESSAGES/volto.po +899 -899
- package/locales/volto.pot +901 -901
- package/locales/zh_CN/LC_MESSAGES/volto.po +899 -899
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/src/components/manage/Blocks/Listing/getAsyncData.js +23 -7
- package/src/components/theme/App/App.jsx +1 -0
package/package.json
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { getQueryStringResults } from '@plone/volto/actions';
|
|
2
2
|
import { resolveBlockExtensions } from '@plone/volto/helpers';
|
|
3
|
+
import qs from 'query-string';
|
|
4
|
+
import { slugify } from '@plone/volto/helpers/Utils/Utils';
|
|
5
|
+
|
|
6
|
+
const getCurrentPage = (location, id) => {
|
|
7
|
+
const pageQueryParam = qs.parse(location.search);
|
|
8
|
+
switch (Object.keys(pageQueryParam).length) {
|
|
9
|
+
case 0:
|
|
10
|
+
return 1;
|
|
11
|
+
case 1:
|
|
12
|
+
// when there is only one query param, it could be the simple page number or the sluggified block id
|
|
13
|
+
return pageQueryParam['page'] || pageQueryParam[slugify(`page-${id}`)];
|
|
14
|
+
default:
|
|
15
|
+
return pageQueryParam[slugify(`page-${id}`)];
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default function getListingBlockAsyncData(props) {
|
|
20
|
+
const { data, path, location, id, dispatch, blocksConfig, content } = props;
|
|
3
21
|
|
|
4
|
-
export default function getListingBlockAsyncData({
|
|
5
|
-
dispatch,
|
|
6
|
-
data,
|
|
7
|
-
path,
|
|
8
|
-
blocksConfig,
|
|
9
|
-
}) {
|
|
10
22
|
const { resolvedExtensions } = resolveBlockExtensions(data, blocksConfig);
|
|
11
23
|
|
|
24
|
+
const subrequestID = content?.UID ? `${content?.UID}-${id}` : id;
|
|
25
|
+
const currentPage = getCurrentPage(location, id);
|
|
26
|
+
|
|
12
27
|
return [
|
|
13
28
|
dispatch(
|
|
14
29
|
getQueryStringResults(
|
|
@@ -19,7 +34,8 @@ export default function getListingBlockAsyncData({
|
|
|
19
34
|
? { fullobjects: 1 }
|
|
20
35
|
: { metadata_fields: '_all' }),
|
|
21
36
|
},
|
|
22
|
-
|
|
37
|
+
subrequestID,
|
|
38
|
+
currentPage,
|
|
23
39
|
),
|
|
24
40
|
),
|
|
25
41
|
];
|