ViewModel
ViewModel =
object
Defined in: packages/schema/src/model.ts:1755
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:1800
The named actions of its records.
chart?
Section titled “chart?”
optionalchart?:ChartModel
Defined in: packages/schema/src/model.ts:1788
A chart of records over time above the list.
create?
Section titled “create?”
optionalcreate?:CreateModel
Defined in: packages/schema/src/model.ts:1817
The page that creates the resource’s records, in place of the create form.
createOpens?
Section titled “createOpens?”
optionalcreateOpens?:AppAddress
Defined in: packages/schema/src/model.ts:1823
Its create address opens this in place of the form (.createOpens(...)).
export?
Section titled “export?”
optionalexport?:false|ExportModel
Defined in: packages/schema/src/model.ts:1815
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:1780
Hints per field, by field name.
filters
Section titled “filters”filters:
FilterWidgetModel[]
Defined in: packages/schema/src/model.ts:1784
The filter widgets above the list, in order.
forms?
Section titled “forms?”
optionalforms?:FormModel[]
Defined in: packages/schema/src/model.ts:1825
Public forms that create its records for people without an account, each at /-/forms/<name>.
optionalhelp?:string
Defined in: packages/schema/src/model.ts:1778
A line under the list’s title.
helpWhen?
Section titled “helpWhen?”
optionalhelpWhen?:HelpWhen
Defined in: packages/schema/src/model.ts:1792
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:1776
The resource’s icon in the admin’s sidebar, bottom bar and user menu, a table when it names none or one the admin does not know.
import?
Section titled “import?”
optionalimport?:boolean|"table"
Defined in: packages/schema/src/model.ts:1811
Whether the list page offers Import, which creates or updates records from an .xlsx, CSV or JSON file; it does when
omitted. table makes it a new table users add from the file, with its fields and records.
layout
Section titled “layout”layout:
LayoutItemModel[]
Defined in: packages/schema/src/model.ts:1786
The record page’s items, in order; one section of every field when empty.
optionallist?:ListModel
Defined in: packages/schema/src/model.ts:1782
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:1802
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:1827
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:1769
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:1767
Where the resource sits in the sidebar.
record?
Section titled “record?”
optionalrecord?:RecordPageModel
Defined in: packages/schema/src/model.ts:1819
The component of the app’s own that is the whole record page, in place of the standard one.
recordMode?
Section titled “recordMode?”
optionalrecordMode?:RecordMode
Defined in: packages/schema/src/model.ts:1790
How the record page opens: as its form, a read view or a locked form; as its form when omitted.
recordOpens?
Section titled “recordOpens?”
optionalrecordOpens?:AppAddress[]
Defined in: packages/schema/src/model.ts:1821
The addresses a record’s page may open in its place, in order: the first whose {{field}}s all have a value in the record, filled with them.
recordWidth?
Section titled “recordWidth?”
optionalrecordWidth?:PageWidth
Defined in: packages/schema/src/model.ts:1796
How wide the standard record page is; a centred column when omitted.
resource
Section titled “resource”resource:
string
Defined in: packages/schema/src/model.ts:1757
The resource it shows.
roles?
Section titled “roles?”
optionalroles?:string[]
Defined in: packages/schema/src/model.ts:1759
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:1794
How the record page shows that a save went through.
saveSearch?
Section titled “saveSearch?”
optionalsaveSearch?:SaveSearchModel
Defined in: packages/schema/src/model.ts:1806
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:1813
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:1765
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:1804
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:1761
Field used as the record’s display title in breadcrumbs, relation links and search results.
titleBadge?
Section titled “titleBadge?”
optionaltitleBadge?:string
Defined in: packages/schema/src/model.ts:1798
The field shown as a badge beside the record page’s title; an enum status field when omitted.
titleFrom?
Section titled “titleFrom?”
optionaltitleFrom?:TitleFromModel
Defined in: packages/schema/src/model.ts:1763
A title the browser derives per reader in place of title, by a rule of the project’s UI (see TitleFromModel).