diff --git a/packages/ui/src/elements/WhereBuilder/reduceClientFields.tsx b/packages/ui/src/elements/WhereBuilder/reduceClientFields.tsx index b1a48ca4262..0e266b17ef4 100644 --- a/packages/ui/src/elements/WhereBuilder/reduceClientFields.tsx +++ b/packages/ui/src/elements/WhereBuilder/reduceClientFields.tsx @@ -40,9 +40,11 @@ export const reduceClientFields = ({ if (typeof tab.label !== 'boolean') { const localizedTabLabel = getTranslation(tab.label, i18n) - const labelWithPrefix = labelPrefix - ? labelPrefix + ' > ' + localizedTabLabel - : localizedTabLabel + const labelWithPrefix = tabHasName(tab) + ? labelPrefix + ? labelPrefix + ' > ' + localizedTabLabel + : localizedTabLabel + : labelPrefix // Make sure we handle nested tabs const tabPathPrefix = diff --git a/test/admin/e2e/2/e2e.spec.ts b/test/admin/e2e/2/e2e.spec.ts index 5e0930db9e0..a344d28c413 100644 --- a/test/admin/e2e/2/e2e.spec.ts +++ b/test/admin/e2e/2/e2e.spec.ts @@ -464,7 +464,7 @@ describe('admin2', () => { await page.locator('.where-builder__add-first-filter').click() await page.locator('.condition__field .rs__control').click() const options = page.locator('.rs__option') - await options.locator('text=Tab 1 > Title').click() + await options.locator('text=Title').click() await page.locator('.condition__operator .rs__control').click() await options.locator('text=equals').click() await page.locator('.condition__value input').fill('test') @@ -780,7 +780,7 @@ describe('admin2', () => { await page.locator('.condition__field .rs__control').click() const options = page.locator('.rs__option') - await expect(options.locator('text=Tab 1 > Title')).toHaveText('Tab 1 > Title') + await expect(options.locator('text=Title')).toHaveText('Title') // list columns await expect(page.locator('#heading-title .sort-column__label')).toHaveText('Title')