-
Notifications
You must be signed in to change notification settings - Fork 796
AO3-7275 Unreviewed comments marked as spam are still visible to creators #5577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d80ce93
6491b6a
48deebd
9849c33
b8068f4
fbc776e
0927b58
6346a39
5c46211
f07956d
dd2c6cc
ab57d9e
321db57
d2a48ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| <% end %> | ||
|
|
||
|
|
||
| <% # chapter navigation %> | ||
| <%# chapter navigation %> | ||
| <% if @previous_chapter || @next_chapter %> | ||
| <li class="chapter entire"><%= link_to ts("Entire Work"), work_path(@work, :view_full_work => 'true') %></li> | ||
|
|
||
|
|
@@ -44,7 +44,7 @@ | |
| <% end %> | ||
|
|
||
|
|
||
| <% # for users, bookmark and mark to read later %> | ||
| <%# for users, bookmark and mark to read later %> | ||
| <% if current_user.is_a?(User) %> | ||
| <% @bookmark ||= bookmark_if_exists(@work) %> | ||
| <li class="bookmark"> | ||
|
|
@@ -64,7 +64,7 @@ | |
| <% end %> | ||
|
|
||
| <li class="comments" id="show_comments_link_top"> | ||
| <% # If in single chapter view, show comments for the chapter; otherwise, show the comments for the entire work %> | ||
| <%# If in single chapter view, show comments for the chapter; otherwise, show the comments for the entire work %> | ||
| <% @previous_chapter || @next_chapter ? commentable = @chapter : commentable = @work %> | ||
| <% if commentable.count_visible_comments > 0 %> | ||
| <%= show_hide_comments_link(commentable) %> | ||
|
|
@@ -73,14 +73,19 @@ | |
| <% end %> | ||
| </li> | ||
|
|
||
| <% # for author or admin, review comments if moderating them %> | ||
| <%# for author or admin, review comments if moderating them %> | ||
| <% if (logged_in_as_admin? || (current_user && current_user.is_author_of?(@work))) && @work.find_all_comments.unreviewed_only.exists? %> | ||
| <li class="comments" id="review_comments"> | ||
| <%= link_to ts("Unreviewed Comments") + " (" + @work.find_all_comments.unreviewed_only.count.to_s + ")" , unreviewed_work_comments_path(@work) %> | ||
| <% unreviewed_count = if logged_in_as_admin? | ||
| @work.find_all_comments.unreviewed_only.count | ||
| else | ||
| @work.find_all_comments.unreviewed_only.not_spam.count | ||
| end %> | ||
| <%= link_to t("works.work_header_navigation.unreviewed_comments", count: unreviewed_count), unreviewed_work_comments_path(@work) %> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you make this use lazy lookup for the locale, so |
||
| </li> | ||
| <% end %> | ||
|
|
||
| <% # allow user to disable style on work if it has been customized %> | ||
| <%# allow user to disable style on work if it has been customized %> | ||
| <% if @work.work_skin %> | ||
| <li class="style"> | ||
| <% if Preference.disable_work_skin?(params[:style]) %> | ||
|
|
@@ -105,7 +110,7 @@ | |
| </li> | ||
| <% end %> | ||
|
|
||
| <%# The li, noscript, and button tags MUST be on the same line here to avoid the behavior described in https://otwarchive.atlassian.net/browse/AO3-4629?focusedCommentId=372231 %> | ||
| <%# The li, noscript, and button tags MUST be on the same line here %> | ||
|
Comment on lines
-108
to
+113
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like an unrelated change found its way into the file, could you undo it? |
||
| <% if downloadable? && AdminSetting.current.downloads_enabled? %> | ||
| <li class="download"><noscript><h4 class="heading"><%= t(".download.heading") %></h4></noscript><button class="hidden"><%= t(".download.button") %></button> | ||
| <ul class="expandable secondary"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,3 +330,23 @@ Feature: Comment Moderation | |
| And I view the work "Moderation" | ||
| And I follow "Unreviewed Comments (1)" | ||
| Then I should not see "Parent Thread" | ||
|
|
||
| Scenario: Creator marks an unreviewed comment as spam and the count updates | ||
| Given I am logged in as "spam_catcher" | ||
| And I have a work "Spam Trap" | ||
| And I edit the work "Spam Trap" | ||
| And I check "Enable comment moderation on this work" | ||
| And I press "Post Without Preview" | ||
| And I am logged out | ||
|
Comment on lines
+335
to
+340
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be replaced with the |
||
| When I view the work "Spam Trap" | ||
| And I fill in "Comment" with "Fake spam" | ||
| And I fill in "Name" with "Spammer" | ||
| And I fill in "Email" with "spam@example.com" | ||
| And I press "Comment" | ||
|
Comment on lines
+342
to
+345
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be replaced with the |
||
| When I am logged in as "spam_catcher" | ||
| And I view the work "Spam Trap" | ||
| Then I should see "Unreviewed Comments (1)" | ||
| When I follow "Unreviewed Comments" | ||
| And I follow "Spam" | ||
| Then I should see "Unreviewed Comments (0)" | ||
| And I should not see "Fake spam" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add some steps that check that for admins the count is still 1 and the comment is visible on the page for unreviewed comments but marked as spam? Additionally, please address the comment about the indentation of the |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,6 +273,7 @@ | |
|
|
||
| Given "the moderated work {string} by {string}" do |title, login| | ||
| user = ensure_user(login) | ||
| user.preference.update!(allow_co_creator_invite: true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is causing the test to fail and seems to be unrelated to this PR, could you remove it? |
||
| w = FactoryBot.create(:work, title: title, authors: [user.default_pseud]) | ||
| w.update_attribute(:moderated_commenting_enabled, true) | ||
| end | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.