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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user