Develop#1110
Conversation
galina-palyukh
commented
May 18, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution successfully implements all core requirements from the task specification. Table sorting works correctly with ASC/DESC toggle, row selection applies the 'active' class properly, the form structure includes all required inputs with correct data-qa attributes, and form validation triggers notifications for Name (< 4 letters) and Age (< 18 or > 90) as specified. There are two issues worth noting for improvement: 1. Cell editing edge case: In the saveState() function, when editing a salary cell and submitting an empty value, the cell displays $0 instead of reverting to the original value. This happens because the salary formatting logic runs after the empty check, overwriting it. Moving the empty check after the salary formatting condition will fix this. 2. Redundant validation: The position field validation in checkValidation() is unnecessary since the HTML5 required attribute already prevents empty submissions for that field. These are minor issues that don't prevent task completion. The implementation is functional and meets all specified requirements.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
|
||
| if (positionInput.value.length === 0) { | ||
| createNotification('error', 'The field "Position" cannot be empty'); | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| if (ageInput.value < 18 || ageInput.value > 90) { | ||
| createNotification('error', 'Age must be between 18 and 90'); | ||
|
|
||
| return false; |
There was a problem hiding this comment.
The validation checks position field but the task only requires validation for Name (< 4 letters) and Age (< 18 or > 90). This extra validation may cause issues if the position field is intentionally left empty during testing.
|
|
||
| const saveState = () => { | ||
| const value = input.value; | ||
|
|
||
| if (value === '') { | ||
| cell.textContent = cellOriginalValue; | ||
| } else { | ||
| cell.textContent = value; | ||
| } | ||
|
|
||
| if (columnName === 'salary') { | ||
| cell.textContent = `$${Number(value).toLocaleString('en-US')}`; |
There was a problem hiding this comment.
Edge case: When cell is empty and column is 'salary', cell.textContent becomes '$NaN' instead of returning original value. The empty check should happen after the salary formatting condition.
|
|
||
| if (nameInput.value.length < 4) { |
There was a problem hiding this comment.
Name validation doesn't trim whitespace - a name like 'abc ' (with trailing space) would incorrectly pass validation since it counts characters including spaces.
|
|
||
| if (positionInput.value.length === 0) { | ||
| createNotification('error', 'The field "Position" cannot be empty'); | ||
|
|
||
| return false; |
There was a problem hiding this comment.
Position field validation (line 199) is not required by the task specification which only mentions Name (< 4 letters) and Age (< 18 or > 90) as validation rules.