Given a status code returned from an API query, I can't seem to get a mapped status field to display correctly in my list view. I seem to be missing how to connect the values from my query to the transformer being used.
I tried following the steps here (albeit that was mapping for a tag in table) to no avail.
I also tried using a query transformer to include the formatting options directly into the query data, but that resulted in a warning about duplicate keys (understandable as the code
field would indeed have multiple duplicate values.
My transformer:
return [
{
code: "SUCCESS",
label: "Deployed",
color: "Green",
icon: "/icon:bold/interface-validation-check-circle"
},
{
code: "FAILURE",
label: "Failed",
color: "Red",
icon: "/icon:bold/computer-desktop-delete-alternate"
},
{
code: "OTHER",
label: "Pending",
color: "Orange",
icon: "/icon:bold/interface-time-reset"
}
];
My query data:
[
{
"deploymentItemId": "123456",
"currentVersion": {
"id": "123456",
"label": "15cd40035",
"version_ts": "2019-01-01T00:00:00Z"
},
"status": {
"code": "SUCCESS"
}
},
{
"deploymentItemId": "234567",
"currentVersion": {
"id": "345678",
"label": "6d1e8e7cd",
"version_ts": "2019-01-01T00:00:00Z"
},
"status": {
"code": "FAILURE",
}
},
{
"deploymentItemId": "345678",
"currentVersion": {
"id": "567890",
"label": "712a82887",
"version_ts": "2019-01-01T00:00:00Z"
},
"status": {
"code": "SUCCESS"
},
{
"deploymentItemId": "456789",
"currentVersion": {
"id": "789012",
"label": "508d0e69c",
"version_ts": "2019-01-01T00:00:00Z"
},
"status": {
"code": "SUCCESS"
}
}
]
The field on the left is displaying the value from the query transformer as a text field and the field on the right is the status using the normal transformer.
According to the http headers, we're running self-hosted 3.6.16-undefined (Build undefined)
.
I appreciate your help!