fix(admin): drop ML copy-from locale chrome (quick-261006-s0v)

Copy overwrote the active locale with the other locale's often-empty string, so the editor went blank. Keep a single synchronized locale picker.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 20:12:47 +02:00
parent ba4427360b
commit 2f03128a58
6 changed files with 13 additions and 76 deletions

View File

@@ -86,11 +86,15 @@ describe('ML field registry and nested save body', () => {
})
expect(title.findAll('[data-ml-locale]')).toHaveLength(1)
expect(body.findAll('[data-ml-locale]')).toHaveLength(1)
expect(title.find('[data-ml-copy-from]').exists()).toBe(false)
expect(body.find('[data-ml-copy-from]').exists()).toBe(false)
expect(title.find('[data-ml-copy]').exists()).toBe(false)
expect(body.find('[data-ml-copy]').exists()).toBe(false)
expect(title.findAll('[data-ml-locale] option').map((node) => node.text())).toEqual(['en', 'pl'])
expect(body.findAll('[data-ml-locale] option').map((node) => node.text())).toEqual(['en', 'pl'])
})
it('edits the active locale and copies from another', async () => {
it('edits the active locale without overwriting sibling locales', async () => {
const wrapper = mlMount(MLTextField, {
field: field('mltext'),
modelValue: { en: 'Hello', pl: 'Witaj' },
@@ -100,9 +104,8 @@ describe('ML field registry and nested save body', () => {
expect(input.element.value).toBe('Hello')
await wrapper.find('[data-ml-locale]').setValue('pl')
expect(wrapper.find('input').element.value).toBe('Witaj')
await wrapper.find('[data-ml-copy-from]').setValue('en')
await wrapper.find('[data-ml-copy]').trigger('click')
expect(wrapper.emitted('update:modelValue')?.at(-1)).toEqual([{ en: 'Hello', pl: 'Hello' }])
await wrapper.find('input').setValue('Cześć')
expect(wrapper.emitted('update:modelValue')?.at(-1)).toEqual([{ en: 'Hello', pl: 'Cześć' }])
})
it('switches every ML control from one selector', async () => {