Skip to content

Add allowed parent types workItemWidgetHierarchyDefinition

What does this MR do and why?

Right now the work item to its parent mapping is hardcoded on frontend side in work_items/constants.js#L309-315.

Extend WorkItemWidgetDefinitionHierarchy to support allowedParentTypes for each work items to filter parent items in Parent widget.

Issue: #457192 (closed)

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

No UI changes

How to set up and validate locally

Go to graphql explorer and run the below queries, you should be able to see allowedParentTypes data

WorkItem Level
query getAllowedWorkItemChildTypes {
  workItem(id: "gid://gitlab/WorkItem/385") {
    workItemType {
      id
      name
      widgetDefinitions {
        ... on WorkItemWidgetDefinitionHierarchy {
          allowedParentTypes {
            nodes { name }      
          }
        }
      }
    }
  }
}
Project Level
query getProjectTypesAllowedChildren{
  project(fullPath: "flightjs/Flight") {
    workItemTypes {
      nodes {
        id
        name
        widgetDefinitions {
          type
          ... on WorkItemWidgetDefinitionHierarchy {
            allowedChildTypes {
              nodes { name }
            },
            allowedParentTypes {
              nodes {
                name
              }
            }
          }
        }
      }
    }
  }
}
Group Level
query getGroupTypesAllowedChildren{
  group(fullPath: "flightjs") {
    workItemTypes {
      nodes {
        id
        name
        widgetDefinitions {
          type
          ... on WorkItemWidgetDefinitionHierarchy {
            allowedChildTypes {
              nodes { name }
            },
            allowedParentTypes {
              nodes { name }
            }
          }
        }
      }
    }
  }
}
Edited by Abhilash Kotte

Merge request reports