@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,20 +1,22 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as we, useQuery as F, useMutation as I } from "@tanstack/react-query";
|
|
3
|
-
import { Settings as
|
|
3
|
+
import { Settings as ke, Trash2 as xe, Plus as V, X as qe, UserPlus as Ce, Loader2 as Y } from "lucide-react";
|
|
4
4
|
import { useState as h, useRef as Fe, useEffect as Ge } from "react";
|
|
5
5
|
import { toast as w } from "sonner";
|
|
6
6
|
import { useNivaroClient as fe } from "../../context.js";
|
|
7
7
|
import { get as G, post as W, patch as Se, del as oe } from "../../lib/commands.js";
|
|
8
|
-
import {
|
|
8
|
+
import { describeOwnerGroup as _e, sentenceLabelsFromFields as $e } from "../../lib/config-sentences.js";
|
|
9
|
+
import { useRecordReader as Ie } from "../../lib/record-loader.js";
|
|
10
|
+
import { ConfigReadBack as Ee } from "../ConfigReadBack.js";
|
|
9
11
|
import { UserAvatar as ce } from "../UserAvatar.js";
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Command as
|
|
12
|
+
import { Button as k } from "../ui/button.js";
|
|
13
|
+
import { Command as Le, CommandInput as je, CommandList as Pe, CommandEmpty as Oe, CommandGroup as Ue, CommandItem as De } from "../ui/command.js";
|
|
12
14
|
import { Input as S } from "../ui/input.js";
|
|
13
15
|
import { Label as C } from "../ui/label.js";
|
|
14
|
-
import { Popover as
|
|
16
|
+
import { Popover as ze, PopoverTrigger as Ae, PopoverContent as Re } from "../ui/popover.js";
|
|
15
17
|
import { SimpleSelect as de } from "../ui/SimpleSelect.js";
|
|
16
|
-
import { FieldPicker as
|
|
17
|
-
import { findM2ORelation as
|
|
18
|
+
import { FieldPicker as Ke } from "./FieldPicker.js";
|
|
19
|
+
import { findM2ORelation as Be, findO2MRelation as Te, renderDisplayTemplate as Me } from "./relations.js";
|
|
18
20
|
const ue = {
|
|
19
21
|
string: [
|
|
20
22
|
{ label: "=", value: "eq" },
|
|
@@ -72,24 +74,24 @@ const ue = {
|
|
|
72
74
|
{ label: "≠", value: "neq" }
|
|
73
75
|
]
|
|
74
76
|
};
|
|
75
|
-
function
|
|
77
|
+
function Qe(t) {
|
|
76
78
|
return ue[t] ?? ue.string;
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function Ve({
|
|
79
81
|
relatedCollection: t,
|
|
80
82
|
value: o,
|
|
81
83
|
onChange: x
|
|
82
84
|
}) {
|
|
83
85
|
const c = fe();
|
|
84
|
-
|
|
85
|
-
const [n, f] = h(""), [d,
|
|
86
|
+
Ie();
|
|
87
|
+
const [n, f] = h(""), [d, r] = h(!1), [b, g] = h(""), v = Fe(null), { data: m } = F({
|
|
86
88
|
queryKey: ["collection-meta", t],
|
|
87
89
|
queryFn: () => c.request(G(`/collections/${t}`)).then((u) => u.data)
|
|
88
90
|
}), s = (m == null ? void 0 : m.display_template) ?? null;
|
|
89
91
|
function N(u) {
|
|
90
|
-
return
|
|
92
|
+
return Me(s, u);
|
|
91
93
|
}
|
|
92
|
-
const { data:
|
|
94
|
+
const { data: L, isLoading: j } = F({
|
|
93
95
|
queryKey: ["items-picker", t, n],
|
|
94
96
|
queryFn: () => c.request(
|
|
95
97
|
G(`/items/${t}`, { limit: 30, search: n || void 0 })
|
|
@@ -103,30 +105,30 @@ function Be({
|
|
|
103
105
|
return Ge(() => {
|
|
104
106
|
if (!d) return;
|
|
105
107
|
function u(P) {
|
|
106
|
-
v.current && !v.current.contains(P.target) &&
|
|
108
|
+
v.current && !v.current.contains(P.target) && r(!1);
|
|
107
109
|
}
|
|
108
110
|
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
109
111
|
}, [d]), /* @__PURE__ */ l("div", { className: "relative", ref: v, children: [
|
|
110
112
|
/* @__PURE__ */ e(
|
|
111
113
|
S,
|
|
112
114
|
{
|
|
113
|
-
value: d ?
|
|
115
|
+
value: d ? b : _ ? N(_) : o,
|
|
114
116
|
onChange: (u) => {
|
|
115
|
-
|
|
117
|
+
g(u.target.value), f(u.target.value);
|
|
116
118
|
},
|
|
117
119
|
onFocus: () => {
|
|
118
|
-
|
|
120
|
+
r(!0), g("");
|
|
119
121
|
},
|
|
120
122
|
placeholder: "Search…",
|
|
121
123
|
className: "h-8 text-[12px] w-[160px]"
|
|
122
124
|
}
|
|
123
125
|
),
|
|
124
|
-
d && /* @__PURE__ */ e("div", { className: "absolute z-50 top-full mt-0.5 max-h-48 w-full min-w-[200px] overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children:
|
|
126
|
+
d && /* @__PURE__ */ e("div", { className: "absolute z-50 top-full mt-0.5 max-h-48 w-full min-w-[200px] overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: j ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-3", children: /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin text-slate-400" }) }) : (L ?? []).length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : (L ?? []).map((u) => /* @__PURE__ */ e(
|
|
125
127
|
"button",
|
|
126
128
|
{
|
|
127
129
|
type: "button",
|
|
128
130
|
onClick: () => {
|
|
129
|
-
x(String(u.id)),
|
|
131
|
+
x(String(u.id)), r(!1), g(""), f("");
|
|
130
132
|
},
|
|
131
133
|
className: "w-full px-3 py-1.5 text-left text-[13px] text-slate-700 hover:bg-slate-50",
|
|
132
134
|
children: N(u)
|
|
@@ -143,12 +145,12 @@ function pe({
|
|
|
143
145
|
onChange: n,
|
|
144
146
|
onRemove: f
|
|
145
147
|
}) {
|
|
146
|
-
const d = o.find((s) => s.field === t.field),
|
|
148
|
+
const d = o.find((s) => s.field === t.field), r = t.field && c ? Be(x, c, t.field) ?? null : null, b = !r && t.field && c ? x.find(
|
|
147
149
|
(s) => s.many_collection === c && s.many_field === t.field && s.junction_field !== null
|
|
148
|
-
) ?? null : null,
|
|
150
|
+
) ?? null : null, g = !r && !b && t.field && c ? Te(x, c, t.field) ?? null : null, v = (r == null ? void 0 : r.one_collection) ?? (b == null ? void 0 : b.one_collection) ?? (g == null ? void 0 : g.many_collection) ?? null, m = v ? "uuid" : (d == null ? void 0 : d.type) ?? "string";
|
|
149
151
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
150
152
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
153
|
+
Ke,
|
|
152
154
|
{
|
|
153
155
|
collection: c,
|
|
154
156
|
fields: o,
|
|
@@ -166,7 +168,7 @@ function pe({
|
|
|
166
168
|
value: t.op,
|
|
167
169
|
onChange: (s) => n({ ...t, op: s }),
|
|
168
170
|
className: "h-8 w-[70px] rounded-md border-slate-200 bg-white px-2 text-[13px]",
|
|
169
|
-
options:
|
|
171
|
+
options: Qe(m).map((s) => ({ value: s.value, label: s.label }))
|
|
170
172
|
}
|
|
171
173
|
),
|
|
172
174
|
m === "boolean" ? /* @__PURE__ */ e(
|
|
@@ -198,7 +200,7 @@ function pe({
|
|
|
198
200
|
className: "h-8 text-[12px] w-[140px]"
|
|
199
201
|
}
|
|
200
202
|
) : v ? /* @__PURE__ */ e(
|
|
201
|
-
|
|
203
|
+
Ve,
|
|
202
204
|
{
|
|
203
205
|
relatedCollection: v,
|
|
204
206
|
value: t.value,
|
|
@@ -224,7 +226,7 @@ function pe({
|
|
|
224
226
|
)
|
|
225
227
|
] });
|
|
226
228
|
}
|
|
227
|
-
function
|
|
229
|
+
function We(t) {
|
|
228
230
|
return [t.first_name, t.last_name].filter(Boolean).join(" ").trim() || t.email;
|
|
229
231
|
}
|
|
230
232
|
function E(t) {
|
|
@@ -237,9 +239,9 @@ function me({
|
|
|
237
239
|
users: x,
|
|
238
240
|
placeholder: c = "Select a user…"
|
|
239
241
|
}) {
|
|
240
|
-
const [n, f] = h(!1), d = x.find((
|
|
241
|
-
return /* @__PURE__ */ l(
|
|
242
|
-
/* @__PURE__ */ e(
|
|
242
|
+
const [n, f] = h(!1), d = x.find((r) => r.id === t);
|
|
243
|
+
return /* @__PURE__ */ l(ze, { open: n, onOpenChange: f, children: [
|
|
244
|
+
/* @__PURE__ */ e(Ae, { asChild: !0, children: /* @__PURE__ */ l(
|
|
243
245
|
"button",
|
|
244
246
|
{
|
|
245
247
|
type: "button",
|
|
@@ -274,23 +276,23 @@ function me({
|
|
|
274
276
|
]
|
|
275
277
|
}
|
|
276
278
|
) }),
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ e(
|
|
279
|
-
/* @__PURE__ */ l(
|
|
280
|
-
/* @__PURE__ */ e(
|
|
281
|
-
/* @__PURE__ */ e(
|
|
282
|
-
|
|
279
|
+
/* @__PURE__ */ e(Re, { className: "w-[280px] p-0", align: "start", children: /* @__PURE__ */ l(Le, { children: [
|
|
280
|
+
/* @__PURE__ */ e(je, { placeholder: "Search users…", className: "h-8 text-[12px]" }),
|
|
281
|
+
/* @__PURE__ */ l(Pe, { children: [
|
|
282
|
+
/* @__PURE__ */ e(Oe, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No users found" }),
|
|
283
|
+
/* @__PURE__ */ e(Ue, { children: x.map((r) => /* @__PURE__ */ l(
|
|
284
|
+
De,
|
|
283
285
|
{
|
|
284
|
-
value: `${E(
|
|
286
|
+
value: `${E(r)} ${r.email}`,
|
|
285
287
|
onSelect: () => {
|
|
286
|
-
o(t ===
|
|
288
|
+
o(t === r.id ? "" : r.id), f(!1);
|
|
287
289
|
},
|
|
288
290
|
className: "text-[12px]",
|
|
289
291
|
children: [
|
|
290
292
|
/* @__PURE__ */ e(
|
|
291
293
|
"svg",
|
|
292
294
|
{
|
|
293
|
-
className: `mr-2 h-3 w-3 shrink-0 ${t ===
|
|
295
|
+
className: `mr-2 h-3 w-3 shrink-0 ${t === r.id ? "opacity-100" : "opacity-0"}`,
|
|
294
296
|
fill: "none",
|
|
295
297
|
viewBox: "0 0 24 24",
|
|
296
298
|
stroke: "currentColor",
|
|
@@ -306,10 +308,10 @@ function me({
|
|
|
306
308
|
)
|
|
307
309
|
}
|
|
308
310
|
),
|
|
309
|
-
E(
|
|
311
|
+
E(r)
|
|
310
312
|
]
|
|
311
313
|
},
|
|
312
|
-
|
|
314
|
+
r.id
|
|
313
315
|
)) })
|
|
314
316
|
] })
|
|
315
317
|
] }) })
|
|
@@ -320,10 +322,10 @@ function he(t) {
|
|
|
320
322
|
const o = ((n = t.first_name) == null ? void 0 : n[0]) ?? "", x = ((f = t.last_name) == null ? void 0 : f[0]) ?? "";
|
|
321
323
|
return (`${o}${x}`.trim() || t.email[0] || "?").toUpperCase();
|
|
322
324
|
}
|
|
323
|
-
function
|
|
325
|
+
function Ye(t) {
|
|
324
326
|
return !t || t.length === 0 ? "All records" : t.map((o) => `${o.field} ${o.op} ${String(o.value ?? "")}`).join(", ");
|
|
325
327
|
}
|
|
326
|
-
function
|
|
328
|
+
function xt({
|
|
327
329
|
stateId: t,
|
|
328
330
|
stateName: o,
|
|
329
331
|
templateId: x,
|
|
@@ -334,31 +336,31 @@ function dt({
|
|
|
334
336
|
queryKey: ["collection-meta", c],
|
|
335
337
|
queryFn: () => n.request(G(`/collections/${c}`)).then((a) => a.data),
|
|
336
338
|
enabled: !!c
|
|
337
|
-
}),
|
|
338
|
-
queryKey:
|
|
339
|
+
}), r = ((re = d == null ? void 0 : d.fields) == null ? void 0 : re.filter((a) => !a.hidden)) ?? [], b = (d == null ? void 0 : d.relations) ?? [], g = ["pipeline-owner-groups", t], { data: v, isLoading: m } = F({
|
|
340
|
+
queryKey: g,
|
|
339
341
|
queryFn: () => n.request(G(`/pipelines/states/${t}/owner-groups`)).then((a) => a.data)
|
|
340
342
|
}), { data: s } = F({
|
|
341
343
|
queryKey: ["users", "picker"],
|
|
342
344
|
queryFn: () => n.request(G("/users", { limit: 200 })).then((a) => a.data)
|
|
343
|
-
}), N = () => f.invalidateQueries({ queryKey:
|
|
344
|
-
|
|
345
|
+
}), N = () => f.invalidateQueries({ queryKey: g }), [L, j] = h(null), [_, u] = h(""), [P, X] = h(!1), [z, O] = h([]), [A, U] = h(""), [ve, H] = h(!1), [J, Z] = h(""), [ee, te] = h(!1), [R, D] = h([]), [K, ae] = h(""), be = (a) => {
|
|
346
|
+
j(a.id), u(a.name ?? ""), X(a.is_default), O(
|
|
345
347
|
(a.filters ?? []).map((p) => ({ field: p.field, op: p.op, value: String(p.value ?? "") }))
|
|
346
348
|
), U("");
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
+
}, B = () => {
|
|
350
|
+
j(null), U("");
|
|
349
351
|
}, le = () => {
|
|
350
352
|
Z(""), te(!1), D([]), ae(""), H(!1);
|
|
351
|
-
}, se = (a) => a.filter((p) => p.field.trim()).map((p) => ({ field: p.field.trim(), op: p.op, value: p.value })),
|
|
353
|
+
}, se = (a) => a.filter((p) => p.field.trim()).map((p) => ({ field: p.field.trim(), op: p.op, value: p.value })), T = I({
|
|
352
354
|
mutationFn: async () => {
|
|
353
|
-
const a = se(
|
|
355
|
+
const a = se(R), p = await n.request(
|
|
354
356
|
W(`/pipelines/states/${t}/owner-groups`, {
|
|
355
357
|
name: J.trim() || void 0,
|
|
356
358
|
is_default: ee,
|
|
357
359
|
filters: a.length > 0 ? a : void 0
|
|
358
360
|
})
|
|
359
361
|
).then((y) => y.data);
|
|
360
|
-
|
|
361
|
-
W(`/pipelines/owner-groups/${p.id}/users`, { user:
|
|
362
|
+
K && await n.request(
|
|
363
|
+
W(`/pipelines/owner-groups/${p.id}/users`, { user: K })
|
|
362
364
|
);
|
|
363
365
|
},
|
|
364
366
|
onSuccess: () => {
|
|
@@ -377,10 +379,10 @@ function dt({
|
|
|
377
379
|
N(), w.success("Group updated");
|
|
378
380
|
},
|
|
379
381
|
onError: () => w.error("Failed to update group")
|
|
380
|
-
}),
|
|
382
|
+
}), ge = I({
|
|
381
383
|
mutationFn: (a) => n.request(oe(`/pipelines/owner-groups/${a}`)),
|
|
382
384
|
onSuccess: () => {
|
|
383
|
-
N(),
|
|
385
|
+
N(), B(), w.success("Group deleted");
|
|
384
386
|
},
|
|
385
387
|
onError: () => w.error("Failed to delete group")
|
|
386
388
|
}), ne = I({
|
|
@@ -389,7 +391,7 @@ function dt({
|
|
|
389
391
|
N(), U("");
|
|
390
392
|
},
|
|
391
393
|
onError: () => w.error("Failed to add user")
|
|
392
|
-
}),
|
|
394
|
+
}), Ne = I({
|
|
393
395
|
mutationFn: (a) => n.request(oe(`/pipelines/owner-group-users/${a}`)),
|
|
394
396
|
onSuccess: () => N(),
|
|
395
397
|
onError: () => w.error("Failed to remove user")
|
|
@@ -397,7 +399,7 @@ function dt({
|
|
|
397
399
|
return /* @__PURE__ */ l("div", { className: "space-y-3", children: [
|
|
398
400
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-600", children: "Owner Groups" }) }),
|
|
399
401
|
m ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading groups…" }) : !v || v.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No owner groups configured — any authenticated user can act as owner for skip evaluation." }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: v.map((a, p) => {
|
|
400
|
-
const y =
|
|
402
|
+
const y = L === a.id;
|
|
401
403
|
return /* @__PURE__ */ l("div", { className: "rounded-lg border border-slate-200 bg-white", children: [
|
|
402
404
|
/* @__PURE__ */ l("div", { className: "group flex items-start gap-3 px-3 py-2.5", children: [
|
|
403
405
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
|
|
@@ -405,23 +407,34 @@ function dt({
|
|
|
405
407
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: a.name || `Group ${p + 1}` }),
|
|
406
408
|
a.is_default && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-cyan", children: "default" })
|
|
407
409
|
] }),
|
|
408
|
-
/* @__PURE__ */ e("p", { className: "font-mono text-[11px] text-slate-400", children:
|
|
409
|
-
|
|
410
|
+
/* @__PURE__ */ e("p", { className: "font-mono text-[11px] text-slate-400", children: Ye(a.filters) }),
|
|
411
|
+
/* @__PURE__ */ e(
|
|
412
|
+
Ee,
|
|
413
|
+
{
|
|
414
|
+
kind: "owner-group",
|
|
415
|
+
sentences: _e(
|
|
416
|
+
a,
|
|
417
|
+
{ stateLabel: o },
|
|
418
|
+
$e(r, b, c)
|
|
419
|
+
)
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
a.users.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center gap-1 flex-wrap pt-0.5", children: a.users.map((i) => /* @__PURE__ */ e(
|
|
410
423
|
ce,
|
|
411
424
|
{
|
|
412
|
-
userId:
|
|
425
|
+
userId: i.user,
|
|
413
426
|
className: "h-7 w-7",
|
|
414
|
-
alt: E(
|
|
427
|
+
alt: E(i),
|
|
415
428
|
fallback: /* @__PURE__ */ e(
|
|
416
429
|
"span",
|
|
417
430
|
{
|
|
418
|
-
title: E(
|
|
431
|
+
title: E(i),
|
|
419
432
|
className: "flex h-7 w-7 items-center justify-center rounded-full bg-nvr-cyan/10 text-[11px] font-medium text-nvr-cyan",
|
|
420
|
-
children: he(
|
|
433
|
+
children: he(i)
|
|
421
434
|
}
|
|
422
435
|
)
|
|
423
436
|
},
|
|
424
|
-
|
|
437
|
+
i.link_id
|
|
425
438
|
)) })
|
|
426
439
|
] }),
|
|
427
440
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
|
|
@@ -429,10 +442,10 @@ function dt({
|
|
|
429
442
|
"button",
|
|
430
443
|
{
|
|
431
444
|
type: "button",
|
|
432
|
-
onClick: () => y ?
|
|
445
|
+
onClick: () => y ? B() : be(a),
|
|
433
446
|
className: "rounded p-1 text-slate-400 hover:text-slate-700",
|
|
434
447
|
title: "Edit group",
|
|
435
|
-
children: /* @__PURE__ */ e(
|
|
448
|
+
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
436
449
|
}
|
|
437
450
|
),
|
|
438
451
|
/* @__PURE__ */ e(
|
|
@@ -440,7 +453,7 @@ function dt({
|
|
|
440
453
|
{
|
|
441
454
|
type: "button",
|
|
442
455
|
onClick: () => {
|
|
443
|
-
confirm(`Delete group "${a.name || `Group ${p + 1}`}"?`) &&
|
|
456
|
+
confirm(`Delete group "${a.name || `Group ${p + 1}`}"?`) && ge.mutate(a.id);
|
|
444
457
|
},
|
|
445
458
|
className: "rounded p-1 text-slate-400 hover:text-red-500",
|
|
446
459
|
title: "Delete group",
|
|
@@ -456,7 +469,7 @@ function dt({
|
|
|
456
469
|
S,
|
|
457
470
|
{
|
|
458
471
|
value: _,
|
|
459
|
-
onChange: (
|
|
472
|
+
onChange: (i) => u(i.target.value),
|
|
460
473
|
placeholder: "Group name (optional)",
|
|
461
474
|
className: "h-8 text-[13px]"
|
|
462
475
|
}
|
|
@@ -468,7 +481,7 @@ function dt({
|
|
|
468
481
|
{
|
|
469
482
|
type: "checkbox",
|
|
470
483
|
checked: P,
|
|
471
|
-
onChange: (
|
|
484
|
+
onChange: (i) => X(i.target.checked),
|
|
472
485
|
className: "rounded"
|
|
473
486
|
}
|
|
474
487
|
),
|
|
@@ -478,13 +491,13 @@ function dt({
|
|
|
478
491
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
479
492
|
/* @__PURE__ */ e(C, { className: "text-[12px]", children: "Filter conditions" }),
|
|
480
493
|
/* @__PURE__ */ l(
|
|
481
|
-
|
|
494
|
+
k,
|
|
482
495
|
{
|
|
483
496
|
type: "button",
|
|
484
497
|
size: "sm",
|
|
485
498
|
variant: "ghost",
|
|
486
499
|
className: "h-6 gap-1 text-[11px]",
|
|
487
|
-
onClick: () => O((
|
|
500
|
+
onClick: () => O((i) => [...i, { field: "", op: "eq", value: "" }]),
|
|
488
501
|
children: [
|
|
489
502
|
/* @__PURE__ */ e(V, { className: "h-3 w-3" }),
|
|
490
503
|
"Add Filter"
|
|
@@ -493,22 +506,22 @@ function dt({
|
|
|
493
506
|
)
|
|
494
507
|
] }),
|
|
495
508
|
z.length === 0 && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "No filters — applies to all records." }),
|
|
496
|
-
z.map((
|
|
509
|
+
z.map((i, q) => /* @__PURE__ */ e(
|
|
497
510
|
pe,
|
|
498
511
|
{
|
|
499
|
-
row:
|
|
500
|
-
fields:
|
|
501
|
-
relations:
|
|
512
|
+
row: i,
|
|
513
|
+
fields: r,
|
|
514
|
+
relations: b,
|
|
502
515
|
collection: c ?? "",
|
|
503
|
-
onChange: ($) => O((ie) => ie.map((Q, ye) => ye ===
|
|
504
|
-
onRemove: () => O(($) => $.filter((ie, Q) => Q !==
|
|
516
|
+
onChange: ($) => O((ie) => ie.map((Q, ye) => ye === q ? $ : Q)),
|
|
517
|
+
onRemove: () => O(($) => $.filter((ie, Q) => Q !== q))
|
|
505
518
|
},
|
|
506
|
-
|
|
519
|
+
q
|
|
507
520
|
))
|
|
508
521
|
] }),
|
|
509
522
|
/* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
510
523
|
/* @__PURE__ */ e(C, { className: "text-[12px]", children: "Users" }),
|
|
511
|
-
a.users.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "No users in this group yet." }) : /* @__PURE__ */ e("div", { className: "space-y-1", children: a.users.map((
|
|
524
|
+
a.users.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "No users in this group yet." }) : /* @__PURE__ */ e("div", { className: "space-y-1", children: a.users.map((i) => /* @__PURE__ */ l(
|
|
512
525
|
"div",
|
|
513
526
|
{
|
|
514
527
|
className: "flex items-center gap-2 rounded-md border border-slate-200 bg-white px-2 py-1.5",
|
|
@@ -516,26 +529,26 @@ function dt({
|
|
|
516
529
|
/* @__PURE__ */ e(
|
|
517
530
|
ce,
|
|
518
531
|
{
|
|
519
|
-
userId:
|
|
532
|
+
userId: i.user,
|
|
520
533
|
className: "h-6 w-6",
|
|
521
|
-
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-medium text-nvr-cyan", children: he(
|
|
534
|
+
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-medium text-nvr-cyan", children: he(i) })
|
|
522
535
|
}
|
|
523
536
|
),
|
|
524
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700", children:
|
|
525
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children:
|
|
537
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700", children: We(i) }),
|
|
538
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: i.email }),
|
|
526
539
|
/* @__PURE__ */ e(
|
|
527
540
|
"button",
|
|
528
541
|
{
|
|
529
542
|
type: "button",
|
|
530
|
-
onClick: () =>
|
|
543
|
+
onClick: () => Ne.mutate(i.link_id),
|
|
531
544
|
className: "rounded p-0.5 text-slate-400 hover:text-red-500",
|
|
532
545
|
title: "Remove user",
|
|
533
|
-
children: /* @__PURE__ */ e(
|
|
546
|
+
children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
|
|
534
547
|
}
|
|
535
548
|
)
|
|
536
549
|
]
|
|
537
550
|
},
|
|
538
|
-
|
|
551
|
+
i.link_id
|
|
539
552
|
)) }),
|
|
540
553
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
541
554
|
/* @__PURE__ */ e(
|
|
@@ -548,7 +561,7 @@ function dt({
|
|
|
548
561
|
}
|
|
549
562
|
),
|
|
550
563
|
/* @__PURE__ */ l(
|
|
551
|
-
|
|
564
|
+
k,
|
|
552
565
|
{
|
|
553
566
|
type: "button",
|
|
554
567
|
size: "sm",
|
|
@@ -566,18 +579,18 @@ function dt({
|
|
|
566
579
|
] }),
|
|
567
580
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2", children: [
|
|
568
581
|
/* @__PURE__ */ e(
|
|
569
|
-
|
|
582
|
+
k,
|
|
570
583
|
{
|
|
571
584
|
type: "button",
|
|
572
585
|
size: "sm",
|
|
573
586
|
variant: "ghost",
|
|
574
587
|
className: "text-[12px]",
|
|
575
|
-
onClick:
|
|
588
|
+
onClick: B,
|
|
576
589
|
children: "Cancel"
|
|
577
590
|
}
|
|
578
591
|
),
|
|
579
592
|
/* @__PURE__ */ e(
|
|
580
|
-
|
|
593
|
+
k,
|
|
581
594
|
{
|
|
582
595
|
type: "button",
|
|
583
596
|
size: "sm",
|
|
@@ -621,7 +634,7 @@ function dt({
|
|
|
621
634
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
622
635
|
/* @__PURE__ */ e(C, { className: "text-[12px]", children: "Filter conditions" }),
|
|
623
636
|
/* @__PURE__ */ l(
|
|
624
|
-
|
|
637
|
+
k,
|
|
625
638
|
{
|
|
626
639
|
type: "button",
|
|
627
640
|
size: "sm",
|
|
@@ -635,16 +648,16 @@ function dt({
|
|
|
635
648
|
}
|
|
636
649
|
)
|
|
637
650
|
] }),
|
|
638
|
-
|
|
639
|
-
|
|
651
|
+
R.length === 0 && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "No filters — applies to all records." }),
|
|
652
|
+
R.map((a, p) => /* @__PURE__ */ e(
|
|
640
653
|
pe,
|
|
641
654
|
{
|
|
642
655
|
row: a,
|
|
643
|
-
fields:
|
|
644
|
-
relations:
|
|
656
|
+
fields: r,
|
|
657
|
+
relations: b,
|
|
645
658
|
collection: c ?? "",
|
|
646
|
-
onChange: (y) => D((
|
|
647
|
-
onRemove: () => D((y) => y.filter((
|
|
659
|
+
onChange: (y) => D((i) => i.map((q, $) => $ === p ? y : q)),
|
|
660
|
+
onRemove: () => D((y) => y.filter((i, q) => q !== p))
|
|
648
661
|
},
|
|
649
662
|
p
|
|
650
663
|
))
|
|
@@ -654,7 +667,7 @@ function dt({
|
|
|
654
667
|
/* @__PURE__ */ e(
|
|
655
668
|
me,
|
|
656
669
|
{
|
|
657
|
-
value:
|
|
670
|
+
value: K,
|
|
658
671
|
onChange: ae,
|
|
659
672
|
users: s ?? [],
|
|
660
673
|
placeholder: "Select a user…"
|
|
@@ -663,7 +676,7 @@ function dt({
|
|
|
663
676
|
] }),
|
|
664
677
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2", children: [
|
|
665
678
|
/* @__PURE__ */ e(
|
|
666
|
-
|
|
679
|
+
k,
|
|
667
680
|
{
|
|
668
681
|
type: "button",
|
|
669
682
|
size: "sm",
|
|
@@ -674,19 +687,19 @@ function dt({
|
|
|
674
687
|
}
|
|
675
688
|
),
|
|
676
689
|
/* @__PURE__ */ e(
|
|
677
|
-
|
|
690
|
+
k,
|
|
678
691
|
{
|
|
679
692
|
type: "button",
|
|
680
693
|
size: "sm",
|
|
681
694
|
className: "text-[12px]",
|
|
682
|
-
disabled:
|
|
683
|
-
onClick: () =>
|
|
684
|
-
children:
|
|
695
|
+
disabled: T.isPending,
|
|
696
|
+
onClick: () => T.mutate(),
|
|
697
|
+
children: T.isPending ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }) : "Create Group"
|
|
685
698
|
}
|
|
686
699
|
)
|
|
687
700
|
] })
|
|
688
701
|
] }) : /* @__PURE__ */ l(
|
|
689
|
-
|
|
702
|
+
k,
|
|
690
703
|
{
|
|
691
704
|
type: "button",
|
|
692
705
|
size: "sm",
|
|
@@ -702,5 +715,5 @@ function dt({
|
|
|
702
715
|
] });
|
|
703
716
|
}
|
|
704
717
|
export {
|
|
705
|
-
|
|
718
|
+
xt as PipelineStateOwners
|
|
706
719
|
};
|