Skip to content

version 1#1801

Open
dianakomar wants to merge 2 commits intomate-academy:masterfrom
dianakomar:develop
Open

version 1#1801
dianakomar wants to merge 2 commits intomate-academy:masterfrom
dianakomar:develop

Conversation

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

Changes are needed because two explicit task requirements are not fully met, even though your core table-generation logic is correct. First, the task specifies that you must select the table with class dashboard, but your code currently uses a generic selector like document.querySelector('table'); update this line (e.g., const table = document.querySelector('table.dashboard');) so it targets the correct element, and add a guard such as if (!table) return; before appending rows to avoid runtime errors if the table is missing. Second, the instructions require using the people array imported from the people.json file, but your script currently defines the people data inline instead of importing it; replace the inline array with an ES module import (for example, import people from '../people.json'; depending on your folder structure) so tests that rely on that import will pass. These two issues are critical because they directly violate the stated requirements and are likely to cause automated checks to fail. Aside from that, your computation of age and century, and the creation of six <td> cells per row (name, gender, born, died, age, century) are all implemented correctly. As a minor improvement (not required to pass), you could also simplify the repeated cell creation by putting the values into an array and looping to create <td> elements for cleaner code. Once you adjust the selector and switch to importing people from the JSON file, your solution should fully align with the project 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

// eslint-disable-next-line no-console
console.log(people); // you can remove it
const table = document.querySelector('table');
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 requires finding the table with class dashboard. This line uses a generic tag selector which may not target the correct element. Use a class selector such as document.querySelector('table.dashboard') or document.querySelector('.dashboard').

Comment thread src/scripts/main.js Outdated
cell6.textContent = century;

row.append(cell1, cell2, cell3, cell4, cell5, cell6);
table.append(row);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Appending rows directly to table will throw if the selector above returns null. Add a guard like if (!table) return; or select the correct element first to avoid runtime errors when table is not found.

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 because it correctly reads the people data, iterates over each person, and creates one <tr> per person in src/scripts/main.js. Each row contains exactly six <td> cells in the required order (name, gender, born, died, age, century), and you compute age as died - born and century with Math.ceil(died / 100) as specified. The rows are appended to the existing table.dashboard element, and you safely handle the case where the table might not exist, so the core functionality is robust. There are no critical issues that block task completion; all main requirements from the description appear to be met. As minor, optional improvements, you could reduce repetition by putting the cell values into an array and looping to create <td> elements, and you might consider more explicit handling of gender values beyond just 'm' vs everything else. Overall, this is a clear and functional implementation that satisfies the task’s expectations.


✨ 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