-
Notifications
You must be signed in to change notification settings - Fork 715
AO3-6067 Uncategorized fandoms in collections not showing #5514
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
Changes from 11 commits
341c874
905d4f7
7ad262f
05bf0e1
8502d6c
d9c3cbe
a5f3f67
d5c7307
e27e433
d109571
556d1e7
e876c2b
fac8449
9e8fa6f
dd384ef
ce9edfc
8db30ad
e0d1c2a
4ed7df5
ee889fb
c225c80
cd6206f
27c6d96
c37aac8
9a783e2
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 |
|---|---|---|
|
|
@@ -70,12 +70,21 @@ def show | |
| # if tag is NOT wrangled, prepare to show works, collections, and bookmarks that are using it | ||
| if !@tag.canonical && !@tag.merger | ||
| @works = if logged_in? # current_user.is_a?User | ||
| @tag.works.visible_to_registered_user.paginate(page: params[:page]) | ||
| @tag.works.visible_to_registered_user | ||
| elsif logged_in_as_admin? | ||
| @tag.works.visible_to_admin.paginate(page: params[:page]) | ||
| @tag.works.visible_to_admin | ||
| else | ||
| @tag.works.visible_to_all.paginate(page: params[:page]) | ||
| @tag.works.visible_to_all | ||
| end | ||
| @bookmarks = @tag.bookmarks.visible | ||
| @collections = @tag.collections | ||
| # if from a collection, only show items from that collection | ||
| if @collection.present? | ||
| @works &= @collection.works | ||
|
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 does not include works in the subcollections, but the counts on the collection page do include them, so this is a mismatch - I can click on "new fandom (1)" and get to a page with no works. For canonical tags the works from the subcollections are included, so we should do the same here
Contributor
Author
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. I see, is there a quick way of having a list of collection from a parent collection? (since I assume child of child are also included)
Collaborator
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. Fortunately, child collections can't have children -- subcollections only go one level deep. |
||
| @bookmarks &= @collection.bookmarks | ||
| @collections &= @collection.children | ||
| end | ||
| @works = @works.paginate(page: params[:page]) | ||
| @bookmarks = @tag.bookmarks.visible.paginate(page: params[:page]) | ||
| @collections = @tag.collections.paginate(page: params[:page]) | ||
ReverM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,49 @@ Feature: Basic collection navigation | |
| Then I should not see "High School Musical" | ||
| And I should see "Steven's Universe" | ||
|
|
||
| Scenario: Uncategorized Fandoms should appear in Collection's Fandoms | ||
| Given I have the collection "Categoric" with name "categoric" | ||
| And the tag "Unrelated Fandom" does not exist | ||
| And I have a canonical "Video Games" fandom tag named "Undertale" | ||
| When I am logged in as "Frisk" | ||
| And I post the work "Categoric Sans" with fandom "Undertale" in the collection "Categoric" | ||
| And I post the work "Categoric Papyrus" with fandom "Undertale" | ||
| And I post the work "Uncategoric Sans" with fandom "Unrelated Fandom" in the collection "Categoric" | ||
| And I post the work "Uncategoric Papyrus" with fandom "Unrelated Fandom" | ||
| And I go to "Categoric" collection's page | ||
| Then I should see "Fandoms (2)" | ||
| When I follow "Fandoms (2)" | ||
| Then I should see "Unrelated Fandom" | ||
| And I should see "Undertale" | ||
|
||
| When I select "Uncategorized Fandoms" from "media_id" | ||
| And I press "Show" | ||
| Then I should see "Unrelated Fandom" | ||
| And I should not see "Undertale" | ||
|
|
||
| # From collection we only see the works in the collection | ||
| When I follow "Unrelated Fandom" | ||
| Then I should see "Sans" | ||
| And I should not see "Papyrus" | ||
|
|
||
| # Else we see all | ||
| When I follow "Uncategorized Fandoms" within "#header" | ||
| And I follow "Unrelated Fandom" | ||
| Then I should see "Sans" | ||
| And I should see "Papyrus" | ||
|
|
||
| Scenario: Non-Canonical Fandoms are not double counted | ||
| Given I have the collection "Canons" with name "canon" | ||
| And I have a canonical "TV Shows" fandom tag named "TV" | ||
| And a synonym "Television" of the tag "TV" | ||
| When I am logged in as "Screen" | ||
| And I post the work "Full name" with fandom "Television" in the collection "Canons" | ||
| And I post the work "Small name" with fandom "TV" in the collection "Canons" | ||
| And I go to "Canons" collection's page | ||
| Then I should see "Fandoms (1)" | ||
| And I should see "Television" | ||
| When I follow "Fandoms (1)" | ||
| Then I should not see "Television" | ||
|
|
||
| Scenario: Browse tags within a collection (or not) | ||
| Given I have a collection "Randomness" | ||
| And a canonical fandom "Naruto" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.