- Print
- DarkLight
Asset Picker
- Print
- DarkLight
The Asset Picker is a configurable component that allows users to select machines and/or lines from their factory assets. It supports both single and multi-select modes with various configuration options.
Configuration Options
The picker can be configured through the following options in the config object:
Option | Type | Default | Description |
|---|---|---|---|
| string | "all" | Determines initial selection behavior. Options: - - - |
| boolean | false | When |
| boolean | false | Only applies in multi-select mode. When |
| boolean | false | When |
| string[] | undefined | Optional array of machine names. When provided, only shows assets listed in the whitelist |
| string | undefined | Optional machine name to select by default |
Example Configuration
{
"config": {
"defaultValue": "first",
"selectMixedAssets": false,
"selectSameType": false,
"selectSingle": false,
"usesLines": false
},
"id": "asset",
"title": "Asset",
"type": "asset"
},Default Query Params
The asset picker generates the following params to the API Query:
Parameter | Type | Description |
|---|---|---|
| string[] | Array of selected machine names |
| string[] | Array of machine types for the selected machines |
| object[] | Detailed information about each selected machine |
The machines array contains objects with the following properties for each selected machine:
Property | Type | Description |
|---|---|---|
| string | Unique identifier for the machine |
| string | Internal machine name (unique) |
| string | Machine type (e.g. "SMType") |
| string | Unique identifier for the machine type |
| string | Human-readable machine name |
| string | Display title for the machine |
| string | Unique identifier for the factory containing the machine |
| string | Internal factory name (unique) |
| string | Human-readable factory name |
Example request body:
"asset": {
"pickerType": "asset",
"value": {
"machine_names": [
"sm_machine_1",
"sm_machine_2"
],
"machine_types": [
"SMType"
],
"machines": [
{
"id": "3d52ccc428a2a961eea74b30",
"name": "sm_machine_1",
"type": "SMType",
"type_id": "510bd9c3437d7a1c18e290de",
"display_name": "Sight Machine 1",
"title": "Sight Machine 1",
"factory": {
"id": "9b82d4248788f1331e1c1d40",
"name": "ETL3_sanfrancisco",
"display_name": "San Francisco"
}
},
{
"id": "b7f842f6dd4d6e9893556ded",
"name": "sm_machine_2",
"type": "SMType",
"type_id": "510bd9c3437d7a1c18e290de",
"display_name": "Sight Machine 2",
"title": "Sight Machine 2",
"factory": {
"id": "9b82d4248788f1331e1c1d40",
"name": "ETL3_sanfrancisco",
"display_name": "San Francisco"
}
}
]
}
},Page Link
The following is the accepted mapping to populate the parameter for this picker:
{
"mapping": {
'asset': '{"machine_source": ["machine_name1", "machine_name2"]}'
}
}