Skip to content

Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library - #560

Open
Motorcycle-lab wants to merge 9 commits into
CodeYourFuture:mainfrom
Motorcycle-lab:book-library
Open

Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library #560
Motorcycle-lab wants to merge 9 commits into
CodeYourFuture:mainfrom
Motorcycle-lab:book-library

Conversation

@Motorcycle-lab

@Motorcycle-labMotorcycle-lab commented Aug 17, 2026

Copy link
Copy Markdown

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

The book project

Questions

If I can self learn all backend and frameworks by myself, build a porfolio by myself and become a full-stack engineer.

@github-actions

This comment has been minimized.

@Motorcycle-labMotorcycle-lab added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actionsgithub-actionsBot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@Motorcycle-labMotorcycle-lab added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actionsgithub-actionsBot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-labMotorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed 📅 Sprint 2 Assigned during Sprint 2 of this module labels Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actionsgithub-actionsBot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-labMotorcycle-lab changed the title Glasgow | 25-ITP-May |Chan Yat Long |Sprint 2 | Book library Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-labMotorcycle-lab added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected labels Aug 18, 2026

@cjyuancjyuan left a comment

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.

@cjyuancjyuan 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 Aug 18, 2026
@Motorcycle-labMotorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 18, 2026
@cjyuan

Copy link
Copy Markdown
Contributor

Did you push your changes to GitHub?

@cjyuancjyuan 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 Aug 18, 2026
@cjyuan

Copy link
Copy Markdown
Contributor

Could you go through the "general feedback" document again to see what else you could also improve?

@cjyuancjyuan 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 Aug 19, 2026
@Motorcycle-labMotorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected labels Aug 19, 2026

@cjyuancjyuan left a comment

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.

Have you also checked `index.html for errors or possible improvements?

Comment threaddebugging/book-library/script.js Outdated
Comment threaddebugging/book-library/script.js
Comment threaddebugging/book-library/script.js Outdated
Comment threaddebugging/book-library/script.js
@cjyuancjyuan 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 Aug 20, 2026
@Motorcycle-labMotorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 20, 2026
Comment threaddebugging/book-library/script.js Outdated
Comment on lines 95 to 97
alert("Are you sure you want to delete the book ?");
myLibrary.splice(i, 1);
render();

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.

alert() won't let a user choose Yes or No. Besides, this message is not quite the same as the original message.
The intent of the original message is to inform the user which book was deleted.

Comment threaddebugging/book-library/script.js Outdated
Comment on lines +56 to +61
const table = document.getElementById("display");
table.innerHTML = "";
let rowsNumber = table.rows.length;
//delete old table
for (let n = rowsNumber - 1; n > 0; n-- {
table.deleteRow(n);
}
const tobody = table.querySelector("tbody") || table;
tobody.innerHTML = "";

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.

  • Why clear both <table> and <tbody>?

  • Where is rowsNumber used?

  • Where is tobody used?

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.

According to https://validator.w3.org/, there are errors in your index.html. Can you fix these errors?

Comment threaddebugging/book-library/index.html Outdated
Comment on lines +30 to +31
<div id="demo" class="collapse">
<form id="bookform">

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.

Good idea to introduce <form>. Why not use a formatter to keep the code consistently formatted?

Comment threaddebugging/book-library/index.html Outdated
Comment on lines 48 to 53
<input
type="number"
class="form-control"
id="pages"
name="pages"
required
/>

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.

  • Why remove required?

  • Why not make this input element to accept only positive whole number?

Comment threaddebugging/book-library/index.html Outdated
Comment on lines 54 to 61
@@ -61,13 +59,9 @@ <h1>Library</h1>
value=""
/>Read
</label>

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.

Currently this checkbox is not showing.

The issue is related to Bootstrap 4.4.1. Could you use AI to find a way to fix the issue? Mentioning "Bootstrap 4.4.1" might help.

Comment threaddebugging/book-library/index.html Outdated
class="btn btn-primary"
onclick="submit();"
/>
<button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button>

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.

Could you look up the trade off between

  • Assigning event listener in HTML
  • Assigning event listener in JS using .addEventListener()

Comment threaddebugging/book-library/index.html Outdated
Comment on lines +64 to +62
<input
type="submit"
value="Submit"
class="btn btn-primary"
onclick="submit();"
/>
<button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button>

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.

Changing the submit button to a regular button means the browser won't check the constraints such as required when the user clicks the button. If your intention is to prevent the browser from submitting the form, which would cause the page to reload, you can call .preventDefault() on the event object passed to the event listener.

@cjyuancjyuan 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 Aug 21, 2026
@Motorcycle-labMotorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 21, 2026

@cjyuancjyuan left a comment

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.

Changes look good.

The issue with clearing the table should be easy to fix. I will mark this PR as "Complete" first.

Comment threaddebugging/book-library/script.js Outdated
Comment on lines +61 to +62
const table = document.getElementById("display");
table.innerHTML = "";

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.

Clear the whole table would also remove the header rows. You could just clear the <tbody> of this table.

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.

Hello Mr cjyuan. You have approved me finally last night at 10pm, but I was not in the computer after that, so I cannot see the pull request which has been finished. I have been doing this pull request with you for four days before the deadline. I had finished every steps at that time and just had the book library left waiting you to get approved. I could not submit the deadline now because the time has passed. I am hoping that you can see my efforts that I had done this pull request with your for four days before the deadline.

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.

I am sorry but I was merely holding the same standard for every trainee.

You could still make it to the upcoming Checkpoint if you join the September ITP and and finished it within 1-2 weeks.

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.

but I will finish here because I am not avaliable for the upcoming ITP September. Is there anyway that I can stll receive the badge of this course

@cjyuancjyuan 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. labels Aug 21, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CompleteVolunteer to add when work is complete and all review comments have been addressed.🏕 Priority MandatoryThis work is expected📅 Sprint 2Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Motorcycle-lab@cjyuan