Code insights: Integrate BE (all repos mode) insight with FE insights dashboards
Created by: vovakulikov
Closes https://github.com/sourcegraph/sourcegraph/issues/22760
Context
Historically we have two main places where insights come from (extensions code and backend gql handler). Extension insights are already integrated with the FE dashboard system but BE insights are not.
This PR adds integration of backend insights IDS to the dashboard insight ids field in the setting cascade and connects the new GQL API. Also, this PR adds BE insights in add insight to the dashboard modal UI and since this PR you can add your BE insights in any custom code insight dashboard.
Example (user settings file):
// Extension based insights live on top level of settings
"searchInsight.insights.myExtensionBasedInsight": { ... configuration },
"codeStats.insights.myExtensionCodeStatsInsight": { ... configuration },
// Sepcial key where all BE insights are stored
"insights.allrepos": {
"searchInsight.insights.myBackendBasedInsight": { ... configuration }
...
...
}
Then if we open All insights dashboards we call gql handler insights(ids: [ID!]!): {} with BE insights ids from the settings and load extension-based insight via extension API.