Files
payload/test/admin/collections/ListDrawer.ts
Jessica Chowdhury c05f10abbc chore: passes allowCreate into list drawer and adds test (#11284)
### What?
We had an `allowCreate` prop for the list drawer that doesn't do
anything. This PR passes the prop through so it can be used.

### How?
Passes `allowCreate` down to the list view and ties it with
`hasCreatePermission`

#### Testing
- Use `admin` test suite and `withListDrawer` collection.
- Test added to the `admin/e2e/list-view`.

Fixes #11246
2025-02-20 12:31:36 +00:00

31 lines
520 B
TypeScript

import type { CollectionConfig } from 'payload'
import { listDrawerSlug } from '../slugs.js'
export const ListDrawer: CollectionConfig = {
slug: listDrawerSlug,
admin: {
components: {
beforeListTable: [
{
path: '/components/BeforeList/index.js#SelectPostsButton',
},
],
},
},
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'description',
type: 'text',
},
{
name: 'number',
type: 'number',
},
],
}