insights: add/remove data series, update series visual metadata
Created by: CristinaBirkel
Partial implementation for https://github.com/sourcegraph/sourcegraph/issues/25979
Description
This is a partial implementation of updating data series on insights:
- Update visual metadata (label and color)
- Add/remove series
- Add a series by including a
dataSerieswith noseriesIdfield - Remove a series by excluding it from the
dataSeriesarray
- Add a series by including a
To finish this issue, the query, timeScope and repositoryScope will need to be updated. These will require more work because they affect the actual data that needs to be generated for the chart.
I have a few notes for discussion and will leave them as comments in the PR.
Testing Steps
- Query
updateLineChartSearchInsightfor an insight with at least onedataSeries, and modify thedataSeries.optionsand see that they return as expected. - Run the same query, but add another
dataSeries, this time leaving out theseriesIdfield. Verify that a new series is created and attached. - Now exclude one of the
dataSeriesand verify that it gets removed.