Comment Moderation - time based bans #6872

Merged
infinite-persistence merged 5 commits from ip/block.timeout.master into master 2021-09-03 16:43:45 +02:00
infinite-persistence commented 2021-08-12 15:45:52 +02:00 (Migrated from github.com)

Dev Notes

https://www.notion.so/lbry/Comment-Timeout-83a2834a888f41be998c91abcd92e908

Ticket

Closes #6712 Comment Moderation - time based bans

Approach

  • Consolidated the 3 types of blocking buttons in the Comment Content-menu (i.e. Block, Moderator Block, Admin Block) into 1 regular Block button.
  • Show a modal when Block is clicked.
    • Let user choose the blocklist (Personal, Moderator, Admin).
      • Most people will just have Personal
    • Let user choose the timeout duration (this PR's impetus).
## Dev Notes https://www.notion.so/lbry/Comment-Timeout-83a2834a888f41be998c91abcd92e908 ## Ticket Closes [#6712 Comment Moderation - time based bans](https://github.com/lbryio/lbry-desktop/issues/6712) ## Approach - Consolidated the 3 types of blocking buttons in the Comment Content-menu (i.e. _Block_, _Moderator Block_, _Admin Block_) into 1 regular _Block_ button. - Show a modal when _Block_ is clicked. - Let user choose the blocklist (Personal, Moderator, Admin). - Most people will just have Personal - Let user choose the timeout duration (this PR's impetus). <img src="https://user-images.githubusercontent.com/64950861/130548077-7811d65d-f609-4475-a586-266840066218.png" width="400">
tzarebczan (Migrated from github.com) reviewed 2021-08-12 15:45:52 +02:00
jessopb (Migrated from github.com) reviewed 2021-08-12 15:45:52 +02:00
tzarebczan commented 2021-08-12 18:42:58 +02:00 (Migrated from github.com)

Checking with Mark based on your notes. I also had a time based ban not work, he's looking into it.

Aside from blocked list showing the time based ban, can also show it on the channel page where we show a channel is blocked.

Checking with Mark based on your notes. I also had a time based ban not work, he's looking into it. Aside from blocked list showing the time based ban, can also show it on the channel page where we show a channel is blocked.
infinite-persistence commented 2021-08-13 10:23:52 +02:00 (Migrated from github.com)

3ea1b41 to 520a155

Minor tweaks and improvements:

  • Fix bug for other block buttons outside of comments (note: they all do "permanent block" for now, no timeout capability).
  • hide tab if "Personal" is the only choice.
  • add persistence to the tab, type and duration settings.
  • minor layout tweaks and mobile fixes.
  • block use from entering floats (commentron wants integers only)
#### 3ea1b41 to 520a155 Minor tweaks and improvements: - Fix bug for other block buttons outside of comments (note: they all do "permanent block" for now, no timeout capability). - hide tab if "Personal" is the only choice. - add persistence to the tab, type and duration settings. - minor layout tweaks and mobile fixes. - block use from entering floats (commentron wants integers only)
infinite-persistence commented 2021-08-20 09:35:28 +02:00 (Migrated from github.com)

520a155 to 30c19fe

  • Match Commentron's update of the resolution to 1s.
  • Changed to Twitch-style of defining the ban duration, i.e. "2d, 1h, 15m". It is easier to code (as long as the plugin is secure, fingers crossed), and the model is well vetted via Twitch. Added a help "?" to give examples, regardless.
  • Display the timeout info (date, duration, remaining info) in the Blocklist Page.
### 520a155 to 30c19fe - Match Commentron's update of the resolution to 1s. - Changed to Twitch-style of defining the ban duration, i.e. "2d, 1h, 15m". It is easier to code (as long as the plugin is secure, fingers crossed), and the model is well vetted via Twitch. Added a help "?" to give examples, regardless. - Display the timeout info (date, duration, remaining info) in the Blocklist Page.
kauffj (Migrated from github.com) reviewed 2021-08-23 17:08:37 +02:00
@ -0,0 +118,4 @@
if (Number.isInteger(seconds) && seconds > 0) {
if (seconds > ONE_HUNDRED_YEARS_IN_SECONDS) {
setInvalid('Wow, banned for more than 100 years?');
kauffj (Migrated from github.com) commented 2021-08-23 17:08:37 +02:00

inconsistent

inconsistent
infinite-persistence (Migrated from github.com) reviewed 2021-08-23 17:52:27 +02:00
@ -0,0 +118,4 @@
if (Number.isInteger(seconds) && seconds > 0) {
if (seconds > ONE_HUNDRED_YEARS_IN_SECONDS) {
setInvalid('Wow, banned for more than 100 years?');
infinite-persistence (Migrated from github.com) commented 2021-08-23 17:52:27 +02:00

As in, not formal?

As in, not formal?
kauffj (Migrated from github.com) reviewed 2021-08-27 18:04:07 +02:00
@ -0,0 +118,4 @@
if (Number.isInteger(seconds) && seconds > 0) {
if (seconds > ONE_HUNDRED_YEARS_IN_SECONDS) {
setInvalid('Wow, banned for more than 100 years?');
kauffj (Migrated from github.com) commented 2021-08-27 18:04:06 +02:00

it says one year in seconds but the text says 100 years

it says one year in seconds but the text says 100 years
infinite-persistence commented 2021-08-28 14:57:17 +02:00 (Migrated from github.com)

30c19fe to c6237a6

  • Fix typo in constant naming
  • Rebased to resolve conflict
### 30c19fe to c6237a6 - Fix typo in constant naming - Rebased to resolve conflict
infinite-persistence commented 2021-09-03 16:41:32 +02:00 (Migrated from github.com)

a49db3c to bf8ab2e

  • Fix bug of potentially calling the moderator API instead of the personal API due to persisted state. It now calls the correct api for the case when the modal is not needed.
## a49db3c to bf8ab2e - Fix bug of potentially calling the moderator API instead of the personal API due to persisted state. It now calls the correct api for the case when the modal is not needed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#6872
No description provided.