Add popularity stats and sorting in ci catalog list page
What does this MR do and why?
Adds the usage statistics to the catalog list view (how many times a resource is being used) and we use a new graphql field called last30DayUsageCount
. This field currently always return 0 and we need #452545 (closed) to be completed before this can work fully. This is why this will ship behind a FF called ci_catalog_popularity
which we will remove in #464593 (closed)
Additionally, we add a new sort option to sort by popularity.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
Mobile:
Before | After |
---|---|
Screen_Recording_2024-05-30_at_2.19.20_PM
How to set up and validate locally
- Set up the project to be a valid catalog resource: https://docs.gitlab.com/ee/ci/components/#create-a-component-project
- Create a release for the resource
- Go to the explore -> CI/CD Catalog page
- Make sure the new sort option is missing
- Make sure that the layout is not showing the stats icon
- Turn on the FF
ci_catalog_popularity
- Notice that the stat for usage (or popularity) is shown. This will always be 0 for now.
- change the sorting option to popularity. This will have no effect since all ressources have 0, but it emits the correct enum value:
USAGE_COUNT_ASC
andUSAGE_COUNT_DESC
according to whether its sorting ascending or descending.
Related to #434333 (closed)