Add approximate duration function
What does this MR do?
!18991 (merged) introduced a new endpoint for cycle analytics stage median calculation, part of the change included returning the median value as a integer in seconds, previously the median used distance_of_time_in_words
to convert to an approximate time. This adds similar functionality to the FE.
- Adds a
limitToDays
option to the parseSeconds function - Adds an
approximateDuration
function to mimic distance_of_time_in_words. I've only implemented up to the level of days since that's all I current require for !19278 (merged) and we can always add more durations - Adds missing specs for the
analytics/cycle_analytics/total_time_component
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖