-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for publishing new custom votings #115
base: master
Are you sure you want to change the base?
Conversation
models/custom-vote.js
Outdated
|
||
constructor({ uri, position, content, context }) { | ||
this.type = 'customVote'; | ||
this.isCustomVote = true; |
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.
You're saving this information in 3 separate locations:
isCustomVote on custom votes, isStandardVote on standard votes, and type
why not just use type
?
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.
Ahhhh yes, that's something I wanted to ask, I didn't find a way of doing the (eq this.type "customVote) or something similar in handlebars, so I created these properties. Is there a way of doing that?
And I thought I didn't wanted just to have isCustomVote and isStandardVote so I kept the type property
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.
hmm I'll have a look, but at a minimum you could calculate the boolean at the point of passing the context to the template instead of storing it here
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.
you can define your own helpers like this: https://handlebarsjs.com/guide/expressions.html#helpers
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.
Done thanks :)
Made it possible to publish the new custom votes generated in GN
Related to this lblod/frontend-gelinkt-notuleren#732