@nivaro/react 0.3.56 → 0.3.58
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 +9 -2
- package/dist/shared/components/CollectionBrowserView.js +2827 -2750
- package/dist/shared/components/DataTable.js +247 -236
- package/dist/shared/components/ItemEditForm.js +1693 -1668
- package/dist/shared/components/ProfileView.js +716 -715
- package/dist/shared/components/RecordReadView.js +367 -364
- package/dist/shared/components/ReportView.js +64 -39
- package/dist/shared/components/alerts/AlertManagerView.js +284 -271
- package/dist/shared/components/cbv/row-focus.js +19 -0
- package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
- package/dist/shared/components/integrations/console/SignalCard.js +59 -59
- package/dist/shared/components/integrations/console/tone.js +52 -30
- package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
- package/dist/shared/components/item-edit/FieldRow.js +175 -173
- package/dist/shared/components/item-edit/InlineTableField.js +407 -402
- package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
- package/dist/shared/components/item-edit/PlanGrid.js +826 -803
- package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
- package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
- package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
- package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
- package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
- package/dist/shared/components/item-edit/related-missing.js +45 -0
- package/dist/shared/components/item-edit/save-outcome.js +5 -5
- package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
- package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
- package/dist/shared/components/panels/ItemLockBanner.js +2 -3
- package/dist/shared/components/panels/PipelinePanel.js +1027 -978
- package/dist/shared/components/panels/RevisionsPanel.js +4 -1
- package/dist/shared/components/panels/TaskPanel.js +265 -249
- package/dist/shared/components/panels/landing-state.js +27 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
- package/dist/shared/components/profile/AiMemoryCard.js +12 -10
- package/dist/shared/components/queue/OwnerAvatars.js +80 -41
- package/dist/shared/components/queue/QueueItemSheet.js +111 -111
- package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
- package/dist/shared/components/queue/QueueWorklist.js +975 -964
- package/dist/shared/components/queue/group-sums.js +27 -0
- package/dist/shared/components/queue/live-state-aspect.js +7 -3
- package/dist/shared/components/queue/path-label.js +14 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
- package/dist/shared/lib/back-closes.js +25 -0
- package/dist/shared/lib/cbv-page-warm.js +36 -0
- package/dist/shared/lib/form-usage-beacon.js +7 -7
- package/dist/shared/lib/list-page-memory.js +41 -0
- package/dist/shared/lib/live.js +44 -44
- package/dist/shared/lib/own-writes.js +76 -28
- package/dist/shared/lib/record-ref.js +78 -53
- package/dist/shared/lib/request-gate.js +110 -109
- package/dist/shared/lib/validation-rules.js +34 -19
- package/package.json +1 -1
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Popover as
|
|
1
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { cn as l } from "../../lib/utils.js";
|
|
4
|
+
import { UserAvatar as h } from "../UserAvatar.js";
|
|
5
|
+
import { Popover as b, PopoverTrigger as v, PopoverContent as k } from "../ui/popover.js";
|
|
6
|
+
const g = {
|
|
7
|
+
suspended: "suspended",
|
|
8
|
+
former: "former user"
|
|
9
|
+
};
|
|
10
|
+
function N(e) {
|
|
11
|
+
return e.inactive ? `${e.name} (${g[e.inactive]})` : e.name;
|
|
12
|
+
}
|
|
13
|
+
function f({ owner: e }) {
|
|
14
|
+
return e.inactive ? /* @__PURE__ */ a(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
"data-owner-inactive": e.inactive,
|
|
18
|
+
className: "ml-1 shrink-0 rounded bg-slate-100 px-1 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
19
|
+
children: g[e.inactive]
|
|
20
|
+
}
|
|
21
|
+
) : null;
|
|
22
|
+
}
|
|
6
23
|
const o = [
|
|
7
24
|
{ bg: "#e0f2fe", fg: "#075985" },
|
|
8
25
|
// sky
|
|
@@ -29,88 +46,110 @@ const o = [
|
|
|
29
46
|
{ bg: "#f3e8ff", fg: "#6b21a8" }
|
|
30
47
|
// purple
|
|
31
48
|
];
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
for (let r = 0; r < e.length; r++)
|
|
35
|
-
return o[Math.abs(
|
|
49
|
+
function y(e) {
|
|
50
|
+
let n = 0;
|
|
51
|
+
for (let r = 0; r < e.length; r++) n = n * 31 + e.charCodeAt(r) | 0;
|
|
52
|
+
return o[Math.abs(n) % o.length];
|
|
36
53
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
return
|
|
54
|
+
function C(e) {
|
|
55
|
+
const n = e.trim().split(/\s+/);
|
|
56
|
+
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
40
57
|
}
|
|
41
|
-
function
|
|
42
|
-
const r =
|
|
58
|
+
function d({ owner: e, className: n }) {
|
|
59
|
+
const r = y(e.id);
|
|
43
60
|
return /* @__PURE__ */ a(
|
|
44
|
-
|
|
61
|
+
h,
|
|
45
62
|
{
|
|
46
63
|
userId: e.id,
|
|
47
64
|
alt: e.name,
|
|
48
|
-
className:
|
|
65
|
+
className: l("h-[22px] w-[22px] ring-2 ring-white dark:ring-card", n),
|
|
49
66
|
fallback: /* @__PURE__ */ a(
|
|
50
67
|
"span",
|
|
51
68
|
{
|
|
52
69
|
title: e.name,
|
|
53
|
-
className:
|
|
70
|
+
className: l(
|
|
54
71
|
"inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full text-[9px] font-semibold ring-2 ring-white dark:ring-card",
|
|
55
|
-
|
|
72
|
+
n
|
|
56
73
|
),
|
|
57
74
|
style: { backgroundColor: r.bg, color: r.fg },
|
|
58
|
-
children:
|
|
75
|
+
children: C(e.name)
|
|
59
76
|
}
|
|
60
77
|
)
|
|
61
78
|
}
|
|
62
79
|
);
|
|
63
80
|
}
|
|
64
|
-
function
|
|
81
|
+
function T({
|
|
65
82
|
owners: e,
|
|
66
|
-
max:
|
|
83
|
+
max: n = 4,
|
|
67
84
|
emptyLabel: r = "No owners"
|
|
68
85
|
}) {
|
|
69
|
-
const [
|
|
86
|
+
const [p, m] = u(!1);
|
|
70
87
|
if (e.length === 0)
|
|
71
88
|
return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: r });
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */ a(
|
|
89
|
+
const c = e.slice(0, n), s = e.length - c.length;
|
|
90
|
+
return /* @__PURE__ */ i(b, { open: p, onOpenChange: m, children: [
|
|
91
|
+
/* @__PURE__ */ a(v, { asChild: !0, children: /* @__PURE__ */ i(
|
|
75
92
|
"button",
|
|
76
93
|
{
|
|
77
94
|
type: "button",
|
|
78
|
-
onClick: (
|
|
79
|
-
"aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map(
|
|
95
|
+
onClick: (t) => t.stopPropagation(),
|
|
96
|
+
"aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map(N).join(", ")}`,
|
|
80
97
|
className: "group/owners flex items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
81
98
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
/* @__PURE__ */ i("span", { className: "flex items-center transition-[gap]", children: [
|
|
100
|
+
c.map((t, x) => /* @__PURE__ */ a(
|
|
101
|
+
d,
|
|
102
|
+
{
|
|
103
|
+
owner: t,
|
|
104
|
+
className: l(x > 0 && "-ml-1.5", t.inactive && "opacity-50 grayscale")
|
|
105
|
+
},
|
|
106
|
+
t.id
|
|
107
|
+
)),
|
|
108
|
+
s > 0 && /* @__PURE__ */ i("span", { className: "-ml-1.5 inline-flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold text-slate-600 ring-2 ring-white dark:bg-muted dark:text-slate-300 dark:ring-card", children: [
|
|
85
109
|
"+",
|
|
86
|
-
|
|
110
|
+
s
|
|
87
111
|
] })
|
|
88
112
|
] }),
|
|
89
|
-
e.length === 1 && /* @__PURE__ */
|
|
113
|
+
e.length === 1 && /* @__PURE__ */ i("span", { className: "ml-1.5 flex min-w-0 items-center", children: [
|
|
114
|
+
/* @__PURE__ */ a(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
className: l(
|
|
118
|
+
"truncate text-[12px] text-slate-600 group-hover/owners:text-slate-800 dark:text-slate-300",
|
|
119
|
+
e[0].inactive && "line-through decoration-slate-400"
|
|
120
|
+
),
|
|
121
|
+
children: e[0].name
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ a(f, { owner: e[0] })
|
|
125
|
+
] }),
|
|
126
|
+
e.length > 1 && e.some((t) => t.inactive) && /* @__PURE__ */ a("span", { className: "ml-1.5 text-[10px] text-slate-500 dark:text-slate-400", children: e.every((t) => t.inactive) ? "none can act" : `${e.filter((t) => t.inactive).length} can’t act` })
|
|
90
127
|
]
|
|
91
128
|
}
|
|
92
129
|
) }),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
130
|
+
/* @__PURE__ */ i(
|
|
131
|
+
k,
|
|
95
132
|
{
|
|
96
133
|
className: "w-[240px] p-1.5",
|
|
97
134
|
align: "start",
|
|
98
|
-
onClick: (
|
|
135
|
+
onClick: (t) => t.stopPropagation(),
|
|
99
136
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ i("p", { className: "px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: [
|
|
101
138
|
e.length,
|
|
102
139
|
" owner",
|
|
103
140
|
e.length === 1 ? "" : "s"
|
|
104
141
|
] }),
|
|
105
|
-
/* @__PURE__ */ a("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((
|
|
106
|
-
/* @__PURE__ */ a(
|
|
107
|
-
/* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children:
|
|
108
|
-
|
|
142
|
+
/* @__PURE__ */ a("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((t) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 rounded px-2 py-1", children: [
|
|
143
|
+
/* @__PURE__ */ a(d, { owner: t }),
|
|
144
|
+
/* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: t.name }),
|
|
145
|
+
/* @__PURE__ */ a(f, { owner: t })
|
|
146
|
+
] }, t.id)) })
|
|
109
147
|
]
|
|
110
148
|
}
|
|
111
149
|
)
|
|
112
150
|
] });
|
|
113
151
|
}
|
|
114
152
|
export {
|
|
115
|
-
|
|
153
|
+
T as OwnerAvatars,
|
|
154
|
+
N as ownerText
|
|
116
155
|
};
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import { jsxs as n, jsx as r, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ExternalLink as
|
|
4
|
-
import { useState as q, useEffect as
|
|
1
|
+
import { jsxs as n, jsx as r, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as re, useQuery as j, useMutation as $ } from "@tanstack/react-query";
|
|
3
|
+
import { ExternalLink as ae, ArrowRight as H } from "lucide-react";
|
|
4
|
+
import { useState as q, useEffect as ne } from "react";
|
|
5
5
|
import { toast as C } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
6
|
+
import { useNivaroClient as oe, useItemNavigation as se } from "../../context.js";
|
|
7
|
+
import { get as O, post as B } from "../../lib/commands.js";
|
|
8
8
|
import { formatMultiValue as de } from "../../lib/format-value.js";
|
|
9
|
-
import { useLiveRecord as
|
|
10
|
-
import { userErrorMessage as
|
|
11
|
-
import { cn as V, formatRelative as
|
|
12
|
-
import { transitionRequirementsFromError as
|
|
13
|
-
import { TransitionRequirementsDialog as
|
|
14
|
-
import { Badge as
|
|
15
|
-
import { Sheet as
|
|
16
|
-
import { OwnerAvatars as
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
return (t ?? []).filter((l) => l.in_row_menu !== !1);
|
|
20
|
-
}
|
|
21
|
-
function Ne(t) {
|
|
22
|
-
return ce(t);
|
|
23
|
-
}
|
|
9
|
+
import { useLiveRecord as ie, batchTouches as D, LIVE_ASPECTS as F } from "../../lib/live.js";
|
|
10
|
+
import { userErrorMessage as le } from "../../lib/safe-error.js";
|
|
11
|
+
import { cn as V, formatRelative as ce, humanHours as me } from "../../lib/utils.js";
|
|
12
|
+
import { transitionRequirementsFromError as ue } from "../panels/PipelinePanel.js";
|
|
13
|
+
import { TransitionRequirementsDialog as pe } from "../panels/TransitionRequirementsDialog.js";
|
|
14
|
+
import { Badge as be } from "../ui/badge.js";
|
|
15
|
+
import { Sheet as xe, SheetContent as he, SheetHeader as fe, SheetTitle as ge } from "../ui/sheet.js";
|
|
16
|
+
import { OwnerAvatars as ye } from "./OwnerAvatars.js";
|
|
17
|
+
import { pathHeader as ve } from "./path-label.js";
|
|
18
|
+
import { useTransitionNote as ke, needsTransitionNote as Ne } from "./transition-note.js";
|
|
24
19
|
function we(t) {
|
|
25
|
-
return t
|
|
20
|
+
return (t ?? []).filter((b) => b.in_row_menu !== !1);
|
|
21
|
+
}
|
|
22
|
+
function _e(t) {
|
|
23
|
+
return me(t);
|
|
26
24
|
}
|
|
27
|
-
|
|
25
|
+
const qe = ve;
|
|
26
|
+
function p({ label: t, children: b }) {
|
|
28
27
|
return /* @__PURE__ */ n("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
|
|
29
28
|
/* @__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:
|
|
29
|
+
/* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: b })
|
|
31
30
|
] });
|
|
32
31
|
}
|
|
33
|
-
function
|
|
32
|
+
function Ve({
|
|
34
33
|
item: t,
|
|
35
|
-
onOpenChange:
|
|
36
|
-
onClaim:
|
|
37
|
-
onRelease:
|
|
38
|
-
workNextActive:
|
|
34
|
+
onOpenChange: b,
|
|
35
|
+
onClaim: W,
|
|
36
|
+
onRelease: z,
|
|
37
|
+
workNextActive: G,
|
|
39
38
|
onNext: S,
|
|
40
39
|
refetchItems: I,
|
|
41
|
-
stateLabels:
|
|
40
|
+
stateLabels: g,
|
|
42
41
|
collectionLabel: T,
|
|
43
|
-
claimsEnabled:
|
|
42
|
+
claimsEnabled: J = !0,
|
|
44
43
|
columnFormats: x,
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
fieldLabel: y,
|
|
45
|
+
width: U,
|
|
46
|
+
itemLayout: X
|
|
47
47
|
}) {
|
|
48
|
-
var
|
|
49
|
-
const h =
|
|
50
|
-
|
|
51
|
-
const { data:
|
|
52
|
-
queryKey: ["queue-sheet-instance", o,
|
|
53
|
-
queryFn: () => f.request(
|
|
54
|
-
enabled: !!o && !!
|
|
55
|
-
}), { data:
|
|
56
|
-
queryKey: ["queue-sheet-comments", o,
|
|
57
|
-
queryFn: () => f.request(
|
|
58
|
-
enabled: !!o && !!
|
|
59
|
-
}),
|
|
48
|
+
var K;
|
|
49
|
+
const h = re(), f = oe(), { open: Y } = se(), [v, M] = q(""), [l, k] = q(null), [N, c] = q(null), P = ke(), o = t == null ? void 0 : t.collection, s = t == null ? void 0 : t.item_id;
|
|
50
|
+
ne(() => c(null), [o, s]);
|
|
51
|
+
const { data: m } = j({
|
|
52
|
+
queryKey: ["queue-sheet-instance", o, s],
|
|
53
|
+
queryFn: () => f.request(O(`/pipelines/instance/${o}/${s}`)).then((e) => e.data),
|
|
54
|
+
enabled: !!o && !!s
|
|
55
|
+
}), { data: u } = j({
|
|
56
|
+
queryKey: ["queue-sheet-comments", o, s],
|
|
57
|
+
queryFn: () => f.request(O("/comments", { collection: o, item: s })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
|
|
58
|
+
enabled: !!o && !!s
|
|
59
|
+
}), d = $({
|
|
60
60
|
mutationFn: ({ transitionId: e, comment: a }) => f.request(
|
|
61
|
-
|
|
61
|
+
B(`/pipelines/instance/${o}/${s}/transition`, {
|
|
62
62
|
transition_id: e,
|
|
63
63
|
...a ? { comment: a } : {}
|
|
64
64
|
})
|
|
65
65
|
),
|
|
66
66
|
onSuccess: () => {
|
|
67
|
-
k(null),
|
|
67
|
+
k(null), c(null), h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), I(), C.success("Transitioned");
|
|
68
68
|
},
|
|
69
|
-
onError: (e, { transitionId: a, comment:
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
69
|
+
onError: (e, { transitionId: a, comment: ee }) => {
|
|
70
|
+
c(null);
|
|
71
|
+
const Q = ue(e);
|
|
72
|
+
if (Q) {
|
|
73
73
|
k((_) => ({
|
|
74
|
-
payload:
|
|
74
|
+
payload: Q,
|
|
75
75
|
transitionId: a,
|
|
76
|
-
comment:
|
|
76
|
+
comment: ee,
|
|
77
77
|
revision: ((_ == null ? void 0 : _.revision) ?? 0) + 1
|
|
78
78
|
}));
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
C.error(
|
|
81
|
+
C.error(le(e, "Transition failed"));
|
|
82
82
|
}
|
|
83
83
|
}), R = $({
|
|
84
|
-
mutationFn: (e) => f.request(
|
|
84
|
+
mutationFn: (e) => f.request(B("/comments", { collection: o, item: s, text: e })),
|
|
85
85
|
onSuccess: () => {
|
|
86
|
-
M(""), h.invalidateQueries({ queryKey: ["queue-sheet-comments", o,
|
|
86
|
+
M(""), h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
|
|
87
87
|
},
|
|
88
88
|
onError: () => C.error("Failed to post comment")
|
|
89
89
|
});
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
ie(o, s, (e) => {
|
|
91
|
+
D(e, F.state) && (h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), e.own || I()), D(e, F.comments) && h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
|
|
92
92
|
});
|
|
93
|
-
const w =
|
|
93
|
+
const w = we(m == null ? void 0 : m.available_transitions), i = N && w.some((e) => e.id === N.id) ? N : null, A = new Map(((m == null ? void 0 : m.states) ?? []).map((e) => [e.id, e])), E = (e) => {
|
|
94
94
|
const a = A.get(e.to_state);
|
|
95
95
|
return e.label || (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || "Move";
|
|
96
|
-
},
|
|
96
|
+
}, Z = (e) => {
|
|
97
97
|
const a = A.get(e.to_state);
|
|
98
98
|
return (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || e.label || "the next step";
|
|
99
|
-
},
|
|
100
|
-
if (!
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
}, L = async (e) => {
|
|
100
|
+
if (!d.isPending) {
|
|
101
|
+
if (Ne(e)) {
|
|
102
|
+
c(null);
|
|
103
103
|
const a = await P.ask(E(e));
|
|
104
104
|
if (!a) return;
|
|
105
|
-
|
|
105
|
+
d.mutate({ transitionId: e.id, comment: a });
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
c(e);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
return /* @__PURE__ */ n(
|
|
111
|
+
return /* @__PURE__ */ n(xe, { open: !!t, onOpenChange: b, children: [
|
|
112
112
|
/* @__PURE__ */ r(
|
|
113
|
-
|
|
113
|
+
he,
|
|
114
114
|
{
|
|
115
115
|
side: "right",
|
|
116
116
|
className: "flex max-w-full flex-col gap-0 p-0",
|
|
117
|
-
style: { width:
|
|
118
|
-
children: t && /* @__PURE__ */ n(
|
|
119
|
-
/* @__PURE__ */ r(
|
|
117
|
+
style: { width: U ?? 480, maxWidth: "96vw" },
|
|
118
|
+
children: t && /* @__PURE__ */ n(te, { children: [
|
|
119
|
+
/* @__PURE__ */ r(fe, { 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
120
|
/* @__PURE__ */ n("div", { className: "min-w-0", children: [
|
|
121
|
-
/* @__PURE__ */ r(
|
|
121
|
+
/* @__PURE__ */ r(ge, { className: "truncate text-[15px] font-semibold", children: t.label }),
|
|
122
122
|
/* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
123
|
-
/* @__PURE__ */ r(
|
|
123
|
+
/* @__PURE__ */ r(be, { variant: "outline", children: T ? T(t.collection) : t.collection }),
|
|
124
124
|
t.state && /* @__PURE__ */ r(
|
|
125
125
|
"span",
|
|
126
126
|
{
|
|
@@ -129,7 +129,7 @@ function De({
|
|
|
129
129
|
backgroundColor: t.state_color ? `${t.state_color}1a` : void 0,
|
|
130
130
|
color: t.state_color ?? void 0
|
|
131
131
|
},
|
|
132
|
-
children: (
|
|
132
|
+
children: (g == null ? void 0 : g[t.state]) ?? t.state
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
] })
|
|
@@ -138,24 +138,24 @@ function De({
|
|
|
138
138
|
"button",
|
|
139
139
|
{
|
|
140
140
|
type: "button",
|
|
141
|
-
onClick: () =>
|
|
141
|
+
onClick: () => Y({
|
|
142
142
|
collection: t.collection,
|
|
143
143
|
itemId: t.item_id,
|
|
144
|
-
layoutSlug:
|
|
144
|
+
layoutSlug: X ?? null
|
|
145
145
|
}),
|
|
146
146
|
className: "flex shrink-0 items-center gap-1 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
147
147
|
children: [
|
|
148
148
|
"Open ",
|
|
149
|
-
/* @__PURE__ */ r(
|
|
149
|
+
/* @__PURE__ */ r(ae, { className: "h-3 w-3" })
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
)
|
|
153
153
|
] }) }),
|
|
154
154
|
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
155
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(
|
|
157
|
-
/* @__PURE__ */ r(
|
|
158
|
-
/* @__PURE__ */ r(
|
|
156
|
+
/* @__PURE__ */ r(p, { label: "Owners", children: /* @__PURE__ */ r(ye, { owners: t.owners, max: 6 }) }),
|
|
157
|
+
/* @__PURE__ */ r(p, { label: "Claimed by", children: ((K = t.claimed_by) == null ? void 0 : K.name) ?? "—" }),
|
|
158
|
+
/* @__PURE__ */ r(p, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
|
|
159
159
|
"span",
|
|
160
160
|
{
|
|
161
161
|
className: V(
|
|
@@ -165,9 +165,9 @@ function De({
|
|
|
165
165
|
children: t.sla_status
|
|
166
166
|
}
|
|
167
167
|
) : "—" }),
|
|
168
|
-
/* @__PURE__ */ r(
|
|
169
|
-
t.at_risk && /* @__PURE__ */ r(
|
|
170
|
-
Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(
|
|
168
|
+
/* @__PURE__ */ r(p, { label: "Aging", children: _e(t.aging_hours) }),
|
|
169
|
+
t.at_risk && /* @__PURE__ */ r(p, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
|
|
170
|
+
Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(p, { label: (y == null ? void 0 : y(e)) || qe(e), children: a == null || a === "" ? "—" : x != null && x[e] ? de(String(a), x[e]) : String(a) }, e))
|
|
171
171
|
] }),
|
|
172
172
|
w.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
|
|
173
173
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Transitions" }),
|
|
@@ -175,16 +175,16 @@ function De({
|
|
|
175
175
|
"button",
|
|
176
176
|
{
|
|
177
177
|
type: "button",
|
|
178
|
-
disabled:
|
|
178
|
+
disabled: d.isPending,
|
|
179
179
|
"aria-pressed": (i == null ? void 0 : i.id) === e.id,
|
|
180
|
-
onClick: () => void
|
|
180
|
+
onClick: () => void L(e),
|
|
181
181
|
className: V(
|
|
182
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
183
|
(i == null ? void 0 : i.id) === e.id && "border-nvr-cyan"
|
|
184
184
|
),
|
|
185
185
|
children: [
|
|
186
186
|
E(e),
|
|
187
|
-
/* @__PURE__ */ r(
|
|
187
|
+
/* @__PURE__ */ r(H, { className: "h-3 w-3 text-slate-400" })
|
|
188
188
|
]
|
|
189
189
|
},
|
|
190
190
|
e.id
|
|
@@ -202,7 +202,7 @@ function De({
|
|
|
202
202
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: t.label }),
|
|
203
203
|
" to",
|
|
204
204
|
" ",
|
|
205
|
-
/* @__PURE__ */ r("span", { className: "font-semibold", children:
|
|
205
|
+
/* @__PURE__ */ r("span", { className: "font-semibold", children: Z(i) }),
|
|
206
206
|
"?"
|
|
207
207
|
] }),
|
|
208
208
|
/* @__PURE__ */ n("div", { className: "mt-2 flex gap-2", children: [
|
|
@@ -210,18 +210,18 @@ function De({
|
|
|
210
210
|
"button",
|
|
211
211
|
{
|
|
212
212
|
type: "button",
|
|
213
|
-
disabled:
|
|
214
|
-
onClick: () =>
|
|
213
|
+
disabled: d.isPending,
|
|
214
|
+
onClick: () => d.mutate({ transitionId: i.id }),
|
|
215
215
|
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
216
|
-
children:
|
|
216
|
+
children: d.isPending ? "Moving…" : "Confirm"
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
219
|
/* @__PURE__ */ r(
|
|
220
220
|
"button",
|
|
221
221
|
{
|
|
222
222
|
type: "button",
|
|
223
|
-
disabled:
|
|
224
|
-
onClick: () =>
|
|
223
|
+
disabled: d.isPending,
|
|
224
|
+
onClick: () => c(null),
|
|
225
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
226
|
children: "Keep"
|
|
227
227
|
}
|
|
@@ -231,11 +231,11 @@ function De({
|
|
|
231
231
|
}
|
|
232
232
|
)
|
|
233
233
|
] }),
|
|
234
|
-
(
|
|
234
|
+
(J || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
235
235
|
"button",
|
|
236
236
|
{
|
|
237
237
|
type: "button",
|
|
238
|
-
onClick: () => t.claimed_by ?
|
|
238
|
+
onClick: () => t.claimed_by ? z(t) : W(t),
|
|
239
239
|
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90",
|
|
240
240
|
children: t.claimed_by ? "Release claim" : "Claim this item"
|
|
241
241
|
}
|
|
@@ -243,14 +243,14 @@ function De({
|
|
|
243
243
|
/* @__PURE__ */ n("div", { children: [
|
|
244
244
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Comments" }),
|
|
245
245
|
/* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
|
|
246
|
-
((
|
|
246
|
+
((u == null ? void 0 : u.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
|
|
247
247
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
|
|
248
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:
|
|
249
|
+
/* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: ce(e.created_at) })
|
|
250
250
|
] }),
|
|
251
251
|
/* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: e.text })
|
|
252
252
|
] }, e.id)),
|
|
253
|
-
((
|
|
253
|
+
((u == null ? void 0 : u.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
|
|
254
254
|
] }),
|
|
255
255
|
/* @__PURE__ */ n("div", { className: "mt-2.5", children: [
|
|
256
256
|
/* @__PURE__ */ r(
|
|
@@ -276,7 +276,7 @@ function De({
|
|
|
276
276
|
] })
|
|
277
277
|
] })
|
|
278
278
|
] }),
|
|
279
|
-
|
|
279
|
+
G && S && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
|
|
280
280
|
"button",
|
|
281
281
|
{
|
|
282
282
|
type: "button",
|
|
@@ -284,32 +284,32 @@ function De({
|
|
|
284
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",
|
|
285
285
|
children: [
|
|
286
286
|
"Next ",
|
|
287
|
-
/* @__PURE__ */ r(
|
|
287
|
+
/* @__PURE__ */ r(H, { className: "h-3.5 w-3.5" })
|
|
288
288
|
]
|
|
289
289
|
}
|
|
290
290
|
) })
|
|
291
291
|
] })
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
l && /* @__PURE__ */ r(
|
|
295
|
+
pe,
|
|
296
296
|
{
|
|
297
|
-
payload:
|
|
298
|
-
transitionId:
|
|
299
|
-
isRetry:
|
|
300
|
-
onSubmitted: () =>
|
|
301
|
-
transitionId:
|
|
302
|
-
comment:
|
|
297
|
+
payload: l.payload,
|
|
298
|
+
transitionId: l.transitionId,
|
|
299
|
+
isRetry: l.revision > 1,
|
|
300
|
+
onSubmitted: () => d.mutate({
|
|
301
|
+
transitionId: l.transitionId,
|
|
302
|
+
comment: l.comment
|
|
303
303
|
}),
|
|
304
|
-
executing:
|
|
304
|
+
executing: d.isPending,
|
|
305
305
|
onClose: () => k(null)
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
l.revision
|
|
308
308
|
),
|
|
309
309
|
P.dialog
|
|
310
310
|
] });
|
|
311
311
|
}
|
|
312
312
|
export {
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
Ve as QueueItemSheet,
|
|
314
|
+
we as peekTransitions
|
|
315
315
|
};
|