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

Concluding the Resource page Functionality by Displaying the Links - User Story 5 #50

Open
wants to merge 163 commits into
base: f24
Choose a base branch
from

Conversation

AlAnoud2003
Copy link

@AlAnoud2003 AlAnoud2003 commented Oct 18, 2024

Concluded the back-end functionality of the “Resources” page by implementing the code that extracts the links from the user’s posts, directly sending and displaying the link in the “Resources” page.

  • File’s changed:
    - src/posts/create.js: Defined a function titled “extractLinks” that identifies all links (Regex pattern) from the text box (whether as markdown links or plain URL), and then returns a unique list of extracted links. Created a condition which calls on the function with the user’s post content, checks if any links were extracted, and adds the extracted links to two sets: a post-specific set and the general set in the database.
    - src/controllers/resources-button.js: Modified the “getResourcesButtonPage” controller function to call on the resources-button API endpoint to retrieve the set of links from the database and cleans the links. The resources-page view is then rendered with a title and the cleaned links in JSON format.
    - src/views/resources-button.tpl: Added JavaScript in the template to parse a JSON string containing the extracted links, sorts them, and creates a list item and anchor element for each link to have it displayed and clickable.

  • Manual testing: Manual testing was conducted through console logging the extracted links from the user’s posts as well as the completed set of links shown in the Resources page.

  • Commits: Commits and code changes from September 26 up to the commit in October 8 reading “NEW MODIFICATINS - ….” was when I manually copied and pasted @rmmahmou ’s pull-request code in my branch in order to begin my implementation of the user story.

This user story is complete and works fine, however there are issues when running "npm run test"

Resolves issue #46

AlAnoud2003 and others added 30 commits September 26, 2024 13:36
@AlAnoud2003 AlAnoud2003 added this to the Sprint 2 milestone Oct 18, 2024
@AlAnoud2003 AlAnoud2003 self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant