insights: don't return series that have been deleted
Created by: CristinaBirkel
Closes #24333 (closed)
Overview
The insight_series
table has a deleted_at
column that allows for a soft delete of insight series. This PR makes sure that deleted series won't be returned when fetching insights.
Testing Steps
I see a "Remove" button in the UI on series when editing an insight, but it's grayed out. Let me know if I'm missing something there. I tested it by editing the db rows directly.
I saw two cases here:
- An insight with only one series: adding a value for
deleted_at
will result in "Your insight is being processed." I imagine we might not let a user delete the last series from an insight anyway? - An insight with multiple series: adding a value for
deleted_at
for one of the series will remove the series from the chart. Making that valuenull
again will add it back to the chart.