fix: proširi bilješke na članove tima i osvježi kalendar
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user