Warn when mention all users in a group
What does this MR do and why?
Related #26889 (closed)
Show warning when mentioning @all
in markdown fields. When we detect @all
in the text field, make a request to the Preview endpoint to check how many people will be notified. If @all
is removed we remove the warning.
This is meant as a sanity check against accidental @all
mentions. Currently we show this in the preview tab, but if you don't click preview before posting a comment you never know!
Screenshots or screen recordings
How to set up and validate locally
- Find a group with more than 10 members (or reduce
referencedUsersThreshold
in field.vue) - Go to an issue in that group
- Type
@all
(not in quotes) in a markdown field - Realise your mistake, don't post the comment, and save thousands of notification emails
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 Simon Knox