Skip to content

Epics Roadmap: Add hasChildrenWithinTimeframe field

Joseph Wambua requested to merge jj-411822-expand-carrot-date-filter into master

What does this MR do and why?

This MR adds a new field (has_children_within_timeframe) to EpicType.

When fetching epics that are filtered by timeframe, we sometimes want to know whether each resulting epics has children that also lie within the specified timeframe. This will be used by the frontend to determine whether to show an expander for the children or not.

Related to: #411822

How to set up and validate locally

  1. Create an epic whose start and end dates are within the current quarter
  2. To the main epic, add child epics whose start/end dates are outside the current quarter
  3. Run the graphql query below: ($START_DATE and $END_DATE should be the start and end dates of the quarter, in this example)
query groupEpics {
  group(fullPath: "milestones") {
    id
    name
    epics(timeframe: {start: $START_DATE, end: $END_DATE}) {
      nodes {
        id
        title
        hasChildren
        hasChildrenWithinTimeframe
        startDate
        dueDate
      }
    }
  }
}
  1. When $START_DATE and $END_DATE cover an epic and its children, then that epic's hasChildrenWithinTimeframe should be true.
  2. When the dates only cover the epic and not its children, then hasChildrenWithinTimeframe should be false.
Edited by Joseph Wambua

Merge request reports