Commit Graph
25 Commits
Author SHA1 Message Date
Andrei Prigorshnev f21d50ebb6 UX: show Update button instead of Enable button when slow mode is already enabled (#13077)
When slow mode is enabled it's possible to open the slow mode dialog again to disable it or to update slow mode settings. The problem is that in this case, the button for saving still has the label "Enable" which is confusing.

This changes the text on the button from "Enable" to "Update" when slow mode is already enabled.
2021-05-25 13:33:39 +04:00
Andrei Prigorshnev c62efc0f0f FIX: Ignore max excerpt length for div excerpts too (#13058)
We support two types of custom excerpts. It can be <div class="excerpt"> or <span class="excerpt">: https://github.com/discourse/discourse/blob/b21f74060e865d809ba466cb52e6cb95c7b0cf1f/lib/excerpt_parser.rb#L120

We also ignore max excerpt length for custom excerpts. But we forgot to process div when ignoring max length.
2021-05-24 13:05:24 +04:00
Andrei Prigorshnev a5dd24c445 DEV: fix warnings 'Hbs template must be compiled and not a string' in tests (#13116)
These warnings appeared only when running tests using Ember CLI.
2021-05-21 19:58:18 +04:00
Andrei Prigorshnev 0df6b0bc47 FIX: slow mode dialog doesn't remember Enabled Until value (#13076)
If reload a page after enabling slow mode and open the slow mode dialog again it would show a slow mode interval but wouldn't show Enabled Until value. This PR fixes it.
2021-05-21 18:13:14 +04:00
Andrei Prigorshnev 28e201f391 DEV: add timezone to user fixtures (#13095) 2021-05-20 16:06:38 +10:00
Andrei Prigorshnev 075cd07a07 No need to disable rate limiter after running tests (#13093)
We disable rate limiter before running every test here https://github.com/discourse/discourse/blob/90ab3b1c7575772aed87755e302aea530909af9a/spec/rails_helper.rb#L109-L109
2021-05-19 16:04:35 +04:00
Andrei Prigorshnev 9e4288a4ab FEATURE: constrain post_excerpt_maxlength (#13064)
Too long excerpts don't make sense. They would make UI wonky. We already have a constraint for the `topic_excerpt_maxlength` setting. This adds the same constraint to `post_excerpt_maxlength`.

It also changes the max value of `topic_excerpt_maxlength` from 999 to 1000.
2021-05-19 14:26:15 +04:00
Andrei Prigorshnev 6d3c975519 FIX: backtracking re-render" assertion in future-date-input (#13075)
> Backtracking re-render refers to a scenario where, in the middle of the rendering process, you have modified something that has already been rendered.

See more details from the Ember team here https://github.com/emberjs/ember.js/issues/13948.

We call _updateInput from init. _updateInput triggers onChangeInput which mutates a date that was given to future-date-input just a moment ago and a rendering cycle wasn't finished yet.
2021-05-19 14:01:23 +04:00
Andrei Prigorshnev 3e0f72f57f FEATURE: Increase daily edit limits proportionally to trust level (#13090) 2021-05-19 13:57:21 +04:00
Andrei Prigorshnev 0a4cb65020 DEV: Fix some deprecation warnings in tests
- Import `exists()` instead of using the global function (#13010)
2021-05-11 14:04:33 +04:00
Andrei Prigorshnev 8f82243ee7 UX: update copy on the notifications empty panel (#12948) 2021-05-05 14:02:39 +04:00
Andrei Prigorshnev 599327658c FIX: temporarily skip flaky future-date-input tests (#12941) 2021-05-04 17:18:58 +04:00
Andrei Prigorshnev 338740c385 UX: hide the list of file extensions on the upload dialog (#12836) 2021-05-04 15:16:00 +04:00
Andrei Prigorshnev e7de943b5d FIX: hide "Next Week" in future-date-input on Sundays (#12918) 2021-05-03 09:22:05 +02:00
Andrei Prigorshnev d3b05f8a9c FEATURE: always insert images on new lines and add newline after (#12895) 2021-04-30 12:38:28 +04:00
Andrei Prigorshnev ced5463ffb FIX: avatar flair wasn't displaying on the user summary page (#12867) 2021-04-28 20:15:22 +04:00
Andrei Prigorshnev d3c0b6bfe1 FEATURE: include avatar flair on the avatars listed in a user summary’s “Most…” sections (#12858) 2021-04-27 23:09:32 +04:00
Andrei Prigorshnev 2c4fd7f7c7 FIX: No JIT when quoting a mention (#12835) 2021-04-27 19:36:17 +04:00
Andrei Prigorshnev f7aeb257ee FIX: Skip notifications about beginner badges (#12819) 2021-04-26 11:41:51 +04:00
Andrei Prigorshnev 8c6ea967ae FEATURE: Show the slow mode indicator in composer (#12720) 2021-04-17 23:40:09 +04:00
Andrei Prigorshnev eb99ecf1d2 FEATURE: In the slow mode dialog make "Enabled Until" mandatory (#12701) 2021-04-15 19:16:01 +04:00
Andrei Prigorshnev 3326d1ff73 FEATURE: Tweak slow mode messages and intervals (#12704) 2021-04-15 13:56:10 +04:00
Andrew Prigorshnev 3bbe87f229 FIX: polls extending in post reply histories (#11837)
* Add an acceptance test

* FIX: polls extending in post reply histories
2021-01-26 10:29:49 -05:00
Andrew PrigorshnevandRobin Ward 0f1c9a2180 FIX: Use the same time moment for related Redis calls in rate limiter (#11692)
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2021-01-12 15:09:15 -05:00
Andrew Prigorshnev e25dd41aee FIX: sliding window end time in rate limiter (#11691)
If the sliding window size is N seconds, then a moment at the Nth second
should be considered as the moment outside of the sliding window.

Otherwise, if the sliding window is already full, at the Nth second,
a new call wouldn't be allowed, but a time to wait before the next call
would be equal to zero, which is confusing.

In other words, the end of the time range shouldn't be included in the
sliding window.

Let's say we start at the second 0, and the sliding window size is 10
seconds. In the current version of rate limiter, this sliding window will
be considered as a time range [0, 10] (including the end of the range),
which actually is 11 seconds in length.

After this fix, the time range will be considered as [0, 10)
(excluding the end of the range), which is exactly 10 seconds in length.
2021-01-12 13:26:43 -05:00