@plone/volto 16.20.1 → 16.20.2
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 -5
- package/.eslintrc +21 -1
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +9 -0
- package/package.json +6 -3
- package/packages/volto-slate/package.json +1 -1
- package/src/components/manage/Contents/Contents.jsx +16 -14
- package/src/components/manage/Widgets/ObjectListWidget.jsx +3 -8
- package/src/helpers/Robots/Robots.js +16 -1
- package/src/helpers/Utils/Utils.js +4 -4
- package/src/helpers/index.js +1 -0
package/.changelog.draft
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
## 16.20.
|
|
1
|
+
## 16.20.2 (2023-04-18)
|
|
2
2
|
|
|
3
3
|
### Bugfix
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- Fix Move to top of folder ordering in folder content view @iFlameing [#4690](https://github.com/plone/volto/issues/4690)
|
|
7
|
-
-
|
|
8
|
-
- Fix search block in edit mode re-queries multiple blocks with an empty search text @reebalazs [#4697](https://github.com/plone/volto/issues/4697)
|
|
5
|
+
- Fix robot.txt - the sitemap link should respect x-forwarded headers @reebalazs [#4638](https://github.com/plone/volto/issues/4638)
|
|
6
|
+
- Fix Move to top of folder ordering in folder content view by searching also @iFlameing [#4690](https://github.com/plone/volto/issues/4690)
|
|
7
|
+
- Fix faulty D&D elements in ObjectBrowserList widget @sneridagh [#4703](https://github.com/plone/volto/issues/4703)
|
|
9
8
|
|
package/.eslintrc
CHANGED
|
@@ -44,8 +44,28 @@
|
|
|
44
44
|
"rootPathSuffix": "src"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"import/core-modules": ["load-volto-addons"]
|
|
47
|
+
"import/core-modules": ["load-volto-addons"],
|
|
48
|
+
"react": {
|
|
49
|
+
"version": "detect"
|
|
50
|
+
}
|
|
48
51
|
},
|
|
52
|
+
"overrides": [
|
|
53
|
+
{
|
|
54
|
+
"files": ["**/*.ts", "**/*.tsx"],
|
|
55
|
+
"extends": ["plugin:@typescript-eslint/recommended", "react-app", "prettier", "plugin:jsx-a11y/recommended"],
|
|
56
|
+
"plugins": ["@typescript-eslint", "prettier", "react-hooks", "jsx-a11y"],
|
|
57
|
+
"parser": "@typescript-eslint/parser"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"files": [
|
|
61
|
+
"**/*.stories.js",
|
|
62
|
+
"**/*.stories.jsx"
|
|
63
|
+
],
|
|
64
|
+
"rules": {
|
|
65
|
+
"import/no-anonymous-default-export": "off"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
49
69
|
"globals": {
|
|
50
70
|
"root": true,
|
|
51
71
|
"__DEVELOPMENT__": true,
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 16.20.2 (2023-04-18)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Fix robot.txt - the sitemap link should respect x-forwarded headers @reebalazs [#4638](https://github.com/plone/volto/issues/4638)
|
|
16
|
+
- Fix Move to top of folder ordering in folder content view by searching also @iFlameing [#4690](https://github.com/plone/volto/issues/4690)
|
|
17
|
+
- Fix faulty D&D elements in ObjectBrowserList widget @sneridagh [#4703](https://github.com/plone/volto/issues/4703)
|
|
18
|
+
|
|
19
|
+
|
|
11
20
|
## 16.20.1 (2023-04-14)
|
|
12
21
|
|
|
13
22
|
### Bugfix
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "16.20.
|
|
12
|
+
"version": "16.20.2",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"stylelint": "./node_modules/.bin/stylelint 'theme/**/*.{css,less}' 'src/**/*.{css,less}'",
|
|
50
50
|
"stylelint:overrides": "./node_modules/.bin/stylelint 'theme/**/*.overrides' 'src/**/*.overrides'",
|
|
51
51
|
"stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
|
|
52
|
-
"lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx,json}'",
|
|
53
|
-
"lint:fix": "./node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx,json}'",
|
|
52
|
+
"lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx,ts,tsx,json}'",
|
|
53
|
+
"lint:fix": "./node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx,ts,tsx,json}'",
|
|
54
54
|
"i18n": "rm -rf build/messages && NODE_ENV=production i18n",
|
|
55
55
|
"i18n:ci": "yarn i18n && git diff -G'^[^\"POT]' --exit-code",
|
|
56
56
|
"dry-release": "release-it --dry-run",
|
|
@@ -412,6 +412,8 @@
|
|
|
412
412
|
"@storybook/addon-essentials": "^6.3.0",
|
|
413
413
|
"@storybook/addon-links": "^6.3.0",
|
|
414
414
|
"@storybook/react": "^6.3.0",
|
|
415
|
+
"@typescript-eslint/eslint-plugin": "5.58.0",
|
|
416
|
+
"@typescript-eslint/parser": "5.58.0",
|
|
415
417
|
"babel-loader": "8.2.2",
|
|
416
418
|
"full-icu": "1.4.0",
|
|
417
419
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -421,6 +423,7 @@
|
|
|
421
423
|
"react-is": "^16.13.1",
|
|
422
424
|
"release-it": "^15.1.3",
|
|
423
425
|
"tmp": "0.2.1",
|
|
426
|
+
"typescript": "5.0.4",
|
|
424
427
|
"use-trace-update": "1.3.2",
|
|
425
428
|
"why": "0.6.2"
|
|
426
429
|
},
|
|
@@ -796,12 +796,11 @@ class Contents extends Component {
|
|
|
796
796
|
*/
|
|
797
797
|
onMoveToTop(event, { value }) {
|
|
798
798
|
const id = this.state.items[value]['@id'];
|
|
799
|
-
value = this.state.currentPage * this.state.pageSize + value;
|
|
800
799
|
this.props
|
|
801
800
|
.orderContent(
|
|
802
801
|
getBaseUrl(this.props.pathname),
|
|
803
802
|
id.replace(/^.*\//, ''),
|
|
804
|
-
|
|
803
|
+
'top',
|
|
805
804
|
)
|
|
806
805
|
.then(() => {
|
|
807
806
|
this.setState(
|
|
@@ -821,18 +820,21 @@ class Contents extends Component {
|
|
|
821
820
|
* @returns {undefined}
|
|
822
821
|
*/
|
|
823
822
|
onMoveToBottom(event, { value }) {
|
|
824
|
-
this.
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
823
|
+
const id = this.state.items[value]['@id'];
|
|
824
|
+
this.props
|
|
825
|
+
.orderContent(
|
|
826
|
+
getBaseUrl(this.props.pathname),
|
|
827
|
+
id.replace(/^.*\//, ''),
|
|
828
|
+
'bottom',
|
|
829
|
+
)
|
|
830
|
+
.then(() => {
|
|
831
|
+
this.setState(
|
|
832
|
+
{
|
|
833
|
+
currentPage: 0,
|
|
834
|
+
},
|
|
835
|
+
() => this.fetchContents(),
|
|
836
|
+
);
|
|
837
|
+
});
|
|
836
838
|
}
|
|
837
839
|
|
|
838
840
|
/**
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { defineMessages, useIntl } from 'react-intl';
|
|
3
3
|
import { Accordion, Button, Segment } from 'semantic-ui-react';
|
|
4
4
|
import { DragDropList, FormFieldWrapper, Icon } from '@plone/volto/components';
|
|
5
|
-
import { applySchemaDefaults } from '@plone/volto/helpers';
|
|
5
|
+
import { applySchemaDefaults, reorderArray } from '@plone/volto/helpers';
|
|
6
6
|
import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
|
|
7
7
|
|
|
8
8
|
import upSVG from '@plone/volto/icons/up-key.svg';
|
|
@@ -164,13 +164,8 @@ const ObjectListWidget = (props) => {
|
|
|
164
164
|
if (!destination) {
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const second = value[destination.index];
|
|
170
|
-
value[destination.index] = first;
|
|
171
|
-
value[source.index] = second;
|
|
172
|
-
|
|
173
|
-
onChange(id, value);
|
|
167
|
+
const newValue = reorderArray(value, source.index, destination.index);
|
|
168
|
+
onChange(id, newValue);
|
|
174
169
|
return true;
|
|
175
170
|
}}
|
|
176
171
|
>
|
|
@@ -28,9 +28,24 @@ export const generateRobots = (req) =>
|
|
|
28
28
|
if (error) {
|
|
29
29
|
resolve(text || error);
|
|
30
30
|
} else {
|
|
31
|
+
// It appears that express does not take the x-forwarded headers into
|
|
32
|
+
// consideration, so we do it ourselves.
|
|
33
|
+
const {
|
|
34
|
+
'x-forwarded-proto': forwardedProto,
|
|
35
|
+
'x-forwarded-host': forwardedHost,
|
|
36
|
+
'x-forwarded-port': forwardedPort,
|
|
37
|
+
} = req.headers;
|
|
38
|
+
const proto = forwardedProto ?? req.protocol;
|
|
39
|
+
const host = forwardedHost ?? req.get('Host');
|
|
40
|
+
const portNum = forwardedPort ?? req.get('Port');
|
|
41
|
+
const port =
|
|
42
|
+
(proto === 'https' && '' + portNum === '443') ||
|
|
43
|
+
(proto === 'http' && '' + portNum === '80')
|
|
44
|
+
? ''
|
|
45
|
+
: `:${portNum}`;
|
|
31
46
|
// Plone has probably returned the sitemap link with the internal url.
|
|
32
47
|
// If so, let's replace it with the current one.
|
|
33
|
-
const url = `${
|
|
48
|
+
const url = `${proto}://${host}${port}`;
|
|
34
49
|
text = text.replace(internalUrl, url);
|
|
35
50
|
// Replace the sitemap with the sitemap index.
|
|
36
51
|
text = text.replace('sitemap.xml.gz', 'sitemap-index.xml');
|
|
@@ -258,11 +258,11 @@ export const removeFromArray = (array, index) => {
|
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
|
-
*
|
|
261
|
+
* Moves an item from origin to target inside an array in an immutable way
|
|
262
262
|
* @param {Array} array Array with data
|
|
263
|
-
* @param {number} origin Index of item to be
|
|
264
|
-
* @param {number} target Index of item to be
|
|
265
|
-
* @returns {Array}
|
|
263
|
+
* @param {number} origin Index of item to be moved from
|
|
264
|
+
* @param {number} target Index of item to be moved to
|
|
265
|
+
* @returns {Array} Resultant array
|
|
266
266
|
*/
|
|
267
267
|
export const reorderArray = (array, origin, target) => {
|
|
268
268
|
const result = Array.from(array);
|