Add a new project-specific templates API endpoint
What does this MR do?
This MR is an essential prerequisite to the "Group level file templates" 11.4 deliverable: #5987 (closed) -> !7391 (merged)
Central to this feature is the fact that the available templates may change based on the group the applying project is in.
The current API endpoints do not even know which project we're pulling templates from, so cannot be used to implement this functionality. Modifying them to respect a project parameter is difficult, so this MR introduces new API endpoints to be used instead:
GET /api/v4/projects/:id/templates/:type
GET /api/v4/projects/:id/templates/:type/:name
They return basically the same information as the non-project-specific endpoints, but since they know what the project is, that information can be used to look up templates from additional sources.
This MR also modifies the blob editor and web IDE to use these new project-specific endpoints when looking up and applying templates.
What are the relevant issue numbers?
Related to https://gitlab.com/gitlab-org/gitlab-ee/issues/5987
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides