Dashboard Config

key

type

info

example

hide

boolean

set true to hide this service from dashboard

sideBarIconName

string

allow you to change the default icon on the dashboard sidebar

can be of of the https://material-ui.com/components/material-icons/

'user'

defaultFieldsToDisplay

array

to hide default fields without using the layout

['_id','createdAt','updatedAt']

docLayout

array

controll the layout of the document

add custom fields

docTitleField

string

The field to display as page title when edit a document

populate

array

Use populate When you want the table to populate fields

This property only adds the populate to client request,

you still need to handle the ability, read this

hideNewButton

boolean

set true to hide the new button

actionButtonsPosition

string

enums: 'start', 'end'

by default the action buttons render at the end of the row

filterFields

array

optioanl - pass an array of fields to display in the filters. when it is empty the all fields will display

listFieldAlign

'left' | 'right' | 'center'

default 'right'

errMessages

object

to translate the input validate errors

errMessages: {

default: JSON.stringify({

name: {

required: 'name is required'

}

}),

i18n: {

'heIL': JSON.stringify({

name: {

required: 'שדה שם הוא חובה'

}

})

}

}

regex

Boolean | array

set true to apply regex search on all string fields or set specific fields regex: ['email']

Example of dashboardConfig

     dashboardConfig: {
      sideBarIconName: 'SettingsInputComponent',
      docLayout: [
        '_id',
        'updatedAt',
        'createdAt',
        ['title',
          'description'],
        ['room',
          'controller'],
        'type',
        ['controllerType',
          'switchingType'],
        'schedules',
        'status',
        {
          when: {
            field: 'type',
            equalTo: OFFICES_TYPE.other,
            then: 'other_type'
          }
        },  
        {
          type: 'custom',
          customFieldType: 'link',
          style: 'button',
          linkTemplate: 'dashboard/floor-plan?floorId={{ _id }}',
          label: 'Plan',
          itemKey: 'linkToPlan',
          hideOnCreate: true,
          hideOnUpdate: false,
        }
      ],
      i18n: {
        'heIL': {
          serviceName: 'רכיבים',
          serviceNameMany: 'רכיבים',
          serviceNameOne: 'רכיב',
          fields: {
            '_id': 'מזהה',
            'updatedAt': 'עודכן',
            'createdAt': 'נוצר',
            title: 'כותרת',
            description: 'תיאור',
            room: 'חדש',
            controller: 'בקר',
            type: 'סוג',
            controllerType: 'סוג בקר',
            switchingType: 'סוג המתג',
            schedules: 'לוח זמנים',
            status: 'סטאטוס',
            floorPlan: 'תכנון קומה',
          }
        }
      }
    }

related docs:

Dashboard Config$PopulatecustomElements

Last updated