fix: proširi bilješke na članove tima i osvježi kalendar
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

Widget Bilješke sada omogućuje odabir više članova tima (ne samo
servisera), a backend validacija i testovi su usklađeni.

Dodatno, nakon realtime service_note notifikacije sada se osvježava
service-notes store, te create flow više ne briše lokalne bilješke kada
odgovor vrati praznu listu.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-08-01 09:48:44 +02:00
parent 52f54e3a75
commit e7641e7be0
6 changed files with 59 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ export default function ServiceNotesWidget({
canManageRecipients = false,
activeTasks = [],
activeWorkOrders = [],
servicers = [],
teamMembers = [],
onCreate,
onClose,
}) {
@@ -156,7 +156,7 @@ export default function ServiceNotesWidget({
className="w-full rounded-md border border-border-hairline bg-canvas-base px-2 py-1.5 text-xs text-text-main"
>
<option value="self">Notifikacija samo meni</option>
{canManageRecipients && <option value="member">Notifikacija serviserima</option>}
{canManageRecipients && <option value="member">Notifikacija odabranim članovima tima</option>}
{canManageRecipients && <option value="team">Notifikacija svim članovima tima</option>}
</select>
{canManageRecipients && audience === 'member' && (
@@ -167,10 +167,10 @@ export default function ServiceNotesWidget({
const selected = Array.from(event.currentTarget.selectedOptions).map((option) => option.value);
setTargetUsers(selected);
}}
size={Math.min(6, Math.max(3, servicers.length || 3))}
size={Math.min(6, Math.max(3, teamMembers.length || 3))}
className="w-full rounded-md border border-border-hairline bg-canvas-base px-2 py-1.5 text-xs text-text-main"
>
{servicers.map((member) => (
{teamMembers.map((member) => (
<option key={member.id} value={member.id}>
{member.full_name || member.email}
</option>
@@ -179,7 +179,7 @@ export default function ServiceNotesWidget({
)}
{canManageRecipients && audience === 'member' && (
<p className="text-[10px] text-text-muted">
Držite Ctrl (ili Cmd) za odabir više servisera.
Držite Ctrl (ili Cmd) za odabir više članova tima.
</p>
)}
<button