Skip to content

Commit

Permalink
drop editor2 remains
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Oct 17, 2023
1 parent 2eee4e5 commit 344732b
Showing 1 changed file with 12 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,35 +239,18 @@ export function getContentProfileFormConfig(
};

if (field?.id != null && hasFormattingOptions(field.id, editor, customFields)) {
const editor3Enabled = editor?.body_html?.editor3 === true;

if (editor3Enabled) {
const formattingOptionsEditor3Field: IFormField = {
label: gettext('Formatting options'),
type: FormFieldType.selectMultiple,
field: 'formatOptions',
required: false,
component_parameters: {
items: Object.entries(getEditor3FormattingOptions(field.id, customFields))
.map(([id, translatedLabel]) => ({id: id, label: translatedLabel})),
},
};

fields.push(formattingOptionsEditor3Field);
} else {
const formattingOptionsEditor2Field: IFormField = {
label: gettext('Formatting options'),
type: FormFieldType.selectMultiple,
field: 'formatOptions',
required: false,
component_parameters: {
items: Object.entries(getEditor3RichTextFormattingOptions())
.map(([id, translatedLabel]) => ({id: id, label: translatedLabel})),
},
};

fields.push(formattingOptionsEditor2Field);
}
const formattingOptionsEditor3Field: IFormField = {
label: gettext('Formatting options'),
type: FormFieldType.selectMultiple,
field: 'formatOptions',
required: false,
component_parameters: {
items: Object.entries(getEditor3FormattingOptions(field.id, customFields))
.map(([id, translatedLabel]) => ({id: id, label: translatedLabel})),
},
};

fields.push(formattingOptionsEditor3Field);
}

if (field?.id != null && field.id === 'feature_media' && schema[field.id].type === 'media') {
Expand Down

0 comments on commit 344732b

Please sign in to comment.