@nivaro/react 0.3.127 → 0.3.128
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 +20 -2
- package/dist/index.js +150 -147
- package/dist/shared/components/CollectionBrowserView.js +3259 -3211
- package/dist/shared/components/DataTable.js +406 -401
- package/dist/shared/components/ItemEditForm.js +4203 -4156
- package/dist/shared/components/MatrixEditor.js +548 -490
- package/dist/shared/components/MyWorkView.js +284 -274
- package/dist/shared/components/NotificationBell.js +264 -218
- package/dist/shared/components/RecordGridEditor.js +582 -472
- package/dist/shared/components/chat/chat-core.js +331 -346
- package/dist/shared/components/chat/chat-typing.js +25 -0
- package/dist/shared/components/command-center/CommandCenterView.js +1 -1
- package/dist/shared/components/command-center/PeekPanel.js +8 -1
- package/dist/shared/components/command-center/api.js +17 -9
- package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
- package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
- package/dist/shared/components/item-edit/GroupSection.js +1 -1
- package/dist/shared/components/item-edit/InlineTableField.js +432 -429
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
- package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
- package/dist/shared/components/item-edit/RowComments.js +33 -30
- package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
- package/dist/shared/components/item-edit/live-related.js +29 -16
- package/dist/shared/components/item-edit/record-opened-live.js +86 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
- package/dist/shared/components/queue/QueueItemSheet.js +171 -130
- package/dist/shared/components/record-grid-guard.js +85 -0
- package/dist/shared/components/support/TicketDetailSheet.js +168 -151
- package/dist/shared/lib/at-risk-fields.js +14 -0
- package/dist/shared/lib/live-queries.js +9 -8
- package/dist/shared/lib/live-screen.js +77 -76
- package/dist/shared/lib/presence-hooks.js +190 -127
- package/dist/shared/lib/user-sync.js +78 -65
- package/dist/shared/lib/waiting-count.js +40 -29
- package/package.json +1 -1
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as M, useQueryClient as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useRef as
|
|
2
|
+
import { useQuery as M, useQueryClient as D, useMutation as q } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as Q, SmilePlus as S } from "lucide-react";
|
|
4
|
+
import { useRef as _, useState as h } from "react";
|
|
5
5
|
import { createPortal as E } from "react-dom";
|
|
6
6
|
import { toast as j } from "sonner";
|
|
7
7
|
import { useNivaroClient as R } from "../../context.js";
|
|
8
8
|
import { get as K, post as F } from "../../lib/commands.js";
|
|
9
9
|
import { formatRelative as L } from "../../lib/utils.js";
|
|
10
10
|
const T = ["👍", "✅", "👀", "🎉", "❤️", "😂"];
|
|
11
|
-
function V(s, a,
|
|
12
|
-
const
|
|
11
|
+
function V(s, a, m) {
|
|
12
|
+
const c = R(), { data: i } = M({
|
|
13
13
|
queryKey: ["row-comment-counts", s, a.join(",")],
|
|
14
|
-
queryFn: () =>
|
|
14
|
+
queryFn: () => c.request(
|
|
15
15
|
K("/comments/counts", { collection: s, ids: a.join(",") })
|
|
16
|
-
).then((
|
|
17
|
-
enabled:
|
|
18
|
-
staleTime: 3e4
|
|
16
|
+
).then((d) => d.data ?? {}).catch(() => ({})),
|
|
17
|
+
enabled: m && a.length > 0,
|
|
18
|
+
staleTime: 3e4,
|
|
19
|
+
// Low (seamless) 3: the key is the joined row ids, so adding or removing a line re-keys it;
|
|
20
|
+
// the badges keep the last counts (a row's count is still its count) until the new answer.
|
|
21
|
+
placeholderData: (d) => d
|
|
19
22
|
});
|
|
20
|
-
return
|
|
23
|
+
return i ?? {};
|
|
21
24
|
}
|
|
22
25
|
function X({
|
|
23
26
|
collection: s,
|
|
24
27
|
rowId: a,
|
|
25
|
-
count:
|
|
28
|
+
count: m
|
|
26
29
|
}) {
|
|
27
|
-
const
|
|
30
|
+
const c = R(), i = D(), d = _(null), [u, p] = h(null), [x, f] = h(""), [y, g] = h(null), v = !!u, { data: N = [], isLoading: P } = M({
|
|
28
31
|
queryKey: ["comments", s, a],
|
|
29
|
-
queryFn: () =>
|
|
30
|
-
(e) => (e.data ?? []).filter((n) => !n.deleted).sort((n,
|
|
32
|
+
queryFn: () => c.request(K("/comments", { collection: s, item: a })).then(
|
|
33
|
+
(e) => (e.data ?? []).filter((n) => !n.deleted).sort((n, l) => new Date(l.created_at).getTime() - new Date(n.created_at).getTime())
|
|
31
34
|
),
|
|
32
35
|
enabled: v
|
|
33
36
|
}), k = q({
|
|
34
|
-
mutationFn: (e) =>
|
|
37
|
+
mutationFn: (e) => c.request(F("/comments", { collection: s, item: a, text: e })),
|
|
35
38
|
onSuccess: () => {
|
|
36
|
-
f(""),
|
|
39
|
+
f(""), i.invalidateQueries({ queryKey: ["comments", s, a] }), i.invalidateQueries({ queryKey: ["row-comment-counts", s] }), i.invalidateQueries({ queryKey: ["comments-related"] });
|
|
37
40
|
},
|
|
38
41
|
onError: () => j.error("Failed to post comment")
|
|
39
42
|
}), w = q({
|
|
40
|
-
mutationFn: ({ id: e, emoji: n }) =>
|
|
43
|
+
mutationFn: ({ id: e, emoji: n }) => c.request(F(`/comments/${e}/reactions`, { emoji: n })),
|
|
41
44
|
onSuccess: () => {
|
|
42
|
-
g(null),
|
|
45
|
+
g(null), i.invalidateQueries({ queryKey: ["comments", s, a] });
|
|
43
46
|
},
|
|
44
47
|
onError: () => j.error("Failed to react")
|
|
45
48
|
});
|
|
@@ -47,36 +50,36 @@ function X({
|
|
|
47
50
|
/* @__PURE__ */ o(
|
|
48
51
|
"button",
|
|
49
52
|
{
|
|
50
|
-
ref:
|
|
53
|
+
ref: d,
|
|
51
54
|
type: "button",
|
|
52
55
|
onClick: (e) => {
|
|
53
56
|
var r;
|
|
54
|
-
if (e.stopPropagation(),
|
|
57
|
+
if (e.stopPropagation(), u) {
|
|
55
58
|
p(null);
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
|
-
const n = (r =
|
|
61
|
+
const n = (r = d.current) == null ? void 0 : r.getBoundingClientRect();
|
|
59
62
|
if (!n) return;
|
|
60
|
-
const
|
|
63
|
+
const l = 280, b = n.bottom + l > window.innerHeight ? Math.max(8, n.top - l - 4) : n.bottom + 4;
|
|
61
64
|
p({ top: b, left: Math.max(8, Math.min(n.left - 240, window.innerWidth - 320)) });
|
|
62
65
|
},
|
|
63
66
|
title: "Line comments",
|
|
64
|
-
className: `relative rounded p-0.5 ${
|
|
67
|
+
className: `relative rounded p-0.5 ${m > 0 ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan"}`,
|
|
65
68
|
"data-row-comments": a,
|
|
66
69
|
children: [
|
|
67
|
-
/* @__PURE__ */ t(
|
|
68
|
-
|
|
70
|
+
/* @__PURE__ */ t(Q, { className: "h-3 w-3" }),
|
|
71
|
+
m > 0 && /* @__PURE__ */ t("span", { className: "absolute -right-1.5 -top-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-nvr-cyan px-0.5 text-[8.5px] font-bold text-white", children: m })
|
|
69
72
|
]
|
|
70
73
|
}
|
|
71
74
|
),
|
|
72
|
-
v &&
|
|
75
|
+
v && u && E(
|
|
73
76
|
/* @__PURE__ */ o(C, { children: [
|
|
74
77
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 z-[100]", onClick: () => p(null) }),
|
|
75
78
|
/* @__PURE__ */ o(
|
|
76
79
|
"div",
|
|
77
80
|
{
|
|
78
81
|
className: "fixed z-[110] w-[300px] rounded-lg border border-slate-200 bg-white shadow-xl dark:border-border dark:bg-popover",
|
|
79
|
-
style: { top:
|
|
82
|
+
style: { top: u.top, left: u.left },
|
|
80
83
|
onClick: (e) => e.stopPropagation(),
|
|
81
84
|
onKeyDown: (e) => {
|
|
82
85
|
e.key === "Escape" && p(null);
|
|
@@ -85,10 +88,10 @@ function X({
|
|
|
85
88
|
"aria-label": "Line comments",
|
|
86
89
|
children: [
|
|
87
90
|
/* @__PURE__ */ t("div", { className: "max-h-[190px] overflow-y-auto px-3 py-2", children: P ? /* @__PURE__ */ t("p", { className: "py-3 text-center text-[11px] text-slate-400", children: "Loading…" }) : N.length === 0 ? /* @__PURE__ */ t("p", { className: "py-3 text-center text-[11px] text-slate-400", children: "No comments on this line yet." }) : /* @__PURE__ */ t("div", { className: "space-y-2", children: N.map((e) => {
|
|
88
|
-
var n,
|
|
91
|
+
var n, l, b;
|
|
89
92
|
return /* @__PURE__ */ o("div", { children: [
|
|
90
93
|
/* @__PURE__ */ o("p", { className: "text-[11px]", children: [
|
|
91
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: [(n = e.user) == null ? void 0 : n.first_name, (
|
|
94
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: [(n = e.user) == null ? void 0 : n.first_name, (l = e.user) == null ? void 0 : l.last_name].filter(Boolean).join(" ") || ((b = e.user) == null ? void 0 : b.email) || "Unknown" }),
|
|
92
95
|
" ",
|
|
93
96
|
/* @__PURE__ */ t("span", { className: "text-slate-400", children: L(e.created_at) })
|
|
94
97
|
] }),
|
|
@@ -115,7 +118,7 @@ function X({
|
|
|
115
118
|
onClick: () => g(y === e.id ? null : e.id),
|
|
116
119
|
className: "rounded p-0.5 text-slate-300 hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
117
120
|
"aria-label": "Add reaction",
|
|
118
|
-
children: /* @__PURE__ */ t(
|
|
121
|
+
children: /* @__PURE__ */ t(S, { className: "h-3 w-3" })
|
|
119
122
|
}
|
|
120
123
|
),
|
|
121
124
|
y === e.id && /* @__PURE__ */ t("span", { className: "absolute bottom-5 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1 py-0.5 shadow-lg dark:border-border dark:bg-popover", children: T.map((r) => /* @__PURE__ */ t(
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { useRef as s, useEffect as f, useCallback as d, createContext as h, useContext as C } from "react";
|
|
2
|
-
import { toast as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
2
|
+
import { toast as k } from "sonner";
|
|
3
|
+
const m = h(null), $ = () => C(m);
|
|
4
|
+
function p(e) {
|
|
5
5
|
const t = [...new Set(e.filter(Boolean))];
|
|
6
6
|
return t.length <= 1 ? t[0] ?? "" : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
7
7
|
}
|
|
8
|
-
function g(e, t) {
|
|
9
|
-
const r = k(e);
|
|
10
|
-
return t ? `${r} cleared — not available for the ${t} you picked` : `${r} cleared — no longer available for what you picked`;
|
|
11
|
-
}
|
|
12
8
|
function S(e, t) {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
9
|
+
const n = p(e);
|
|
10
|
+
return t ? `${n} cleared — not available for the ${t} you picked` : `${n} cleared — no longer available for what you picked`;
|
|
11
|
+
}
|
|
12
|
+
function g(e, t) {
|
|
13
|
+
const n = new Set(e.map((r) => r.field)), c = [...new Set(e.flatMap((r) => r.parents))].filter((r) => !n.has(r));
|
|
14
|
+
return c.length === 0 ? null : c.reduce((r, o) => t(o) > t(r) ? o : r, c[0]);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const w = 4e3, T = 500, P = "nvr-cascade-clear";
|
|
17
|
+
function v(e) {
|
|
18
18
|
const t = s(e);
|
|
19
19
|
t.current = e;
|
|
20
|
-
const
|
|
20
|
+
const n = s([]), c = s(0), r = s(null);
|
|
21
21
|
return f(
|
|
22
22
|
() => () => {
|
|
23
|
-
|
|
23
|
+
r.current && clearTimeout(r.current);
|
|
24
24
|
},
|
|
25
25
|
[]
|
|
26
26
|
), d((o) => {
|
|
27
27
|
const i = Date.now();
|
|
28
|
-
i - c.current >
|
|
29
|
-
const a =
|
|
28
|
+
i - c.current > w && (n.current = []), c.current = i, n.current.some((a) => a.field === o.field) || n.current.push(o), r.current && clearTimeout(r.current), r.current = setTimeout(() => {
|
|
29
|
+
const a = n.current;
|
|
30
30
|
if (a.length === 0) return;
|
|
31
|
-
const u =
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const u = g(a, t.current.editSeq);
|
|
32
|
+
k.info(
|
|
33
|
+
S(
|
|
34
34
|
a.map((l) => l.label),
|
|
35
35
|
u ? t.current.labelOf(u) : null
|
|
36
36
|
),
|
|
@@ -39,14 +39,16 @@ function M(e) {
|
|
|
39
39
|
description: "Pick them again from the narrowed lists."
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
},
|
|
42
|
+
}, T);
|
|
43
43
|
}, []);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function M(e, t, n) {
|
|
46
|
+
return n.crossFill > 0 || n.notPerson > 0 ? !1 : (e.touched.add(t), e.seq.set(t, e.next()), !0);
|
|
47
47
|
}
|
|
48
48
|
function A(e, t) {
|
|
49
|
-
t.leftWorkStaged
|
|
49
|
+
if (t.leftWorkStaged) return;
|
|
50
|
+
const n = new Set(t.typedDuringSave ?? []);
|
|
51
|
+
for (const c of [...e]) n.has(c) || e.delete(c);
|
|
50
52
|
}
|
|
51
53
|
function E(e) {
|
|
52
54
|
return `Pick a ${e}`;
|
|
@@ -55,14 +57,14 @@ function N(e) {
|
|
|
55
57
|
return typeof e == "string" && e.startsWith("Pick a ");
|
|
56
58
|
}
|
|
57
59
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
m as CascadeClearNoticeContext,
|
|
61
|
+
S as cascadeClearText,
|
|
60
62
|
E as cascadePickMessage,
|
|
61
|
-
|
|
63
|
+
g as cascadeRootParent,
|
|
62
64
|
N as isCascadePickMessage,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
p as joinLabels,
|
|
66
|
+
M as notePersonLinkEdit,
|
|
65
67
|
A as settleTouchedAfterSave,
|
|
66
|
-
|
|
68
|
+
v as useCascadeClearNotices,
|
|
67
69
|
$ as useCascadeClearNotifier
|
|
68
70
|
};
|
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
const o = (
|
|
2
|
-
function
|
|
3
|
-
return (
|
|
4
|
-
const
|
|
5
|
-
return
|
|
1
|
+
const o = (n, t) => n != null && String(n) === t;
|
|
2
|
+
function a(n, t) {
|
|
3
|
+
return (r) => {
|
|
4
|
+
const e = r[0];
|
|
5
|
+
return e === "o2m-rows" || e === "o2m-field-snapshots" || e === "m2m-items" || e === "summary-m2a-items" ? o(r[3], t) : e === "rrv-related" || e === "record-links" || e === "record-graph" || e === "referenced-by" ? r[1] === n && o(r[2], t) : e === "o2m-compare";
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return (
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function s(n, t) {
|
|
9
|
+
return (r) => (r[0] === "item-actions" || r[0] === "ext-item-actions") && r[1] === n && o(r[2], t);
|
|
10
|
+
}
|
|
11
|
+
function u(n, t) {
|
|
12
|
+
return (r) => r[0] === "resolve-paths" && r[1] === n && o(r[2], t);
|
|
13
|
+
}
|
|
14
|
+
const f = [
|
|
15
|
+
["pipeline-instance", "nivaro_addendums"],
|
|
16
|
+
["addendum-lines"]
|
|
17
|
+
];
|
|
18
|
+
function c(n, t) {
|
|
19
|
+
return (r) => {
|
|
20
|
+
const e = r[0];
|
|
21
|
+
return e === "m2m-items" ? o(r[3], t) : e === "file-usage" || e === "file-download-stats" ? r[1] === n && o(r[2], t) : e === "files-meta" || e === "file-meta" || e === "file-health";
|
|
12
22
|
};
|
|
13
23
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
return Math.floor(
|
|
24
|
+
const i = 3e3;
|
|
25
|
+
function d(n = Math.random) {
|
|
26
|
+
return Math.floor(n() * i);
|
|
17
27
|
}
|
|
18
28
|
export {
|
|
19
|
-
|
|
20
|
-
i as
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
f as ADDENDUM_DETAIL_KEYS,
|
|
30
|
+
i as WIDE_RELATED_SPREAD_MS,
|
|
31
|
+
s as actionQueryOfRecord,
|
|
32
|
+
c as fileQueryOfRecord,
|
|
33
|
+
a as relatedQueryOfRecord,
|
|
34
|
+
u as resolvedPathQueryOfRecord,
|
|
35
|
+
d as wideSpreadDelay
|
|
23
36
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useQueryClient as E } from "@tanstack/react-query";
|
|
2
|
+
import { useRef as d, useEffect as O } from "react";
|
|
3
|
+
import { useLiveEvent as a } from "../../lib/live.js";
|
|
4
|
+
import { useMyUserId as g } from "../../lib/presence-signals.js";
|
|
5
|
+
const h = 3e3;
|
|
6
|
+
function w(r, n) {
|
|
7
|
+
return (e) => (e == null ? void 0 : e.collection) == null || (e == null ? void 0 : e.item) == null ? !0 : e.collection === r && String(e.item) === n;
|
|
8
|
+
}
|
|
9
|
+
function y(r) {
|
|
10
|
+
const n = /* @__PURE__ */ new Set();
|
|
11
|
+
if (!Array.isArray(r == null ? void 0 : r.viewers)) return n;
|
|
12
|
+
for (const e of r.viewers) {
|
|
13
|
+
const t = (e == null ? void 0 : e.id) ?? (e == null ? void 0 : e.user_id);
|
|
14
|
+
t != null && n.add(String(t).toUpperCase());
|
|
15
|
+
}
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
function S(r, n, e) {
|
|
19
|
+
const t = y(n), o = e ? e.toUpperCase() : null;
|
|
20
|
+
let s = !1;
|
|
21
|
+
for (const u of t) !r.has(u) && u !== o && (s = !0);
|
|
22
|
+
r.clear();
|
|
23
|
+
for (const u of t) r.add(u);
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
function C(r) {
|
|
27
|
+
if (Array.isArray(r)) {
|
|
28
|
+
const n = /* @__PURE__ */ new Set();
|
|
29
|
+
for (const e of r) {
|
|
30
|
+
const t = (e == null ? void 0 : e.user_id) ?? (e == null ? void 0 : e.id);
|
|
31
|
+
t != null && n.add(String(t).toUpperCase());
|
|
32
|
+
}
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
return r && typeof r == "object" && r.status === "not_opened" ? /* @__PURE__ */ new Set() : null;
|
|
36
|
+
}
|
|
37
|
+
function _(r, n, e) {
|
|
38
|
+
if (!e) return !1;
|
|
39
|
+
const t = n ? n.toUpperCase() : null;
|
|
40
|
+
for (const o of y(r)) if (o !== t && !e.has(o)) return !0;
|
|
41
|
+
return !1;
|
|
42
|
+
}
|
|
43
|
+
function A(r, n, e, t = !0) {
|
|
44
|
+
const o = E(), s = g(), u = d(/* @__PURE__ */ new Set()), c = d(!1);
|
|
45
|
+
O(() => {
|
|
46
|
+
u.current = /* @__PURE__ */ new Set(), c.current = !1;
|
|
47
|
+
}, [r, n]);
|
|
48
|
+
const i = d(!1);
|
|
49
|
+
a(
|
|
50
|
+
"record:viewers",
|
|
51
|
+
(f) => {
|
|
52
|
+
var l;
|
|
53
|
+
if (!c.current) {
|
|
54
|
+
c.current = !0;
|
|
55
|
+
const m = (l = o.getQueriesData({ queryKey: [...e] })[0]) == null ? void 0 : l[1];
|
|
56
|
+
_(f, s, C(m)) && (i.current = !0), S(u.current, f, s);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
S(u.current, f, s) && (i.current = !0);
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
enabled: t && !!r && !!n,
|
|
63
|
+
includeOwn: !0,
|
|
64
|
+
match: w(r, n)
|
|
65
|
+
}
|
|
66
|
+
), a(
|
|
67
|
+
"record:viewers",
|
|
68
|
+
() => {
|
|
69
|
+
i.current && (i.current = !1, o.invalidateQueries({ queryKey: [...e] }));
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
enabled: t && !!r && !!n,
|
|
73
|
+
includeOwn: !0,
|
|
74
|
+
debounceMs: h,
|
|
75
|
+
match: w(r, n)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
h as RECORD_OPENED_SETTLE_MS,
|
|
81
|
+
S as bringsNewViewer,
|
|
82
|
+
_ as firstNoticeJoins,
|
|
83
|
+
C as knownOpeners,
|
|
84
|
+
A as useRefreshOnRecordOpened,
|
|
85
|
+
w as viewersNoticeFor
|
|
86
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs as u, jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Eye as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { formatRelative as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as u, jsx as p, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as g } from "@tanstack/react-query";
|
|
3
|
+
import { Eye as x, EyeOff as y } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as b } from "../../context.js";
|
|
5
|
+
import { get as v } from "../../lib/commands.js";
|
|
6
|
+
import { formatRelative as w, formatDateTime as d, cn as $ } from "../../lib/utils.js";
|
|
7
|
+
import { useRefreshOnRecordOpened as _ } from "../item-edit/record-opened-live.js";
|
|
8
|
+
import { UserChip as O } from "../item-edit/UserChip.js";
|
|
9
|
+
const f = "pipeline-owner-opened";
|
|
10
|
+
function N(e, r = w) {
|
|
10
11
|
var s, n, t;
|
|
11
12
|
if (e.status === "not_opened")
|
|
12
13
|
return {
|
|
@@ -24,34 +25,34 @@ function N(e, r = v) {
|
|
|
24
25
|
tail: ` opened this ${r(e.opened_at)}${i}`
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function C({
|
|
28
29
|
collection: e,
|
|
29
30
|
item: r,
|
|
30
31
|
stateId: i,
|
|
31
32
|
className: l
|
|
32
33
|
}) {
|
|
33
|
-
const s =
|
|
34
|
-
queryKey: [
|
|
34
|
+
const s = b(), { data: n } = g({
|
|
35
|
+
queryKey: [f, e, r, i],
|
|
35
36
|
queryFn: () => s.request(
|
|
36
|
-
|
|
37
|
-
).then((
|
|
37
|
+
v(`/pipelines/instance/${e}/${r}/owner-opened`)
|
|
38
|
+
).then((c) => c.data ?? null),
|
|
38
39
|
staleTime: 6e4,
|
|
39
40
|
retry: !1
|
|
40
41
|
});
|
|
41
|
-
if (!n || n.status !== "opened" && n.status !== "not_opened") return null;
|
|
42
|
+
if (_(e, r, [f, e, r]), !n || n.status !== "opened" && n.status !== "not_opened") return null;
|
|
42
43
|
const t = N(n);
|
|
43
44
|
if (!t) return null;
|
|
44
|
-
const o = n.status === "opened", m = o ?
|
|
45
|
+
const o = n.status === "opened", m = o ? x : y, a = o ? d(n.opened_at) : d(n.entered_at);
|
|
45
46
|
return /* @__PURE__ */ u(
|
|
46
47
|
"p",
|
|
47
48
|
{
|
|
48
49
|
"data-owner-opened": n.status,
|
|
49
|
-
className:
|
|
50
|
+
className: $(
|
|
50
51
|
"flex items-start gap-1.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400",
|
|
51
52
|
l
|
|
52
53
|
),
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ p(
|
|
55
56
|
m,
|
|
56
57
|
{
|
|
57
58
|
"aria-hidden": !0,
|
|
@@ -62,11 +63,11 @@ function A({
|
|
|
62
63
|
"span",
|
|
63
64
|
{
|
|
64
65
|
className: "min-w-0 text-left",
|
|
65
|
-
"data-tip": o ? `Opened ${
|
|
66
|
+
"data-tip": o ? `Opened ${a}` : `In this step since ${a}`,
|
|
66
67
|
children: [
|
|
67
68
|
t.lead,
|
|
68
|
-
o && n.by ? /* @__PURE__ */ u(
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
o && n.by ? /* @__PURE__ */ u(h, { children: [
|
|
70
|
+
/* @__PURE__ */ p(O, { userId: n.by.id, children: /* @__PURE__ */ p(
|
|
70
71
|
"button",
|
|
71
72
|
{
|
|
72
73
|
type: "button",
|
|
@@ -86,7 +87,7 @@ function A({
|
|
|
86
87
|
);
|
|
87
88
|
}
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
f as OWNER_OPENED_HEAD,
|
|
91
|
+
C as OwnerOpenedLine,
|
|
91
92
|
N as ownerOpenedWords
|
|
92
93
|
};
|
|
@@ -73,7 +73,7 @@ function ve({
|
|
|
73
73
|
enabled: !!((R = d == null ? void 0 : d.findings) != null && R.length),
|
|
74
74
|
staleTime: 6e4
|
|
75
75
|
}), L = () => {
|
|
76
|
-
i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: [t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
|
|
76
|
+
i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: ["rrv-record", t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
|
|
77
77
|
};
|
|
78
78
|
if (!(d != null && d.enabled) || d.findings.length === 0) return null;
|
|
79
79
|
const v = d.findings.length;
|
|
@@ -49,7 +49,7 @@ function F({ s, onApplied: m }) {
|
|
|
49
49
|
onSuccess: (e) => {
|
|
50
50
|
$.success(
|
|
51
51
|
`${e.team.action === "create" ? "Created" : "Linked"} ${e.team.name} on ${e.cells.length} cell${e.cells.length === 1 ? "" : "s"}`
|
|
52
|
-
), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["owner-groups"] }), e.team.id != null && m(e.team.id);
|
|
52
|
+
), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["pipeline-all-owner-groups"] }), e.team.id != null && m(e.team.id);
|
|
53
53
|
},
|
|
54
54
|
onError: (e) => w(e, "Could not apply")
|
|
55
55
|
}), q = [...new Set(s.cells.map((e) => e.template_name ?? "Template"))], k = s.members.filter((e) => e.redacted || e.status && e.status !== "active");
|