Auto-populate project slug string to project name if name is empty
What does this MR do?
This MR changes the behaviour of the new project input fields (for all new project forms).
Currently, if you enter a project name, it will auto-populate the project slug (path) for you. However, if you enter a project slug, it will not auto-populate the project name.
With this MR, when you enter a project slug, it will auto-populate the project name (converting -
/_
to spaces and uppercasing each word - Title Case). The one stipulation is that if a project name has already been manually entered, the project slug won't overwrite it.
It is worth saying that this does now introduce a discrepancy between project name and project slug, insofar as if you enter a project name it will always overwrite the slug irrespective of whether the user has manually changed it or not.
I would be interested to hear whether we should align these two things so they follow the same behaviour:
- If the project name and project slug (hereon called field(s)) is blank, then filling in one of these fields will auto-populate the other
- If the user uses the same field (the one used to initially enter some values) and changes its value, the other field will reflect this change
- If the user manually edits a field, it will not be affected by a change in the other field
Discussion outcomes
- Leave it for now, we can align the behaviours if and when we determine a need to do so (user issue, UX research etc)
Screenshots
A quick video of the new behaviour as it stands: Screen_Recording_2020-01-10_at_12.24.42
Does this MR meet the acceptance criteria?
I hope so
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #24305 (closed)