Code Insights: Add use as template links to the example section cards
Created by: vovakulikov
Closes https://github.com/sourcegraph/sourcegraph/issues/30157
Context
This PR adds use as templates
links to the example insights section on the landing page. Also (tech details) this PR adds URL parsers for the capture group and search-based insight creation UIs.
How to test
Since this PR changes logic around the calculation of initial values for the creation UI we have to test a few cases for it
- Search insight creation UI should remember the last typed values when you refresh the page
- Search insight 1-click creation flow should work properly
- Use as template link for Search insight should work properly (populate values form example card in the creation form)
- Capture group insight creation UI should remember the last typed values when you refresh the page
- Use as template link for Capture group insight should work properly (populate values form example card in the creation form)
TODO
-
Implement URL parsers for the search based creation UI -
Adjust View card layout for the "use as template" link in the action panel -
Implement URL parsers for the capture group creation UI