Skip to content

Commit

Permalink
Fix modal title in schemawidget.
Browse files Browse the repository at this point in the history
  • Loading branch information
robgietema committed Dec 17, 2024
1 parent d37ea18 commit 1df0a8e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/volto/src/components/manage/Widgets/SchemaWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1502,13 +1502,21 @@ class SchemaWidget extends Component {
const choices = [...this.props.fields, ...this.props.additionalFactory];
let editFieldType = '';
if (this.state.editField) {
let factory =
this.props.value.properties[this.state.editField.id].factory;

if (factory.value) {
factory = factory.value;
}
const fieldType = find(choices, {
value: this.props.value.properties[this.state.editField.id].factory,
});
editFieldType = this.props.intl.formatMessage({
id: fieldType.value,
defaultMessage: fieldType.label,
value: factory !== '' ? factory : 'label_text_field',
});
editFieldType = fieldType
? this.props.intl.formatMessage({
id: fieldType.value,
defaultMessage: fieldType.label,
})
: '';
}
const nonUserCreatedFields = this.props.value.fieldsets[
this.state.currentFieldset
Expand Down

0 comments on commit 1df0a8e

Please sign in to comment.