fix(ui): ensures admin.disableListFilter is disabled despite url search params (#9874)
Continuation of #9846 and partial fix for #9774. When setting `admin.disableListFilter` retroactively, it remains active within the list filter controls. Same for when the URL search query contains one of these fields, except this will actually display the _wrong_ field, falling back to the _first_ field from the config. The fix is to properly disable the condition for this field if it's an active filter, while still preventing it from ever rendering as an option within the field selector itself.
This commit is contained in:
26
test/helpers/e2e/openListColumns.ts
Normal file
26
test/helpers/e2e/openListColumns.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
export const openListColumns = async (
|
||||
page: Page,
|
||||
{
|
||||
togglerSelector = '.list-controls__toggle-columns',
|
||||
columnContainerSelector = '.list-controls__columns',
|
||||
}: {
|
||||
columnContainerSelector?: string
|
||||
togglerSelector?: string
|
||||
},
|
||||
): Promise<any> => {
|
||||
const columnContainer = page.locator(columnContainerSelector).first()
|
||||
|
||||
const isAlreadyOpen = await columnContainer.isVisible()
|
||||
|
||||
if (!isAlreadyOpen) {
|
||||
await page.locator(togglerSelector).first().click()
|
||||
}
|
||||
|
||||
await expect(page.locator(`${columnContainerSelector}.rah-static--height-auto`)).toBeVisible()
|
||||
|
||||
return columnContainer
|
||||
}
|
||||
26
test/helpers/e2e/openListFilters.ts
Normal file
26
test/helpers/e2e/openListFilters.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
export const openListFilters = async (
|
||||
page: Page,
|
||||
{
|
||||
togglerSelector = '.list-controls__toggle-where',
|
||||
filterContainerSelector = '.list-controls__where',
|
||||
}: {
|
||||
filterContainerSelector?: string
|
||||
togglerSelector?: string
|
||||
},
|
||||
) => {
|
||||
const columnContainer = page.locator(filterContainerSelector).first()
|
||||
|
||||
const isAlreadyOpen = await columnContainer.isVisible()
|
||||
|
||||
if (!isAlreadyOpen) {
|
||||
await page.locator(togglerSelector).first().click()
|
||||
}
|
||||
|
||||
await expect(page.locator(`${filterContainerSelector}.rah-static--height-auto`)).toBeVisible()
|
||||
|
||||
return columnContainer
|
||||
}
|
||||
@@ -3,28 +3,7 @@ import type { Page } from '@playwright/test'
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
import { exactText } from '../../helpers.js'
|
||||
|
||||
export const openListColumns = async (
|
||||
page: Page,
|
||||
{
|
||||
togglerSelector = '.list-controls__toggle-columns',
|
||||
columnContainerSelector = '.list-controls__columns',
|
||||
}: {
|
||||
columnContainerSelector?: string
|
||||
togglerSelector?: string
|
||||
},
|
||||
): Promise<any> => {
|
||||
const columnContainer = page.locator(columnContainerSelector).first()
|
||||
const isAlreadyOpen = await columnContainer.isVisible()
|
||||
|
||||
if (!isAlreadyOpen) {
|
||||
await page.locator(togglerSelector).first().click()
|
||||
}
|
||||
|
||||
await expect(page.locator(`${columnContainerSelector}.rah-static--height-auto`)).toBeVisible()
|
||||
|
||||
return columnContainer
|
||||
}
|
||||
import { openListColumns } from './openListColumns.js'
|
||||
|
||||
export const toggleColumn = async (
|
||||
page: Page,
|
||||
|
||||
Reference in New Issue
Block a user