-
-
Notifications
You must be signed in to change notification settings - Fork 158
Birmingham | ITP-Sep-2025 |Ahmad Ehsas | Sprint 2 | Book library #339
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
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Data flows) doesn't match expected format (example: 'Sprint 2', without quotes) 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's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Data Flows) doesn't match expected format (example: 'Sprint 2', without quotes) 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's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Data-flows) doesn't match expected format (example: 'Sprint 2', without quotes) 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's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (data flows) doesn't match expected format (example: 'Sprint 2', without quotes) 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's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Wrong number of parts separated by |s 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 couldn't be matched to an assignment in this module. Please check its title is in the correct format, and that you only have one PR per assignment. 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.
-
Branch is not clean. Please revert all unrelated changes.
-
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.
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.
Branch is still not clean. Please revert all unrelated changes.
debugging/book-library/script.js
Outdated
| if (!title.value.trim() || !author.value.trim() || !pages.value.trim()) { | ||
| alert("Please fill all fields!"); | ||
| return false; | ||
| } else { | ||
| let book = new Book(title.value, title.value, pages.value, check.checked); | ||
| library.push(book); | ||
| render(); | ||
| return; | ||
| } | ||
| let book = new Book(title.value.trim(), author.value.trim(), pages.value, check.checked); |
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.
- Without proper validation or pre-processing, the book could be assigned an invalid "number of pages".
- Some of the function calls are unnecessarily repeated. To improve performance, consider storing the results of these function calls in variables and referencing those variables instead.
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.
Updated the addBook function with improved validation and optimised input handling
- Added validation for the "number of pages" field to ensure it is a positive number.
- Optimised the addBook function by storing input values in variables to avoid redundant calls.
- Updated the form in index.html to include placeholders and proper input attributes for a better user experience.
| if (myLibrary.length === 0) { | ||
| let book1 = new Book("Robinson Crusoe", "Daniel Defoe", "252", true); | ||
| let book2 = new Book("The Old Man and the Sea", "Ernest Hemingway", "127", true); | ||
| myLibrary.push(book1, book2); |
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.
While storing page counts as string does not affect this simple app, it is a bad practice to represent same kind of values in different data type.
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.
Update the populateStorage function to store page counts as numbers instead of strings
- Changed page counts in the sample books to use numbers for consistency.
- Ensures better data representation and avoids potential issues with numerical operations.
|
The branch is clean. And, everything is up to date. |
|
Changes to the code are good. Branch is still not clean, You can see all the changed files in the "Changed files" tab of this PR. |
|
When I checked the branch's status, everything was up to date. Can you give me more information about why the branch is not clean? |
|
Your branch is not clean because it contains unrelated changes (changes unrelated to Book Library exercise) in the Sprint-1 folder. The are unrelated changes in the Sprint-1 folder because you didn't create this branch from So the make this branch clean, you have to revert the changes made in the Sprint-1 folder. |
|
I am very confused about how to revert the changes. Can you guide me or make a Google Meet call in your free time? |
|
Since you created the branch from In your case: Important:
1. Open Your Cloned Repository in VSCode and Start a Terminal in VSCode.VSCode will start the terminal in the top-level folder of the current project. 2. Switch to the branch you want to rebase (
|
|
Alternatively, you can manually replace those "unrelated changed files" by the same files in CYF's |
…rs instead of strings.
fa7a257 to
d6df415
Compare
|
Thank you for the guidance. |
|
Well done! |
Self checklist
Changelist
I have completed all the required tasks.
Questions