Show default value in squash and merge commit template textareas
What does this MR do and why?
Solves #348707 (closed)
Shows default value in a textareas for squash and merge commit templates instead of placeholders.
At the same time, it persists nil to database instead when default value is used.
This fixes rendering problem for placeholder with new lines (it does not render in Safari, possibly others).
Screenshots or screen recordings
For projects without any value set:
After - default values are prefilled in textareas:
After - when user clears the values:
Note that for merge suggestions I've only added the help text. It's a one line text field, so there's no issue with placeholder there.
How to set up and validate locally
- Go to any project -> settings -> general.
- Expand Merge Requests section.
- Check that "Merge commit message template" and "Squash commit message template" is prefilled with default values.
- Change the value and confirm that it updated in DB.
- Change back to default value and confirm that it is
nil
in DB, but shows as default value in textarea. - Change to empty value and confirm that it is
nil
in DB, but shows as default value in textarea.
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.
Edited by Michael Kozono