### 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
31 lines
520 B
TypeScript
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',
|
|
},
|
|
],
|
|
}
|