Removed the template type selector
What does this MR do and why?
- Completely removes the template type selector as per #358212 (comment 1230417217)
- Refactors a couple of inefficient JS functions to avoid unnecessarily parsing all of the template types
- Introduces the logic to hide the template selector when the file name doesn't match any of the predefined template types (even though we do not show the type selector)
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Create a new file in a repository. Try the following:
- give the file a random name like
foo
. The template selector should not be shown - while on the edit page, rename the file to something, covered by the template types, for example
LICENSE
. Observe the "Apply template" dropdown to be rendered. It should contain the list of the license templates - while still on the edit page, rename the file to another name, covered by the template types, for example
Dockerfile
. Observe the "Apply templates" dropdown containing the templates for the Dockerfile now - save the file
- Click 'Edit' on the newly-created file or any other type-covered file (
.gitlab-ci.yml
,LICENSE
, etc.). Observe the "Apply template" dropdown to be rendered right away
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #358212 (closed)
Edited by Denys Mishunov