Skip to content

first commit - #2102

Open
DaniilDanilyuk wants to merge 2 commits into
mate-academy:masterfrom
DaniilDanilyuk:develop
Open

DaniilDanilyuk wants to merge 2 commits into
mate-academy:masterfrom
DaniilDanilyuk:develop

Conversation

@DaniilDanilyuk

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

Your implementation has a critical sorting order issue that needs to be fixed. The task explicitly requires sorting in descending order (highest salary first), but your comparator uses intoValue(a.getAttribute('data-salary')) - intoValue(b.getAttribute('data-salary')) which produces ascending order. While using prepend instead of append happens to display the correct visual result, the sort comparator itself must produce descending order as specified in the requirements. Change the comparator to intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')) to fix this issue.


✨ 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 +12 to +15
arrOfElement.sort(
(a, b) =>
intoValue(a.getAttribute('data-salary')) -
intoValue(b.getAttribute('data-salary')),

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 sort comparator produces ascending order (a - b), but the task requires descending order. Change to intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')) to sort from highest to lowest salary.

@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

Your solution is approved. The implementation correctly addresses all task requirements: the sorting comparator now properly produces descending order (highest salary first) using intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')), all required functions are implemented (sortList and getEmployees), the helper function intoValue for salary conversion is in place, and both functions are called as specified. All checklist items pass, including proper use of data attributes, correct employee object schema, and appropriate DOM manipulation.


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

Footnotes

  1. Rate AI review example ↩

This branch has not been deployed

No deployments
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