Skip to content

Remove Link usage from code insights charts and use native links

Administrator requested to merge vk/code-insights-fix-bad-absolute-links into main

Created by: vovakulikov

Just because Link component from react-router-dom package can't handle external and local links together we should't use them in the code insights charts.

In case of global path Link component transforms href from https:sourcegraph.com/search to /https:sourcegraph.com/search, notice / at the beginning of the href path. This / makes redirect by link relative which lead us to a problem when after redirect by this link we have URL like this https://sourcegraph/https://sourcegraph/search which is just a bad link.

Possible solution here use native links with absolute paths and handle cmd+click and check external path. We already have this logic for handling markdown links - createLinkClickHandler

Merge request reports

Loading