Skip to content
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

Automatically tag Instructor/Student topics with resolution status upon post #36

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

jwjulie
Copy link
Contributor

@jwjulie jwjulie commented Feb 10, 2025

Context
Resolves issues #30 and #27 and addresses #24. Addresses user stories for resolved/unresolved posts and instructor role indicator.

Description
Created Students group on installation. Dependent on Instructors group created in add-role-groups branch. Add membership checks for Instructors/Students groups. Upon topic creation, tag with "instructor-post"/"unresolved" tags for Instructors/Students.

Codebase Changes

  • src/install.js: Function createStudentsGroup initializes Students group and privileges are given in the same file.
  • src/privileges/users.js: Functions isInstructor and isStudent are group membership checks for users.
  • src/user/index.js: Exports the membership functions as part of user.
  • src/topics/create.js: Modifies Topics.post to automatically add 'unresolved' and 'instructor-post' tags to topics when they are created by users in the 'Students' and 'Instructors' groups respectively.

Additional Information
Ran lint and test and tested using the following steps.

User testing:

  1. Add user to Instructors group
  2. Post a new topic
  3. instructor-post tag should be automatically added
  1. Add user to Students group
  2. Post a new topic
  3. unresolved tag should be automatically added
image image

Create Student group upon Install. Add membership checks for Instructors/Students groups. Upon post creation, tag with "instructor-post"/"unresolved" tags for Instructors/Students respectively.
@jwjulie jwjulie added this to the Sprint 1 milestone Feb 10, 2025
@jwjulie jwjulie requested a review from yukiiii04 February 10, 2025 21:34
@jwjulie jwjulie self-assigned this Feb 10, 2025
@jwjulie jwjulie changed the title topic resolution branch Automatically tag Instructor/Student topic posts with resolution status Feb 10, 2025
@jwjulie jwjulie changed the title Automatically tag Instructor/Student topic posts with resolution status Automatically tag Instructor/Student topics with resolution status upon post Feb 10, 2025
@lynzhlang lynzhlang self-requested a review February 11, 2025 15:32
Copy link
Contributor

@yukiiii04 yukiiii04 left a comment

Choose a reason for hiding this comment

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

Pulled & tested, looks good to me.

await privileges.global.give(defaultPrivileges.concat(['groups:view:users:info']), 'Instructors');
console.log('===000===000===GAVE INSTRUCTORS PERMS');
await privileges.global.give(defaultPrivileges.concat([
'groups:ban', 'groups:upload:post:file']), 'Global Moderators');
await privileges.global.give(['groups:view:users', 'groups:view:tags', 'groups:view:groups'], 'guests');
Copy link
Contributor

Choose a reason for hiding this comment

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

I added in my working branch (yuki-polls-p2b) a statement similar to this that gives the "create-polls" privilege to all groups, but I don't think that is showing up with strictly 1 change. Here's the attached screenshot, let me know what you think about that (maybe we need to link for sprint 2).

Screenshot 2025-02-11 at 11 17 29 Screenshot 2025-02-11 at 11 17 29 Screenshot 2025-02-11 at 11 17 29

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13250887416

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 9 of 13 (69.23%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.008%) to 82.663%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/topics/create.js 3 5 60.0%
src/user/index.js 2 4 50.0%
Totals Coverage Status
Change from base Build 13250615741: -0.008%
Covered Lines: 22331
Relevant Lines: 25594

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants