Skip to content

Add GraphQL fields for namespace link paths and permissions

What does this MR do and why?

Add GraphQL fields for namespace link paths and permissions

  • Add autocomplete_award_emojis_path, new_trial_path, and project_namespace_full_path to base LinkPaths type
  • Add export_csv_path and new_issue_path to ProjectNamespaceLinks
  • Add import_work_items and admin_project permissions
  • Implement new_trial_path with GitLab.com vs self-managed logic in EE
  • Add comprehensive specs for all new fields and methods

References

Relates to #578973

Example

query result
fragment namespaceURLs on Namespace {
  linkPaths {
    autocompleteAwardEmojisPath
    newTrialPath
    namespaceFullPath
    rssPath
    calendarPath
    groupPath
    issuesListPath
    epicsListPath
    ... on ProjectNamespaceLinks {
        newWorkItemEmailAddress
        exportCsvPath
    		newIssuePath
    }
  }
}


query getNamespaceUserPermissions {
  public_group_namespace: namespace(fullPath: "twitter") {
    ...namespaceURLs
  }
	public_project_namespace: namespace(fullPath: "twitter/Typeahead.Js") {
    ...namespaceURLs
  }
  user_namespace: namespace(fullPath: "root") {
    ...namespaceURLs
  }
}

{
  "data": {
    "public_group_namespace": {
      "linkPaths": {
        "autocompleteAwardEmojisPath": "/-/autocomplete/award_emojis",
        "newTrialPath": "/-/trials/new?namespace_id=35",
        "namespaceFullPath": "twitter",
        "rssPath": "/groups/twitter/-/work_items.atom?feed_token=<token>",
        "calendarPath": "/groups/twitter/-/work_items.ics?feed_token=<token>",
        "groupPath": "twitter",
        "issuesListPath": "/groups/twitter/-/issues",
        "epicsListPath": "/groups/twitter/-/epics"
      }
    },
    "public_project_namespace": {
      "linkPaths": {
        "autocompleteAwardEmojisPath": "/-/autocomplete/award_emojis",
        "newTrialPath": "/-/trials/new?namespace_id=35",
        "namespaceFullPath": "twitter",
        "rssPath": "/twitter/Typeahead.Js/-/work_items.atom?feed_token",
        "calendarPath": "/twitter/Typeahead.Js/-/work_items.ics?feed_token",
        "groupPath": "twitter",
        "issuesListPath": "/twitter/Typeahead.Js/-/issues",
        "epicsListPath": null,
        "newWorkItemEmailAddress": null,
        "exportCsvPath": "/twitter/Typeahead.Js/-/issues/export_csv",
        "newIssuePath": "/twitter/Typeahead.Js/-/issues/new"
      }
    },
    "user_namespace": {
      "linkPaths": {
        "autocompleteAwardEmojisPath": "/-/autocomplete/award_emojis",
        "newTrialPath": null,
        "namespaceFullPath": null,
        "rssPath": null,
        "calendarPath": null,
        "groupPath": null,
        "issuesListPath": null,
        "epicsListPath": null
      }
    }
  },
  "correlationId": "01K9P70KRFS0PN94BP1CRF4Z74"
}

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vedant Jain

Merge request reports

Loading