Move year dropdown outside of each usage chart
What does this MR do and why?
This moves the year selection dropdown of the pipeline usage charts to the top, allowing to filter all of the charts with a single
dropdown, this is behind the move_year_dropdown_usage_charts
feature flag
Screenshots or screen recordings
One year dropdown for all charts
Before | After |
---|---|
How to set up and validate locally
- Start a rails console session,
bundle exec rails console
orbundle exec rails c
- Create a couple of CI/CD minutes usage entries, here's an example for January 2023 and February 2023
user = User.find(1)
project = Project.find(23) # Change this ID to whatever project ID you wish to use
monthly_usage = Ci::Minutes::ProjectMonthlyUsage.new(project_id: project.id, date: Date.new(2023, 01, 01), amount_used: 70, shared_runners_duration: 100)
monthly_usage.save
namespace_usage = Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: user.namespace.id, date: Date.new(2023, 01, 01), amount_used: 70, shared_runners_duration: 100)
namespace_usage.save
monthly_usage = Ci::Minutes::ProjectMonthlyUsage.new(project_id: project.id, date: Date.new(2023, 02, 01), amount_used: 120, shared_runners_duration: 150)
monthly_usage.save
namespace_usage = Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: user.namespace.id, date: Date.new(2023, 02, 01), amount_used: 120, shared_runners_duration: 150)
namespace_usage.save
- Enable the
move_year_dropdown_usage_charts
feature flag before closing the rails console session
Feature.enable(:move_year_dropdown_usage_charts)
- Close the rails console session by pressing
Ctrl + D
- Login to your GDK and go to your user preferences -> Usage Quotas and check the graphs and play around with the dropdowns
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jose Ivan Vargas