Files
firecms/website/docs/api/interfaces/entitycollection.md
2021-06-06 13:36:47 +02:00

7.2 KiB

id, title, sidebar_label, sidebar_position, custom_edit_url
id title sidebar_label sidebar_position custom_edit_url
entitycollection Interface: EntityCollection<S, Key, AdditionalKey> EntityCollection 0 null

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.

If you need a lower level implementation you can check CollectionTable

Type parameters

Name Type
S S: EntitySchema<Key> = EntitySchema<any>
Key Key: string = Extract<keyof S["properties"], string>
AdditionalKey AdditionalKey: string = string

Properties

additionalColumns

Optional additionalColumns: AdditionalColumnDelegate<AdditionalKey, S, Key>[]

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

Defined in

models/models.ts:65


defaultSize

Optional defaultSize: CollectionSize

Default size of the rendered collection

Defined in

models/models.ts:44


description

Optional description: string

Optional description of this view. You can use Markdown.

Defined in

models/models.ts:27


excludedProperties

Optional excludedProperties: (Key | AdditionalKey)[]

Properties that should NOT get displayed in the collection view. All the other properties from the the entity are displayed It has no effect if the properties value is set.

Defined in

models/models.ts:116


exportable

Optional exportable: boolean | ExportConfig

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

models/models.ts:96


extraActions

Optional extraActions: (extraActionsParams: ExtraActionsParams<S, Key>) => ReactNode

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

param this collection view

param current selected entities by the end user or undefined if none

Type declaration

▸ (extraActionsParams): ReactNode

Parameters
Name Type
extraActionsParams ExtraActionsParams<S, Key>
Returns

ReactNode

Defined in

models/models.ts:143


filterableProperties

Optional filterableProperties: Key[]

Properties that can be filtered in this view

Defined in

models/models.ts:121


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

models/models.ts:51


initialFilter

Optional initialFilter: Partial<{ [K in string]: [WhereFilterOp, any]}>

Initial filters applied to this collection. Consider that you can filter any property, but only those included in filterableProperties will include the corresponding filter widget. Defaults to none.

Defined in

models/models.ts:129


initialSort

Optional initialSort: [Key, "asc" | "desc"]

Default sort applied to this collection

Defined in

models/models.ts:134


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

models/models.ts:83


name

name: string

Plural name of the view. E.g. 'products'

Defined in

models/models.ts:22


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

models/models.ts:59


permissions

Optional permissions: PermissionsBuilder<S, Key>

Permissions the logged-in user can perform on this collection. If not specified everything defaults to true

Defined in

models/models.ts:76


properties

Optional properties: (Key | AdditionalKey)[]

Properties displayed in this collection. If this property is not set every property is displayed

Defined in

models/models.ts:109


relativePath

relativePath: string

Relative Firestore 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

Defined in

models/models.ts:34


schema

schema: S

Schema representing the entities of this view

Defined in

models/models.ts:39


selectionEnabled

Optional selectionEnabled: boolean

Are the entities in this collection selectable. Defaults to true

Defined in

models/models.ts:88


subcollections

Optional subcollections: EntityCollectionView<EntitySchema<any, any>, any, string>[]

Following the Firestore document and collection schema, you can add subcollections to your entity in the same way you define the root collections.

Defined in

models/models.ts:103


textSearchDelegate

Optional textSearchDelegate: TextSearchDelegate

If a text search delegate is supplied, a search bar is displayed on top

Defined in

models/models.ts:70