@nivaro/react 0.3.52 → 0.3.54
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 +47 -3
- package/dist/shared/components/ItemEditForm.js +4196 -4163
- package/dist/shared/components/NotificationBell.js +163 -150
- package/dist/shared/components/PageRenderer.js +645 -593
- package/dist/shared/components/ProfileView.js +36 -34
- package/dist/shared/components/QueryStatStrip.js +96 -89
- package/dist/shared/components/QueryTable.js +214 -215
- package/dist/shared/components/ReportView.js +548 -529
- package/dist/shared/components/alerts/AlertManagerView.js +346 -320
- package/dist/shared/components/item-edit/CatalogPickerField.js +1300 -1219
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +52 -54
- package/dist/shared/components/item-edit/FieldAffordances.js +145 -136
- package/dist/shared/components/item-edit/FieldRenderer.js +366 -326
- package/dist/shared/components/item-edit/InlineTableField.js +3047 -2932
- package/dist/shared/components/item-edit/NestedRelationEditor.js +149 -143
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +12 -11
- package/dist/shared/components/item-edit/PlanGrid.js +718 -705
- package/dist/shared/components/item-edit/RelationCombobox.js +23 -20
- package/dist/shared/components/item-edit/SummaryPanel.js +415 -361
- package/dist/shared/components/item-edit/line-qty.js +115 -53
- package/dist/shared/components/item-edit/save-outcome.js +48 -0
- package/dist/shared/components/item-edit/save-refusal.js +18 -18
- package/dist/shared/components/item-edit/stale-banner.js +13 -0
- package/dist/shared/components/item-edit/usePersonalDefaults.js +225 -220
- package/dist/shared/components/panels/CommentPanel.js +204 -197
- package/dist/shared/components/panels/ItemLockBanner.js +318 -291
- package/dist/shared/components/panels/PipelinePanel.js +1388 -1218
- package/dist/shared/components/panels/RecordIntegrityBanner.js +201 -172
- package/dist/shared/components/panels/RevisionsPanel.js +101 -106
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +564 -534
- package/dist/shared/components/panels/requirement-side-effects.js +46 -29
- package/dist/shared/components/queue/QueueItemSheet.js +219 -146
- package/dist/shared/components/queue/QueueWorklist.js +738 -730
- package/dist/shared/components/widgets/ReviewListWidget.js +236 -201
- package/dist/shared/lib/activity-sentence.js +236 -227
- package/dist/shared/lib/draft-store.js +35 -29
- package/dist/shared/lib/page-widget-access.js +11 -0
- package/dist/shared/lib/record-ref.js +43 -34
- package/package.json +1 -1
|
@@ -1,40 +1,57 @@
|
|
|
1
|
-
const o = (
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
if (o(
|
|
5
|
-
if (typeof
|
|
6
|
-
const
|
|
7
|
-
return !Number.isNaN(
|
|
1
|
+
const o = (e) => e == null || e === "";
|
|
2
|
+
function u(e, t) {
|
|
3
|
+
if (e === t || o(e) && o(t)) return !0;
|
|
4
|
+
if (o(e) || o(t)) return !1;
|
|
5
|
+
if (typeof e != "object" && typeof t != "object") {
|
|
6
|
+
const i = Number(e), r = Number(t);
|
|
7
|
+
return !Number.isNaN(i) && !Number.isNaN(r) ? i === r : String(e) === String(t);
|
|
8
8
|
}
|
|
9
|
-
return JSON.stringify(
|
|
9
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const d = /* @__PURE__ */ new Set([
|
|
12
|
+
"changed",
|
|
13
|
+
"created",
|
|
14
|
+
"modified",
|
|
15
|
+
"date_created",
|
|
16
|
+
"date_updated",
|
|
17
|
+
"date_modified",
|
|
18
|
+
"created_at",
|
|
19
|
+
"updated_at",
|
|
20
|
+
"modified_at",
|
|
21
|
+
"user_created",
|
|
22
|
+
"user_updated",
|
|
23
|
+
"created_by",
|
|
24
|
+
"updated_by",
|
|
25
|
+
"modified_by"
|
|
26
|
+
]);
|
|
27
|
+
function s(e, t, i) {
|
|
28
|
+
if (!e || e.ok === !1 || !Array.isArray(e.changes)) return [];
|
|
13
29
|
const r = [];
|
|
14
|
-
for (const
|
|
15
|
-
!
|
|
30
|
+
for (const n of e.changes)
|
|
31
|
+
!n || typeof n.field != "string" || n.field in t || n.field.startsWith("_") || d.has(n.field.toLowerCase()) || i && !i(n.field) || o(n.from) || u(n.from, n.to) || r.push({ field: n.field, from: n.from, to: n.to });
|
|
16
32
|
return r;
|
|
17
33
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
for (const
|
|
21
|
-
return
|
|
34
|
+
function l(e) {
|
|
35
|
+
const t = {};
|
|
36
|
+
for (const i of e) t[i.field] = i.from;
|
|
37
|
+
return t;
|
|
22
38
|
}
|
|
23
|
-
const
|
|
24
|
-
async function m(
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
for (;
|
|
29
|
-
const
|
|
30
|
-
|
|
39
|
+
const a = 5;
|
|
40
|
+
async function m(e, t = a) {
|
|
41
|
+
const i = new Array(e.length);
|
|
42
|
+
let r = 0;
|
|
43
|
+
const n = async () => {
|
|
44
|
+
for (; r < e.length; ) {
|
|
45
|
+
const f = r++;
|
|
46
|
+
i[f] = await e[f]();
|
|
31
47
|
}
|
|
32
|
-
},
|
|
33
|
-
return await Promise.all(Array.from({ length:
|
|
48
|
+
}, c = Math.max(1, Math.min(t, e.length));
|
|
49
|
+
return await Promise.all(Array.from({ length: c }, n)), i;
|
|
34
50
|
}
|
|
35
51
|
export {
|
|
36
|
-
|
|
37
|
-
a as
|
|
38
|
-
l as
|
|
52
|
+
d as AUDIT_FIELDS,
|
|
53
|
+
a as ROW_WRITE_CONCURRENCY,
|
|
54
|
+
l as keepValuesPatch,
|
|
55
|
+
s as overwrittenBySideEffect,
|
|
39
56
|
m as runPooled
|
|
40
57
|
};
|
|
@@ -1,195 +1,263 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ExternalLink as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { formatMultiValue as
|
|
9
|
-
import { useLiveRecord as
|
|
10
|
-
import { userErrorMessage as
|
|
11
|
-
import { cn as
|
|
12
|
-
import { transitionRequirementsFromError as
|
|
13
|
-
import { TransitionRequirementsDialog as
|
|
14
|
-
import { Badge as
|
|
15
|
-
import { Sheet as
|
|
16
|
-
import { OwnerAvatars as
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as n, jsx as r, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as te, useQuery as Q, useMutation as $ } from "@tanstack/react-query";
|
|
3
|
+
import { ExternalLink as re, ArrowRight as O } from "lucide-react";
|
|
4
|
+
import { useState as q, useEffect as ae } from "react";
|
|
5
|
+
import { toast as C } from "sonner";
|
|
6
|
+
import { useNivaroClient as ne, useItemNavigation as oe } from "../../context.js";
|
|
7
|
+
import { get as B, post as D } from "../../lib/commands.js";
|
|
8
|
+
import { formatMultiValue as de } from "../../lib/format-value.js";
|
|
9
|
+
import { useLiveRecord as se, batchTouches as F, LIVE_ASPECTS as H } from "../../lib/live.js";
|
|
10
|
+
import { userErrorMessage as ie } from "../../lib/safe-error.js";
|
|
11
|
+
import { cn as V, formatRelative as le, humanHours as ce } from "../../lib/utils.js";
|
|
12
|
+
import { transitionRequirementsFromError as me } from "../panels/PipelinePanel.js";
|
|
13
|
+
import { TransitionRequirementsDialog as ue } from "../panels/TransitionRequirementsDialog.js";
|
|
14
|
+
import { Badge as pe } from "../ui/badge.js";
|
|
15
|
+
import { Sheet as be, SheetContent as xe, SheetHeader as he, SheetTitle as fe } from "../ui/sheet.js";
|
|
16
|
+
import { OwnerAvatars as ge } from "./OwnerAvatars.js";
|
|
17
|
+
import { useTransitionNote as ye, needsTransitionNote as ve } from "./transition-note.js";
|
|
18
|
+
function ke(t) {
|
|
19
|
+
return (t ?? []).filter((l) => l.in_row_menu !== !1);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
21
|
+
function Ne(t) {
|
|
22
|
+
return ce(t);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
function we(t) {
|
|
25
|
+
return t.split(".").map((l) => l.replace(/_/g, " ").replace(/\b\w/g, (g) => g.toUpperCase())).join(" → ");
|
|
26
|
+
}
|
|
27
|
+
function b({ label: t, children: l }) {
|
|
28
|
+
return /* @__PURE__ */ n("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
|
|
29
|
+
/* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: t }),
|
|
30
|
+
/* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: l })
|
|
27
31
|
] });
|
|
28
32
|
}
|
|
29
|
-
function
|
|
30
|
-
item:
|
|
31
|
-
onOpenChange:
|
|
32
|
-
onClaim:
|
|
33
|
-
onRelease:
|
|
34
|
-
workNextActive:
|
|
35
|
-
onNext:
|
|
36
|
-
refetchItems:
|
|
37
|
-
stateLabels:
|
|
38
|
-
collectionLabel:
|
|
39
|
-
claimsEnabled:
|
|
40
|
-
columnFormats:
|
|
41
|
-
width:
|
|
42
|
-
itemLayout:
|
|
33
|
+
function De({
|
|
34
|
+
item: t,
|
|
35
|
+
onOpenChange: l,
|
|
36
|
+
onClaim: g,
|
|
37
|
+
onRelease: L,
|
|
38
|
+
workNextActive: U,
|
|
39
|
+
onNext: S,
|
|
40
|
+
refetchItems: I,
|
|
41
|
+
stateLabels: y,
|
|
42
|
+
collectionLabel: T,
|
|
43
|
+
claimsEnabled: W = !0,
|
|
44
|
+
columnFormats: x,
|
|
45
|
+
width: z,
|
|
46
|
+
itemLayout: G
|
|
43
47
|
}) {
|
|
44
|
-
var
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
var j;
|
|
49
|
+
const h = te(), f = ne(), { open: J } = oe(), [v, M] = q(""), [c, k] = q(null), [N, m] = q(null), P = ye(), o = t == null ? void 0 : t.collection, d = t == null ? void 0 : t.item_id;
|
|
50
|
+
ae(() => m(null), [o, d]);
|
|
51
|
+
const { data: u } = Q({
|
|
52
|
+
queryKey: ["queue-sheet-instance", o, d],
|
|
53
|
+
queryFn: () => f.request(B(`/pipelines/instance/${o}/${d}`)).then((e) => e.data),
|
|
54
|
+
enabled: !!o && !!d
|
|
55
|
+
}), { data: p } = Q({
|
|
56
|
+
queryKey: ["queue-sheet-comments", o, d],
|
|
57
|
+
queryFn: () => f.request(B("/comments", { collection: o, item: d })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
|
|
58
|
+
enabled: !!o && !!d
|
|
59
|
+
}), s = $({
|
|
60
|
+
mutationFn: ({ transitionId: e, comment: a }) => f.request(
|
|
61
|
+
D(`/pipelines/instance/${o}/${d}/transition`, {
|
|
62
|
+
transition_id: e,
|
|
63
|
+
...a ? { comment: a } : {}
|
|
57
64
|
})
|
|
58
65
|
),
|
|
59
66
|
onSuccess: () => {
|
|
60
|
-
|
|
67
|
+
k(null), m(null), h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, d] }), I(), C.success("Transitioned");
|
|
61
68
|
},
|
|
62
|
-
onError: (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
onError: (e, { transitionId: a, comment: Z }) => {
|
|
70
|
+
m(null);
|
|
71
|
+
const K = me(e);
|
|
72
|
+
if (K) {
|
|
73
|
+
k((_) => ({
|
|
74
|
+
payload: K,
|
|
75
|
+
transitionId: a,
|
|
76
|
+
comment: Z,
|
|
77
|
+
revision: ((_ == null ? void 0 : _.revision) ?? 0) + 1
|
|
69
78
|
}));
|
|
70
79
|
return;
|
|
71
80
|
}
|
|
72
|
-
|
|
81
|
+
C.error(ie(e, "Transition failed"));
|
|
73
82
|
}
|
|
74
|
-
}),
|
|
75
|
-
mutationFn: (
|
|
83
|
+
}), R = $({
|
|
84
|
+
mutationFn: (e) => f.request(D("/comments", { collection: o, item: d, text: e })),
|
|
76
85
|
onSuccess: () => {
|
|
77
|
-
|
|
86
|
+
M(""), h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, d] });
|
|
78
87
|
},
|
|
79
|
-
onError: () =>
|
|
88
|
+
onError: () => C.error("Failed to post comment")
|
|
80
89
|
});
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
se(o, d, (e) => {
|
|
91
|
+
F(e, H.state) && (h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, d] }), e.own || I()), F(e, H.comments) && h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, d] });
|
|
83
92
|
});
|
|
84
|
-
const
|
|
85
|
-
|
|
93
|
+
const w = ke(u == null ? void 0 : u.available_transitions), i = N && w.some((e) => e.id === N.id) ? N : null, A = new Map(((u == null ? void 0 : u.states) ?? []).map((e) => [e.id, e])), E = (e) => {
|
|
94
|
+
const a = A.get(e.to_state);
|
|
95
|
+
return e.label || (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || "Move";
|
|
96
|
+
}, X = (e) => {
|
|
97
|
+
const a = A.get(e.to_state);
|
|
98
|
+
return (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || e.label || "the next step";
|
|
99
|
+
}, Y = async (e) => {
|
|
100
|
+
if (!s.isPending) {
|
|
101
|
+
if (ve(e)) {
|
|
102
|
+
m(null);
|
|
103
|
+
const a = await P.ask(E(e));
|
|
104
|
+
if (!a) return;
|
|
105
|
+
s.mutate({ transitionId: e.id, comment: a });
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
m(e);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ n(be, { open: !!t, onOpenChange: l, children: [
|
|
86
112
|
/* @__PURE__ */ r(
|
|
87
|
-
|
|
113
|
+
xe,
|
|
88
114
|
{
|
|
89
115
|
side: "right",
|
|
90
116
|
className: "flex max-w-full flex-col gap-0 p-0",
|
|
91
|
-
style: { width:
|
|
92
|
-
children:
|
|
93
|
-
/* @__PURE__ */ r(
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */ r(
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */ r(
|
|
98
|
-
|
|
117
|
+
style: { width: z ?? 480, maxWidth: "96vw" },
|
|
118
|
+
children: t && /* @__PURE__ */ n(ee, { children: [
|
|
119
|
+
/* @__PURE__ */ r(he, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
|
|
120
|
+
/* @__PURE__ */ n("div", { className: "min-w-0", children: [
|
|
121
|
+
/* @__PURE__ */ r(fe, { className: "truncate text-[15px] font-semibold", children: t.label }),
|
|
122
|
+
/* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
123
|
+
/* @__PURE__ */ r(pe, { variant: "outline", children: T ? T(t.collection) : t.collection }),
|
|
124
|
+
t.state && /* @__PURE__ */ r(
|
|
99
125
|
"span",
|
|
100
126
|
{
|
|
101
127
|
className: "rounded px-1.5 py-0.5 text-[11px] font-medium",
|
|
102
128
|
style: {
|
|
103
|
-
backgroundColor:
|
|
104
|
-
color:
|
|
129
|
+
backgroundColor: t.state_color ? `${t.state_color}1a` : void 0,
|
|
130
|
+
color: t.state_color ?? void 0
|
|
105
131
|
},
|
|
106
|
-
children: (
|
|
132
|
+
children: (y == null ? void 0 : y[t.state]) ?? t.state
|
|
107
133
|
}
|
|
108
134
|
)
|
|
109
135
|
] })
|
|
110
136
|
] }),
|
|
111
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ n(
|
|
112
138
|
"button",
|
|
113
139
|
{
|
|
114
140
|
type: "button",
|
|
115
|
-
onClick: () =>
|
|
116
|
-
collection:
|
|
117
|
-
itemId:
|
|
118
|
-
layoutSlug:
|
|
141
|
+
onClick: () => J({
|
|
142
|
+
collection: t.collection,
|
|
143
|
+
itemId: t.item_id,
|
|
144
|
+
layoutSlug: G ?? null
|
|
119
145
|
}),
|
|
120
146
|
className: "flex shrink-0 items-center gap-1 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
121
147
|
children: [
|
|
122
148
|
"Open ",
|
|
123
|
-
/* @__PURE__ */ r(
|
|
149
|
+
/* @__PURE__ */ r(re, { className: "h-3 w-3" })
|
|
124
150
|
]
|
|
125
151
|
}
|
|
126
152
|
)
|
|
127
153
|
] }) }),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */ r(
|
|
131
|
-
/* @__PURE__ */ r(
|
|
132
|
-
/* @__PURE__ */ r(
|
|
154
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
155
|
+
/* @__PURE__ */ n("div", { className: "mb-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
|
|
156
|
+
/* @__PURE__ */ r(b, { label: "Owners", children: /* @__PURE__ */ r(ge, { owners: t.owners, max: 6 }) }),
|
|
157
|
+
/* @__PURE__ */ r(b, { label: "Claimed by", children: ((j = t.claimed_by) == null ? void 0 : j.name) ?? "—" }),
|
|
158
|
+
/* @__PURE__ */ r(b, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
|
|
133
159
|
"span",
|
|
134
160
|
{
|
|
135
|
-
className:
|
|
161
|
+
className: V(
|
|
136
162
|
"rounded px-1.5 py-0.5 text-[11px] font-medium",
|
|
137
|
-
|
|
163
|
+
t.sla_status === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : t.sla_status === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"
|
|
138
164
|
),
|
|
139
|
-
children:
|
|
165
|
+
children: t.sla_status
|
|
140
166
|
}
|
|
141
167
|
) : "—" }),
|
|
142
|
-
/* @__PURE__ */ r(
|
|
143
|
-
|
|
144
|
-
Object.entries(
|
|
168
|
+
/* @__PURE__ */ r(b, { label: "Aging", children: Ne(t.aging_hours) }),
|
|
169
|
+
t.at_risk && /* @__PURE__ */ r(b, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
|
|
170
|
+
Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(b, { label: we(e), children: a == null || a === "" ? "—" : x != null && x[e] ? de(String(a), x[e]) : String(a) }, e))
|
|
145
171
|
] }),
|
|
146
|
-
|
|
172
|
+
w.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
|
|
147
173
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Transitions" }),
|
|
148
|
-
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"button",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: w.map((e) => /* @__PURE__ */ n(
|
|
175
|
+
"button",
|
|
176
|
+
{
|
|
177
|
+
type: "button",
|
|
178
|
+
disabled: s.isPending,
|
|
179
|
+
"aria-pressed": (i == null ? void 0 : i.id) === e.id,
|
|
180
|
+
onClick: () => void Y(e),
|
|
181
|
+
className: V(
|
|
182
|
+
"flex items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] font-medium text-slate-700 hover:border-nvr-cyan hover:text-nvr-navy disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
183
|
+
(i == null ? void 0 : i.id) === e.id && "border-nvr-cyan"
|
|
184
|
+
),
|
|
185
|
+
children: [
|
|
186
|
+
E(e),
|
|
187
|
+
/* @__PURE__ */ r(O, { className: "h-3 w-3 text-slate-400" })
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
e.id
|
|
191
|
+
)) }),
|
|
192
|
+
i && /* @__PURE__ */ n(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
role: "alertdialog",
|
|
196
|
+
"aria-label": "Confirm move",
|
|
197
|
+
"data-peek-confirm": !0,
|
|
198
|
+
className: "mt-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2.5 dark:border-amber-500/30 dark:bg-amber-500/10",
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ n("p", { className: "text-[12.5px] text-slate-700 dark:text-slate-200", children: [
|
|
201
|
+
"Move ",
|
|
202
|
+
/* @__PURE__ */ r("span", { className: "font-semibold", children: t.label }),
|
|
203
|
+
" to",
|
|
204
|
+
" ",
|
|
205
|
+
/* @__PURE__ */ r("span", { className: "font-semibold", children: X(i) }),
|
|
206
|
+
"?"
|
|
207
|
+
] }),
|
|
208
|
+
/* @__PURE__ */ n("div", { className: "mt-2 flex gap-2", children: [
|
|
209
|
+
/* @__PURE__ */ r(
|
|
210
|
+
"button",
|
|
211
|
+
{
|
|
212
|
+
type: "button",
|
|
213
|
+
disabled: s.isPending,
|
|
214
|
+
onClick: () => s.mutate({ transitionId: i.id }),
|
|
215
|
+
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
216
|
+
children: s.isPending ? "Moving…" : "Confirm"
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ r(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
type: "button",
|
|
223
|
+
disabled: s.isPending,
|
|
224
|
+
onClick: () => m(null),
|
|
225
|
+
className: "h-7 rounded-md border border-slate-200 bg-white px-3 text-[12px] text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-300",
|
|
226
|
+
children: "Keep"
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] })
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
)
|
|
165
233
|
] }),
|
|
166
|
-
(
|
|
234
|
+
(W || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
167
235
|
"button",
|
|
168
236
|
{
|
|
169
237
|
type: "button",
|
|
170
|
-
onClick: () =>
|
|
238
|
+
onClick: () => t.claimed_by ? L(t) : g(t),
|
|
171
239
|
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90",
|
|
172
|
-
children:
|
|
240
|
+
children: t.claimed_by ? "Release claim" : "Claim this item"
|
|
173
241
|
}
|
|
174
242
|
) }),
|
|
175
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ n("div", { children: [
|
|
176
244
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Comments" }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
((
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
[
|
|
181
|
-
/* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children:
|
|
245
|
+
/* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
|
|
246
|
+
((p == null ? void 0 : p.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
|
|
247
|
+
/* @__PURE__ */ n("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
|
|
248
|
+
[e.first_name, e.last_name].filter(Boolean).join(" ") || e.email || "—",
|
|
249
|
+
/* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: le(e.created_at) })
|
|
182
250
|
] }),
|
|
183
|
-
/* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children:
|
|
184
|
-
] },
|
|
185
|
-
((
|
|
251
|
+
/* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: e.text })
|
|
252
|
+
] }, e.id)),
|
|
253
|
+
((p == null ? void 0 : p.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
|
|
186
254
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ n("div", { className: "mt-2.5", children: [
|
|
188
256
|
/* @__PURE__ */ r(
|
|
189
257
|
"textarea",
|
|
190
258
|
{
|
|
191
|
-
value:
|
|
192
|
-
onChange: (
|
|
259
|
+
value: v,
|
|
260
|
+
onChange: (e) => M(e.target.value),
|
|
193
261
|
placeholder: "Add a comment…",
|
|
194
262
|
rows: 2,
|
|
195
263
|
className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
|
|
@@ -199,8 +267,8 @@ function Ie({
|
|
|
199
267
|
"button",
|
|
200
268
|
{
|
|
201
269
|
type: "button",
|
|
202
|
-
disabled: !
|
|
203
|
-
onClick: () =>
|
|
270
|
+
disabled: !v.trim() || R.isPending,
|
|
271
|
+
onClick: () => R.mutate(v.trim()),
|
|
204
272
|
className: "mt-1 rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:text-slate-800 disabled:opacity-50 dark:border-border dark:text-slate-300",
|
|
205
273
|
children: "Post"
|
|
206
274
|
}
|
|
@@ -208,35 +276,40 @@ function Ie({
|
|
|
208
276
|
] })
|
|
209
277
|
] })
|
|
210
278
|
] }),
|
|
211
|
-
|
|
279
|
+
U && S && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
|
|
212
280
|
"button",
|
|
213
281
|
{
|
|
214
282
|
type: "button",
|
|
215
|
-
onClick:
|
|
283
|
+
onClick: S,
|
|
216
284
|
className: "flex w-full items-center justify-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-2 text-[13px] font-semibold text-white hover:bg-nvr-cyan/90",
|
|
217
285
|
children: [
|
|
218
286
|
"Next ",
|
|
219
|
-
/* @__PURE__ */ r(
|
|
287
|
+
/* @__PURE__ */ r(O, { className: "h-3.5 w-3.5" })
|
|
220
288
|
]
|
|
221
289
|
}
|
|
222
290
|
) })
|
|
223
291
|
] })
|
|
224
292
|
}
|
|
225
293
|
),
|
|
226
|
-
|
|
227
|
-
|
|
294
|
+
c && /* @__PURE__ */ r(
|
|
295
|
+
ue,
|
|
228
296
|
{
|
|
229
|
-
payload:
|
|
230
|
-
transitionId:
|
|
231
|
-
isRetry:
|
|
232
|
-
onSubmitted: () =>
|
|
233
|
-
|
|
234
|
-
|
|
297
|
+
payload: c.payload,
|
|
298
|
+
transitionId: c.transitionId,
|
|
299
|
+
isRetry: c.revision > 1,
|
|
300
|
+
onSubmitted: () => s.mutate({
|
|
301
|
+
transitionId: c.transitionId,
|
|
302
|
+
comment: c.comment
|
|
303
|
+
}),
|
|
304
|
+
executing: s.isPending,
|
|
305
|
+
onClose: () => k(null)
|
|
235
306
|
},
|
|
236
|
-
|
|
237
|
-
)
|
|
307
|
+
c.revision
|
|
308
|
+
),
|
|
309
|
+
P.dialog
|
|
238
310
|
] });
|
|
239
311
|
}
|
|
240
312
|
export {
|
|
241
|
-
|
|
313
|
+
De as QueueItemSheet,
|
|
314
|
+
ke as peekTransitions
|
|
242
315
|
};
|