Dynamic workItemTypes list based on namespace

Problem

Currently the WorkItems::Type (WIT) GraphQL queries on Namespace.workItemTypes, Project.workItemTypes, and Group.workItemTypes always returns a static list of all WITs in alphabetic order.

However, these WIT queries needs to take in consideration:

  • Availability per namespace type: namespace, project, or group.
  • Feature Flags: e.g. it should not return Objectives and Key Results types when okrs_mvc is disabled
  • GitLab Edition: such as EE or FOSS.
  • User permission: e.g. guest users cannot create incidents, so the incident type should not be returned for them.

This is especially important to implement before we allow the creation of custom work item types.

Edited by Kassio Borges