Hi everyone I forked the repository and did some commits as I think it could be easier then to comment. I would appreciate some guidance before I get more lost You can see my commits here:
I created a select button in the tanner menu (post-admin-menu) as UX for the feature.
This button renders a modal that should show the grantable Badges and add the url of the post automatically as a reason. As you can see I was able to pass the object of the selected post, but I don’t know how to read its attributes (this is my first ember project), in order to get the url. Is there any easy solution? Any suggestions?
Also I would like to be able to read all the grantableBadges for the user. I don’t know if I should directly call them from the grant-badges controller or import them from somewhere else as I did with the selectedPost. What do you think? Any ideas?
Any other feedback is also welcome. Thanks in advance!
It opens up a modal for the admin to choose a specific badge to be granted to the user.
The “badge reason” is not shown on purpose and automatically attributed to the post from which the “grant badge” action is triggered. I’ve also considered showing a readonly “badge reason” input box, but the current approach seems cleaner.
would it be possible to exclude the badges such as “First Mention,” which are normally granted automatically as opposed to manually?
I thought of this before, but eventually decided to include all badges (same behavior as the admin page), since having less to choose from may be more problematic.
if possible, order the badge list by the count of manual grants for each badge
I can totally see this being helpful to granting certain badges manually repeatedly. (On a technical note, I think we will need an additional database column and an index.) In the worst case that this does not happen, the dropdown is completely filterable.
I think we got to remove all the “automatically granted badges” from both places. The trouble with including them is that the schedule will kick in and remove the badge later on.
I would not muck with ordering though for now, seems complicated.
I think you’re right that it should be enabled for moderators too (my bad). I’ll open a PR later to correct it unless someone in the team beats me to it.