performant-software / Annotation-Studio

An online annotation platform for teaching and learning in the humanities.
http://www.annotationstudio.org
GNU General Public License v2.0
6 stars 1 forks source link

Use alternative method for counting documents in folders #467

Closed camdendotlol closed 1 year ago

camdendotlol commented 1 year ago

Summary

As per #466, this PR updates the way the number of tags is calculated to be correct.

Instead of tag.taggings_count, which was incorrectly scoped, the folder list now uses a helper method that does the same thing, but correctly this time.

Closes #466

Testing

Working with two different anthologies on staging:

  1. Create a folder with the same name in both anthologies.
  2. Add documents to the folder in both anthologies.
  3. The number of documents listed below the folder icon should be the number you've added to the folder in this anthology, rather than the combined total for both.
  4. Play around with the folder feature a bit more to make sure the number listed always matches the number of documents that appear when you click the folder.
  5. The page that lists the folders shouldn't take too long to load.
camdendotlol commented 1 year ago

@blms For point 3, the name property is effectively a unique slug. Attempting to add a document to a new folder with the same name as an existing folder will just place it into the existing folder.