-
-
Notifications
You must be signed in to change notification settings - Fork 71
West-Midlands ITP-Jan-2025 | Ifeanyi Madubugwu | Module-Data-Flow| Sprint -2| Book Library #189
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
base: main
Are you sure you want to change the base?
Conversation
…e from the form. added the function to check if the book is read or not and also added the function to change the status of the book to read or unread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is working. I think there are a few improvements you can still make.
debugging/book-library/index.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I checked the code in index.html
at https://validator.w3.org/, it indicated some errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi CJ
have i fixed my html element and all has passed in https://validator.w3.org/,
debugging/book-library/script.js
Outdated
title.value == null || | ||
title.value == "" || | ||
title.value.trim() === "" || | ||
author.value == null || | ||
author.value.trim() === "" || | ||
pages.value == null || | ||
pages.value == "" | ||
pages.value.trim() === "" | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of input validation,
- Can
.value
benull
? (Do we need to checksomeInputElement.value == null
?) - What if a user enters an invalid page number in the "pages" input field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Cj
i have refactor the code and have remove
title.value == null
author.value == null
page.value == null
debugging/book-library/script.js
Outdated
render(); | ||
} | ||
console.log(myLibrary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this console.log() statement for the app to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Cj
i have removed the console.log, i implemented that when i was debugging my code.
Thanks
debugging/book-library/script.js
Outdated
for (let n = rowsNumber - 1; n > 0; n-- ) { | ||
table.deleteRow(n); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of deleting the table rows one by one, can you think of a more efficient way to remove all rows (except the <th>...</th>
) in the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Cj
i have refactor the code to clear all row except the header, and also sort myLibrary before rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
With the way the book's title is assigned to an HTML element (line 73), a book with a title containing special character sequence such as
<i>
can possibly ruin the display. -
Is the value assigned to the
id
attribute ofchangeBut
anddelButton
unique? -
Is there a need to assign an id attribute to
delButton
(line 92) orchangeBut
(line 79)? -
Can you think of a more consistent way to name the variables representing the two buttons,
changeBut
anddelButton
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Cj
on line 73, i have refactor the code to textContent instead of innerHTML,
i deleted the id attribute for the changeBut and delButton, and i also rename the variable to statusButton and deleteButton
I didn't see any changes made based on my feedback. |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.