Skip to main content
Version: 2.0.0-alpha

Interface: EntityCollection<M, AdditionalKey, UserType>

This interface represents a view that includes a collection of entities. It can be in the root level of the configuration, defining the main menu navigation. You can also find it as a subcollection of a different one.

Type parameters​

NameType
Mextends Object = any
AdditionalKeyextends string = string
UserTypeextends User = User

Properties​

additionalColumns​

• Optional additionalColumns: AdditionalColumnDelegate<M, AdditionalKey, UserType>[]

You can add additional columns to the collection view by implementing an additional column delegate.

Defined in​

lib/src/models/collections.ts:173


alias​

• Optional alias: string

You can set an alias that will be used internally instead of the path. The alias value will be used to determine the URL of the collection, while path will still be used in the datasource. Note that you can use this value in reference properties too.

Defined in​

lib/src/models/collections.ts:50


callbacks​

• Optional callbacks: EntityCallbacks<M, User>

This interface defines all the callbacks that can be used when an entity is being created, updated or deleted. Useful for adding your own logic or blocking the execution of the operation.

Defined in​

lib/src/models/collections.ts:126


customId​

• Optional customId: boolean | EnumValues | "optional"

If this property is not set, the property will be created by the datasource. You can set the value to true to allow the users to choose the ID. You can also pass a set of values (as an EnumValues object) to allow them to pick from only those.

Defined in​

lib/src/models/collections.ts:148


defaultSize​

• Optional defaultSize: CollectionSize

Default size of the rendered collection

Defined in​

lib/src/models/collections.ts:178


description​

• Optional description: string

Optional description of this view. You can use Markdown.

Defined in​

lib/src/models/collections.ts:35


exportable​

• Optional exportable: boolean | ExportConfig<UserType>

Should the data in this collection view include an export button. You can also set an ExportConfig configuration object to customize the export and add additional values. Defaults to true

Defined in​

lib/src/models/collections.ts:112


filterCombinations​

• Optional filterCombinations: Partial<Record<Extract<keyof M, string>, "asc" | "desc">>[]

If you need to filter/sort by multiple properties in this collection, you can define the supported filter combinations here. In the case of Firestore, you need to create special indexes in the console to support filtering/sorting by more than one property. You can then specify here the indexes created.

Defined in​

lib/src/models/collections.ts:194


group​

• Optional group: string

Optional field used to group top level navigation entries under a~ navigation view. If you set this value in a subcollection it has no effect.

Defined in​

lib/src/models/collections.ts:65


icon​

• Optional icon: string

Icon key to use in this collection. You can use any of the icons in the MUI specs: https://mui.com/material-ui/material-icons/ e.g. 'AccountTree' or 'Person'

Defined in​

lib/src/models/collections.ts:58


initialFilter​

• Optional initialFilter: Partial<Record<Extract<keyof M, string>, [WhereFilterOp, any]>>

Initial filters applied to the collection this collection is related to. Defaults to none.

Defined in​

lib/src/models/collections.ts:156


initialSort​

• Optional initialSort: [Extract<keyof M, string>, "asc" | "desc"]

Default sort applied to this collection

Defined in​

lib/src/models/collections.ts:161


inlineEditing​

• Optional inlineEditing: boolean

Can the elements in this collection be edited inline in the collection view. If this flag is set to false but permissions.edit is true, entities can still be edited in the side panel

Defined in​

lib/src/models/collections.ts:185


name​

• name: string

Name of the collection, typically plural. E.g. Products, Blog

Defined in​

lib/src/models/collections.ts:24


pagination​

• Optional pagination: number | boolean

If enabled, content is loaded in batches. If false all entities in the collection are loaded. You can specify a number to specify the pagination size (50 by default) Defaults to true

Defined in​

lib/src/models/collections.ts:85


path​

• path: string

Relative path of this view to its parent. If this view is in the root the path is equal to the absolute one. This path also determines the URL in FireCMS, unless an alias is specified

Defined in​

lib/src/models/collections.ts:42


permissions​

• Optional permissions: Permissions | PermissionsBuilder<M, UserType>

Permissions the logged-in user can perform on this collection. If not specified everything defaults to true. Note that defining permissions at the collection level will override any configuration defined by {@link FireCMSProps#roles}

Defined in​

lib/src/models/collections.ts:99


properties​

• properties: PropertiesOrBuilders<M>

Set of properties that compose an entity

Defined in​

lib/src/models/collections.ts:70


propertiesOrder​

• Optional propertiesOrder: keyof M[]

Order in which the properties are displayed. If you are specifying your collection as code, the order is the same as the one you define in properties

Defined in​

lib/src/models/collections.ts:77


selectionController​

• Optional selectionController: SelectionController<M>

Pass your own selection controller if you want to control selected entities externally.

see useSelectionController

Defined in​

lib/src/models/collections.ts:139


selectionEnabled​

• Optional selectionEnabled: boolean

Are the entities in this collection selectable. Defaults to true

Defined in​

lib/src/models/collections.ts:104


singularName​

• Optional singularName: string

Singular name of an entry in this collection E.g. Product, Blog entry

Defined in​

lib/src/models/collections.ts:30


subcollections​

• Optional subcollections: EntityCollection<any, any, User>[]

You can add subcollections to your entity in the same way you define the root collections. The collections added here will be displayed when opening the side dialog of an entity.

Defined in​

lib/src/models/collections.ts:119


textSearchEnabled​

• Optional textSearchEnabled: boolean

Flag to indicate if a search bar should be displayed on top of the collection table.

Defined in​

lib/src/models/collections.ts:91


views​

• Optional views: EntityCustomView<M>[]

Array of builders for rendering additional panels in an entity view. Useful if you need to render custom views

Defined in​

lib/src/models/collections.ts:167

Methods​

extraActions​

â–¸ Optional extraActions(extraActionsParams): ReactNode

Builder for rendering additional components such as buttons in the collection toolbar

Parameters​

NameType
extraActionsParamsExtraActionsParams<M, UserType>

Returns​

ReactNode

Defined in​

lib/src/models/collections.ts:132