Skip to content

Manchester | 25-ITP-Sep | Mahtem T. Mengstu | Sprint 2 | Book_library#353

Closed
Mahtem wants to merge 5 commits intoCodeYourFuture:mainfrom
Mahtem:Book_library
Closed

Manchester | 25-ITP-Sep | Mahtem T. Mengstu | Sprint 2 | Book_library#353
Mahtem wants to merge 5 commits intoCodeYourFuture:mainfrom
Mahtem:Book_library

Conversation

@Mahtem
Copy link
Copy Markdown

@Mahtem Mahtem commented Dec 12, 2025

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Bugs in the book library fixed.

Questions

Questions will be asked in cyf_reviewers slack page.

@Mahtem Mahtem added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 12, 2025
@github-actions

This comment was marked as resolved.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 12, 2025
@github-actions

This comment was marked as resolved.

@Mahtem Mahtem added the 📅 Sprint 2 Assigned during Sprint 2 of this module label Dec 12, 2025
@github-actions

This comment was marked as duplicate.

@Mahtem Mahtem added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 12, 2025
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Can you check if any of this general feedback can help you further improve your code?
https://github.com/cjyuan/Module-Data-Flows/blob/book-library-feedback/debugging/book-library/feedback.md

Doing so can help me speed up the review process. Thanks.

Comment thread .vscode/launch.json
Comment on lines +2 to +4
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • JSON != JS. A JSON string containing JS-style comments is considered invalid.

  • Better to use .gitignore to exclude non-essential configuration files from being added to a repo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

  • JSON != JS. A JSON string containing JS-style comments is considered invalid.

    • Better to use .gitignore to exclude non-essential configuration files from being added to a repo.

Thank you, I will see what it really is. It happened accidentally.

Comment thread debugging/book-library/script.js Outdated
Comment on lines +32 to +35
const lettersOnly = /^[A-Za-z\s]+$/;

// Title: letters + numbers + spaces (no special characters)
const titleAllowed = /^[A-Za-z0-9\s]+$/;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two rules could exclude quite some real-world books.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These two rules could exclude quite some real-world books.

Thank you, It has now been updated to handle wide range of author and title inputs normally.

Comment thread debugging/book-library/script.js Outdated
}

// Create and save the book
let book = new Book(title.value, author.value, pages.value, check.checked);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These raw values are not the values you validated. Consider
Step 1: Store preprocessed raw input in some variables
Step 2: Validate the values in the variables
Step 3: Refer to the values of the variables (to avoid accidently using raw input)

Also, some invalid "number of pages" can still pass the current validation rule.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These raw values are not the values you validated. Consider Step 1: Store preprocessed raw input in some variables Step 2: Validate the values in the variables Step 3: Refer to the values of the variables (to avoid accidently using raw input)

Also, some invalid "number of pages" can still pass the current validation rule.

Thank you @cjyuan, the code has been updated to preprocess and validate all input values before storing.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 12, 2025
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

The input validation is strong now.

Can you check if any of this general feedback can help you further improve your code?
https://github.com/cjyuan/Module-Data-Flows/blob/book-library-feedback/debugging/book-library/feedback.md

@Mahtem
Copy link
Copy Markdown
Author

Mahtem commented Dec 14, 2025

Can you check if any of this general feedback can help you further improve your code?

Thank you @cjyuan for the constructive and comprehensive feedback I have included modifications from the guide, both in the index.html and script.js

@Mahtem Mahtem added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 15, 2025
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Changes look great!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants