Code Insights: [FE] Refactor views components
Created by: vovakulikov
History
Historically we have a few components that are used for rendering insight cards in Code Insights pages in /view
directory. That is because we have Code Insights pages in /enterprise
version and at the same time we have the OSS version of insights (extension-like insights like Codecov, Eslint, Snyk at homepage insights section and directory page insight section).
So to stick with our rules about the OSS version can't rely on components from /enterprise
version (which makes sense) we had to split views like components and extract them in a separate /views
directory.
What does this PR do
It actually does a few things
- Cleans up export/import structure
- Fixed a few visual problems with the view card
- Removes insights types from view component that makes them insight independent that allows us to use them in non-insights consumers (except one big place about tracking but we will get it later in a separate PR)
Visual changes
@AlicjaSuska FYI
- I have aligned the paddings on all sides of the card (now it looks a little bit cleaner)
- I increased the height of the card so even top padding has been increased the chart content stays the same
- Fixed Y label generation for "flat" data series
Before | After |
For reviewers
It is a little bit over our PR size policy. But most changes here are mechanical. I would suggest reviewing this commit by commit. Most of the commits make sense on their own.