-
-
Notifications
You must be signed in to change notification settings - Fork 161
London | 25-ITP-SEP | Imran Mohamed | Sprint 2 | Book Library #329
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
Conversation
…ipt functionality for book library application & complete code reading tasks
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
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.
|
Thank you for the feedback. I'll make sure to work on the issues/suggestions you've pointed out. |
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.
Pull request overview
This PR refactors the book library application by fixing multiple bugs, improving form validation, enhancing HTML semantics, and completing code reading exercises. The changes address issues with book display, form submission, author attribution, and delete functionality.
Key changes:
- Fixed JavaScript bugs including incorrect variable references, missing parentheses, and incorrect event listener names
- Improved HTML structure with proper input types, accessibility attributes, and semantic elements
- Enhanced form handling by moving to button-based submission with proper event listeners
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| debugging/book-library/script.js | Fixed multiple bugs including syntax errors, variable references, and improved code quality with proper comparisons and string interpolation |
| debugging/book-library/index.html | Enhanced semantic HTML with lang attribute, proper input types, accessibility labels, and form structure |
| debugging/book-library/style.css | Updated selectors to match HTML changes and improved styling consistency |
| debugging/code-reading/readme.md | Added answers to scope and reference-related JavaScript questions |
| debugging/book-library/readme.md | Documented completion of bug fixes |
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.
Excellent work.
| First console.log outputs 9 as x is passed and the f1 call doesn't alter its value outside the fn. | ||
| Second console.log prints the object {x:10} as f2 increments y.x by 1 |
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.
Suggestion: Look up the relevant technical terms, pass by value and pass by reference.
| authorInput.value = ""; | ||
| pagesInput.value = ""; | ||
| checkInput.checked = false; | ||
| alert(`You've added ${book.title} to your library.`); |
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.
Note:
alert() is not a friendly way to display messages in an app, especially non-critical messages.
It is ok to use alert() in this "exercise" app, just don't make it a habit.
Also, alert() can block the execution of the application. For example, even if you moved alert0 after render(), the rendering will still be blocked by alert(). So in both "addition" and "deletion" (lines 97-99), the updated list of books will only be rendered after the user closed the dialog box.
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 was looking into Bootstrap's alert classes and realised I could have in-page messages as opposed to alerts. I will implement this as a workaround.
Self checklist
Changelist
Refactor HTML structure, enhance form validation, and improve JavaScript functionality for book library & complete code reading tasks