@plone/volto 17.15.1 → 17.15.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/.eslintrc CHANGED
@@ -27,7 +27,8 @@
27
27
  ],
28
28
  "react-hooks/rules-of-hooks": "error",
29
29
  "react-hooks/exhaustive-deps": "warn",
30
- "react/react-in-jsx-scope": "off"
30
+ "react/react-in-jsx-scope": "off",
31
+ "jsx-a11y/label-has-associated-control": "off"
31
32
  },
32
33
  "settings": {
33
34
  "import/resolver": {
package/CHANGELOG.md CHANGED
@@ -17,6 +17,20 @@ myst:
17
17
 
18
18
  <!-- towncrier release notes start -->
19
19
 
20
+ ## 17.15.3 (2024-03-04)
21
+
22
+ ### Bugfix
23
+
24
+ - Enhance findBlocks to check for blocks also in data for add-ons such as @eeacms/volto-tabs-block. @ichim-david [#5796](https://github.com/plone/volto/issues/5796)
25
+ - Fixed ArrayWidget sorting items. @giuliaghisini [#5804](https://github.com/plone/volto/issues/5804)
26
+ - Reset global Form state onSubmit and onCancel in Add and Edit forms @sneridagh [#5827](https://github.com/plone/volto/issues/5827)
27
+
28
+ ## 17.15.2 (2024-02-24)
29
+
30
+ ### Bugfix
31
+
32
+ - Pin `eslint-plugin-jsx-a11y` to version `^6.7.0` to fix ESLint couldn't determine the plugin "jsx-a11y". @ichim-david [#5785](https://github.com/plone/volto/issues/5785)
33
+
20
34
  ## 17.15.1 (2024-02-22)
21
35
 
22
36
  ### Bugfix
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "17.15.1",
12
+ "version": "17.15.3",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -289,7 +289,7 @@
289
289
  "eslint-import-resolver-alias": "1.1.2",
290
290
  "eslint-import-resolver-babel-plugin-root-import": "1.1.1",
291
291
  "eslint-plugin-import": "2.28.1",
292
- "eslint-plugin-jsx-a11y": "6.7.1",
292
+ "eslint-plugin-jsx-a11y": "^6.7.1",
293
293
  "eslint-plugin-prettier": "5.0.0",
294
294
  "eslint-plugin-react": "7.33.2",
295
295
  "eslint-plugin-react-hooks": "4.6.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "17.15.1",
3
+ "version": "17.15.3",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -16,7 +16,12 @@ import { v4 as uuid } from 'uuid';
16
16
  import qs from 'query-string';
17
17
  import { toast } from 'react-toastify';
18
18
 
19
- import { createContent, getSchema, changeLanguage } from '@plone/volto/actions';
19
+ import {
20
+ createContent,
21
+ getSchema,
22
+ changeLanguage,
23
+ setFormData,
24
+ } from '@plone/volto/actions';
20
25
  import {
21
26
  Form,
22
27
  Icon,
@@ -154,6 +159,7 @@ class Add extends Component {
154
159
  nextProps.createRequest.loaded &&
155
160
  nextProps.content['@type'] === this.props.type
156
161
  ) {
162
+ this.props.setFormData({});
157
163
  this.props.history.push(
158
164
  this.props.returnUrl || flattenToAppURL(nextProps.content['@id']),
159
165
  );
@@ -207,6 +213,7 @@ class Add extends Component {
207
213
  * @returns {undefined}
208
214
  */
209
215
  onCancel() {
216
+ this.props.setFormData({});
210
217
  if (this.props.location?.state?.translationOf) {
211
218
  const language = this.props.location.state.languageFrom;
212
219
  const langFileName = toGettextLang(language);
@@ -470,7 +477,7 @@ export default compose(
470
477
  returnUrl: qs.parse(props.location.search).return_url,
471
478
  type: qs.parse(props.location.search).type,
472
479
  }),
473
- { createContent, getSchema, changeLanguage },
480
+ { createContent, getSchema, changeLanguage, setFormData },
474
481
  ),
475
482
  preloadLazyLibs('cms'),
476
483
  )(Add);
@@ -34,6 +34,7 @@ import {
34
34
  unlockContent,
35
35
  getSchema,
36
36
  listActions,
37
+ setFormData,
37
38
  } from '@plone/volto/actions';
38
39
  import {
39
40
  flattenToAppURL,
@@ -182,6 +183,7 @@ class Edit extends Component {
182
183
  });
183
184
  }
184
185
  if (this.props.updateRequest.loading && nextProps.updateRequest.loaded) {
186
+ this.props.setFormData({});
185
187
  this.props.history.push(
186
188
  this.props.returnUrl || getBaseUrl(this.props.pathname),
187
189
  );
@@ -257,6 +259,7 @@ class Edit extends Component {
257
259
  * @returns {undefined}
258
260
  */
259
261
  onCancel() {
262
+ this.props.setFormData({});
260
263
  this.props.history.push(
261
264
  this.props.returnUrl || getBaseUrl(this.props.pathname),
262
265
  );
@@ -524,6 +527,7 @@ export default compose(
524
527
  getSchema,
525
528
  lockContent,
526
529
  unlockContent,
530
+ setFormData,
527
531
  },
528
532
  ),
529
533
  preloadLazyLibs('cms'),
@@ -299,14 +299,15 @@ class ArrayWidget extends Component {
299
299
  !this.props.creatable
300
300
  ? SortableContainer(Select)
301
301
  : SortableContainer(CreatableSelect);
302
-
303
302
  return (
304
303
  <FormFieldWrapper {...this.props}>
305
304
  <SortableSelect
306
305
  useDragHandle
307
306
  // react-sortable-hoc props:
308
307
  axis="xy"
309
- onSortEnd={this.onSortEnd}
308
+ onSortEnd={(sortProp) => {
309
+ this.onSortEnd(selectedOption, sortProp);
310
+ }}
310
311
  menuShouldScrollIntoView={false}
311
312
  distance={4}
312
313
  // small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:
@@ -701,10 +701,13 @@ export function findBlocks(blocks, types, result = []) {
701
701
 
702
702
  Object.keys(blocks).forEach((blockId) => {
703
703
  const block = blocks[blockId];
704
+ // check blocks from data as well since some add-ons use that
705
+ // such as @eeacms/volto-tabs-block
706
+ const child_blocks = block.blocks || block.data?.blocks;
704
707
  if (types.includes(block['@type'])) {
705
708
  result.push(blockId);
706
- } else if (containerBlockTypes.includes(block['@type']) || block.blocks) {
707
- findBlocks(block.blocks, types, result);
709
+ } else if (containerBlockTypes.includes(block['@type']) || child_blocks) {
710
+ findBlocks(child_blocks, types, result);
708
711
  }
709
712
  });
710
713