I have just made and delivered our first badge over at thismmalife.com
Thanks Julianna for the recent updates to this :D
Manage Badges in /admin/badges #9721
What type of PR is this? (check all applicable)
- [x] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Overall, this PR adds additional functionality to badge management and badge awarding via /admin/badge_achievements
and specs to support the additions/changes that have been made. These additions and changes give Admins the ability to create
, update
, and "award" badges, as well as see an overview of all of the current badges via the redesigned /admin/badges
index page. Furthermore, this PR addresses the verbiage around awarding badges and fixes a bug with usernames not being downcased when awarding badges to a user.
This PR adds the following:
- The ability to create new badges via new/create controller actions and the necessary view and routes to make this happen.
- The ability to edit/update existing badges via new controller actions and the necessary view and routes to make this happen.
- The ability to view all badges and click on individual badges in order to edit/update them via a redesigned index page.
- Appropriate methods in
Admin::Internal::Badges
and routes for the changes made. - A button, "Award Badges", that sends Admins to the badge award form, where they can award badges to users.
- A button, "Create Badges", that sends Admins to the badge creation form, where they can create new badges.
- Updates the routes for awarding badges from
/admin/badges/award_badges
to/admin/badge_achievements/award_badges
- Reverts changes made to redirecting from
/admin/badges
to/admin/badge_achievements
(after a discussion, we decided that only awarding badges should live under the/badge_achievements
route and every other action should remain living under/admin/badges
). - Updates to the language used in the warning banner on the badge award form and above the usernames field on the form.
-
.downcase
to usernames when awarding badges to ensure that they are lowercase and do not silently fail. - Additional specs around case-sensitive names when awarding badges, the new badge URL and its redirect, updating badges with the new
edit
form, and creating badges with thenew
form.
Related Tickets & Documents
Related to PR #9643
QA Instructions, Screenshots, Recordings
- Navigate to
/admin/badges
to observe the redesignedindex
page for badge management:
- Click on an individual badge's
title
to navigate to the badge'sedit
page:
- Once on the
edit
page, update the badge by changing itstitle
,slug
,description
, and/orbadge_image
to ensure that everything works properly (prior to updating everything, test that the "Back to All Badges" button works!):
- After updating the badge, you will be redirected back to the
index
page. You should see your newly updated badge appear in the table, as well as a confirmation that the badge was updated:
- Once you are redirected back to the
index
page, click the "Create Badge" button to navigate to the badge creation form:
- Fill out the form and click the "Create Badge" button to successfully create a new badge:
- After creating the badge, you will be redirected back to the
index
page. You should see your newly created badge appear in the table, as well as a confirmation that the badge was created:
- Once you are back on the
index
page, click the "Award Badge" button to navigate to the badge awarding form:
- Select a badge and fill out the rest of the form and to award a badge to yourself and/or another user:
- Once you have clicked "Award Badges", you will be redirected to the
index
page where you should see a confirmation message:
- Navigate to your notifications to ensure that you received a notification for the awarded badge:
- Navigate to the profiles of the users you awarded badges to and ensure that the badges were awarded:
- Click on the newly awarded badge to ensure that it renders as expected with all of the badge information you provided:
- Finally, navigate to one of your badges using
/badge/
+ theslug
for the badge (for example,/badge/money-sloth-award
) it to ensure that navigating this way still works as well:
- Try to break things!
🛠️
Added tests?
- [x] yes, in addition to updating existing specs
- [ ] no, because they aren't needed
- [ ] no, because I need help
Added to documentation?
- [ ] docs.forem.com
- [ ] readme
- [x] no documentation needed... I think? Any ideas on whether or not these addition/changes warrant additions/changes to documentation?
[optional] Are there any post-deployment tasks we need to perform?
None that I can think of!
Top comments (6)
How exciting! I'm glad that you're loving the feature so far and cannot wait to see what other badges you create. 🎉
Actually I am working on digital badges for belts in jiu-jitsu and other martial arts that I can award to people that have them in real life 🤓
That is super cool! 😎
I received it. So cool! Glad to be part of the first 100. :D
Yay!
🤩