adhocteam / nytimes-library

A collaborative documentation site, powered by Google Docs.
https://nyt-library-demo.herokuapp.com/
Apache License 2.0
1 stars 1 forks source link

Added Document Voting #34

Closed zenkimoto closed 2 years ago

zenkimoto commented 2 years ago

Closes #21

Description of Change

Added support for up/down voting and give reasons for the vote on the Google Documents detail view only.

Properties vote, voteDate and voteReason have been added to the Google DataStore Entity LibraryViewDoc.

EDIT: Updated with Stimulus

Motivation and Context

We want to keep track on which documents are helpful and which are not. We leverage the existing Google Datastore Entity as it is similar to a join table between users and documents.

Vote values are 1 for thumbs up and a -1 for thumbs down. The idea for using this is if we wanted to get the overall vote score of a document, we simply sum the votes.

Checklist

zenkimoto commented 2 years ago

@gunsch - I will update this branch with the Stimulus stuff once this PR is approved and merged.