@plone/volto 17.15.2 → 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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/src/components/manage/Add/Add.jsx +9 -2
- package/src/components/manage/Edit/Edit.jsx +4 -0
- package/src/components/manage/Widgets/ArrayWidget.jsx +3 -2
- package/src/helpers/Blocks/Blocks.js +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,14 @@ 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
|
+
|
|
20
28
|
## 17.15.2 (2024-02-24)
|
|
21
29
|
|
|
22
30
|
### Bugfix
|
package/package.json
CHANGED
|
@@ -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 {
|
|
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={
|
|
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']) ||
|
|
707
|
-
findBlocks(
|
|
709
|
+
} else if (containerBlockTypes.includes(block['@type']) || child_blocks) {
|
|
710
|
+
findBlocks(child_blocks, types, result);
|
|
708
711
|
}
|
|
709
712
|
});
|
|
710
713
|
|