Loading
Add inline validation for group name on edit page
What does this MR do and why?
Follow-up to !239243 (merged) that extends the same inline group-name validation to the group general settings (edit) page (/groups/<group>/-/edit → General → Naming).
Because the edit page is a server-rendered HAML form (not the Vue-based create form), this MR adds a small vanilla-JS validator (group_name_validation.js) that reuses checkGroupNameRules from !239243 (merged) and wires it up via the edit-page entry point.
References
Relates to #597214 (closed)
Depends on: !239243 (merged) (this MR targets that branch; retarget to master after !239243 (merged) merges).
Screenshots or screen recordings
How to set up and validate locally
- Open
/groups/<your-group>/-/edit→ General → Naming, visibility in your browser. - Verify error states:
- Clear Group name and submit → expect
Group name is required.inline, form does not submit. - Type
-foo→ expect inline format error. - Type
foo$bar→ expect inline format error.
- Clear Group name and submit → expect
- Verify valid input shows no error and allows saving:
- Type
My Groupand save → expectsuccessfully updatedflash. - Type
🚀 Rockets(emoji start) and save. - Type
_internaland save.
- Type
- Verify recovery:
- Type
-bad, then clear the field → expect error disappears (and aria-invalid resets). - Type
-bad, then fix tobad→ expect error disappears.
- Type
- Verify accessibility:
- With the field invalid, screen-reader users should hear the error text (linked via
aria-describedby).
- With the field invalid, screen-reader users should hear the error text (linked via
- Verify no regressions:
- Other settings on the page (description, visibility, etc.) save normally.
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 Shane Maglangit