SO-Close-Vote-Reviewers / UserScripts

Various user scripts that add features to the review queue or to the chat room
Other
56 stars 41 forks source link

CV Request Generator considers Spam as both No Reason and Reason Optional #208

Closed HenryEcker closed 1 year ago

HenryEcker commented 2 years ago

When making a flag-pls for spam with the CV Request Generator the "Request Reason" field is disabled.

Screen Shot 2022-05-06 at 16 55 18

However, it is often helpful to explain less obvious spam.


The reason it is disabled is due to the declarations in lines 69 and 70:

const requestTypesWithNoReason = ['!!/reportuser', '!!/addblu-', '!!/rmblu-', '!!/addwlu-', '!!/rmwlu-', 'spam'];
const requestTypesWithOptionalReason = ['!!/report', '!!/report-force', '!!/scan', '!!/scan-force', 'spam', 'offensive', 'reflag NAA', 'reflag VLQ'];

The value 'spam' appears in both the requestTypesWithNoReason and the requestTypesWithOptionalReason arrays. (It is the only value which appears in both)

When determining whether the input field is required or disabled it currently checks only checks if it is in the requestTypesWithNoReason array. If the value is present it makes the field not required and disables the field. L3011-L3022

Simply removing 'spam' from requestTypesWithNoReason in L69 makes the spam option behave as a Optional Reason which I think was the intended behaviour:

const requestTypesWithNoReason = ['!!/reportuser', '!!/addblu-', '!!/rmblu-', '!!/addwlu-', '!!/rmwlu-'];
Screen Shot 2022-05-06 at 17 04 25