ViewModel
ViewModel =
object
Defined in: packages/schema/src/model.ts:1137
How the admin shows a resource: its names, list, filters, record page and actions, built by view(...) and sent to
each user in /meta without what they cannot see. See Views.
Properties
Section titled “Properties”actions
Section titled “actions”actions:
ActionModel[]
Defined in: packages/schema/src/model.ts:1176
The named actions of its records.
chart?
Section titled “chart?”
optionalchart?:ChartModel
Defined in: packages/schema/src/model.ts:1168
A chart of records over time above the list.
create?
Section titled “create?”
optionalcreate?:CreateModel
Defined in: packages/schema/src/model.ts:1190
The page that creates the resource’s records, in place of the create form.
export?
Section titled “export?”
optionalexport?:false|ExportModel
Defined in: packages/schema/src/model.ts:1188
Whether the list page offers Export, and the most rows a file holds; offered without a limit when omitted.
fields
Section titled “fields”fields:
Record<string,FieldViewModel>
Defined in: packages/schema/src/model.ts:1160
Hints per field, by field name.
filters
Section titled “filters”filters:
FilterWidgetModel[]
Defined in: packages/schema/src/model.ts:1164
The filter widgets above the list, in order.
forms?
Section titled “forms?”
optionalforms?:FormModel[]
Defined in: packages/schema/src/model.ts:1192
Public forms that create its records for people without an account, each at /-/forms/<name>.
optionalhelp?:string
Defined in: packages/schema/src/model.ts:1158
A line under the list’s title.
helpWhen?
Section titled “helpWhen?”
optionalhelpWhen?:HelpWhen
Defined in: packages/schema/src/model.ts:1172
When the help lines of its fields and sections show, unless their own helpWhen says; always when omitted.
optionalicon?:string
Defined in: packages/schema/src/model.ts:1156
An icon name, carried in /meta for apps that render their own shell.
import?
Section titled “import?”
optionalimport?:boolean
Defined in: packages/schema/src/model.ts:1184
Whether the list page offers Import, which creates or updates records from an .xlsx or CSV file; it does when omitted.
layout
Section titled “layout”layout:
LayoutItemModel[]
Defined in: packages/schema/src/model.ts:1166
The record page’s items, in order; one section of every field when empty.
optionallist?:ListModel
Defined in: packages/schema/src/model.ts:1162
The list page; the resource’s first six fields as columns when omitted.
listOf?
Section titled “listOf?”
optionallistOf?:string
Defined in: packages/schema/src/model.ts:1178
The relation field whose records the list page shows instead of this resource’s rows, in their own view’s list.
lists?
Section titled “lists?”
optionallists?:NamedListModel[]
Defined in: packages/schema/src/model.ts:1194
Other lists of the resource, each with its own sidebar entry and address.
names?
Section titled “names?”
optionalnames?:object
Defined in: packages/schema/src/model.ts:1149
What one record and several are called, such as “Repair” and “Repairs”; the resource’s name in words when omitted.
plural
Section titled “plural”plural:
string
The records’ name, as in the sidebar.
singular
Section titled “singular”singular:
string
One record’s name, as in “New repair”.
optionalnav?:NavModel
Defined in: packages/schema/src/model.ts:1147
Where the resource sits in the sidebar.
recordMode?
Section titled “recordMode?”
optionalrecordMode?:RecordMode
Defined in: packages/schema/src/model.ts:1170
How the record page opens: as its form, a read view or a locked form; as its form when omitted.
resource
Section titled “resource”resource:
string
Defined in: packages/schema/src/model.ts:1139
The resource it shows.
roles?
Section titled “roles?”
optionalroles?:string[]
Defined in: packages/schema/src/model.ts:1141
Shown only to users with one of these roles; a view without roles is the default.
saveFeedback?
Section titled “saveFeedback?”
optionalsaveFeedback?:SaveFeedback
Defined in: packages/schema/src/model.ts:1174
How the record page shows that a save went through.
saveSearch?
Section titled “saveSearch?”
optionalsaveSearch?:SaveSearchModel
Defined in: packages/schema/src/model.ts:1182
The list page’s button that saves its filter as a search of the user’s own.
searchesOf?
Section titled “searchesOf?”
optionalsearchesOf?:SearchesOfModel
Defined in: packages/schema/src/model.ts:1186
The list page shows the user’s saved searches of another resource, each with what it finds, instead of rows.
searchResult?
Section titled “searchResult?”
optionalsearchResult?:SearchResultModel
Defined in: packages/schema/src/model.ts:1145
A record in the global search: a title of one or more fields joined by spaces, over a subtitle field by default.
signIn?
Section titled “signIn?”
optionalsignIn?:SignInPromptModel
Defined in: packages/schema/src/model.ts:1180
What a visitor who is not signed in is told in place of the list, and by a favorite or “Save search” button that saves here.
title?
Section titled “title?”
optionaltitle?:string
Defined in: packages/schema/src/model.ts:1143
Field used as the record’s display title in breadcrumbs, relation links and search results.