Skip to content

Instructor and TA tags#36

Merged
cirex-web merged 4 commits intomainfrom
feat/instructor-student-tags
Feb 13, 2026
Merged

Instructor and TA tags#36
cirex-web merged 4 commits intomainfrom
feat/instructor-student-tags

Conversation

@cirex-web
Copy link

@cirex-web cirex-web commented Feb 12, 2026

TA/Instructor badges

This feature forces all users in the instructor and TA groups to have a badge next to their replies and posts. NodeBB does offer badges already, but it's opt-in per user and is by-default disabled when a user joins a group. This change makes it by-default enabled and does not allow users to hide the badge once they've joined a group. (this restriction only applies to groups called "ta" or "instructor")

closes #24 (I ultimately decided not to display student tags as well since if a user is not a TA or instructor, they must be a student)

User Testing

  1. Create a ta or instructor group
  2. Click Edit to edit group settings
image
  1. Enable Show Badge. Feel free to customize the title, icon, and color of the badge.
image
  1. Press Save Changes
  2. You should now see the TA badge next to your username
image

Unit Testing

In test/user.js, I wrote the test 'should force instructor group onto groupTitleArray even if user deselects it' to test functionality. We set up the test by creating and joining the groups ta, instructor, and other-group. The subsequent User.updateProfile(testUid, { groupTitle: '[]', uid: testUid }) call is akin to the user going into their settings and setting the group badge display to be false for all groups. We then verify that when getting user data, the ta and instructor groups are still present in the groupTitleArray field. This test covers all of the changed lines of code.

I've also added unit testing for my earlier endorsement feature and put everything in a UserGuide.md file

@railway-app railway-app bot temporarily deployed to Clean Code Team (nodebb) / nodebb-spring-26-clean-cod-pr-36 February 12, 2026 23:09 Destroyed
@railway-app
Copy link

railway-app bot commented Feb 12, 2026

🚅 Deployed to the nodebb-spring-26-clean-cod-pr-36 environment in Clean Code Team (nodebb)

Service Status Web Updated (UTC)
nodebb-spring-26-clean-code ✅ Success (View Logs) Web Feb 13, 2026 at 2:18 am

@coveralls
Copy link

coveralls commented Feb 12, 2026

Pull Request Test Coverage Report for Build 21972086049

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 3 files are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 78.878%

Files with Coverage Reduction New Missed Lines %
src/user/approval.js 7 83.9%
Totals Coverage Status
Change from base Build 21888516342: -0.01%
Covered Lines: 25392
Relevant Lines: 30361

💛 - Coveralls

@railway-app railway-app bot temporarily deployed to Clean Code Team (nodebb) / nodebb-spring-26-clean-cod-pr-36 February 12, 2026 23:25 Destroyed
@railway-app railway-app bot temporarily deployed to Clean Code Team (nodebb) / nodebb-spring-26-clean-cod-pr-36 February 13, 2026 02:15 Destroyed
Copy link

@JoshuaNam JoshuaNam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice job adding unit tests to check. I see green lights for the merge as well.

@cirex-web cirex-web merged commit 3c09401 into main Feb 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indicator next to user post for whether they are a student/instructor

3 participants

Comments