Adds configurations for browse-by-folder document results. This PR **does NOT** allow for filtering out folders on a per collection basis. That will be addressed in a future PR 👍 ### Disable browse-by-folder all together ```ts type RootFoldersConfiguration = { /** * If true, the browse by folder view will be enabled * * @default true */ browseByFolder?: boolean // ...rest of type } ``` ### Remove document types from appearing in the browse by folder view ```ts type CollectionFoldersConfiguration = | boolean | { /** * If true, the collection documents will be included in the browse by folder view * * @default true */ browseByFolder?: boolean } ``` ### Misc Fixes https://github.com/payloadcms/payload/issues/12631 where adding folders.collectionOverrides was being set on the client config - it should be omitted. Fixes an issue where `baseListFilters` were not being respected.
32 lines
855 B
TypeScript
32 lines
855 B
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import { clickFolderCard } from './clickFolderCard.js'
|
|
|
|
type Args = {
|
|
folderName?: string
|
|
page: Page
|
|
rowIndex?: number
|
|
}
|
|
export async function selectFolderAndConfirmMoveFromList({
|
|
page,
|
|
folderName,
|
|
rowIndex = 1,
|
|
}: Args): Promise<void> {
|
|
const firstListItem = page.locator(`tbody .row-${rowIndex}`)
|
|
const folderPill = firstListItem.locator('.move-doc-to-folder')
|
|
await folderPill.click()
|
|
|
|
if (folderName) {
|
|
await clickFolderCard({ folderName, doubleClick: true, page })
|
|
}
|
|
|
|
const selectButton = page
|
|
.locator('button[aria-label="Apply Changes"]')
|
|
.filter({ hasText: 'Select' })
|
|
await selectButton.click()
|
|
const confirmMoveButton = page
|
|
.locator('dialog#move-folder-drawer-confirm-move')
|
|
.getByRole('button', { name: 'Move' })
|
|
await confirmMoveButton.click()
|
|
}
|