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

Automatic refresh of Student topic tags to display topic resolution upon Instructor reply #53

Merged
merged 6 commits into from
Feb 28, 2025

Conversation

jwjulie
Copy link
Contributor

@jwjulie jwjulie commented Feb 28, 2025

Context
Resolves issues #51 and #52. Addresses user stories for resolved/unresolved posts and instructor role indicator.

Description
Added new functions to trigger an automatic refresh of the topic tag when a Student topic is resolved by an Instructor reply.

Codebase Changes

  • src/topics/create.js: In Topics.reply calls newly added function resolveTopic which calls Topics.updateTopicTags in src/topics/tags.js to swap the unresolved tag for a resolved tag. Then it triggers a websocket event event:topic_resolved which activates a new listener in public/src/client/topic/events.js
  • public/src/client/topic/events.js: Added function onTopicResolved which calls Tag.updateTopicTags in public/src/client/topic/tag.js which updates the topic tags on the user end.
  • Added tests to test/topics.js

Additional Information
Test added to test/topics.js to address resolving of Student post.
Ran lint and test and tested using the following steps.

User testing:

  1. Student posts a new topic
  2. unresolved tag should be automatically added
  3. Instructor replies to the topic
  4. resolved tag should be automatically added and the unresolved tag should be automatically removed without requiring a manual page refresh

Coverage after all topic resolution feature implementation:
image

Coverage after test added to test suite:
image

@jwjulie jwjulie added this to the Sprint 2 milestone Feb 28, 2025
@jwjulie jwjulie requested a review from yukiiii04 February 28, 2025 04:38
@jwjulie jwjulie self-assigned this Feb 28, 2025
@yukiiii04 yukiiii04 requested a review from lynzhlang February 28, 2025 04:39
@lynzhlang
Copy link
Contributor

I took a look at your code and it looks good to me! Earlier I pulled from your branch and your feature works on my end as well :D

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.

This looks so clean and great to me! Working with the existing socket for auto refresh is such a great move haha. Checked and tested locally, ready for merge.

Copy link
Contributor

@lynzhlang lynzhlang left a comment

Choose a reason for hiding this comment

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

oops didn't approve it earlier

@yukiiii04 yukiiii04 merged commit b913024 into main Feb 28, 2025
1 check passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13581441589

Details

  • 13 of 14 (92.86%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 82.665%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/topics/create.js 13 14 92.86%
Totals Coverage Status
Change from base Build 13274660005: 0.01%
Covered Lines: 22343
Relevant Lines: 25607

💛 - 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
Development

Successfully merging this pull request may close these issues.

4 participants