Admin UI
Admin UI Configuration

AdminConfig

The AdminConfig Type allows you to influence the generated views and actions.

OptionTypedefaultdescription
routes{[key:string]:RouteConfigType|string}replaces a route to a generated view with a specific route to a custom component
entities{[name:string]:EntityViewConfig}configuration of the views for a specific entity
dateOptionsIntl.DateTimeFormatOptionsJavascript defaultsused for localization of dates
fileBaseUrlstringhttp://localhost:4000/files (opens in a new tab)should point to the base url for your stored files
orderFields{field:string, direction:'asc'|'desc'}[]which fields should be used to order tables - 1st hit
resourceskey/valueresources used by the Admin UI
fieldDefaultsFunctionoverride default behavior independent from specific entities
localestringenused for localization
selectAsAutoCompleteFromnumber20in forms the selection of a value is rendered as select when <= 20 entries, and autocomplete when larger than 20

Routes

const commonConfig:AdminConfig = {
routes: {
    Car: {
      show: '/my/car/:id',
      index: '/my/cars'
    }
  }
}

Instead of rendering the default components you can route to any custom route and render your own component. For more details see Custom Components

Entities

The generated views are based on the index, show, edit, create actions for an entity. You can influence these generated views and actions per entity.

const commonConfig:AdminConfig = {
entities:  {
  Car: {
    listTitle: 'Vehicles',
    itemTitle: 'Vehice',
    index: {
      fields: ['license','color', 'Driver']
    }
  }
}

For more details see Entity View.

DateOptions

When rendering dates, this options will be used

const commonConfig:AdminConfig = {  
  dateOptions: { year:'numeric', month: '2-digit', day: '2-digit' }
}

fileBaseUrl

Point this to where your GraphQL API would store files.

const commonConfig:AdminConfig = {
  fileBaseUrl: 'http://localhost:4000/files'
}