feat: proširi prikaz dizalice i vlasnika u zadacima
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

Dodaj detalje dizalice (proizvođač, model i SN) te vlasnika u modal radnog zadatka i kalendar zadataka, uz zajednički frontend helper za DRY prikaz.

Proširi Task API serializer dodatnim poljima za prikaz dizalice/vlasnika i ažuriraj testove serializera za nova izlazna polja.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-07-20 09:53:09 +02:00
parent 1a18498b30
commit b92596f6a6
6 changed files with 118 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'preact/hooks';
import ModalShell from '../ui/ModalShell';
import { formatWorkOrderDisplayCode } from '../../lib/displayIds';
import { getStatusLabel } from '../../stores/taskStore';
import { getTaskCraneDisplay, getTaskCraneOwner } from '../../lib/taskCraneDisplay';
const STATUS_OPTIONS = ['aktivan', 'servis', 'spreman_za_zavrsetak', 'zavrsen', 'neaktivan'];
@@ -211,9 +212,13 @@ export default function TaskServiceRecordsModal({
<dt className="text-xs text-text-muted">Dodijeljeno</dt>
<dd className="text-text-main">{task.assigned_to_name || '-'}</dd>
</div>
<div>
<dt className="text-xs text-text-muted">Vlasnik</dt>
<dd className="text-text-main">{getTaskCraneOwner(task)}</dd>
</div>
<div>
<dt className="text-xs text-text-muted">Dizalica</dt>
<dd className="text-text-main">{task.vehicle_registration || '-'}</dd>
<dd className="text-text-main">{getTaskCraneDisplay(task)}</dd>
</div>
<div>
<dt className="text-xs text-text-muted">Putni nalog</dt>
@@ -255,6 +260,26 @@ export default function TaskServiceRecordsModal({
className="resize-none rounded-lg border border-border-hairline bg-canvas-elevated px-3 py-2 text-text-main disabled:opacity-60"
/>
</label>
<div className="grid gap-3 sm:grid-cols-2">
<label className="flex flex-col gap-1 text-sm">
<span className="text-xs text-text-muted">Vlasnik</span>
<input
type="text"
value={getTaskCraneOwner(task)}
disabled
className="rounded-lg border border-border-hairline bg-canvas-deep px-3 py-2 text-text-main disabled:opacity-80"
/>
</label>
<label className="flex flex-col gap-1 text-sm">
<span className="text-xs text-text-muted">Dizalica</span>
<input
type="text"
value={getTaskCraneDisplay(task)}
disabled
className="rounded-lg border border-border-hairline bg-canvas-deep px-3 py-2 text-text-main disabled:opacity-80"
/>
</label>
</div>
<label className="flex flex-col gap-1 text-sm">
<span className="text-xs text-text-muted">Status</span>
<select