@plone/volto 16.20.2 → 16.20.4
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 +6 -4
- package/.eslintrc +1 -21
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +18 -0
- package/package.json +4 -7
- package/packages/volto-slate/package.json +1 -1
- package/src/middleware/Api.test.js +54 -0
- package/src/middleware/api.js +1 -1
package/.changelog.draft
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
## 16.20.
|
|
1
|
+
## 16.20.4 (2023-04-20)
|
|
2
2
|
|
|
3
3
|
### Bugfix
|
|
4
4
|
|
|
5
|
-
- Fix
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
- Fix fetching API paths with urlencoded characters in the querystring. @davisagli [#4718](https://github.com/plone/volto/issues/4718)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Security upgrade for momentjs [#4716](https://github.com/plone/volto/issues/4716)
|
|
8
10
|
|
package/.eslintrc
CHANGED
|
@@ -44,28 +44,8 @@
|
|
|
44
44
|
"rootPathSuffix": "src"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"import/core-modules": ["load-volto-addons"]
|
|
48
|
-
"react": {
|
|
49
|
-
"version": "detect"
|
|
50
|
-
}
|
|
47
|
+
"import/core-modules": ["load-volto-addons"]
|
|
51
48
|
},
|
|
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
|
-
],
|
|
69
49
|
"globals": {
|
|
70
50
|
"root": true,
|
|
71
51
|
"__DEVELOPMENT__": true,
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 16.20.4 (2023-04-20)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Fix fetching API paths with urlencoded characters in the querystring. @davisagli [#4718](https://github.com/plone/volto/issues/4718)
|
|
16
|
+
|
|
17
|
+
### Internal
|
|
18
|
+
|
|
19
|
+
- Security upgrade for momentjs [#4716](https://github.com/plone/volto/issues/4716)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 16.20.3 (2023-04-18)
|
|
23
|
+
|
|
24
|
+
### Bugfix
|
|
25
|
+
|
|
26
|
+
- Revert inadvertently included files from another PR in #4710 @sneridagh [#4713](https://github.com/plone/volto/issues/4713)
|
|
27
|
+
|
|
28
|
+
|
|
11
29
|
## 16.20.2 (2023-04-18)
|
|
12
30
|
|
|
13
31
|
### 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.4",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"test:husky": "CI=true yarn test --bail --findRelatedTests",
|
|
45
45
|
"test:debug": "node --inspect node_modules/.bin/jest --runInBand",
|
|
46
46
|
"start:prod": "NODE_ENV=production node build/server.js",
|
|
47
|
-
"prettier": "./node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,
|
|
48
|
-
"prettier:fix": "./node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,
|
|
47
|
+
"prettier": "./node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json}'",
|
|
48
|
+
"prettier:fix": "./node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json}'",
|
|
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",
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
"lodash-move": "1.1.1",
|
|
314
314
|
"lodash-webpack-plugin": "0.11.5",
|
|
315
315
|
"mini-css-extract-plugin": "0.9.0",
|
|
316
|
-
"moment": "2.
|
|
316
|
+
"moment": "2.29.4",
|
|
317
317
|
"object-assign": "4.1.1",
|
|
318
318
|
"pofile": "1.0.10",
|
|
319
319
|
"postcss": "8.4.13",
|
|
@@ -412,8 +412,6 @@
|
|
|
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",
|
|
417
415
|
"babel-loader": "8.2.2",
|
|
418
416
|
"full-icu": "1.4.0",
|
|
419
417
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -423,7 +421,6 @@
|
|
|
423
421
|
"react-is": "^16.13.1",
|
|
424
422
|
"release-it": "^15.1.3",
|
|
425
423
|
"tmp": "0.2.1",
|
|
426
|
-
"typescript": "5.0.4",
|
|
427
424
|
"use-trace-update": "1.3.2",
|
|
428
425
|
"why": "0.6.2"
|
|
429
426
|
},
|
|
@@ -53,6 +53,60 @@ describe('api middleware helpers', () => {
|
|
|
53
53
|
);
|
|
54
54
|
expect(result).toEqual('/de/mypage/@navigation?expand.navigation.depth=3');
|
|
55
55
|
});
|
|
56
|
+
it('addExpandersToPath - Path matching, preserve query', () => {
|
|
57
|
+
config.settings.apiExpanders = [
|
|
58
|
+
{
|
|
59
|
+
match: '/de/mypage',
|
|
60
|
+
GET_CONTENT: ['mycustomexpander', 'mycustomexpander2'],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
const result = addExpandersToPath(
|
|
65
|
+
'/de/mypage/@navigation?expand.navigation.depth=3',
|
|
66
|
+
GET_CONTENT,
|
|
67
|
+
);
|
|
68
|
+
expect(result).toEqual(
|
|
69
|
+
'/de/mypage/@navigation?expand=mycustomexpander,mycustomexpander2&expand.navigation.depth=3',
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
it('addExpandersToPath - Path matching, preserve query with multiple', () => {
|
|
73
|
+
config.settings.apiExpanders = [
|
|
74
|
+
{
|
|
75
|
+
match: '/de/mypage',
|
|
76
|
+
GET_CONTENT: ['mycustomexpander', 'mycustomexpander2'],
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const result = addExpandersToPath(
|
|
81
|
+
'/de/mypage/@navigation?expand.navigation.depth=3&expand.other=2',
|
|
82
|
+
GET_CONTENT,
|
|
83
|
+
);
|
|
84
|
+
expect(result).toEqual(
|
|
85
|
+
'/de/mypage/@navigation?expand=mycustomexpander,mycustomexpander2&expand.navigation.depth=3&expand.other=2',
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
it('addExpandersToPath - Path not matching, preserve encoded query', () => {
|
|
89
|
+
config.settings.apiExpanders = [
|
|
90
|
+
{
|
|
91
|
+
match: '/de/otherpath',
|
|
92
|
+
GET_CONTENT: ['mycustomexpander'],
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
const result = addExpandersToPath('/de/mypage?query=a%26b', GET_CONTENT);
|
|
97
|
+
expect(result).toEqual('/de/mypage?query=a%26b');
|
|
98
|
+
});
|
|
99
|
+
it('addExpandersToPath - Path matching, preserve encoded query', () => {
|
|
100
|
+
config.settings.apiExpanders = [
|
|
101
|
+
{
|
|
102
|
+
match: '/de/mypage',
|
|
103
|
+
GET_CONTENT: ['mycustomexpander'],
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
const result = addExpandersToPath('/de/mypage?query=a%26b', GET_CONTENT);
|
|
108
|
+
expect(result).toEqual('/de/mypage?expand=mycustomexpander&query=a%26b');
|
|
109
|
+
});
|
|
56
110
|
it('addExpandersToPath - Two custom expanders from settings', () => {
|
|
57
111
|
config.settings.apiExpanders = [
|
|
58
112
|
{
|
package/src/middleware/api.js
CHANGED
|
@@ -43,7 +43,7 @@ export function addExpandersToPath(path, type, isAnonymous) {
|
|
|
43
43
|
const {
|
|
44
44
|
url,
|
|
45
45
|
query: { expand, ...query },
|
|
46
|
-
} = qs.parseUrl(path);
|
|
46
|
+
} = qs.parseUrl(path, { decode: false });
|
|
47
47
|
|
|
48
48
|
const expandersFromConfig = apiExpanders
|
|
49
49
|
.filter((expand) => matchPath(url, expand.match) && expand[type])
|