@nivaro/react 0.3.40 → 0.3.42
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/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,216 +1,280 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Bot as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useApiFetchConfig as
|
|
6
|
-
import { useLiveEvent as
|
|
7
|
-
import { useLiveOps as
|
|
8
|
-
import { resolveNotificationTarget as Z, runNotificationTarget as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
2
|
+
import { useQueryClient as ie, useQuery as le, useMutation as F } from "@tanstack/react-query";
|
|
3
|
+
import { Bot as ce } from "lucide-react";
|
|
4
|
+
import { useState as C, useRef as W, useEffect as E, useMemo as me } from "react";
|
|
5
|
+
import { useApiFetchConfig as ue, useItemNavigation as pe, useNavigation as be } from "../context.js";
|
|
6
|
+
import { useLiveEvent as he } from "../lib/live.js";
|
|
7
|
+
import { useLiveOps as xe, useFreshIds as ge } from "../lib/live-ops.js";
|
|
8
|
+
import { resolveNotificationTarget as Z, runNotificationTarget as fe } from "../lib/notification-target.js";
|
|
9
|
+
import { usePrefetchIntent as ke } from "../lib/prefetch.js";
|
|
10
|
+
import { useOptionalRealtime as ye } from "../lib/realtime.js";
|
|
11
|
+
import { userErrorMessage as we } from "../lib/safe-error.js";
|
|
12
|
+
import { withinDay as G, slaChip as Ne } from "../lib/sla-chip.js";
|
|
13
|
+
import { cn as M } from "../lib/utils.js";
|
|
14
|
+
import { AgentQuestionsCard as ve } from "./AgentQuestionsCard.js";
|
|
15
|
+
import { FirstWeekCard as _e } from "./ai/FirstWeekCard.js";
|
|
16
|
+
import { TaskDoButton as Ce } from "./ai/TaskDo.js";
|
|
17
|
+
import { openChatRoom as Se, canOpenChatRoom as $e } from "./chat/chat-core.js";
|
|
18
|
+
import { useMyRecordRooms as Te } from "./chat/chat-hooks.js";
|
|
19
|
+
import { LearningPathCard as je } from "./help-videos/viewer/LearningPathCard.js";
|
|
20
|
+
import { RequiredVideosCard as Ae } from "./help-videos/viewer/RequiredVideosCard.js";
|
|
21
|
+
import { SkeletonBar as Me, ListSkeleton as Le } from "./Skeletons.js";
|
|
22
|
+
import { TickerNumber as Oe } from "./TickerNumber.js";
|
|
23
|
+
import { UserAvatar as qe } from "./UserAvatar.js";
|
|
24
|
+
const Ie = 8e3, R = ["records", "tasks", "team", "waiting", "notifications"], X = {
|
|
23
25
|
records: "Waiting on you",
|
|
24
26
|
tasks: "My tasks",
|
|
25
27
|
team: "Team tasks",
|
|
26
28
|
waiting: "Waiting on others",
|
|
27
29
|
notifications: "Notifications"
|
|
28
|
-
},
|
|
30
|
+
}, De = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), L = (i) => !!i && String(i).slice(0, 10) < De(), Fe = {
|
|
29
31
|
alert: "bg-red-500/10 text-red-600 dark:text-red-400",
|
|
30
32
|
warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
|
|
31
33
|
neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
|
|
32
34
|
ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
33
35
|
};
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return
|
|
36
|
+
function We({ sla: i }) {
|
|
37
|
+
const u = Ne(i);
|
|
38
|
+
return u ? /* @__PURE__ */ e(
|
|
37
39
|
"span",
|
|
38
40
|
{
|
|
39
|
-
"data-sla-chip":
|
|
40
|
-
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${
|
|
41
|
-
children:
|
|
41
|
+
"data-sla-chip": u.tone,
|
|
42
|
+
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Fe[u.tone]}`,
|
|
43
|
+
children: u.label
|
|
42
44
|
}
|
|
43
45
|
) : null;
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
+
function Ee({ state: i, color: u }) {
|
|
48
|
+
return i ? /* @__PURE__ */ e(
|
|
47
49
|
"span",
|
|
48
50
|
{
|
|
49
51
|
className: "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
50
52
|
style: {
|
|
51
|
-
backgroundColor:
|
|
52
|
-
color:
|
|
53
|
+
backgroundColor: u ? `${u}22` : "rgba(100,116,139,.12)",
|
|
54
|
+
color: u ?? void 0
|
|
53
55
|
},
|
|
54
|
-
children:
|
|
56
|
+
children: i.replace(/_/g, " ")
|
|
55
57
|
}
|
|
56
58
|
) : null;
|
|
57
59
|
}
|
|
58
|
-
function
|
|
60
|
+
function Ue({ order: i, hidden: u }) {
|
|
61
|
+
const c = i.filter(
|
|
62
|
+
(m) => !u.includes(m) && (m === "records" || m === "tasks" || m === "notifications")
|
|
63
|
+
), y = (m, g) => /* @__PURE__ */ d(
|
|
64
|
+
"section",
|
|
65
|
+
{
|
|
66
|
+
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
69
|
+
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children: X[m] ?? m }),
|
|
70
|
+
m === "records" && /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ e(
|
|
73
|
+
Le,
|
|
74
|
+
{
|
|
75
|
+
header: !1,
|
|
76
|
+
rows: g,
|
|
77
|
+
rowClassName: "h-[37px] px-4",
|
|
78
|
+
columns: m === "records" ? [
|
|
79
|
+
{ key: "label", grow: 6 },
|
|
80
|
+
{ key: "where", width: 90, shape: "short" },
|
|
81
|
+
{ key: "state", width: 72, shape: "badge" },
|
|
82
|
+
{ key: "sla", width: 56, shape: "badge" }
|
|
83
|
+
] : [
|
|
84
|
+
{ key: "label", grow: 5 },
|
|
85
|
+
{ key: "when", width: 64, shape: "date" }
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
m
|
|
92
|
+
), k = [];
|
|
93
|
+
for (let m = 0; m < c.length; ) {
|
|
94
|
+
if (c[m] === "records") {
|
|
95
|
+
k.push(y("records", 5)), m++;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const g = c.slice(m, m + 2).filter((f) => f !== "records");
|
|
99
|
+
k.push(
|
|
100
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => y(f, 4)) }, g.join("+"))
|
|
101
|
+
), m += g.length;
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
|
|
104
|
+
/* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
|
|
105
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((m) => /* @__PURE__ */ d(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: m }),
|
|
111
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Me, { width: 34, className: "h-[18px] rounded-md" }) })
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
m
|
|
115
|
+
)) }),
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Refresh" }),
|
|
117
|
+
/* @__PURE__ */ e("span", { className: "ml-2 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Customize" })
|
|
118
|
+
] }),
|
|
119
|
+
k
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
122
|
+
function O({ label: i, value: u, tone: c }) {
|
|
59
123
|
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
|
|
60
|
-
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children:
|
|
61
|
-
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${
|
|
124
|
+
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: i }),
|
|
125
|
+
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(Oe, { value: u }) })
|
|
62
126
|
] });
|
|
63
127
|
}
|
|
64
|
-
function
|
|
65
|
-
notificationRoutes:
|
|
66
|
-
onOpenPath:
|
|
128
|
+
function mt({
|
|
129
|
+
notificationRoutes: i,
|
|
130
|
+
onOpenPath: u
|
|
67
131
|
} = {}) {
|
|
68
|
-
const { apiBase:
|
|
69
|
-
var
|
|
70
|
-
const n = ((
|
|
71
|
-
|
|
72
|
-
},
|
|
132
|
+
const { apiBase: c, authHeaders: y, credentials: k } = ue(), { open: m } = pe(), g = be(), f = ie(), ee = ke(), U = (r) => {
|
|
133
|
+
var h, l;
|
|
134
|
+
const n = ((h = i == null ? void 0 : i.support) == null ? void 0 : h.call(i, String(r))) ?? ((l = g.consoleUrl) == null ? void 0 : l.call(g, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
|
|
135
|
+
u ? u(n) : g.navigate(n);
|
|
136
|
+
}, q = ye(), [te, S] = C(!1), [x, re] = C(() => {
|
|
73
137
|
try {
|
|
74
138
|
const r = localStorage.getItem("nvr_mywork_sections");
|
|
75
139
|
if (r) {
|
|
76
140
|
const n = JSON.parse(r);
|
|
77
141
|
if (Array.isArray(n == null ? void 0 : n.order) && Array.isArray(n == null ? void 0 : n.hidden)) {
|
|
78
|
-
const
|
|
79
|
-
k:
|
|
80
|
-
at: n.order.indexOf(
|
|
81
|
-
})).sort((
|
|
82
|
-
return { order:
|
|
142
|
+
const h = R.map((l, p) => ({
|
|
143
|
+
k: l,
|
|
144
|
+
at: n.order.indexOf(l) >= 0 ? n.order.indexOf(l) : p - 0.5
|
|
145
|
+
})).sort((l, p) => l.at - p.at).map((l) => l.k);
|
|
146
|
+
return { order: h, hidden: n.hidden.filter((l) => h.includes(l)) };
|
|
83
147
|
}
|
|
84
148
|
}
|
|
85
149
|
} catch {
|
|
86
150
|
}
|
|
87
|
-
return { order: [...
|
|
151
|
+
return { order: [...R], hidden: [] };
|
|
88
152
|
}), K = (r) => {
|
|
89
|
-
|
|
153
|
+
re(r);
|
|
90
154
|
try {
|
|
91
155
|
localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
|
|
92
156
|
} catch {
|
|
93
157
|
}
|
|
94
|
-
}, [
|
|
158
|
+
}, [ae, de] = C(!1), P = W(0), [$, ne] = C("all"), { data: a, isLoading: se, refetch: Q, isFetching: B } = le({
|
|
95
159
|
queryKey: ["my-work"],
|
|
96
160
|
queryFn: async () => {
|
|
97
|
-
const r = await fetch(`${
|
|
161
|
+
const r = await fetch(`${c}/my-work`, { headers: y, credentials: k });
|
|
98
162
|
if (!r.ok) throw new Error("my-work failed");
|
|
99
163
|
return (await r.json()).data;
|
|
100
164
|
},
|
|
101
165
|
staleTime: 6e4
|
|
102
|
-
}), z =
|
|
166
|
+
}), z = W(0), w = W(null), H = () => {
|
|
103
167
|
const r = () => {
|
|
104
|
-
|
|
105
|
-
}, n = z.current +
|
|
106
|
-
|
|
168
|
+
w.current = null, z.current = Date.now(), S(!1), f.invalidateQueries({ queryKey: ["my-work"] });
|
|
169
|
+
}, n = z.current + Ie - Date.now();
|
|
170
|
+
w.current || (n <= 0 ? r() : w.current = setTimeout(r, n));
|
|
107
171
|
};
|
|
108
|
-
|
|
172
|
+
xe("my-work", H, { debounceMs: 1500 }), he("notification:new", H, { debounceMs: 1500 }), E(
|
|
109
173
|
() => () => {
|
|
110
|
-
|
|
174
|
+
w.current && clearTimeout(w.current);
|
|
111
175
|
},
|
|
112
176
|
[]
|
|
113
177
|
);
|
|
114
|
-
const J =
|
|
178
|
+
const J = ge([
|
|
115
179
|
...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
|
|
116
180
|
...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
|
|
117
181
|
...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
|
|
118
182
|
...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
|
|
119
183
|
...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
|
|
120
|
-
]),
|
|
184
|
+
]), N = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = me(() => {
|
|
121
185
|
const r = /* @__PURE__ */ new Set();
|
|
122
186
|
for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
|
|
123
187
|
return [...r];
|
|
124
188
|
}, [a]);
|
|
125
189
|
E(() => {
|
|
126
|
-
if (!(!
|
|
127
|
-
return
|
|
190
|
+
if (!(!q || I.length === 0))
|
|
191
|
+
return q.subscribeCollections(I, () => {
|
|
128
192
|
const r = Date.now();
|
|
129
|
-
r -
|
|
193
|
+
r - P.current < 3e4 || (P.current = r, S(!0));
|
|
130
194
|
});
|
|
131
|
-
}, [
|
|
132
|
-
const V =
|
|
195
|
+
}, [q, I]);
|
|
196
|
+
const V = F({
|
|
133
197
|
// A ticket closes through /support so its requester hears about it.
|
|
134
|
-
mutationFn: (r) => fetch(`${
|
|
198
|
+
mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
|
|
135
199
|
method: "PATCH",
|
|
136
|
-
headers: { ...
|
|
137
|
-
credentials:
|
|
200
|
+
headers: { ...y, "content-type": "application/json" },
|
|
201
|
+
credentials: k,
|
|
138
202
|
body: JSON.stringify({ status: "done" })
|
|
139
203
|
}),
|
|
140
|
-
onSuccess: () =>
|
|
141
|
-
}),
|
|
204
|
+
onSuccess: () => f.invalidateQueries({ queryKey: ["my-work"] })
|
|
205
|
+
}), T = F({
|
|
142
206
|
mutationFn: async ({ id: r, action: n }) => {
|
|
143
|
-
const
|
|
207
|
+
const h = await fetch(`${c}/tasks/${r}/${n}`, {
|
|
144
208
|
method: "POST",
|
|
145
|
-
headers: { ...
|
|
146
|
-
credentials:
|
|
209
|
+
headers: { ...y, "content-type": "application/json" },
|
|
210
|
+
credentials: k,
|
|
147
211
|
body: "{}"
|
|
148
|
-
}),
|
|
149
|
-
if (!
|
|
212
|
+
}), l = await h.json().catch(() => ({}));
|
|
213
|
+
if (!h.ok) throw new Error(l.error ?? "Failed");
|
|
150
214
|
return n;
|
|
151
215
|
},
|
|
152
216
|
onSuccess: (r) => {
|
|
153
|
-
|
|
217
|
+
D(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), f.invalidateQueries({ queryKey: ["my-work"] });
|
|
154
218
|
},
|
|
155
|
-
onError: (r) =>
|
|
156
|
-
}), [
|
|
219
|
+
onError: (r) => D(we(r, "Failed"))
|
|
220
|
+
}), [j, D] = C(null);
|
|
157
221
|
E(() => {
|
|
158
|
-
if (!
|
|
159
|
-
const r = setTimeout(() =>
|
|
222
|
+
if (!j) return;
|
|
223
|
+
const r = setTimeout(() => D(null), 4e3);
|
|
160
224
|
return () => clearTimeout(r);
|
|
161
|
-
}, [
|
|
162
|
-
const Y =
|
|
163
|
-
mutationFn: (r) => fetch(`${
|
|
225
|
+
}, [j]);
|
|
226
|
+
const Y = F({
|
|
227
|
+
mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
|
|
164
228
|
method: "POST",
|
|
165
|
-
headers: { ...
|
|
166
|
-
credentials:
|
|
229
|
+
headers: { ...y, "content-type": "application/json" },
|
|
230
|
+
credentials: k,
|
|
167
231
|
body: JSON.stringify({ ids: r })
|
|
168
232
|
}),
|
|
169
233
|
onSuccess: () => {
|
|
170
|
-
|
|
234
|
+
f.invalidateQueries({ queryKey: ["my-work"] }), f.invalidateQueries({ queryKey: ["notifications"] });
|
|
171
235
|
}
|
|
172
|
-
}),
|
|
173
|
-
const
|
|
174
|
-
record: (
|
|
175
|
-
...
|
|
176
|
-
},
|
|
177
|
-
...
|
|
178
|
-
record: (
|
|
179
|
-
var
|
|
180
|
-
return ((
|
|
236
|
+
}), v = (r, n) => {
|
|
237
|
+
const h = {
|
|
238
|
+
record: (p, t) => (m({ collection: p, itemId: t }), null),
|
|
239
|
+
...i
|
|
240
|
+
}, l = Z(r, n, {
|
|
241
|
+
...h,
|
|
242
|
+
record: (p, t) => {
|
|
243
|
+
var b;
|
|
244
|
+
return ((b = i == null ? void 0 : i.record) == null ? void 0 : b.call(i, p, t)) ?? null;
|
|
181
245
|
}
|
|
182
246
|
});
|
|
183
|
-
if (
|
|
184
|
-
|
|
247
|
+
if (l) {
|
|
248
|
+
fe(l, (p) => u == null ? void 0 : u(p));
|
|
185
249
|
return;
|
|
186
250
|
}
|
|
187
|
-
r && n && !/^nivaro_/i.test(r) && r !== "__chat__" &&
|
|
188
|
-
},
|
|
251
|
+
r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && m({ collection: r, itemId: n });
|
|
252
|
+
}, oe = (r, n) => r && n && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, n, {
|
|
189
253
|
record: () => null,
|
|
190
|
-
...
|
|
254
|
+
...i
|
|
191
255
|
});
|
|
192
|
-
return
|
|
193
|
-
/* @__PURE__ */ e(
|
|
256
|
+
return se || !a ? /* @__PURE__ */ e(Ue, { order: x.order, hidden: x.hidden }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
|
|
257
|
+
/* @__PURE__ */ e(_e, { onOpenPath: u }),
|
|
194
258
|
/* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
|
|
195
259
|
/* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
|
|
196
|
-
/* @__PURE__ */ e(
|
|
260
|
+
/* @__PURE__ */ e(O, { label: "Waiting on you", value: a.counts.owned }),
|
|
197
261
|
/* @__PURE__ */ e(
|
|
198
|
-
|
|
262
|
+
O,
|
|
199
263
|
{
|
|
200
264
|
label: "SLA breached",
|
|
201
265
|
value: a.counts.owned_breached,
|
|
202
266
|
tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
|
|
203
267
|
}
|
|
204
268
|
),
|
|
205
|
-
/* @__PURE__ */ e(
|
|
206
|
-
/* @__PURE__ */ e(
|
|
269
|
+
/* @__PURE__ */ e(O, { label: "Open tasks", value: a.counts.tasks }),
|
|
270
|
+
/* @__PURE__ */ e(O, { label: "Unread notifications", value: a.counts.notifications })
|
|
207
271
|
] }),
|
|
208
|
-
|
|
272
|
+
te && /* @__PURE__ */ d(
|
|
209
273
|
"button",
|
|
210
274
|
{
|
|
211
275
|
type: "button",
|
|
212
276
|
onClick: () => {
|
|
213
|
-
|
|
277
|
+
S(!1), Q();
|
|
214
278
|
},
|
|
215
279
|
className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
|
|
216
280
|
children: [
|
|
@@ -224,7 +288,7 @@ function nt({
|
|
|
224
288
|
{
|
|
225
289
|
type: "button",
|
|
226
290
|
onClick: () => {
|
|
227
|
-
|
|
291
|
+
S(!1), Q();
|
|
228
292
|
},
|
|
229
293
|
disabled: B,
|
|
230
294
|
className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
@@ -236,17 +300,17 @@ function nt({
|
|
|
236
300
|
"button",
|
|
237
301
|
{
|
|
238
302
|
type: "button",
|
|
239
|
-
onClick: () =>
|
|
303
|
+
onClick: () => de((r) => !r),
|
|
240
304
|
className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
|
|
241
305
|
children: "Customize"
|
|
242
306
|
}
|
|
243
307
|
),
|
|
244
|
-
|
|
308
|
+
ae && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
245
309
|
/* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
|
|
246
310
|
x.order.map((r, n) => {
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
|
|
311
|
+
const h = X[r] ?? r, l = x.hidden.includes(r), p = (t) => {
|
|
312
|
+
const b = [...x.order], o = n + t;
|
|
313
|
+
o < 0 || o >= b.length || ([b[n], b[o]] = [b[o], b[n]], K({ ...x, order: b }));
|
|
250
314
|
};
|
|
251
315
|
return /* @__PURE__ */ d("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
|
|
252
316
|
/* @__PURE__ */ e(
|
|
@@ -255,25 +319,25 @@ function nt({
|
|
|
255
319
|
type: "button",
|
|
256
320
|
onClick: () => K({
|
|
257
321
|
...x,
|
|
258
|
-
hidden:
|
|
322
|
+
hidden: l ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
|
|
259
323
|
}),
|
|
260
324
|
className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
|
|
261
|
-
title:
|
|
262
|
-
children:
|
|
325
|
+
title: l ? "Show section" : "Hide section",
|
|
326
|
+
children: l ? "" : "✓"
|
|
263
327
|
}
|
|
264
328
|
),
|
|
265
329
|
/* @__PURE__ */ e(
|
|
266
330
|
"span",
|
|
267
331
|
{
|
|
268
|
-
className: `min-w-0 flex-1 truncate text-[12px] ${
|
|
269
|
-
children:
|
|
332
|
+
className: `min-w-0 flex-1 truncate text-[12px] ${l ? "text-slate-400 line-through" : ""}`,
|
|
333
|
+
children: h
|
|
270
334
|
}
|
|
271
335
|
),
|
|
272
336
|
/* @__PURE__ */ e(
|
|
273
337
|
"button",
|
|
274
338
|
{
|
|
275
339
|
type: "button",
|
|
276
|
-
onClick: () =>
|
|
340
|
+
onClick: () => p(-1),
|
|
277
341
|
disabled: n === 0,
|
|
278
342
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
279
343
|
children: "↑"
|
|
@@ -283,7 +347,7 @@ function nt({
|
|
|
283
347
|
"button",
|
|
284
348
|
{
|
|
285
349
|
type: "button",
|
|
286
|
-
onClick: () =>
|
|
350
|
+
onClick: () => p(1),
|
|
287
351
|
disabled: n === x.order.length - 1,
|
|
288
352
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
289
353
|
children: "↓"
|
|
@@ -294,73 +358,74 @@ function nt({
|
|
|
294
358
|
] })
|
|
295
359
|
] })
|
|
296
360
|
] }),
|
|
297
|
-
|
|
361
|
+
j && /* @__PURE__ */ e(
|
|
298
362
|
"p",
|
|
299
363
|
{
|
|
300
364
|
className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[12px] dark:border-border dark:bg-card",
|
|
301
365
|
role: "status",
|
|
302
366
|
"data-my-work-task-note": !0,
|
|
303
|
-
children:
|
|
367
|
+
children: j
|
|
304
368
|
}
|
|
305
369
|
),
|
|
306
|
-
/* @__PURE__ */ e(
|
|
307
|
-
/* @__PURE__ */ e(
|
|
308
|
-
/* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e(ve, { questions: a.questions ?? [] }),
|
|
371
|
+
/* @__PURE__ */ e(Ae, { className: "mb-4" }),
|
|
372
|
+
/* @__PURE__ */ e(je, { className: "mb-4" }),
|
|
309
373
|
(() => {
|
|
310
374
|
const r = {
|
|
311
375
|
records: () => {
|
|
312
|
-
const t = a.owned.filter((
|
|
313
|
-
var
|
|
314
|
-
return ((
|
|
315
|
-
}).length,
|
|
316
|
-
var
|
|
317
|
-
return ((
|
|
318
|
-
}) : a.owned,
|
|
376
|
+
const t = a.owned.filter((s) => G(s.sla)).length, b = a.owned.filter((s) => {
|
|
377
|
+
var _;
|
|
378
|
+
return ((_ = s.sla) == null ? void 0 : _.status) === "breached";
|
|
379
|
+
}).length, o = $ === "soon" ? a.owned.filter((s) => G(s.sla)) : $ === "breached" ? a.owned.filter((s) => {
|
|
380
|
+
var _;
|
|
381
|
+
return ((_ = s.sla) == null ? void 0 : _.status) === "breached";
|
|
382
|
+
}) : a.owned, A = [
|
|
319
383
|
{ key: "all", label: `All (${a.owned.length})` },
|
|
320
384
|
{ key: "soon", label: `Warning within 24h (${t})` },
|
|
321
|
-
{ key: "breached", label: `Breached (${
|
|
385
|
+
{ key: "breached", label: `Breached (${b})` }
|
|
322
386
|
];
|
|
323
387
|
return /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
324
388
|
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
325
389
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
|
|
326
390
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
|
|
327
391
|
] }),
|
|
328
|
-
a.owned.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children:
|
|
392
|
+
a.owned.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: A.map((s) => /* @__PURE__ */ e(
|
|
329
393
|
"button",
|
|
330
394
|
{
|
|
331
395
|
type: "button",
|
|
332
|
-
"data-my-work-sla-filter":
|
|
333
|
-
"aria-pressed": $ ===
|
|
334
|
-
onClick: () =>
|
|
396
|
+
"data-my-work-sla-filter": s.key,
|
|
397
|
+
"aria-pressed": $ === s.key,
|
|
398
|
+
onClick: () => ne(s.key),
|
|
335
399
|
className: [
|
|
336
400
|
"rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
|
|
337
|
-
$ ===
|
|
401
|
+
$ === s.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
338
402
|
].join(" "),
|
|
339
|
-
children:
|
|
403
|
+
children: s.label
|
|
340
404
|
},
|
|
341
|
-
|
|
405
|
+
s.key
|
|
342
406
|
)) }) }),
|
|
343
|
-
|
|
407
|
+
o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((s) => /* @__PURE__ */ e(
|
|
344
408
|
"li",
|
|
345
409
|
{
|
|
346
|
-
className:
|
|
347
|
-
"data-my-work-fresh": J.has(`o:${
|
|
410
|
+
className: N(`o:${s.collection}:${s.item}`),
|
|
411
|
+
"data-my-work-fresh": J.has(`o:${s.collection}:${s.item}`) || void 0,
|
|
348
412
|
children: /* @__PURE__ */ d(
|
|
349
413
|
"button",
|
|
350
414
|
{
|
|
351
415
|
type: "button",
|
|
352
|
-
onClick: () =>
|
|
416
|
+
onClick: () => v(s.collection, s.item),
|
|
417
|
+
...ee.record(s.collection, s.item),
|
|
353
418
|
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
|
|
354
419
|
children: [
|
|
355
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children:
|
|
356
|
-
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children:
|
|
357
|
-
/* @__PURE__ */ e(
|
|
358
|
-
/* @__PURE__ */ e(
|
|
420
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: s.label }),
|
|
421
|
+
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: s.collection.replace(/_/g, " ") }),
|
|
422
|
+
/* @__PURE__ */ e(Ee, { state: s.state, color: s.state_color }),
|
|
423
|
+
/* @__PURE__ */ e(We, { sla: s.sla })
|
|
359
424
|
]
|
|
360
425
|
}
|
|
361
426
|
)
|
|
362
427
|
},
|
|
363
|
-
`${
|
|
428
|
+
`${s.collection}:${s.item}`
|
|
364
429
|
)) })
|
|
365
430
|
] });
|
|
366
431
|
},
|
|
@@ -369,7 +434,7 @@ function nt({
|
|
|
369
434
|
a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ d(
|
|
370
435
|
"li",
|
|
371
436
|
{
|
|
372
|
-
className:
|
|
437
|
+
className: M("flex items-center gap-2.5 px-4 py-2", N(`t:${t.id}`)),
|
|
373
438
|
children: [
|
|
374
439
|
/* @__PURE__ */ e(
|
|
375
440
|
"button",
|
|
@@ -391,7 +456,7 @@ function nt({
|
|
|
391
456
|
"data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
|
|
392
457
|
"data-my-work-agent-task": t.id,
|
|
393
458
|
children: [
|
|
394
|
-
/* @__PURE__ */ e(
|
|
459
|
+
/* @__PURE__ */ e(ce, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
395
460
|
t.agent_name ?? "Agent"
|
|
396
461
|
]
|
|
397
462
|
}
|
|
@@ -400,7 +465,7 @@ function nt({
|
|
|
400
465
|
"button",
|
|
401
466
|
{
|
|
402
467
|
type: "button",
|
|
403
|
-
onClick: () => t.kind === "support" ? U(t.id) :
|
|
468
|
+
onClick: () => t.kind === "support" ? U(t.id) : v(t.collection, t.item),
|
|
404
469
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
405
470
|
children: [
|
|
406
471
|
t.title,
|
|
@@ -409,18 +474,18 @@ function nt({
|
|
|
409
474
|
}
|
|
410
475
|
),
|
|
411
476
|
/* @__PURE__ */ e(
|
|
412
|
-
|
|
477
|
+
Ce,
|
|
413
478
|
{
|
|
414
479
|
task: t,
|
|
415
480
|
isAssignee: !0,
|
|
416
481
|
compact: !0,
|
|
417
|
-
onTaskChanged: () => void
|
|
482
|
+
onTaskChanged: () => void f.invalidateQueries({ queryKey: ["my-work"] })
|
|
418
483
|
}
|
|
419
484
|
),
|
|
420
485
|
t.due_date && /* @__PURE__ */ e(
|
|
421
486
|
"span",
|
|
422
487
|
{
|
|
423
|
-
className: `text-[11px] tabular-nums ${
|
|
488
|
+
className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
424
489
|
children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
|
|
425
490
|
}
|
|
426
491
|
)
|
|
@@ -442,7 +507,7 @@ function nt({
|
|
|
442
507
|
(a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ d(
|
|
443
508
|
"li",
|
|
444
509
|
{
|
|
445
|
-
className:
|
|
510
|
+
className: M("flex items-center gap-2.5 px-4 py-2", N(`tt:${t.id}`)),
|
|
446
511
|
"data-my-work-team-task": t.id,
|
|
447
512
|
children: [
|
|
448
513
|
t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
|
|
@@ -450,7 +515,7 @@ function nt({
|
|
|
450
515
|
"button",
|
|
451
516
|
{
|
|
452
517
|
type: "button",
|
|
453
|
-
onClick: () =>
|
|
518
|
+
onClick: () => v(t.collection, t.item),
|
|
454
519
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
455
520
|
children: [
|
|
456
521
|
t.title,
|
|
@@ -461,7 +526,7 @@ function nt({
|
|
|
461
526
|
t.due_date && /* @__PURE__ */ e(
|
|
462
527
|
"span",
|
|
463
528
|
{
|
|
464
|
-
className: `text-[11px] tabular-nums ${
|
|
529
|
+
className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
465
530
|
children: new Date(t.due_date).toLocaleDateString(void 0, {
|
|
466
531
|
timeZone: "UTC"
|
|
467
532
|
})
|
|
@@ -471,8 +536,8 @@ function nt({
|
|
|
471
536
|
"button",
|
|
472
537
|
{
|
|
473
538
|
type: "button",
|
|
474
|
-
onClick: () =>
|
|
475
|
-
disabled:
|
|
539
|
+
onClick: () => T.mutate({ id: t.id, action: "claim" }),
|
|
540
|
+
disabled: T.isPending,
|
|
476
541
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
|
|
477
542
|
"data-my-work-claim": t.id,
|
|
478
543
|
children: "Pick it up"
|
|
@@ -486,7 +551,7 @@ function nt({
|
|
|
486
551
|
}
|
|
487
552
|
),
|
|
488
553
|
waiting: () => {
|
|
489
|
-
const t = a.requested ?? [],
|
|
554
|
+
const t = a.requested ?? [], b = t.filter((o) => L(o.due_date)).length;
|
|
490
555
|
return /* @__PURE__ */ d(
|
|
491
556
|
"section",
|
|
492
557
|
{
|
|
@@ -496,63 +561,63 @@ function nt({
|
|
|
496
561
|
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
497
562
|
/* @__PURE__ */ d("h2", { className: "text-[13px] font-medium", children: [
|
|
498
563
|
"Waiting on others",
|
|
499
|
-
|
|
500
|
-
|
|
564
|
+
b > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
|
|
565
|
+
b,
|
|
501
566
|
" overdue"
|
|
502
567
|
] })
|
|
503
568
|
] }),
|
|
504
569
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
|
|
505
570
|
] }),
|
|
506
|
-
t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((
|
|
507
|
-
const
|
|
571
|
+
t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((o) => {
|
|
572
|
+
const A = L(o.due_date), s = !!o.nudged_at && Date.now() - new Date(o.nudged_at).getTime() < 20 * 36e5;
|
|
508
573
|
return /* @__PURE__ */ d(
|
|
509
574
|
"li",
|
|
510
575
|
{
|
|
511
|
-
className:
|
|
512
|
-
"data-my-work-requested":
|
|
576
|
+
className: M("flex items-center gap-2.5 px-4 py-2", N(`r:${o.id}`)),
|
|
577
|
+
"data-my-work-requested": o.id,
|
|
513
578
|
children: [
|
|
514
579
|
/* @__PURE__ */ d(
|
|
515
580
|
"button",
|
|
516
581
|
{
|
|
517
582
|
type: "button",
|
|
518
|
-
onClick: () =>
|
|
583
|
+
onClick: () => o.kind === "support" ? U(o.id) : v(o.collection, o.item),
|
|
519
584
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
520
585
|
children: [
|
|
521
|
-
|
|
586
|
+
o.title,
|
|
522
587
|
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
|
|
523
|
-
|
|
524
|
-
|
|
588
|
+
o.assignee_name ?? (o.team_name ? `${o.team_name} team` : "Unassigned"),
|
|
589
|
+
o.item_label
|
|
525
590
|
].filter(Boolean).join(" · ") })
|
|
526
591
|
]
|
|
527
592
|
}
|
|
528
593
|
),
|
|
529
|
-
|
|
594
|
+
o.due_date && /* @__PURE__ */ d(
|
|
530
595
|
"span",
|
|
531
596
|
{
|
|
532
|
-
className: `text-[11px] tabular-nums ${
|
|
597
|
+
className: `text-[11px] tabular-nums ${A ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
533
598
|
children: [
|
|
534
|
-
|
|
535
|
-
new Date(
|
|
599
|
+
A ? "Overdue · " : "",
|
|
600
|
+
new Date(o.due_date).toLocaleDateString(void 0, {
|
|
536
601
|
timeZone: "UTC"
|
|
537
602
|
})
|
|
538
603
|
]
|
|
539
604
|
}
|
|
540
605
|
),
|
|
541
|
-
|
|
606
|
+
o.kind !== "support" && /* @__PURE__ */ e(
|
|
542
607
|
"button",
|
|
543
608
|
{
|
|
544
609
|
type: "button",
|
|
545
|
-
onClick: () =>
|
|
546
|
-
disabled:
|
|
547
|
-
title:
|
|
610
|
+
onClick: () => T.mutate({ id: o.id, action: "nudge" }),
|
|
611
|
+
disabled: T.isPending || s,
|
|
612
|
+
title: s ? "Already nudged today" : "Send a reminder",
|
|
548
613
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
549
|
-
"data-my-work-nudge":
|
|
550
|
-
children:
|
|
614
|
+
"data-my-work-nudge": o.id,
|
|
615
|
+
children: s ? "Nudged" : "Nudge"
|
|
551
616
|
}
|
|
552
617
|
)
|
|
553
618
|
]
|
|
554
619
|
},
|
|
555
|
-
|
|
620
|
+
o.id
|
|
556
621
|
);
|
|
557
622
|
}) })
|
|
558
623
|
]
|
|
@@ -575,10 +640,10 @@ function nt({
|
|
|
575
640
|
a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ d(
|
|
576
641
|
"li",
|
|
577
642
|
{
|
|
578
|
-
className:
|
|
643
|
+
className: M("flex items-start gap-2.5 px-4 py-2", N(`n:${t.id}`)),
|
|
579
644
|
children: [
|
|
580
645
|
/* @__PURE__ */ e(
|
|
581
|
-
|
|
646
|
+
qe,
|
|
582
647
|
{
|
|
583
648
|
userId: t.sender,
|
|
584
649
|
className: "mt-0.5 h-5 w-5",
|
|
@@ -589,8 +654,8 @@ function nt({
|
|
|
589
654
|
"button",
|
|
590
655
|
{
|
|
591
656
|
type: "button",
|
|
592
|
-
onClick: () =>
|
|
593
|
-
className:
|
|
657
|
+
onClick: () => v(t.collection, t.item),
|
|
658
|
+
className: oe(t.collection, t.item) ? "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80" : "min-w-0 flex-1 cursor-default text-left",
|
|
594
659
|
children: [
|
|
595
660
|
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
|
|
596
661
|
t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
|
|
@@ -614,57 +679,57 @@ function nt({
|
|
|
614
679
|
] })
|
|
615
680
|
}, n = new Map(
|
|
616
681
|
x.order.filter((t) => !x.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
|
|
617
|
-
),
|
|
618
|
-
let
|
|
619
|
-
for (;
|
|
620
|
-
const t =
|
|
682
|
+
), h = [...n.keys()], l = [];
|
|
683
|
+
let p = 0;
|
|
684
|
+
for (; p < h.length; ) {
|
|
685
|
+
const t = h[p];
|
|
621
686
|
if (t === "records")
|
|
622
|
-
|
|
687
|
+
l.push(/* @__PURE__ */ e("div", { children: n.get(t) }, t)), p++;
|
|
623
688
|
else {
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children:
|
|
627
|
-
),
|
|
689
|
+
const b = [t];
|
|
690
|
+
p + 1 < h.length && h[p + 1] !== "records" && b.push(h[p + 1]), l.push(
|
|
691
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: b.map((o) => /* @__PURE__ */ e("div", { children: n.get(o) }, o)) }, b.join("+"))
|
|
692
|
+
), p += b.length;
|
|
628
693
|
}
|
|
629
694
|
}
|
|
630
|
-
return
|
|
695
|
+
return l;
|
|
631
696
|
})(),
|
|
632
|
-
/* @__PURE__ */ e(
|
|
697
|
+
/* @__PURE__ */ e(Ke, {})
|
|
633
698
|
] });
|
|
634
699
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
637
|
-
return !
|
|
700
|
+
function Ke() {
|
|
701
|
+
const i = $e(), { rooms: u } = Te(i);
|
|
702
|
+
return !i || u.length === 0 ? null : /* @__PURE__ */ d(
|
|
638
703
|
"section",
|
|
639
704
|
{
|
|
640
705
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
641
706
|
"data-my-work-chat": !0,
|
|
642
707
|
children: [
|
|
643
708
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
|
|
644
|
-
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children:
|
|
709
|
+
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: u.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
645
710
|
"button",
|
|
646
711
|
{
|
|
647
712
|
type: "button",
|
|
648
|
-
onClick: () =>
|
|
713
|
+
onClick: () => Se(c.room, c.label),
|
|
649
714
|
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
|
|
650
|
-
"data-my-work-chat-room":
|
|
715
|
+
"data-my-work-chat-room": c.room,
|
|
651
716
|
children: [
|
|
652
717
|
/* @__PURE__ */ d("span", { className: "min-w-0 flex-1", children: [
|
|
653
|
-
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children:
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
718
|
+
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: c.label }),
|
|
719
|
+
c.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
|
|
720
|
+
c.last_message.sender_name ? `${c.last_message.sender_name}: ` : "",
|
|
721
|
+
c.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
|
|
657
722
|
] })
|
|
658
723
|
] }),
|
|
659
|
-
|
|
660
|
-
/* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-slate-100 px-1.5 text-[10px] font-bold tabular-nums text-slate-600 dark:bg-muted dark:text-slate-300", children:
|
|
724
|
+
c.mentions > 0 && /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white", children: "@" }),
|
|
725
|
+
/* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-slate-100 px-1.5 text-[10px] font-bold tabular-nums text-slate-600 dark:bg-muted dark:text-slate-300", children: c.unread > 99 ? "99+" : c.unread })
|
|
661
726
|
]
|
|
662
727
|
}
|
|
663
|
-
) },
|
|
728
|
+
) }, c.room)) })
|
|
664
729
|
]
|
|
665
730
|
}
|
|
666
731
|
);
|
|
667
732
|
}
|
|
668
733
|
export {
|
|
669
|
-
|
|
734
|
+
mt as MyWorkView
|
|
670
735
|
};
|