-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPluginConfig.ts
45 lines (34 loc) · 1.39 KB
/
PluginConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { FieldAccess } from 'payload/types';
export interface PluginConfig {
/** Array of collection slugs to exclude */
excludedCollections?: string[];
/** Array of global slugs to exclude */
excludedGlobals?: string[];
/** Name of the created by field, default: `createdBy` */
createdByFieldName?: string;
/** Name of the updated by field, default: `updatedBy` */
updatedByFieldName?: string;
/** Label for the created by field, default: `Created By` */
createdByLabel?:
| string
| Record<string, string>
| ((slug: string) => string | Record<string, string>);
/** Label for the updated by field, default: `Updated By` */
updatedByLabel?:
| string
| Record<string, string>
| ((slug: string) => string | Record<string, string>);
/** Whether the created by field is editable, default: false */
createdByFieldEditable?: boolean | ((slug: string) => boolean);
/** Whether the updated by field is editable, default: false */
updatedByFieldEditable?: boolean | ((slug: string) => boolean);
/** Show readonly created & updated by fields in sidebar, default: `true` */
showInSidebar?: boolean;
/** Function that determines read access to the createdBy & updatedBy fields
* @example
* fieldAccess: ({ req: { user } }) => user.isAdmin
*/
fieldAccess?: FieldAccess;
/** Show display field if value is undefined */
showUndefinedValues?: boolean;
}