Skip to content

Solution#1878

Open
Rostyslav452 wants to merge 6 commits into
mate-academy:masterfrom
Rostyslav452:develop
Open

Solution#1878
Rostyslav452 wants to merge 6 commits into
mate-academy:masterfrom
Rostyslav452:develop

Conversation

@Rostyslav452
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation has two issues that violate explicit task requirements. First, the input selection should be scoped to the form element using document.querySelector('form').querySelectorAll('input') rather than selecting all inputs in the document - this is critical because it won't work correctly if other inputs exist on the page. Second, the placeholder should capitalize only the first letter (e.g., 'Email' not 'EMAIL' or 'email'), which you can achieve with e.name.charAt(0).toUpperCase() + e.name.slice(1). Please fix both of these issues to meet the requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
'use strict';

// write code here
const inputs = [...document.querySelectorAll('input')];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The requirement specifies getting inputs from the form tag, not from the entire document. Use document.querySelector('form').querySelectorAll('input') or form.querySelectorAll('input').

Comment thread src/scripts/main.js Outdated
label.setAttribute('htmlFor', `${e.id}`);
label.textContent = e.name.toUpperCase();

e.setAttribute('placeholder', `${e.name}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The placeholder should capitalize only the first letter (e.g., 'Email'), not convert all letters to uppercase. Use a method that capitalizes only the first character while keeping the rest lowercase.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Changes are needed. Your implementation has 2 critical issues that violate explicit requirements from the task checklist.

Issue 1: Input selection not scoped to form [CHECKLIST ITEM #1]
You're using document.querySelectorAll('input') which selects ALL inputs on the page. The requirement explicitly states inputs should be selected from the form tag specifically. Use document.querySelector('form').querySelectorAll('input') to scope the selection to the form element only.

Issue 2: Placeholder not capitalized [CHECKLIST ITEM #6]
You're using e.setAttribute('placeholder', e.name) which leaves the placeholder text lowercase. The requirement specifies placeholder text should be capitalized (e.g., 'Email' not 'email'). Apply the same capitalization logic you already use for the label text on line 10: e.name.charAt(0).toUpperCase() + e.name.slice(1).

Both issues are explicit checklist violations that prevent the task from being considered complete. Please fix these two items and resubmit.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
'use strict';

// write code here
const inputs = [...document.querySelectorAll('input')];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The selection should be scoped to the form element. Use document.querySelector('form').querySelectorAll('input') instead to select only inputs within the form tag as required by checklist item #1.

Comment thread src/scripts/main.js Outdated
label.setAttribute('htmlFor', `${e.id}`);
label.textContent = e.name.charAt(0).toUpperCase() + e.name.slice(1);

e.setAttribute('placeholder', `${e.name}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The placeholder text is not capitalized. According to checklist item #6, placeholder text should be capitalized (e.g., 'Email' not 'email'). Apply the same capitalization logic used for the label text on line 10.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved. The implementation correctly addresses both critical issues from the previous review: input selection is now properly scoped using e.querySelectorAll('input') within each form iteration, and placeholder text is capitalized using the same capitalizedName variable as the label text. All seven checklist requirements are satisfied with proper DOM manipulation using before() to append labels as siblings. Great work on resolving the previous concerns and implementing clean, correct code!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants