FEATURE: Topic slow mode. (PR #10904)

Adds a new slow mode for topics that are heating up. Users will have to wait for a period of time before being able to post again.

We store this interval inside the topics table and track the last time a user posted using the last_posted_at datetime in the TopicUser relation.

Some screenshots:

Screen Shot 2020-10-13 at 09 15 05 Screen Shot 2020-10-13 at 09 15 50 Screen Shot 2020-10-13 at 09 15 59


Screen Shot 2020-10-13 at 09 16 31

If the user ignores the warning and tries to post:

Screen Shot 2020-10-13 at 09 19 07


use @action please

    const topic = composer.topic;

this should be moved in init, with slowModes being null, and the array set in the init, otherwise you leak this array

we have ember helpers for this kind of cases

use @action please

  return { hours, minutes, seconds: initialSeconds }
      return I18n.t("topic.slow_mode_intervals.hours", { hours });

hours, minutes

indentation is wrong

can’t we use false here ? instead of “false” ?

indentation is wrong

indentation is wrong

also does pull-right something we use ?

please avoid direct styling on html elements

xxx ?

Generally speaking I find the word “interval” incorrect, and I think “duration” would be more correct.

    const topic = composer.topic;

moment js has a lot of helpers to deal with duration, maybe you should have a look at it ?

I’m not a huge fan of magic number for sizes :stuck_out_tongue:

Thanks for the thorough review, @jjaffeux! I addressed all your comments.