-
-
Notifications
You must be signed in to change notification settings - Fork 158
Glasgow | 25-ITP-SEP | Alaa Tagi | Sprint 2 | Book/Library #346
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
cjyuan
left a comment
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.
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.
|
i fixed HTML,JS and CSS files to match all requirements in this project. |
cjyuan
left a comment
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 greatly improved.
Input validation part can still use some improvement.
debugging/book-library/script.js
Outdated
| if (Number.isNaN(pages) || pages <= 0) { | ||
| alert("Page count must be a positive number."); | ||
| return; | ||
| } |
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.
Some invalid "number of pages" can still pass the check on line 30.
debugging/book-library/script.js
Outdated
| row.insertCell().textContent = book.title; | ||
| row.insertCell().textContent = book.author; | ||
| row.insertCell().textContent = book.pages; | ||
|
|
||
| changeBut.addEventListener("click", function () { | ||
| myLibrary[i].check = !myLibrary[i].check; | ||
| const readCell = row.insertCell(); |
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.
Can you think of the pros and cons of these two approaches for creating cells within a row?
- Keeping all the cell creation code in one location, like what the original code does.
- Scattering the cell creation code across different locations, like what you did.
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.
I think Keeping all cell creation code in one place make the structure easier to read and maintain, while scattering the code can make each part easier to manage but can also make the table setup less clear.
… and prevent any invalid book to be added
cjyuan
left a comment
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.
All good. Well done!
Learners, PR Template
Self checklist
Changelist
I have made some changes in script.js file to meet the rquirements.
Questions
No question.