feat(admin): render mltextarea fields per locale

- MLField.vue is the one locale-switching wrapper; MLTextField,
  MLMarkdownField and the new MLTextareaField are shells around it
- isMLFieldType replaces the inline ML type-name checks in formState,
  FormView and RelationChildModal
- register mltextarea as a group-labelled control; rebuild dist
This commit is contained in:
Jakub Zych
2026-10-06 21:36:04 +02:00
parent 3596df4ff5
commit a913eec50f
15 changed files with 275 additions and 162 deletions

View File

@@ -9,6 +9,7 @@ import TextareaField from '../../src/components/form/fields/TextareaField.vue'
import PartialField from '../../src/components/form/fields/PartialField.vue'
import MarkdownField from '../../src/components/form/fields/MarkdownField.vue'
import MLMarkdownField from '../../src/components/form/fields/MLMarkdownField.vue'
import MLTextareaField from '../../src/components/form/fields/MLTextareaField.vue'
import MLTextField from '../../src/components/form/fields/MLTextField.vue'
import PasswordField from '../../src/components/form/fields/PasswordField.vue'
import PermissionEditorField from '../../src/components/form/fields/PermissionEditorField.vue'
@@ -203,7 +204,15 @@ describe('markdown and multilingual field types (Phase 14.2.1)', () => {
expect(groupLabelled('mlmarkdown')).toBe(true)
})
it.each(['mlunknown', 'MLTEXT', 'richtext', 'markdowneditor'])(
it('registers mltextarea as an editable group-labelled type', () => {
expect(rendererFor('mltextarea')).toBe(MLTextareaField)
expect(isRegistered('mltextarea')).toBe(true)
expect(needsRecord('mltextarea')).toBe(false)
expect(ownsLabel('mltextarea')).toBe(false)
expect(groupLabelled('mltextarea')).toBe(true)
})
it.each(['mlunknown', 'MLTEXT', 'MLTEXTAREA', 'richtext', 'markdowneditor'])(
'falls back to UnsupportedField for unknown ML type %j',
(type) => {
expect(isRegistered(type)).toBe(false)