fix(11): address code-review findings in catalog inline-edit
- WR-01: remove blur-commit on EditableCell toggle (onChange already saves+closes; prevents double updateServiceField) - WR-02: skip server action when cell value unchanged (commit + new commitOnBlur dirty-check) - WR-03: on blur, revert required-empty field via cancel() instead of leaving the cell stuck in error state - WR-04: normalize it-IT price input (1.234,50) before parse; Number() rejects trailing garbage - IN-01: render row error in its own <tr> instead of an invalid 7th <td> in a 6-column row Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ function ServiceRow({ service }: { service: ServiceWithTags }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<tr
|
||||
className={`border-b border-[#e5e7eb] hover:bg-[#f9f9f9] transition-colors duration-150 ${
|
||||
!service.active ? "opacity-50" : ""
|
||||
@@ -85,12 +86,15 @@ function ServiceRow({ service }: { service: ServiceWithTags }) {
|
||||
onSave={(v) => saveField("active", v)}
|
||||
/>
|
||||
</td>
|
||||
{error && (
|
||||
</tr>
|
||||
{error && (
|
||||
<tr>
|
||||
<td className="py-1 px-3 text-xs text-red-600" colSpan={6}>
|
||||
{error}
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
</tr>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user