Skip to content
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

Design public API feedback voting #542

Closed
1 task
bajiat opened this issue Oct 26, 2015 · 6 comments
Closed
1 task

Design public API feedback voting #542

bajiat opened this issue Oct 26, 2015 · 6 comments
Assignees
Milestone

Comments

@bajiat
Copy link
Contributor

bajiat commented Oct 26, 2015

First version of communication channel between consumers and managers allows consumers to send feedback, request etc. about APIs and managers to view the feedback.

Wireframe

mockup

FeedbackVotes collection

This feature may use a new collection called FeedbackVotes. Each Feedback Vote document will contain the following fields:

  • feedbackId - string - the ID of the Feedback document
  • userId - string - the ID of the user
  • vote - integer - the numeric vote for the user (allowed values: 1 and -1)

Collection helper(s)

The following collection helper will be attached to the Feedback collection:

  • sumOfVotes() - adds all vote integers together, returns the sum of all votes as an integer

Server method(s)

The following method(s) will be defined on the server:

  • submitVote(vote) - takes an integer as an argument, checks whether user has already voted, either updates existing or adds new user vote

Publication(s)

The following publication(s) will be useful:

  • getAllVotesForSingleFeedback (feedbackId) - returns a database cursor for the following query:
FeedbackVotes.find({feedbackId: feedbackId});

Template-level subscription(s)

Each feedback template will subscribe to the getAllVotesForSingleFeedback publication. This will ensure that only votes for displayed feedback are returned.

Sorting by top voted?

  • Determine how to sort by top voted. I.e. is it possible to sort by a collection helper? Will it be necessary to store the computed sum of ratings as a field in the Feedback document, rather than using a collection helper?
@bajiat bajiat added the MVP2 label Oct 26, 2015
@brylie brylie changed the title Implement public view for API feedback made through communication channel Implement public API feedback voting Oct 26, 2015
@bajiat bajiat added the planning label Nov 5, 2015
@bajiat bajiat changed the title Implement public API feedback voting Design public API feedback voting Nov 9, 2015
@brylie brylie added ready and removed planning labels Nov 9, 2015
@bajiat bajiat added this to the Sprint 16 milestone Nov 9, 2015
@brylie
Copy link
Contributor

brylie commented Nov 12, 2015

@apinf/developers do you have any ideas how to sort the top voted Feedback submissions? Please review the implementation notes to get an idea of my thinking.

@bajiat
Copy link
Contributor Author

bajiat commented Nov 13, 2015

@brylie I think it is more important to have the voting in place than to be able to sort according to votes, if sorting is blocking the implementation. Besides, we have quite a number of UI improvements in backlog that in my opinion have a higher priority than sorting the votes, for example enhancements for user profile.
@kyyberi, what would you say, is it possible to implement this feature without sorting by the votes?

@brylie
Copy link
Contributor

brylie commented Nov 16, 2015

@bajiat and @kyyberi, if there is not any further feedback, I will proceed with implementing this feature as described in the issue text.

@kyyberi
Copy link

kyyberi commented Nov 16, 2015

Without sorting is fine for now.

@brylie
Copy link
Contributor

brylie commented Nov 16, 2015

@frenchbread for future reference, will you please provide a link to the article you mentioned about MongoDB math operations?

@frenchbread
Copy link
Contributor

I was talking about an online course MongoDB for Node.js developers. Course is free but requires you to be registered for it to view its materials.

I found a similar article that covers main idea of aggregation principles in mongodb described in this course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants