-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixes #11379: Made the subtopics method #11380
Closed
Closed
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
669acd0
Fixes #11379: Made the subtopics method
KarishmaVanwari d195a96
Update tag_controller_test.rb
jywarren 31ba768
Apply suggestions from code review
jywarren 9d73d03
fixing my syntax errors
jywarren 3ab03cc
Merge branch 'main' of https://github.com/KarishmaVanwari/plots2 into…
KarishmaVanwari 908f3ee
Merge branch 'subtopics' of https://github.com/KarishmaVanwari/plots2…
KarishmaVanwari e76687d
Update app/controllers/tag_controller.rb
KarishmaVanwari c7cc324
Merge branch 'main' of https://github.com/KarishmaVanwari/plots2 into…
KarishmaVanwari f4d90c8
small fixes
jywarren e220ca5
resolved
jywarren 517175f
Merge branch 'subtopics' of https://github.com/KarishmaVanwari/plots2…
KarishmaVanwari 11cdb1c
Created test data
KarishmaVanwari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,3 +284,9 @@ sub_tag: | |
tid: 37 | ||
nid: 1 | ||
uid: 2 | ||
|
||
subtopic_tag: | ||
tid: 38 | ||
uid: 2 | ||
nid: 41 | ||
date: <%= DateTime.now.to_i %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,3 +150,7 @@ hidden_response_tag: | |
subscribed_tag: | ||
tid: 37 | ||
name: sub:tag | ||
|
||
subtopic_tag: | ||
tid: 38 | ||
name: parent:one |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it's applied to this page, which is a note, not a wiki:
https://github.com/KarishmaVanwari/plots2/blob/subtopics/test/fixtures/nodes.yml#L497
Will that affect the logic, and possibly cause it not to return things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it should get the slug for this note, and try to use it as a subtopic tagname, according to this logic:
https://github.com/publiclab/plots2/pull/11380/files#diff-5d60373322d4baf080e5f3957fc30d0e8058337c202f5641e1775402776428b1R533
Aha - yes, so, then it takes the slug from that page, which is "jeff-12-20-2020-ouija-board" - and tries to find a tag with that name. It doesn't find one, so it returns null.
Let's change this to instead point at this node, which is a page, with slug
about
. Then let's add a new tag with the nameabout
so that there is actually a tag that can be returned.We could give these more realistic tag names so it makes more sense... but, maybe it's not worth it for now. Let's just get it working first.
So now you'll also have to add a new tags.yml entry, but it doesn't need a node_tags.yml entry, since we only look if the tag exists, not if we used it anywhere. Let's see how that works!