Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you ๐
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
[ ] ๐ Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
[ ] ๐ Update the file app/controllers/stats_controller.rb in the plots2 repository (press the little pen Icon) and edit the line as shown below.
See this page for some help in taking your first steps!
Below is a "diff" showing in red (and a -) which lines to remove, and in green (and a +) which lines to add:
@@ -100,6 +100,16 @@ def answers
format(data, 'answers')
end
+ def tag
+ data = Tag.select(:tid, :name, :parent, :count).all
+ format(data, 'tag')
+ end
+
+ def node_tag
+ data = NodeTag.select(:tid, :nid, :uid).where(date: start.to_i...fin.to_i).all
+ format(data, 'node_tag')
+ end
+
def comments
data = Comment.where(status: 1, timestamp: start.to_i...fin.to_i).all
format(data, 'comment')
[ ] ๐พ Commit your changes
[ ] ๐ Start a Pull Request. There are two ways how you can start a pull request:
If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.
You can also edit files directly in your browser and open a pull request from there.
๐ฌโฐ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!
If this happens to you, don't sweat it! Grab another open issue.
๐- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.
๐ฅ- If someone seems stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!
Leave a comment below!
This one is for @skilfullycurled!
@skillfullycurled we would love for you to solve this one! And don't hesitate to ask for help! Thanks.
Adding in the other pieces that @jywarren wrote about in the original issue #5268
Oh sorry @skilfullycurled i didn't see this. A few thoughts that may help move it along:
But for the tables you're looking for: term_data and community_tags --
def tag
data = Tag.select(:tid, :name, :parent, :count).all
format(data, 'tag')
end
def node_tag
data = NodeTag.select(:tid, :nid, :uid).where(date: start.to_i...fin.to_i).all
format(data, 'node_tag')
end
Then, adding routes to match; something like these for comments:
And a link on this page to display it:
(although the Tag model has not timestamps, so we'd just note there that it's ALL tags)
Benjamin, this would be a pretty easy first-timers-only issue to add, i think; does this look good to you? If so, we can build an FTO from it. Thanks!
_Originally posted by @jywarren in https://github.com/publiclab/plots2/issues/5268#issuecomment-480987000_
Thanks @IshaGupta18!
Okay, I made the changes. Right now it's set to draft pull request but I'm not sure if that was the correct thing to do for reasons that I explained in the comments of the request.
A follow up question, is it better to have conversations about the changes in the pull request or in this issue thread?
For example I have two questions about the changes to the stats view.
The way the tags are set up in the database relationally (i.e. a list of all tags, and a list of which nodes each tag are used on) makes sense from a programmatic point of view, but I think it's a bit unexpected to the average person. I will be documenting how to merge the two after they are both downloaded, but in the meantime, I want to get some feedback on the names I've chosen for the drop down. I've titled the tags (term_data) "List of Tags", and I've titled the node_tags (community_tags) "Tag Usage". Does that make sense for the time being?
I've used the following examples to make the changes to the view:
<%= link_to "Comments", stats_comments_path(format: 'csv', start: params[:start], end: params[:end]) %>
However, with regard to the node_tags, none of the exemplars for the other downloads come from the name of a model with an underscore already in it. Is stats_node_tags_path the equivalent of stats_comments_path?
Okay, I made the changes. Right now it's set to draft pull request but I'm not sure if that was the correct thing to do for reasons that I explained in the comments of the request.
Hi, please make the pull request at publiclab/plots2 instead of skilfullycurled/plots2?
Let's do things in baby steps.
Best of luck :+1:
I think I need to turn my baby steps into infant steps. When I make the pull request from publiclab/plots2 my branch doesn't show up as an option. I can make a pull request in my own repository and choose the following options. It shows plots2 in the upper left hand corner. I'll try that...

Okay, test failed but it's easy to see why. Will fix.
I closed the other pull request thinking I could go back to the branch on my fork, make the changes, and then start a new one pull reqeust. Unfortunately, I am unable to commit my changes. Here's what the top and bottom of the page look like.

Then the code where I made the edits...

Also, if possible can you provide a few steps at a time instead of just one? Or, break down the step into even more baby steps?
Thanks for your help, everyone!
Okay, well I tried reading up on everything and the PR request page said to:
Add more commits by pushing to the skilfullycurled-tag-stats branch on skilfullycurled/plots2.
So I did that. The error seems to be fixed on my end. That is, when I go to the page and into the editor, the trailing white space that was causing the problem is no longer there. So, maybe that's why I can't commit because I'm not making any changes? Anyway, keep me posted on what to do next. I might just start over.
Ah, actually, I think I got it. I made the change before the test on a different file was done. In between making the change on the first failed test, and it finishing the tests for the other file, there was a new error. I fixed it and it's re-running the tests automatically.
Checks all passed now!
I left a note for [at]publiclab/reviewers.
Anything else I can slash should do?
Most helpful comment
Ah, actually, I think I got it. I made the change before the test on a different file was done. In between making the change on the first failed test, and it finishing the tests for the other file, there was a new error. I fixed it and it's re-running the tests automatically.