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

Merging changes from US1 Implementation (Sprint 1) #30

Merged
merged 18 commits into from
Oct 5, 2024
Merged

Merging changes from US1 Implementation (Sprint 1) #30

merged 18 commits into from
Oct 5, 2024

Conversation

dominicteh1
Copy link

@dominicteh1 dominicteh1 commented Sep 21, 2024

What?

Why?

These changes resolve US1, which is to allow students and instructors to preview the first few sentences of a post to get a quick understanding of what question is being asked. For more information, refer to US1 under "Team Bulbasaur User Stories" board.

How?

  • Navigated NodeBB site to find functions that related to topics. (Went to OH) Located function in Category.getCategoryTopics in src/categories/topics.js file, which GETs and displays all posts
  • Located where the actual post content was stored, which is in getMainPosts function
  • Introduced a new attribute "content" and took the first 100 chrs without HTML tags and called that attribute from the frontend to display the preview for each post
  • Inspect element on NodeBB site to find the HTML tags node-theme-harmony/templates/partials/topics_list.tpl, searched the GitHub repo for those same tags to locate where the tags were in the files
  • Followed guide from Prof to make a new theme "Team Bulbasaur Theme" to store the changes properly to ensure CI/CD works for future sprints

Testing?

  • Ran npm run test to check that all test cases passed
  • Introduced "content" to TopicObject.yaml to ensure that response and schema aligned
  • Fixed logic to ensure that assertions in tests were run correctly

Screenshots

Successful implementation of US1 feature
image

Successful test run
image

Anything Else?

Thank you

a1inachen and others added 6 commits September 18, 2024 20:58
* append each topic title with content preview

* addressed lint errors

* removed console log from P1
src/categories/topics.js: add attribute {content} to the topic object in the Categories.getCategoryTopics() function

node_modules/nodebb-theme/harmony/templates/partials/topics_list.tpl: add <div> to include topic.content in the topics_list page
display changes from an extra block next to the title to placing the content preview underneath the title
test whether the content has more than 100 characters and add '...' to contents that exceed the 100 character limit
@coveralls
Copy link

coveralls commented Sep 21, 2024

Pull Request Test Coverage Report for Build 11189175819

Details

  • 8 of 9 (88.89%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 82.669%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/categories/topics.js 8 9 88.89%
Totals Coverage Status
Change from base Build 10836944112: -0.001%
Covered Lines: 22332
Relevant Lines: 25593

💛 - Coveralls

Copy link

@a1inachen a1inachen left a comment

Choose a reason for hiding this comment

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

Yes! All makes sense and looks good to me

Copy link

@bythehills bythehills left a comment

Choose a reason for hiding this comment

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

lgtm !! 👍

Copy link

@Michaelli8899 Michaelli8899 left a comment

Choose a reason for hiding this comment

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

Yes all the code changes make sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants