FEATURE: reason to reject user signup (PR #11700)

Feature for Must Approve Users setup. When a user is rejected, a staff member can optionally set a reason for audit purposes. In addition, feedback email can be sent to the user.

Meta: Account rejection email - #8 by kris.kotlarek - feature - Discourse Meta

GitHub

In javascript we prefercamelCase not snake_case

This looks like a very nice feature but I have a few suggestions.

          action,

It is good practice to declare local variables when defining your class. Javascript is better at keeping the same object shape rather than changing it later.

example:

  rejectReason: null,
  sendEmail: false

I would prefer if these arguments were only added if they exist and that is the correct reviewable type.

        title: "Why are you rejecting this user?"
      subject_template: "You've been rejected on %{site_name}"

I feel like the ! might feel like we’re rubbing it in or something. Better to be more neutral.

You’re not setting sendEmail here, because it seems bound in the template to model.sendEmail not the local variable. In that case, if a user checks off sendEmail then closes the modal, it’ll still be true when they submit the reviewable. It needs to be reset, and preferably to use the component’s sendEmail

1 Like

I also feel like we should have a front end test to make sure the modal works properly.

@eviltrout thank you for your review, I fixed everything you mentioned and added test for modal :rocket:

can you use @action please ?

Looks good to me now, thanks for the changes. Feel free to merge once you address @jjaffeux 's concern :slight_smile:

The system to give a reason for refusing a new user should be similar to a yet to add system to provide a reason to reject a post or topic under review.