@nivaro/react 0.3.65 → 0.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +2432 -2592
- package/dist/shared/components/ItemEditForm.js +3912 -3773
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +559 -542
- package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +73 -47
- package/dist/shared/components/item-edit/picker-search.js +25 -21
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +1007 -979
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/obligation-reason-text.js +1 -1
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ClipboardList as
|
|
4
|
-
import { useState as C, useRef as
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as Fe } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as De, useQuery as T, useMutation as K } from "@tanstack/react-query";
|
|
3
|
+
import { ClipboardList as Ee, ChevronDown as ce, X as ee, Plus as Ie, Bot as Le, Users as We, History as je, Pencil as Oe, RotateCcw as Ke, ChevronsUpDown as xe, Check as Ue } from "lucide-react";
|
|
4
|
+
import { useState as C, useRef as Re, useEffect as te, useMemo as Me } from "react";
|
|
5
5
|
import { toast as w } from "sonner";
|
|
6
|
-
import { useNivaroClient as j, useItemEditAuth as
|
|
7
|
-
import { get as A, post as Y, patch as
|
|
8
|
-
import { OPEN_TASK_STATUSES as me, invalidateRecordTasks as
|
|
9
|
-
import { formatDate as Z, cn as U, formatRelative as fe } from "../../lib/utils.js";
|
|
10
|
-
import { TaskDoButton as
|
|
6
|
+
import { useNivaroClient as j, useItemEditAuth as He } from "../../context.js";
|
|
7
|
+
import { get as A, post as Y, patch as Be, del as Ve } from "../../lib/commands.js";
|
|
8
|
+
import { OPEN_TASK_STATUSES as me, invalidateRecordTasks as ze } from "../../lib/record-tasks.js";
|
|
9
|
+
import { formatDate as Z, cn as U, formatRelative as fe, formatDateTime as be } from "../../lib/utils.js";
|
|
10
|
+
import { TaskDoButton as Ge } from "../ai/TaskDo.js";
|
|
11
11
|
import { Button as z } from "../ui/button.js";
|
|
12
12
|
import { Checkbox as ue } from "../ui/checkbox.js";
|
|
13
|
-
import { Command as
|
|
13
|
+
import { Command as ke, CommandInput as ye, CommandList as Ne, CommandEmpty as ve, CommandGroup as ae, CommandItem as _e } from "../ui/command.js";
|
|
14
14
|
import { Input as ne } from "../ui/input.js";
|
|
15
15
|
import { Label as W } from "../ui/label.js";
|
|
16
|
-
import { Popover as
|
|
16
|
+
import { Popover as we, PopoverTrigger as Ce, PopoverContent as Se } from "../ui/popover.js";
|
|
17
17
|
import { SimpleSelect as J } from "../ui/SimpleSelect.js";
|
|
18
|
-
import { Textarea as
|
|
19
|
-
const
|
|
18
|
+
import { Textarea as Je } from "../ui/textarea.js";
|
|
19
|
+
const Xe = "id,first_name,last_name,email,is_out_of_office,ooo_end,delegate_id";
|
|
20
20
|
function G(a) {
|
|
21
21
|
return a && ([a.first_name, a.last_name].filter(Boolean).join(" ") || a.email) || "Unknown";
|
|
22
22
|
}
|
|
23
23
|
const q = (a, o) => a != null && o != null && String(a).toUpperCase() === String(o).toUpperCase();
|
|
24
|
-
function
|
|
24
|
+
function Pe(a) {
|
|
25
25
|
if (!a) return [];
|
|
26
26
|
try {
|
|
27
27
|
const o = JSON.parse(a);
|
|
@@ -30,7 +30,7 @@ function Se(a) {
|
|
|
30
30
|
return [];
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Qe(a, o) {
|
|
34
34
|
return a.map((d) => {
|
|
35
35
|
const c = o.get(d.field) ?? d.field.replace(/_/g, " ");
|
|
36
36
|
return d.op === "nnull" ? `${c} is filled in` : d.op === "eq" ? `${c} is ${String(d.value ?? "")}` : d.op === "null" ? `${c} is empty` : `${c} ${d.op} ${String(d.value ?? "")}`.trim();
|
|
@@ -45,7 +45,7 @@ function pe({ priority: a }) {
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Ye({
|
|
49
49
|
collection: a,
|
|
50
50
|
item: o,
|
|
51
51
|
value: d,
|
|
@@ -68,7 +68,7 @@ function Qe({
|
|
|
68
68
|
A("/users", {
|
|
69
69
|
limit: 25,
|
|
70
70
|
people: 1,
|
|
71
|
-
fields:
|
|
71
|
+
fields: Xe,
|
|
72
72
|
...f ? { search: f } : {}
|
|
73
73
|
})
|
|
74
74
|
).then((s) => s.data).catch(() => []),
|
|
@@ -90,7 +90,7 @@ function Qe({
|
|
|
90
90
|
}), H = (s, S) => {
|
|
91
91
|
const E = (L == null ? void 0 : L[String(s.id).toUpperCase()]) ?? 0;
|
|
92
92
|
return /* @__PURE__ */ n(
|
|
93
|
-
|
|
93
|
+
_e,
|
|
94
94
|
{
|
|
95
95
|
value: s.id,
|
|
96
96
|
onSelect: () => {
|
|
@@ -100,7 +100,7 @@ function Qe({
|
|
|
100
100
|
"data-task-person": s.id,
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ t(
|
|
103
|
-
|
|
103
|
+
Ue,
|
|
104
104
|
{
|
|
105
105
|
className: U("mr-2 h-3.5 w-3.5", q(d, s.id) ? "opacity-100" : "opacity-0")
|
|
106
106
|
}
|
|
@@ -123,8 +123,8 @@ function Qe({
|
|
|
123
123
|
s.id
|
|
124
124
|
);
|
|
125
125
|
};
|
|
126
|
-
return /* @__PURE__ */ n(
|
|
127
|
-
/* @__PURE__ */ t(
|
|
126
|
+
return /* @__PURE__ */ n(we, { open: x, onOpenChange: m, children: [
|
|
127
|
+
/* @__PURE__ */ t(Ce, { asChild: !0, children: /* @__PURE__ */ n(
|
|
128
128
|
z,
|
|
129
129
|
{
|
|
130
130
|
variant: "outline",
|
|
@@ -138,9 +138,9 @@ function Qe({
|
|
|
138
138
|
]
|
|
139
139
|
}
|
|
140
140
|
) }),
|
|
141
|
-
/* @__PURE__ */ t(
|
|
141
|
+
/* @__PURE__ */ t(Se, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ n(ke, { shouldFilter: !1, value: R, onValueChange: M, children: [
|
|
142
142
|
/* @__PURE__ */ t(
|
|
143
|
-
|
|
143
|
+
ye,
|
|
144
144
|
{
|
|
145
145
|
placeholder: "Search people…",
|
|
146
146
|
className: "h-8 text-[12px]",
|
|
@@ -148,15 +148,15 @@ function Qe({
|
|
|
148
148
|
onValueChange: r
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
/* @__PURE__ */ n(
|
|
152
|
-
/* @__PURE__ */ t(
|
|
151
|
+
/* @__PURE__ */ n(Ne, { children: [
|
|
152
|
+
/* @__PURE__ */ t(ve, { className: "py-3 text-center text-[12px] text-muted-foreground", children: D.isFetching ? "Searching…" : "No one matches" }),
|
|
153
153
|
l.length > 0 && /* @__PURE__ */ t(ae, { heading: "On this record", children: l.map((s) => H(s, s.reasons)) }),
|
|
154
154
|
g.length > 0 && /* @__PURE__ */ t(ae, { heading: f ? "Everyone" : "Everyone (type to search)", children: g.map((s) => H(s)) })
|
|
155
155
|
] })
|
|
156
156
|
] }) })
|
|
157
157
|
] });
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ze(a) {
|
|
160
160
|
const o = j();
|
|
161
161
|
return T({
|
|
162
162
|
queryKey: ["task-agents"],
|
|
@@ -165,7 +165,7 @@ function Ye(a) {
|
|
|
165
165
|
staleTime: 5 * 6e4
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function et({
|
|
169
169
|
agents: a,
|
|
170
170
|
value: o,
|
|
171
171
|
onChange: d
|
|
@@ -186,7 +186,7 @@ function Ze({
|
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function tt({
|
|
190
190
|
value: a,
|
|
191
191
|
onChange: o
|
|
192
192
|
}) {
|
|
@@ -214,30 +214,30 @@ function et({
|
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function $e(a) {
|
|
218
218
|
const o = j(), { data: d } = T({
|
|
219
219
|
queryKey: ["task-field-labels", a],
|
|
220
220
|
queryFn: () => o.request(A(`/collections/${a}`)).then((u) => u.data.fields ?? []).catch(() => []),
|
|
221
221
|
staleTime: 10 * 6e4
|
|
222
222
|
}), c = (d ?? []).filter(
|
|
223
223
|
(u) => !u.hidden && u.field !== "id" && u.type !== "alias" && !u.field.startsWith("__")
|
|
224
|
-
), i =
|
|
224
|
+
), i = Me(
|
|
225
225
|
() => new Map(c.map((u) => [u.field, u.label || u.field.replace(/_/g, " ")])),
|
|
226
226
|
[c]
|
|
227
227
|
);
|
|
228
228
|
return { fields: c, labels: i };
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function at({
|
|
231
231
|
collection: a,
|
|
232
232
|
value: o,
|
|
233
233
|
onChange: d
|
|
234
234
|
}) {
|
|
235
|
-
const { fields: c, labels: i } =
|
|
235
|
+
const { fields: c, labels: i } = $e(a), [u, x] = C(!1), m = o[0] ?? null;
|
|
236
236
|
return /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-task-done-when": !0, children: [
|
|
237
237
|
/* @__PURE__ */ t(W, { className: "block text-[11px]", children: "Close automatically when (optional)" }),
|
|
238
238
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
239
|
-
/* @__PURE__ */ n(
|
|
240
|
-
/* @__PURE__ */ t(
|
|
239
|
+
/* @__PURE__ */ n(we, { open: u, onOpenChange: x, children: [
|
|
240
|
+
/* @__PURE__ */ t(Ce, { asChild: !0, children: /* @__PURE__ */ n(
|
|
241
241
|
z,
|
|
242
242
|
{
|
|
243
243
|
variant: "outline",
|
|
@@ -248,12 +248,12 @@ function tt({
|
|
|
248
248
|
]
|
|
249
249
|
}
|
|
250
250
|
) }),
|
|
251
|
-
/* @__PURE__ */ t(
|
|
252
|
-
/* @__PURE__ */ t(
|
|
253
|
-
/* @__PURE__ */ n(
|
|
254
|
-
/* @__PURE__ */ t(
|
|
251
|
+
/* @__PURE__ */ t(Se, { className: "w-[260px] p-0", align: "start", children: /* @__PURE__ */ n(ke, { children: [
|
|
252
|
+
/* @__PURE__ */ t(ye, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
|
|
253
|
+
/* @__PURE__ */ n(Ne, { children: [
|
|
254
|
+
/* @__PURE__ */ t(ve, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field" }),
|
|
255
255
|
/* @__PURE__ */ t(ae, { children: c.map((h) => /* @__PURE__ */ t(
|
|
256
|
-
|
|
256
|
+
_e,
|
|
257
257
|
{
|
|
258
258
|
value: `${i.get(h.field)} ${h.field}`,
|
|
259
259
|
onSelect: () => {
|
|
@@ -269,7 +269,7 @@ function tt({
|
|
|
269
269
|
] })
|
|
270
270
|
] }) })
|
|
271
271
|
] }),
|
|
272
|
-
m && /* @__PURE__ */ n(
|
|
272
|
+
m && /* @__PURE__ */ n(Fe, { children: [
|
|
273
273
|
/* @__PURE__ */ t("div", { className: "w-[130px]", children: /* @__PURE__ */ t(
|
|
274
274
|
J,
|
|
275
275
|
{
|
|
@@ -304,7 +304,7 @@ function tt({
|
|
|
304
304
|
] })
|
|
305
305
|
] });
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const nt = () => ({
|
|
308
308
|
title: "",
|
|
309
309
|
description: "",
|
|
310
310
|
mode: "person",
|
|
@@ -319,7 +319,7 @@ const at = () => ({
|
|
|
319
319
|
priority: "normal",
|
|
320
320
|
doneWhen: []
|
|
321
321
|
});
|
|
322
|
-
function
|
|
322
|
+
function st(a) {
|
|
323
323
|
return {
|
|
324
324
|
title: a.title,
|
|
325
325
|
description: a.description ?? "",
|
|
@@ -333,7 +333,7 @@ function nt(a) {
|
|
|
333
333
|
teamName: a.team_name ?? null,
|
|
334
334
|
due: a.due_date ? String(a.due_date).slice(0, 10) : "",
|
|
335
335
|
priority: a.priority ?? "normal",
|
|
336
|
-
doneWhen:
|
|
336
|
+
doneWhen: Pe(a.done_when)
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
function he({
|
|
@@ -348,7 +348,7 @@ function he({
|
|
|
348
348
|
onCancel: h
|
|
349
349
|
}) {
|
|
350
350
|
var P;
|
|
351
|
-
const [r, f] = C(d), b = (l, g) => f((k) => ({ ...k, [l]: g })), F =
|
|
351
|
+
const [r, f] = C(d), b = (l, g) => f((k) => ({ ...k, [l]: g })), F = Ze(x).data ?? [], D = x && (F.length > 0 || r.mode === "agent"), N = r.mode === "team" ? r.teamId != null : r.mode === "agent" ? !!r.agent : !!r.assignee, _ = r.mode === "person" && ((P = r.assigneePerson) != null && P.is_out_of_office) ? r.assigneePerson : null;
|
|
352
352
|
return /* @__PURE__ */ n(
|
|
353
353
|
"div",
|
|
354
354
|
{
|
|
@@ -372,7 +372,7 @@ function he({
|
|
|
372
372
|
/* @__PURE__ */ n("div", { children: [
|
|
373
373
|
/* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Details (optional)" }),
|
|
374
374
|
/* @__PURE__ */ t(
|
|
375
|
-
|
|
375
|
+
Je,
|
|
376
376
|
{
|
|
377
377
|
value: r.description,
|
|
378
378
|
onChange: (l) => b("description", l.target.value),
|
|
@@ -405,20 +405,20 @@ function he({
|
|
|
405
405
|
)) })
|
|
406
406
|
] }),
|
|
407
407
|
r.mode === "agent" ? /* @__PURE__ */ t(
|
|
408
|
-
|
|
408
|
+
et,
|
|
409
409
|
{
|
|
410
410
|
agents: F,
|
|
411
411
|
value: r.agent,
|
|
412
412
|
onChange: (l) => f((g) => ({ ...g, agent: (l == null ? void 0 : l.conn) ?? null, agentName: (l == null ? void 0 : l.name) ?? null }))
|
|
413
413
|
}
|
|
414
414
|
) : r.mode === "team" ? /* @__PURE__ */ t(
|
|
415
|
-
|
|
415
|
+
tt,
|
|
416
416
|
{
|
|
417
417
|
value: r.teamId,
|
|
418
418
|
onChange: (l, g) => f((k) => ({ ...k, teamId: l, teamName: (g == null ? void 0 : g.name) ?? null }))
|
|
419
419
|
}
|
|
420
420
|
) : /* @__PURE__ */ t(
|
|
421
|
-
|
|
421
|
+
Ye,
|
|
422
422
|
{
|
|
423
423
|
collection: a,
|
|
424
424
|
item: o,
|
|
@@ -471,7 +471,7 @@ function he({
|
|
|
471
471
|
] })
|
|
472
472
|
] }),
|
|
473
473
|
/* @__PURE__ */ t(
|
|
474
|
-
|
|
474
|
+
at,
|
|
475
475
|
{
|
|
476
476
|
collection: a,
|
|
477
477
|
value: r.doneWhen,
|
|
@@ -543,13 +543,13 @@ function ge({ taskId: a }) {
|
|
|
543
543
|
" ",
|
|
544
544
|
"· ",
|
|
545
545
|
i.user_name ? `${i.user_name}, ` : "",
|
|
546
|
-
/* @__PURE__ */ t("span", { title:
|
|
546
|
+
/* @__PURE__ */ t("span", { title: be(i.at), children: fe(i.at) })
|
|
547
547
|
] })
|
|
548
548
|
] }, i.id))
|
|
549
549
|
}
|
|
550
550
|
) : /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "No history yet." });
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function _t({
|
|
553
553
|
collection: a,
|
|
554
554
|
item: o,
|
|
555
555
|
title: d,
|
|
@@ -558,7 +558,7 @@ function vt({
|
|
|
558
558
|
onQueueTask: u,
|
|
559
559
|
onRemoveQueuedTask: x
|
|
560
560
|
}) {
|
|
561
|
-
const m = j(), h =
|
|
561
|
+
const m = j(), h = De(), { isAdmin: r, userId: f } = He(), [b, F] = C(!1), D = Re(!1);
|
|
562
562
|
te(() => {
|
|
563
563
|
!D.current && c !== void 0 && (D.current = !0, F(c));
|
|
564
564
|
}, [c]);
|
|
@@ -566,8 +566,8 @@ function vt({
|
|
|
566
566
|
queryKey: ["tasks", a, o],
|
|
567
567
|
queryFn: () => m.request(A("/tasks", { collection: a, item: o })).then((e) => e.data),
|
|
568
568
|
enabled: !!a && !y
|
|
569
|
-
}), { labels: H } =
|
|
570
|
-
|
|
569
|
+
}), { labels: H } = $e(a), s = () => {
|
|
570
|
+
ze(h, a, o), h.invalidateQueries({ queryKey: ["task-history"] });
|
|
571
571
|
}, S = (e, p) => {
|
|
572
572
|
var I;
|
|
573
573
|
return ((I = e == null ? void 0 : e.response) == null ? void 0 : I.error) ?? (e instanceof Error && e.message ? e.message : p);
|
|
@@ -592,7 +592,7 @@ function vt({
|
|
|
592
592
|
},
|
|
593
593
|
onError: (e) => w.error(S(e, "Could not create the task"))
|
|
594
594
|
}), B = K({
|
|
595
|
-
mutationFn: ({ id: e, body: p }) => m.request(
|
|
595
|
+
mutationFn: ({ id: e, body: p }) => m.request(Be(`/tasks/${e}`, p)),
|
|
596
596
|
onSuccess: (e, p) => {
|
|
597
597
|
s(), l(null), p.body.status === "open" ? w.success("Task reopened") : w.success("Task updated");
|
|
598
598
|
},
|
|
@@ -610,15 +610,15 @@ function vt({
|
|
|
610
610
|
},
|
|
611
611
|
onError: (e) => w.error(S(e, "Could not pick it up"))
|
|
612
612
|
}), re = K({
|
|
613
|
-
mutationFn: (e) => m.request(
|
|
613
|
+
mutationFn: (e) => m.request(Ve(`/tasks/${e}`)),
|
|
614
614
|
onSuccess: () => {
|
|
615
615
|
s(), w.success("Task deleted");
|
|
616
616
|
},
|
|
617
617
|
onError: (e) => w.error(S(e, "Could not delete the task"))
|
|
618
618
|
});
|
|
619
619
|
if (!a) return null;
|
|
620
|
-
const v = L.filter((e) => me.has(e.status)), X = L.filter((e) => !me.has(e.status)),
|
|
621
|
-
function
|
|
620
|
+
const v = L.filter((e) => me.has(e.status)), X = L.filter((e) => !me.has(e.status)), qe = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), Q = (e) => r || q(e.assignee, f) || q(e.created_by, f), Te = (e) => r || q(e.created_by, f);
|
|
621
|
+
function Ae(e) {
|
|
622
622
|
u == null || u({
|
|
623
623
|
title: e.title.trim(),
|
|
624
624
|
description: e.description.trim() || void 0,
|
|
@@ -631,7 +631,7 @@ function vt({
|
|
|
631
631
|
}), _(!1);
|
|
632
632
|
}
|
|
633
633
|
const oe = (e, p) => {
|
|
634
|
-
const I = !p && !!e.due_date && String(e.due_date).slice(0, 10) <
|
|
634
|
+
const I = !p && !!e.due_date && String(e.due_date).slice(0, 10) < qe;
|
|
635
635
|
return /* @__PURE__ */ n("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-slate-400", children: [
|
|
636
636
|
/* @__PURE__ */ t(pe, { priority: e.priority }),
|
|
637
637
|
e.agent_assignee ? /* @__PURE__ */ n(
|
|
@@ -640,7 +640,7 @@ function vt({
|
|
|
640
640
|
className: "inline-flex items-center gap-1 text-[#0e7490] dark:text-[#67e8f9]",
|
|
641
641
|
"data-task-agent": e.agent_assignee,
|
|
642
642
|
children: [
|
|
643
|
-
/* @__PURE__ */ t(
|
|
643
|
+
/* @__PURE__ */ t(Le, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
644
644
|
e.agent_name ?? "An agent",
|
|
645
645
|
e.assignee_name && /* @__PURE__ */ n("span", { className: "text-slate-400", children: [
|
|
646
646
|
"for ",
|
|
@@ -649,7 +649,7 @@ function vt({
|
|
|
649
649
|
]
|
|
650
650
|
}
|
|
651
651
|
) : e.assignee ? /* @__PURE__ */ t("span", { children: e.assignee_name ?? "Someone" }) : e.team_id != null ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
652
|
-
/* @__PURE__ */ t(
|
|
652
|
+
/* @__PURE__ */ t(We, { className: "h-3 w-3" }),
|
|
653
653
|
"Waiting for ",
|
|
654
654
|
e.team_name ?? "the team"
|
|
655
655
|
] }) : null,
|
|
@@ -661,7 +661,7 @@ function vt({
|
|
|
661
661
|
p && e.completed_at && /* @__PURE__ */ n("span", { "data-task-completed-by": !0, children: [
|
|
662
662
|
e.status === "cancelled" ? "Cancelled" : `Done${e.completed_by_name ? ` by ${e.completed_by_name}` : ""}`,
|
|
663
663
|
" ",
|
|
664
|
-
/* @__PURE__ */ t("span", { title:
|
|
664
|
+
/* @__PURE__ */ t("span", { title: be(e.completed_at), children: fe(e.completed_at) })
|
|
665
665
|
] }),
|
|
666
666
|
e.created_by_name && !q(e.created_by, e.assignee) && /* @__PURE__ */ n("span", { children: [
|
|
667
667
|
"Asked by ",
|
|
@@ -669,7 +669,7 @@ function vt({
|
|
|
669
669
|
] })
|
|
670
670
|
] });
|
|
671
671
|
}, de = (e, p) => /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
672
|
-
!p && /* @__PURE__ */ t(
|
|
672
|
+
!p && /* @__PURE__ */ t(Ge, { task: e, compact: !0, onTaskChanged: s }),
|
|
673
673
|
/* @__PURE__ */ t(
|
|
674
674
|
"button",
|
|
675
675
|
{
|
|
@@ -679,7 +679,7 @@ function vt({
|
|
|
679
679
|
"aria-label": `History of ${e.title}`,
|
|
680
680
|
title: "History",
|
|
681
681
|
"data-task-history-toggle": e.id,
|
|
682
|
-
children: /* @__PURE__ */ t(
|
|
682
|
+
children: /* @__PURE__ */ t(je, { className: "h-3.5 w-3.5" })
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
685
|
!p && Q(e) && /* @__PURE__ */ t(
|
|
@@ -691,7 +691,7 @@ function vt({
|
|
|
691
691
|
"aria-label": `Edit ${e.title}`,
|
|
692
692
|
title: "Edit",
|
|
693
693
|
"data-task-edit": e.id,
|
|
694
|
-
children: /* @__PURE__ */ t(
|
|
694
|
+
children: /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" })
|
|
695
695
|
}
|
|
696
696
|
),
|
|
697
697
|
p && Q(e) && /* @__PURE__ */ n(
|
|
@@ -703,12 +703,12 @@ function vt({
|
|
|
703
703
|
className: "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:hover:text-slate-200",
|
|
704
704
|
"data-task-reopen": e.id,
|
|
705
705
|
children: [
|
|
706
|
-
/* @__PURE__ */ t(
|
|
706
|
+
/* @__PURE__ */ t(Ke, { className: "h-3 w-3" }),
|
|
707
707
|
"Reopen"
|
|
708
708
|
]
|
|
709
709
|
}
|
|
710
710
|
),
|
|
711
|
-
|
|
711
|
+
Te(e) && /* @__PURE__ */ t(
|
|
712
712
|
"button",
|
|
713
713
|
{
|
|
714
714
|
type: "button",
|
|
@@ -732,7 +732,7 @@ function vt({
|
|
|
732
732
|
className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
733
733
|
children: [
|
|
734
734
|
/* @__PURE__ */ n("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
735
|
-
/* @__PURE__ */ t(
|
|
735
|
+
/* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
736
736
|
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Tasks" }),
|
|
737
737
|
(y ? (i ?? []).length : v.length) > 0 && /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: y ? `${(i ?? []).length} queued` : `${v.length} open` }),
|
|
738
738
|
/* @__PURE__ */ t(
|
|
@@ -788,7 +788,7 @@ function vt({
|
|
|
788
788
|
y && (i ?? []).length === 0 && !N && /* @__PURE__ */ t("p", { className: "py-1 text-[12px] text-slate-400", children: "Tasks are created once the record is saved." }),
|
|
789
789
|
!y && v.length === 0 && !N && /* @__PURE__ */ t("p", { className: "py-1 text-[13px] text-slate-400", children: "No open tasks" }),
|
|
790
790
|
!y && v.length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: v.map((e) => {
|
|
791
|
-
const p =
|
|
791
|
+
const p = Pe(e.done_when), I = !e.assignee && e.team_id != null;
|
|
792
792
|
return /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
|
|
793
793
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2.5", children: [
|
|
794
794
|
/* @__PURE__ */ t(
|
|
@@ -807,7 +807,7 @@ function vt({
|
|
|
807
807
|
oe(e, !1),
|
|
808
808
|
p.length > 0 && /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11px] text-slate-500", "data-task-rule": !0, children: [
|
|
809
809
|
"Closes itself when ",
|
|
810
|
-
|
|
810
|
+
Qe(p, H)
|
|
811
811
|
] }),
|
|
812
812
|
I && /* @__PURE__ */ t(
|
|
813
813
|
"button",
|
|
@@ -828,7 +828,7 @@ function vt({
|
|
|
828
828
|
{
|
|
829
829
|
collection: a,
|
|
830
830
|
item: o,
|
|
831
|
-
initial:
|
|
831
|
+
initial: st(e),
|
|
832
832
|
submitLabel: "Save changes",
|
|
833
833
|
busy: B.isPending,
|
|
834
834
|
allowTeam: !1,
|
|
@@ -857,7 +857,7 @@ function vt({
|
|
|
857
857
|
className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
858
858
|
"data-task-add": !0,
|
|
859
859
|
children: [
|
|
860
|
-
/* @__PURE__ */ t(
|
|
860
|
+
/* @__PURE__ */ t(Ie, { className: "h-3.5 w-3.5" }),
|
|
861
861
|
"Add task"
|
|
862
862
|
]
|
|
863
863
|
}
|
|
@@ -867,13 +867,13 @@ function vt({
|
|
|
867
867
|
{
|
|
868
868
|
collection: a,
|
|
869
869
|
item: o,
|
|
870
|
-
initial:
|
|
870
|
+
initial: nt(),
|
|
871
871
|
submitLabel: y ? "Queue task" : "Create task",
|
|
872
872
|
busy: se.isPending,
|
|
873
873
|
allowTeam: !0,
|
|
874
874
|
allowAgent: !y,
|
|
875
875
|
onCancel: () => _(!1),
|
|
876
|
-
onSubmit: (e) => y ?
|
|
876
|
+
onSubmit: (e) => y ? Ae(e) : se.mutate(e)
|
|
877
877
|
}
|
|
878
878
|
),
|
|
879
879
|
!y && X.length > 0 && /* @__PURE__ */ n("div", { children: [
|
|
@@ -923,5 +923,5 @@ function vt({
|
|
|
923
923
|
] });
|
|
924
924
|
}
|
|
925
925
|
export {
|
|
926
|
-
|
|
926
|
+
_t as TaskPanel
|
|
927
927
|
};
|