Skip to content

add task solution#1838

Open
Vlad99M wants to merge 4 commits into
mate-academy:masterfrom
Vlad99M:develop
Open

add task solution#1838
Vlad99M wants to merge 4 commits into
mate-academy:masterfrom
Vlad99M:develop

Conversation

@Vlad99M

@Vlad99M Vlad99M commented Jun 24, 2026

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because a critical requirement about the data source is not met and this is causing tests to fail. Your DOM logic for creating the table rows, computing age (died - born), and determining the century is correct and aligns with the task, which is great. However, in src/scripts/main.js you currently define a hardcoded const people = [...] instead of using the provided import people from './people.json';, which violates the requirement to build the table from the JSON file ([CHECKLIST ITEM #2] and [CHECKLIST ITEM #9]). This also leads to a mismatch in property names: the JSON uses sex, but your code accesses person.gender, so the gender column never gets the expected values like Male, and the Cypress test should create a table based on people.json file fails.

To fix this, you should: 1) uncomment and use import people from './people.json';, 2) remove the inline hardcoded people array, and 3) update the gender cell to read from person.sex instead of person.gender. After that, make sure you still create six cells per row (name, sex/gender, born, died, age, century) and append each row to the .dashboard table as you already do. Once these adjustments are made, your solution should meet all the core requirements and pass the related tests. Keep the good structure you already have—only the data source and property name need to be aligned with the task.


✨ 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
console.log(people); // you can remove it

// write your code here
// import people from './people.json';

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 task explicitly mentions to use the already imported people.json file. This import is currently commented out, so the implementation does not meet that requirement; consider uncommenting it and adjusting your code to use that people variable.

Comment thread src/scripts/main.js Outdated

const genderCell = document.createElement('td');

genderCell.textContent = person.gender;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here you access person.gender, but in the provided data above the field is named sex. If you switch to using people.json, ensure you reference the correct property (person.sex) so the gender column is filled correctly.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there are still critical functional issues that prevent the task from meeting the requirements and passing the tests. The gender column is currently reading person.gender (in src/scripts/main.js, inside your row creation loop), but the data uses the sex property, so the gender cells will be empty and the "gender" requirement is not satisfied; you need to change that cell to use person.sex instead. Additionally, your script still relies on a hardcoded const people = [...] array instead of the people.json file that is supposed to be imported via import people from './people.json';, which means the table is not actually being generated from the JSON source the tests expect.

To fix the blockers:

  • Remove or comment out the inline const people = [...] definition and use the already provided import people from './people.json'; at the top of main.js as your data source.
  • Update the gender cell assignment so that you read person.sex for the gender column.

Once these two issues are corrected, your existing logic for computing age and century and for creating six cells per row should fully meet the task requirements. Your structural DOM work is solid, so focus on aligning the data source and property names with the specification; you’re very close to a complete solution.


✨ 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
Comment on lines +384 to +386
const genderCell = document.createElement('td');

genderCell.textContent = person.gender;

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 gender column must be based on the sex property from the JSON (person.sex), but here you read person.gender, which doesn’t exist in the data. This will leave the gender cells empty and violates the requirement for the gender column. Update this to use person.sex.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution as an educational override so you can keep progressing while learning, but there is one important fix you should make next. Your DOM logic for generating the table is solid: you correctly create one row per person, fill 6 cells (name, gender from person.sex, born, died, age, and century), and append each row to the table with class .dashboard, which matches the task requirements [CHECKLIST ITEM #3, #4, #7]. The main issue is that you still define a local const people = [...] array in src/scripts/main.js instead of using the required JSON import import people from './people.json';, which violates the data-source requirement and can break tests that expect the data to come from people.json [CHECKLIST ITEM #2, #8, #11, #15]. To fix this, remove or comment out the entire inline const people = [...] block (including its data) and rely solely on the already imported people variable at the top of the file, without redeclaring it. Once you do that, your existing loop and cell-creation logic should pass the tests that look for values like Male in the table cells, because they will then be reading from the correct JSON data. Overall, your table-building logic is well done—focus now on cleaning up the data source usage, and you’ll have a fully compliant solution.


✨ 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

@etojeDenys etojeDenys left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

demo link does not work. please fix it and re-request the review

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.

3 participants