Label

The label component is used to display property values in a label. A label can take in exactly one property (if it is a nested property, then up to 3 levels). Sequence determines the order in which the labels appear.

{
  "labels": [{
    "sequence": 1,
    "properties": [

    ],
    "defaultColor":
    "displayLabel":
    "values": [
      {  "value":
         "color":
         "displayLabel":
         "prefix":
      },
      ...
    ]
  }]
}

Assign Color

A color can be specified for every property value. For enums, the value is the domain code.

In the UI the domain boilerplate value is displayed.

In case of a boolean, it takes true and false as value. For string, number and date fields, the field value must be specified.

The following colors are available:

  • red

  • orchid

  • blue

  • blue-2

  • cyan

  • cyan-2

  • cyan-3

  • green-2

  • green

  • grey

"labels":[{
  "sequence":1,
  "properties":[
    {  "name":"status"
    }
  ],
  "values":[
   {  "value":"INITIAL",
      "color":"grey"
   },
   {
     "value": CHANGE",
      "color":"blue"
   },
    ..
  ]
}]

Conditionally Display Label

If a field has a value that is not configured, the label either displays the defaultColor or the label is not displayed at all. A label is never displayed when the value of the property is NULL. This implies that the display settings 'Always' and 'notNull' give the same results in case of labels.

"labels":[{
  "sequence":1,
  "properties":[
    {"name":"status"
      ...
    }
  ],
  "defaultColor":"grey"
  "values":[
    { "value":"FINALIZED",
      "color":"green"
    },
    { "value": "CHANGE",
      "color":"blue"
    },
    ..
  ]
}]

Array Property and Label

The user can also specify a property of the list (array or subResource), in this case the label is shown for each value in the list. Consider the following example to clarify:

"labels":[{
  "sequence":1,
  "properties":[
    { "name":"claimPendReasonList",
      "properties": [
        { "name":"pendReason",
          "sequence": 1,
          "properties": [
            { "name":"code",
              "sequence": 1
            }
          ]
        }
      ]
    }
  ],
  "defaultColor":"blue"
}]

This displays a blue label with the pend reason code as value for each pend reason on the claim.

Custom Label Value

Display Label

It is possible to display custom labels by specifying the 'displayLabel' property referring to the boilerplate text key. The boilerplate text of that key is then displayed as the label.

"labels":[{
  "sequence":1,
  "properties":[
   ...
  ],
  "defaultColor":"grey",
  "displayLabel":"",//boilerplate key
  "values":[
    { "value":"Y",
      "color":"blue",
      "displayLabel":""//boilerplate key
      "prefix":""//boilerplate key

    }..
  ]
}]
Example

Label 'Obsolete' in red when a message is marked as obsolete.

"labels":[{
  "sequence":1,
  "properties":[
    { "name":"obsolete",
      "sequence":1
    }
  ],
  "values":[
    { "values":"true",
      "color":"red",
      "displayLabel":"CUSTOM_FN002_LABEL_OBSOLETE" //boilerplatekey
    }..
  ]
}]

The label component to display the message severity for object 'messages' in search message page.

"labels": [{
  "sequence":1,
  "properties": [
    { "name":"severity",
      "sequence": 1,
    }
  ],
  "defaultColor":"blue",
  "values":[
    {"value":"F",
      "color":"red"
    }
  ]
}]

Prefix

It is also possible to add a prefix to the label which is being displayed by specifying the 'prefix' property referring to the boilerplate text key for the prefix.

The boilerplate text of that key is then prefixed to the label i.e. '<prefix> <label value>'. It is also possible to use 'prefix' along with 'displayLabel'

"labels":[{
  "sequence":1,
  "properties":[
   ...
  ],
  "defaultColor":"grey",
  "prefix":""//boilerplate key
  "values":[
    { "value":"Y",
      "color":"blue"
    }..
  ]
}]