# Service Configuration

### dashboardConfig - Inside you service options:

all the configuration is optional

* **sideBarIconName -** string\
  allow you to change the default icon on the dashboard sidebar

  [ant.design](https://ant.design/components/icon/) icon name<br>

  ```javascript
  dashboardConfig: {
    sideBarIconName: 'user',
  }

  ```

* **defaultFieldsToDisplay** - array\
  default value is \['\_id','createdAt','updatedAt']<br>

  ```javascript
  // Example - hide updatedAt field
  dashboardConfig: {
    defaultFieldsToDisplay: ['_id','createdAt'],
  }
  ```

* **docLayout** -  array\
  to change the layout of the document\
  by default the input will be render one under the other\
  with docLayout you can force other layout\
  if you are passing a docLayout, only fields inside the docLayout will be render to the screen<br>

  ```javascript
  // Example - To hide updatedAt
  dashboardConfig: {
    docLayout: [
    ['name','color'] // render fields in the same row
    'tags',
    'type',
    {
      when: {
        field: 'type',
        equalTo: 'other',
        then: ['otherType','info'], // render this fields only when 
        otherwise: ['info']
      }
    }
    ],
  }
  ```

* **docTitleField -** string\
  The field to display as page title when edit a document<br>

* **populate** - array\
  Use populate When you want the table to populate fields<br>

  ```javascript
  // Example - hide updatedAt field
  const options = {
    dashboardConfig: {
      populate: ['users'],
    }
  }
  ```

  This property only adds the populate to client request, \
  you still need to handle the ability, read this<br>
