Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library - #560
Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library #560Motorcycle-lab wants to merge 8 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
-
Could you fix the checkboxes in the PR description?
-
Coud 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.mdDoing so can help me speed up the review process. Thanks.
|
Did you push your changes to GitHub? |
|
Sorry sir. I am a bit confusing because If you clicked on my file change, I have already updated the file. |
|
Could you go through the "general feedback" document again to see what else you could also improve? |
cjyuan
left a comment
There was a problem hiding this comment.
Have you also checked `index.html for errors or possible improvements?
| alert("Are you sure you want to delete the book ?"); | ||
| myLibrary.splice(i, 1); | ||
| render(); |
There was a problem hiding this comment.
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.
| 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 = ""; |
There was a problem hiding this comment.
-
Why clear both
<table>and<tbody>? -
Where is
rowsNumberused? -
Where is
tobodyused?
There was a problem hiding this comment.
According to https://validator.w3.org/, there are errors in your index.html. Can you fix these errors?
| <div id="demo" class="collapse"> | ||
| <form id="bookform"> |
There was a problem hiding this comment.
Good idea to introduce <form>. Why not use a formatter to keep the code consistently formatted?
| <input | ||
| type="number" | ||
| class="form-control" | ||
| id="pages" | ||
| name="pages" | ||
| required | ||
| /> |
There was a problem hiding this comment.
-
Why remove
required? -
Why not make this input element to accept only positive whole number?
| @@ -61,13 +59,9 @@ <h1>Library</h1> | |||
| value="" | |||
| />Read | |||
| </label> | |||
There was a problem hiding this comment.
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.
| class="btn btn-primary" | ||
| onclick="submit();" | ||
| /> | ||
| <button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button> |
There was a problem hiding this comment.
Could you look up the trade off between
- Assigning event listener in HTML
- Assigning event listener in JS using
.addEventListener()
| <input | ||
| type="submit" | ||
| value="Submit" | ||
| class="btn btn-primary" | ||
| onclick="submit();" | ||
| /> | ||
| <button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button> |
There was a problem hiding this comment.
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.
Self checklist
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.