fix(work-orders): never attribute checklist completion to viewer

This commit is contained in:
Arthur Bassi 2026-07-22 10:23:50 -03:00
parent d2ff345965
commit 40c6e3cb3d
2 changed files with 2 additions and 5 deletions

View file

@ -6,7 +6,6 @@ type DispatchChecklistSectionProps = {
items: DispatchChecklistItem[];
isLocked: boolean;
isUpdating: boolean;
userName: string;
newItem: string;
onNewItemChange: (value: string) => void;
onToggleItem: (itemId: string | number, isCompleted: boolean) => void;
@ -17,7 +16,6 @@ export function DispatchChecklistSection({
items,
isLocked,
isUpdating,
userName,
newItem,
onNewItemChange,
onToggleItem,
@ -44,9 +42,9 @@ export function DispatchChecklistSection({
/>
<Box className="flex-1">
<Typography variant="body2">{item.itemText}</Typography>
{item.isCompleted && (
{item.isCompleted && (item.completedBy || item.completedAt) && (
<Typography variant="caption" color="text.secondary">
{item.completedBy || userName}
{item.completedBy?.trim() || "Unknown"}
{item.completedAt ? ` · ${formatDateTime(item.completedAt)}` : ""}
</Typography>
)}

View file

@ -72,7 +72,6 @@ export function DispatchDetailModal({
items={dispatch.checklistItems}
isLocked={controller.isLocked}
isUpdating={controller.updateChecklistMutation.isPending}
userName={controller.userName}
newItem={controller.newChecklistItem}
onNewItemChange={controller.setNewChecklistItem}
onToggleItem={(itemId, isCompleted) =>