London | 26-ITP-May | Vito Moratti | Sprint 2 | Book-library - #570
London | 26-ITP-May | Vito Moratti | Sprint 2 | Book-library#570vmoratti wants to merge 19 commits into
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
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.
| id="title" | ||
| name="title" | ||
| required | ||
| /> |
There was a problem hiding this comment.
The browser checks the input elements against the specified constraints only when a user submits a form.
Without <form>, the browser won't enforce the "required" constraint.
There was a problem hiding this comment.
Why not make this input element to accept only positive whole number?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I have also run the HTML code through the validator and there are no red flags now.
I also added delay for the deletion message to show after the deletion of book.
There was a problem hiding this comment.
A common practice is to exclude local configuration files, which typically differ between developers, from a PR branch unless the configuration is required for the changes to work.
To ignore a tracked file such as .vscode/settings.json locally, use:
git update-index --skip-worktree path/to/file
And if you ever need undo the operation in order to track it again, use:
git update-index --no-skip-worktree path/to/file
There was a problem hiding this comment.
thank you, that file snuck in into commit, and i wasn't sure if it's needed to be pushed. So, does it mean that by doing:
git update-index --no-skip-worktree path/to/file
i have undone it now?
There was a problem hiding this comment.
That only tells git not to track the file but the changes made before will still remain on the branch.
For this PR, it's ok to leave it there. You could practice that in future PRs.
| titleInput.value.trim(), | ||
| authorInput.value.trim(), |
There was a problem hiding this comment.
What f titleInput.value is " "? Could a book title or author's name be an empty string?
There was a problem hiding this comment.
I got it. trimming() before the condition checking
| setTimeout(function () { | ||
| alert(`You've deleted title: ${deletedTitle}`); | ||
| }, 0.5); | ||
| }, 3); |
There was a problem hiding this comment.
Why 3 (or 0.5) ? What difference does it make?
There was a problem hiding this comment.
Sorry, of course it's milliseconds. I've changed it to 300 now.
There was a problem hiding this comment.
Not much , as it's in milliseconds. So, i have changed now.
| authorInput.value.trim(), | ||
| title, | ||
| author, | ||
| Number(pagesInput.value), |
There was a problem hiding this comment.
Note: It's a safer practice to also check the input in JS. (Someone could have accidently changed the constraints in the HTML later).
| setTimeout(function () { | ||
| alert(`You've deleted title: ${deletedTitle}`); | ||
| }, 3); | ||
| alert(`You've deleted title: ${deletedTitle}`); |
There was a problem hiding this comment.
Why remove the setTimeout()? You could set the delay to 0 (instead of some magic number). Because of the way JS queues a task with setTimeout(), it could prevent alert() from blocking the page from being updated.
Self checklist
Changelist
I fixed all the "bugs" and also run it through the Lighthouse tool for accessibility with 94% success.