Skip to content

London | 26-ITP-May | Martin Mwaka | Sprint 2 | Book library - #523

Open
Temceo wants to merge 6 commits into
CodeYourFuture:mainfrom
Temceo:martin_book_library
Open

London | 26-ITP-May | Martin Mwaka | Sprint 2 | Book library#523
Temceo wants to merge 6 commits into
CodeYourFuture:mainfrom
Temceo:martin_book_library

Conversation

@Temceo

@Temceo Temceo commented Aug 7, 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

Debug and improve functionality of the library app

Temceo added 5 commits August 5, 2026 09:02
…js - update to accept populate table from fragment and refactor to make content easier to understand - style.css - add css for delete book message
@github-actions

This comment has been minimized.

@Temceo Temceo added 🏕 Priority Mandatory This work is expected 📅 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. Module-Data-Flows The name of the module. labels Aug 7, 2026
@github-actions

This comment has been minimized.

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

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Temceo Temceo added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 7, 2026

@cjyuan cjyuan 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.

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

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

@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 Aug 7, 2026
@Temceo

Temceo commented Aug 8, 2026

Copy link
Copy Markdown
Author

I have reviewed the general feedback and improved the code

@Temceo Temceo 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 8, 2026
Comment on lines +51 to +53
<label for="pages">Pages:</label>
<input type="number" class="form-control" id="pages" name="pages">
<span class="error error-pages"></span>

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 not make this input element reject unwanted input values?

const displayBooks = document.querySelector(".display-books");
const bookEntryTab = document.getElementById("demo");

let myLibrary = [];

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.

Can we declare myLibrary in a way that prevents it from being accidentally reassigned?

Comment on lines +27 to 30
myLibrary.push(new Book("Robison Crusoe", "Daniel Defoe", "252", true));
myLibrary.push(
new Book("The Old Man and the Sea", "Ernest Hemingway", "127", true)
);

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 represent page count as a string?

Comment on lines +36 to +39
addBookForm.addEventListener("submit", (event) => {
event.preventDefault();
processEntries();
});

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.

To make locating all the "code that is to be executed once on page load" easier, a common practice is to keep the code in the same place. For example, inside the page's onload callback function.

});

if (isValid) {
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.

  • The raw values used here could be different from those checked on line 75.

  • pages.value could be a value like "3e2" or "12.345". Should page count be assigned values like these?

Comment on lines +153 to +164
const table = document.createElement("table");
table.className = "table table-striped";

const thead = document.createElement("thead");
const headerRow = document.createElement("tr");
["Title", "Author", "Pages", "Read", "Delete"].forEach((label) => {
const th = document.createElement("th");
th.textContent = label;
headerRow.appendChild(th);
});
thead.appendChild(headerRow);
table.appendChild(thead);

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 dynamically create the static table its header rows every time render() is called? Why not keep them in index.html as HTML code?

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

Labels

Module-Data-Flows The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants