fix empty values in compute results processing
Created by: coury-clark
This PR has 2 fixes:
- Filters empty compute results caused by https://github.com/sourcegraph/sourcegraph/issues/37972
- Refactored the live preview for compute group insights to require
generatedByCaptureGroups
as well asgroupBy
Test plan
Before
{
"data": {
"searchInsightLivePreview": [
{
"points": [
{
"value": 72,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": "Go"
},
{
"points": [
{
"value": 67,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": ""
},
{
"points": [
{
"value": 49,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": "Markdown"
},
{
"points": [
{
"value": 12,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": "JSON"
},
{
"points": [
{
"value": 10,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": "PLSQL"
},
{
"points": [
{
"value": 3,
"dateTime": "2022-07-14T15:35:47Z"
}
],
"label": "Shell"
}
]
}
}
After
{
"data": {
"searchInsightLivePreview": [
{
"points": [
{
"value": 72,
"dateTime": "2022-07-14T15:37:26Z"
}
],
"label": "Go"
},
{
"points": [
{
"value": 49,
"dateTime": "2022-07-14T15:37:26Z"
}
],
"label": "Markdown"
},
{
"points": [
{
"value": 12,
"dateTime": "2022-07-14T15:37:26Z"
}
],
"label": "JSON"
},
{
"points": [
{
"value": 10,
"dateTime": "2022-07-14T15:37:26Z"
}
],
"label": "PLSQL"
},
{
"points": [
{
"value": 3,
"dateTime": "2022-07-14T15:37:26Z"
}
],
"label": "Shell"
}
]
}
}