I have just made and delivered our first badge over at thismmalife.com
Thanks Julianna for the recent updates to this :D
What type of PR is this? (check all applicable)
- [x] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
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
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::Badgesand 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
- Reverts changes made to redirecting from
/admin/badge_achievements(after a discussion, we decided that only awarding badges should live under the
/badge_achievementsroute and every other action should remain living under
- Updates to the language used in the warning banner on the badge award form and above the usernames field on the form.
.downcaseto 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
editform, and creating badges with the
Related Tickets & Documents
Related to PR #9643
QA Instructions, Screenshots, Recordings
- Navigate to
/admin/badgesto observe the redesigned
indexpage for badge management:
- Click on an individual badge's
titleto navigate to the badge's
- Once on the
editpage, update the badge by changing its
badge_imageto 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
indexpage. 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
indexpage, 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
indexpage. 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
indexpage, 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
indexpage 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
slugfor the badge (for example,
/badge/money-sloth-award) it to ensure that navigating this way still works as well:
- Try to break things!
- [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!