Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): don't use tab label as prefix on tabs which have no name. #9965

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/ui/src/elements/WhereBuilder/reduceClientFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
5 changes: 3 additions & 2 deletions test/admin/e2e/2/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ 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 expect(options.first()).toHaveText('Title')
await options.first().click()
await page.locator('.condition__operator .rs__control').click()
await options.locator('text=equals').click()
await page.locator('.condition__value input').fill('test')
Expand Down Expand Up @@ -780,7 +781,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.first()).toHaveText('Title')

// list columns
await expect(page.locator('#heading-title .sort-column__label')).toHaveText('Title')
Expand Down
Loading