Skip to content

London | 26-ITP-May | Edina Kurdi | Sprint 2 | Book Library - #552

Open
edinakurdi wants to merge 36 commits into
CodeYourFuture:mainfrom
edinakurdi:sprint-2/book-library
Open

London | 26-ITP-May | Edina Kurdi | Sprint 2 | Book Library#552
edinakurdi wants to merge 36 commits into
CodeYourFuture:mainfrom
edinakurdi:sprint-2/book-library

Conversation

@edinakurdi

Copy link
Copy Markdown

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

  • Added the missing closing bracket in the render() function's loop
  • Corrected the array name to myLibrary and fixed the event listener to use click
  • Fixed the variable mapping in render()
  • Fixed variable name mismatch. (delButton)
  • Fixed the submit() function so it saves the actual author's name instead of copying the title twice. (Note - in the commit msg I may have accidentally said this was in render())
  • Fixed the read (y/n) display logic for new table entries

Other corrections I made:
Added missing author form validation, fixed HTML input types, corrected a book title typo, and removed redundant CSS.

@edinakurdi edinakurdi 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 14, 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.

Could you also 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.

Comment thread debugging/book-library/index.html Outdated
Comment on lines +32 to +34
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="check" 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.

If this checkbox is not showing, could you try fixing the issue with the help of AI. The issue is related to Bootstrap 4.4.1. So mentioning "Bootstrap 4.4.1" to AI might help.

Comment thread debugging/book-library/index.html Outdated
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="check" value="" />Read
</label>
<input type="submit" value="Submit" class="btn btn-primary" onclick="submit();" />

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

  • attaching event listener in HTML
  • attaching event listener in JS using .addEventListener()?

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.

inline breaks separation of concersn and doesnt allow multiple event listeneres, and forces the function to global scope which can cause issues, but it is quick to write, shorter
addEventListener supports multiple event listeners, no global scope, but requires more code.
updated

@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 14, 2026
@edinakurdi edinakurdi 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 16, 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.

Changes look good.

Well done.

let book = new Book(title.value, title.value, pages.value, check.checked);
library.push(book);
render();
bookForm.addEventListener("submit", function (e) {

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 consider placing all code that runs once on page load in a single function. For example, you could put it inside the page load callback or create a function named init() or setup() and call it once when the page loads.

This makes it easier to locate and manage all the code that runs once when the app starts.

Comment on lines +89 to 96
const confirmDel = confirm(
`Are you sure you want to delete "${myLibrary[i].title}"?`
);
if (confirmDel) {
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.

Informing the user that the book has been deleted is not quite the same as asking whether they want to delete the book though.

@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. labels Aug 16, 2026
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. Module-Data-Flows The name of the module. 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants