@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.
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
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "17.22.2",
12
+ "version": "17.23.0",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "17.22.2",
3
+ "version": "17.23.0",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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 = map(currentFieldset.fields, (field) => ({
217
- ...schema.properties[field],
218
- id: field,
219
- value: this.state.formData[field],
220
- required: schema.required.indexOf(field) !== -1,
221
- onChange: this.onChangeField,
222
- onBlur: this.onBlurField,
223
- onClick: this.onClickInput,
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.length > 1 && (
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)}?id=${Date.now()}`
85
+ ? `${flattenToAppURL(value?.download)}`
86
86
  : null || value?.data
87
87
  ? `data:${value['content-type']};${value.encoding},${value.data}`
88
88
  : null;