TABLE OF CONTENTS


1. Dashboards

1.2. Adding new dashboards

To create a new dashboard: POST http://localhost:4200/dashboard/api/dashboards/(URL) with JSON in the body.

Example:

{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"isPublic"false
}


1.3 Dashboard slugs

URL will look like /dashboard/<dashboard id> by default. But, it's possible to define dashboard slug URL in config section.

Example:

{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"config": {
        
"slug""<slug name>"
},
    
"isPublic"false

}


1.4. Dashboard localized name

Dashboard name could be localized in the menu via configuration

Example:


{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"config": {
        
"name": {
            
"en""<localized dashboard name>",
}
},
    
"isPublic"false
}



1.5. Dashboard groups

By default, all dashboards will be shown in Dashboard group. But, there is a possibility to configure dashboards in groups.

Example for the separate group:

{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"config": {
        
"menu":{  
            
"group":{  
                
"key""<GROUP-KEY>",
                
"name":{  
                    
"en""<group name>"
}
}
}
},
    
"isPublic"false
}


Example without group:

{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"config": {
        
"menu":{  
            
"group": { }
}
},
    
"isPublic"false

}


1.6. Icons in Dashboard menu

By default, all dashboards are combined in Dashboard group and have predefined icon or letter. In addition we have possibility to specify icon in the Dashboard group or assign it for each.

Dashboard or Dashboard group icon could be set up in the menu via configuration and for this we should apply icon parameter. To choose value for icon use Material Design icons set


Example for single Dashboard:

{
  
"icon""bookmark",
  
"menu": {
    
"name": {
      
"en""Main page",
      
"ru""Главная"
},
    
"group": {}
},
  
"slug""main"

}


Example for Dashboard in group:

{
  
"name": {
    
"en""Second",
    
"ru""Second"
},
  
"icon""filter_2",
  
"menu": {
    
"group": {
      
"key""SOME-GROUP",
      
"name": {
        
"en""Some group",
        
"ru""Some group"
},
      
"icon""camera"
}
},
  
"slug""second"

}


And if you want to configure Dashboard without icon use "icon": "no-icon"

1.7. Position in Dashboard menu

In General Dashboards or Dashboard groups are sorted by predefined rules. First of all should be shown single Dashboards and after them Dashboards in the group. If you want to change this order you should use orderIndex parameter. This parameter also sets up in the menu via configuration.


Picture 33


Example for sorting Dashboard in group:

{
  
"name": {
    
"en""Second",
    
"ru""Second"
},
  
"icon""filter_2",
  
"orderIndex"1,
  
"menu": {
    
"group": {
      
"key""SOME-GROUP",
      
"name": {
        
"en""Some group",
        
"ru""Some group"
},
      
"icon""camera"
}
},
  
"slug""second"

}


  • orderIndex - can be negative or positive. Less parameter pushed Dashboard or Dashboard group into first place.

  • groupIsLink - can be true or false and used for placing single Dashboards between groups.


Picture 34


Example for placing Dashboard between group:

{
  
"icon""low_priority",
  
"orderIndex"1,
  
"menu": {
    
"name": {
      
"en""Between groups",
      
"ru""Between groups"
},
    
"group": {
      
"orderIndex"-8
},
    
"groupIsLink"true
},
  
"slug""between"

}



1.8. Conditions

By default, all dashboards will be shown in the menu. But, there is a possibility to configure conditions when they should or should not be shown.

context.get('xmEntityId') will return xmEntityId that chosen from the entity list.

Example for the separate group:

{
    
"name""<dashboard name>",
    
"owner""<user key>",
    
"config": {
        
"condition""return context.get('xmEntityId');"
},
    
"isPublic"false

}


1.9. Changing Dashboard layout

To change a new dashboard layout: PUT http://localhost:4200/dashboard/api/dashboards/(URL) with JSON in the body.

Example:

{
  
"id":951,
  
"name":"Main",
  
"owner":"89a08ed4-5e7a-4f00-b6db-73c8ee9a0d5f",
  
"layout":{
    
"layout": [ <layout> ]
},
  
"isPublic":false

}


Layout object example:

{
  
"class":"row",
  
"content":[ { "widget":1001 } ]
},
{
  
"class":"row",
  
"content":[ { "class":"col-sm-6""widget":1002 }, { "class":"col-sm-6""widget":1003
 } ]
}