Skip to content

ITP London - Jan 2025 | Samunta Sunuwar| Module Data Flows | Book Library #203

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

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

Conversation

Samunta
Copy link

@Samunta Samunta commented Apr 16, 2025

  • 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

@Samunta Samunta added the Needs Review Participant to add when requesting review label Apr 16, 2025
@Samunta Samunta linked an issue Apr 16, 2025 that may be closed by this pull request
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Apr 17, 2025
Copy link
Contributor

@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.

Good job!

I think some of the code can still use some improvement.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good job in fixing most of the errors in the HTML code.

According to https://validator.w3.org/, there are still some errors in the HTML code. Can you fix these errors?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your feedback, I have made changes as requested.

Comment on lines 32 to 39
title.value == null ||
title.value == "" ||
//adding author validation
author.value == null ||
author.value == "" ||
pages.value == null ||
pages.value == ""
) {
Copy link
Contributor

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,

  • Can .value be null? (Do we need to check someInputElement.value == null?)
  • Do you accept books to appear in the app as shown in this pic:
    image

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your feedback, I have made changes as requested.

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

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
Author

Choose a reason for hiding this comment

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

Thank you for your feedback, I have made changes as requested.

});
// fixed: using one consistent button variable
let delButton = document.createElement("button");
delButton.id = `delete-${i}`; // optional: clearer ID
Copy link
Contributor

Choose a reason for hiding this comment

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

Great job in recognizing the need to ensure unique id value.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

  • Line 76:

    • The current method of assigning book titles to HTML elements can cause display issues if a title contains special character sequences like <i>.
  • Can you suggest a more consistent naming convention for the variables representing the two buttons, currently named 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.

Thank you for your feedback, I have made changes as requested.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 17, 2025
Samunta added 3 commits April 19, 2025 15:00
…<input> element is a void element, which means it should not have a closing tag (like </input>)
…and used .trim to ensure no white spaces are being added. Also added validation to reject input with negative or decimal numbers
…ows instantly, instead of triggering multiple reflows with deleteRow.
@Samunta Samunta added Complete Volunteer to add when work is complete and review comments have been addressed and removed Reviewed Volunteer to add when completing a review labels Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TECH ED] Book Library
2 participants