Fix VSD column names not matching the date range
What does this MR do and why?
Fixes a bug where on the first & last day of the month, the month name used as the column header did not match the date range used for the column. This was primarily caused by nMonthsBefore
being used to transition to a month with shorter days (ex. March 31 > Feb 28
actually returns a day in early March, since Feb 31
does not exist).
I cleaned up the logic a bit and added a new test to avoid future regressions.
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 |
---|---|
How to set up and validate locally
- Navigate to the VSD for any group:
http://gdk.test:3000/groups/flightjs/-/analytics/dashboards/value_streams_dashboard
- Mock the current date by returning a custom Date() here
export const generateValueStreamDashboardStartDate = () => {
return new Date('2020-03-31');
};
- Validate that the table shows the correct column headers
Related to #439901 (closed) and #430043 (closed)
Edited by Alex Pennells