@plone/volto 17.22.2 → 17.23.0
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/src/components/manage/Form/ModalForm.jsx +12 -10
- package/src/components/manage/Form/ModalForm.test.jsx +26 -0
- package/src/components/manage/Widgets/FileWidget.jsx +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,18 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 17.23.0 (2025-12-08)
|
|
21
|
+
|
|
22
|
+
### Feature
|
|
23
|
+
|
|
24
|
+
- ModalForm should handle empty schemas, rendering an empty form with just the submit and cancel buttons. @tedw87 [#7681](https://github.com/plone/volto/issues/7681)
|
|
25
|
+
|
|
26
|
+
## 17.22.3 (2025-10-01)
|
|
27
|
+
|
|
28
|
+
### Bugfix
|
|
29
|
+
|
|
30
|
+
- Fix image rerender on page edit. @calinvladth [#7390](https://github.com/plone/volto/issues/7390)
|
|
31
|
+
|
|
20
32
|
## 17.22.2 (2025-09-29)
|
|
21
33
|
|
|
22
34
|
### Bugfix
|
package/package.json
CHANGED
|
@@ -213,15 +213,17 @@ class ModalForm extends Component {
|
|
|
213
213
|
const { schema, onCancel } = this.props;
|
|
214
214
|
const currentFieldset = schema.fieldsets[this.state.currentTab];
|
|
215
215
|
|
|
216
|
-
const fields =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
const fields = currentFieldset
|
|
217
|
+
? map(currentFieldset.fields, (field) => ({
|
|
218
|
+
...schema.properties[field],
|
|
219
|
+
id: field,
|
|
220
|
+
value: this.state.formData[field],
|
|
221
|
+
required: schema.required.indexOf(field) !== -1,
|
|
222
|
+
onChange: this.onChangeField,
|
|
223
|
+
onBlur: this.onBlurField,
|
|
224
|
+
onClick: this.onClickInput,
|
|
225
|
+
}))
|
|
226
|
+
: [];
|
|
225
227
|
|
|
226
228
|
const state_errors = keys(this.state.errors).length > 0;
|
|
227
229
|
return (
|
|
@@ -255,7 +257,7 @@ class ModalForm extends Component {
|
|
|
255
257
|
)}
|
|
256
258
|
<div>{this.props.submitError}</div>
|
|
257
259
|
</Message>
|
|
258
|
-
{schema.fieldsets
|
|
260
|
+
{schema.fieldsets?.length > 1 && (
|
|
259
261
|
<Menu tabular stackable>
|
|
260
262
|
{map(schema.fieldsets, (item, index) => (
|
|
261
263
|
<Menu.Item
|
|
@@ -90,4 +90,30 @@ describe('ModalForm', () => {
|
|
|
90
90
|
const loadingMessage = getByText(/renaming items.../i);
|
|
91
91
|
expect(loadingMessage).toBeInTheDocument();
|
|
92
92
|
});
|
|
93
|
+
|
|
94
|
+
it('renders with empty fieldsets array', () => {
|
|
95
|
+
const store = mockStore({
|
|
96
|
+
intl: {
|
|
97
|
+
locale: 'en',
|
|
98
|
+
messages: {},
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
const component = renderer.create(
|
|
102
|
+
<Provider store={store}>
|
|
103
|
+
<ModalForm
|
|
104
|
+
schema={{
|
|
105
|
+
fieldsets: [],
|
|
106
|
+
properties: {},
|
|
107
|
+
required: [],
|
|
108
|
+
}}
|
|
109
|
+
onSubmit={() => {}}
|
|
110
|
+
onCancel={() => {}}
|
|
111
|
+
open={false}
|
|
112
|
+
title="Action without form"
|
|
113
|
+
/>
|
|
114
|
+
</Provider>,
|
|
115
|
+
);
|
|
116
|
+
const json = component.toJSON();
|
|
117
|
+
expect(json).toMatchSnapshot();
|
|
118
|
+
});
|
|
93
119
|
});
|
|
@@ -82,7 +82,7 @@ const FileWidget = (props) => {
|
|
|
82
82
|
}, [value]);
|
|
83
83
|
|
|
84
84
|
const imgsrc = value?.download
|
|
85
|
-
? `${flattenToAppURL(value?.download)}
|
|
85
|
+
? `${flattenToAppURL(value?.download)}`
|
|
86
86
|
: null || value?.data
|
|
87
87
|
? `data:${value['content-type']};${value.encoding},${value.data}`
|
|
88
88
|
: null;
|