Skip to content
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

London-ITP-Jan2025| Sabita Shrestha| Module-Data-Flows| Book-library| week2 #185

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SabitaShrestha325
Copy link

@SabitaShrestha325 SabitaShrestha325 commented Apr 5, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@SabitaShrestha325 SabitaShrestha325 added the Needs Review Participant to add when requesting review label Apr 5, 2025
@SabitaShrestha325 SabitaShrestha325 changed the title Londo-ITP-Jan2025| Sabita Shrestha| Module-Data-Flows| Book-library| week2 London-ITP-Jan2025| Sabita Shrestha| Module-Data-Flows| Book-library| week2 Apr 5, 2025
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some improvements you can still make to the JS code.

Also, when I checked the code in index.html at https://validator.w3.org/, it indicated some errors.

Comment on lines 57 to 59
for (let n = rowsNumber - 1; n > 0; n-- ){
table.deleteRow(n);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of deleting the table rows one by one, can you think of a more efficient way to remove all rows (except the <th>...</th>) in the table?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of input validation,

  1. Are all input properly checked?
  2. Can .value be null? (Do we need to check someInputElement.value == null?)
  3. What if a user enters only space characters in the "title" input field?
  4. What if a users enters -1 or 3.1416 in the "pages" input field?

With the way the book's title is assigned to an HTML element (line 69), a book with a title containing special character sequence such as <i> can possibly ruin the display.

Lines 75, 89:

  • Is the value assigned to these id attribute unique?
  • Is there a need to assign an id attribute to delButton?
  • Is there a need to assign an id attribute to changeBut (at line 72)?

Lines 74, 88:

  • Can you think of a more consistent way to name the variables representing the two buttons, changeBut and delButton?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for your review. I have made the changes as mentioned; could you please review my work and let me know if anything needs to be adjusted? Thank you.

@cjyuan
Copy link

cjyuan commented Apr 9, 2025

On separate note, the self checklist and the Changelist in the PR template is not filled.

May I suggest learning the "importance to fill the PR template in a Github PR" via Google search or ChatGPT?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Apr 9, 2025
@cjyuan
Copy link

cjyuan commented Apr 9, 2025

Changes to the JS code look great! Wonderful job. (Can consider also fix the error in HTML when you have time). Feel free to mark this as "Complete" anytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants