Code insights: Implement delete insights with new dashboard functionality
Created by: vovakulikov
Context
We always have this core insight functionality but with the dashboards system, we missed that at some point. This PR brings this functionality back. Currently, we have delete
item in the insight context menu component. By click on that, you will delete this insight from all settings subjects and exclude this insight from all code insights dashboards.
Knowing issues
- Currently, if you delete some insight this operation triggers re-fetching all insights in the dashboard. This problem will be fixed in this ticket. https://github.com/sourcegraph/sourcegraph/issues/21097
- Delete operation doesn't have a confirmation UI (Related issues https://github.com/sourcegraph/sourcegraph/issues/21515)
What have been done
-
Extract edit operations concept from the edit insight page -
Re-write use-delete-insight handler taking into account new code insight dashboard system -
Connect handler and UI