@nivaro/react 0.3.103 → 0.3.104
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 +4 -2
- package/dist/shared/components/ItemEditForm.js +2867 -2845
- package/dist/shared/components/imports/CollectionImportPanel.js +483 -459
- package/dist/shared/components/integrations/IntegrationStatusLines.js +71 -68
- package/dist/shared/components/item-edit/UserChip.js +38 -38
- package/dist/shared/components/layout-editor/DesignNode.js +16 -14
- package/dist/shared/components/layout-editor/LayoutEditor.js +445 -441
- package/dist/shared/components/layout-editor/inspector/Inspector.js +18 -18
- package/dist/shared/components/layout-editor/inspector/SlotInspector.js +80 -52
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ButtonsSection.js +54 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +23 -15
- package/dist/shared/components/layout-editor/useLayoutDraft.js +211 -196
- package/dist/shared/components/panels/ExternalRequestsChip.js +141 -122
- package/dist/shared/lib/entry-config.js +7 -7
- package/dist/shared/lib/integration-chip.js +10 -6
- package/dist/shared/lib/owners-header-tile.js +63 -0
- package/package.json +1 -1
|
@@ -1,104 +1,122 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Satellite as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import {
|
|
8
|
-
import { integrationChipSummary as
|
|
9
|
-
import { useLiveRefetchInterval as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { SubmissionRow as
|
|
12
|
-
import { useRecordObligations as
|
|
13
|
-
import { OutboundPreviewSection as
|
|
14
|
-
import { Dialog as
|
|
15
|
-
import { RecordEventPathSheet as
|
|
16
|
-
function
|
|
17
|
-
|
|
1
|
+
import { jsxs as d, jsx as r, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as M, useMutation as O, useQuery as j } from "@tanstack/react-query";
|
|
3
|
+
import { Satellite as b } from "lucide-react";
|
|
4
|
+
import { useState as v, useEffect as R } from "react";
|
|
5
|
+
import { toast as x } from "sonner";
|
|
6
|
+
import { useNivaroClient as C } from "../../context.js";
|
|
7
|
+
import { post as B, get as I } from "../../lib/commands.js";
|
|
8
|
+
import { integrationChipSummary as V, externalRequestsShown as A } from "../../lib/integration-chip.js";
|
|
9
|
+
import { useLiveRefetchInterval as H } from "../../lib/live-queries.js";
|
|
10
|
+
import { cn as w, formatRelative as J } from "../../lib/utils.js";
|
|
11
|
+
import { SubmissionRow as U } from "../integrations/console/SubmissionRow.js";
|
|
12
|
+
import { useRecordObligations as E, IntegrationStatusLines as W } from "../integrations/IntegrationStatusLines.js";
|
|
13
|
+
import { OutboundPreviewSection as z } from "../integrations/RecordIntegrationPreview.js";
|
|
14
|
+
import { Dialog as G, DialogContent as X, DialogHeader as Y, DialogTitle as Z, DialogBody as ee } from "../ui/dialog.js";
|
|
15
|
+
import { RecordEventPathSheet as te } from "./IntegrationActivitySection.js";
|
|
16
|
+
function $(t, s, u, a = !0) {
|
|
17
|
+
const p = C();
|
|
18
|
+
return j({
|
|
19
|
+
queryKey: ["erp-submissions", t, String(s)],
|
|
20
|
+
queryFn: () => p.request(
|
|
21
|
+
I(`/erp-submissions/${t}/${encodeURIComponent(s)}`)
|
|
22
|
+
).then((n) => n.data ?? []),
|
|
23
|
+
enabled: a && !!t && !!s,
|
|
24
|
+
staleTime: 15e3,
|
|
25
|
+
refetchInterval: u
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const q = /* @__PURE__ */ new Map();
|
|
29
|
+
function xe(t, s, u) {
|
|
30
|
+
var g;
|
|
31
|
+
const a = u && !!s, p = $(t, s ?? "", void 0, a), n = E(t, a ? s ?? "" : ""), c = A({
|
|
32
|
+
layoutOn: u,
|
|
33
|
+
// A viewer refused the record's integrations has nothing to see here.
|
|
34
|
+
partnerIntegration: n.isError ? !1 : n.partnerIntegration,
|
|
35
|
+
obligations: n.isError ? 0 : n.obligationCount,
|
|
36
|
+
submissions: p.isError ? 0 : ((g = p.data) == null ? void 0 : g.length) ?? null
|
|
37
|
+
});
|
|
38
|
+
return R(() => {
|
|
39
|
+
c !== null && u && q.set(t, c);
|
|
40
|
+
}, [c, t, u]), a ? c ?? q.get(t) ?? !1 : !1;
|
|
41
|
+
}
|
|
42
|
+
function fe({
|
|
43
|
+
collection: t,
|
|
18
44
|
itemId: s
|
|
19
45
|
}) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (!
|
|
23
|
-
const e = document.querySelector(`[data-submission-id="${
|
|
46
|
+
const u = C(), a = M(), [p, n] = v(!1), [c, g] = v(null), [h, N] = v(null);
|
|
47
|
+
R(() => {
|
|
48
|
+
if (!p || h == null) return;
|
|
49
|
+
const e = document.querySelector(`[data-submission-id="${h}"]`);
|
|
24
50
|
e == null || e.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
25
|
-
}, [
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
queryFn: () => k.request(
|
|
29
|
-
_(`/erp-submissions/${r}/${encodeURIComponent(s)}`)
|
|
30
|
-
).then((e) => e.data ?? []),
|
|
31
|
-
enabled: !!r && !!s,
|
|
32
|
-
staleTime: 15e3,
|
|
33
|
-
refetchInterval: S
|
|
34
|
-
}), h = O({
|
|
35
|
-
mutationFn: (e) => k.request(I(`/erp-submissions/${e}/retry`)),
|
|
51
|
+
}, [p, h]);
|
|
52
|
+
const P = H(6e4), { data: Q, isLoading: D } = $(t, s, P), f = O({
|
|
53
|
+
mutationFn: (e) => u.request(B(`/erp-submissions/${e}/retry`)),
|
|
36
54
|
onSuccess: (e) => {
|
|
37
|
-
var
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
queryKey: ["integration-obligations", "record",
|
|
55
|
+
var S;
|
|
56
|
+
const l = (S = e == null ? void 0 : e.data) == null ? void 0 : S.status;
|
|
57
|
+
l && l !== "failed" ? x.success("Submission retried successfully") : x.error("Retry failed — expand the request for the error"), a.invalidateQueries({ queryKey: ["erp-submissions", t, String(s)] }), a.invalidateQueries({ queryKey: ["erp-submission-attempts"] }), a.invalidateQueries({
|
|
58
|
+
queryKey: ["integration-obligations", "record", t, String(s)]
|
|
41
59
|
});
|
|
42
60
|
},
|
|
43
|
-
onError: () =>
|
|
61
|
+
onError: () => x.error("Retry failed")
|
|
44
62
|
}), {
|
|
45
|
-
lines:
|
|
46
|
-
remediationEnabled:
|
|
47
|
-
isLoading:
|
|
48
|
-
} =
|
|
49
|
-
if (
|
|
50
|
-
return /* @__PURE__ */
|
|
63
|
+
lines: y,
|
|
64
|
+
remediationEnabled: K,
|
|
65
|
+
isLoading: L
|
|
66
|
+
} = E(t, s), m = Q ?? [];
|
|
67
|
+
if (D || L)
|
|
68
|
+
return /* @__PURE__ */ d(
|
|
51
69
|
"span",
|
|
52
70
|
{
|
|
53
71
|
className: "flex shrink-0 items-center gap-1.5 self-center rounded-md border border-slate-200 px-2 py-1 text-[11px] text-slate-400 dark:border-border",
|
|
54
72
|
"data-nvr-external-requests": "loading",
|
|
55
73
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ r(b, { className: "h-3.5 w-3.5 opacity-60" }),
|
|
75
|
+
/* @__PURE__ */ r("span", { className: "h-2.5 w-16 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" })
|
|
58
76
|
]
|
|
59
77
|
}
|
|
60
78
|
);
|
|
61
|
-
const
|
|
62
|
-
for (const e of
|
|
63
|
-
const
|
|
64
|
-
|
|
79
|
+
const o = V(y, m, (e) => e ? J(e) : ""), k = /* @__PURE__ */ new Map();
|
|
80
|
+
for (const e of m) {
|
|
81
|
+
const l = (e.external_api_name ?? (e.external_api != null ? `#${e.external_api}` : "External")).toLowerCase();
|
|
82
|
+
k.has(l) || k.set(l, { id: e.id, status: e.status });
|
|
65
83
|
}
|
|
66
|
-
const
|
|
84
|
+
const F = m.length === 0 && o.partners.length === 0, T = {
|
|
67
85
|
ok: "bg-emerald-500",
|
|
68
86
|
attention: "bg-red-500",
|
|
69
87
|
pending: "bg-sky-500",
|
|
70
88
|
neutral: "bg-slate-400 dark:bg-slate-500"
|
|
71
|
-
},
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
89
|
+
}, i = o.attention;
|
|
90
|
+
return /* @__PURE__ */ d(_, { children: [
|
|
91
|
+
F ? /* @__PURE__ */ d(
|
|
74
92
|
"button",
|
|
75
93
|
{
|
|
76
94
|
type: "button",
|
|
77
|
-
onClick: () =>
|
|
95
|
+
onClick: () => n(!0),
|
|
78
96
|
className: "flex shrink-0 items-center gap-1.5 self-center rounded-md border border-dashed border-slate-200 px-2 py-1 text-[11px] text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-white/5",
|
|
79
97
|
"data-nvr-external-requests": "none",
|
|
80
98
|
"data-tip": "Nothing from this record has been sent to an outside system yet. Click to see what the first push would carry.",
|
|
81
99
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ r(b, { className: "h-3.5 w-3.5 opacity-60" }),
|
|
83
101
|
"No external requests"
|
|
84
102
|
]
|
|
85
103
|
}
|
|
86
|
-
) : /* @__PURE__ */
|
|
104
|
+
) : /* @__PURE__ */ d(
|
|
87
105
|
"button",
|
|
88
106
|
{
|
|
89
107
|
type: "button",
|
|
90
|
-
onClick: () =>
|
|
108
|
+
onClick: () => n(!0),
|
|
91
109
|
"data-nvr-external-requests": !0,
|
|
92
|
-
"data-integrations-ok":
|
|
93
|
-
"data-integrations-attention":
|
|
94
|
-
className:
|
|
110
|
+
"data-integrations-ok": o.ok,
|
|
111
|
+
"data-integrations-attention": i,
|
|
112
|
+
className: w(
|
|
95
113
|
"flex shrink-0 items-center gap-1.5 self-center rounded-md border px-2 py-1 text-[11px] font-medium transition-colors",
|
|
96
|
-
|
|
114
|
+
i > 0 ? "border-red-200 text-slate-700 hover:bg-red-50/60 dark:border-red-500/40 dark:text-slate-200 dark:hover:bg-red-500/10" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-white/5"
|
|
97
115
|
),
|
|
98
|
-
title:
|
|
116
|
+
title: i > 0 ? `${i} integration ${i === 1 ? "issue needs" : "issues need"} attention — click for details` : "Integrations for this record — partner status and every request sent",
|
|
99
117
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
118
|
+
/* @__PURE__ */ r(b, { className: w("h-3.5 w-3.5", i > 0 ? "text-red-500" : "text-nvr-cyan") }),
|
|
119
|
+
o.partners.length <= 3 ? o.partners.map((e) => /* @__PURE__ */ d(
|
|
102
120
|
"span",
|
|
103
121
|
{
|
|
104
122
|
className: "inline-flex items-center gap-1",
|
|
@@ -106,133 +124,134 @@ function ge({
|
|
|
106
124
|
"data-integration-status": e.status,
|
|
107
125
|
"data-tip": e.tip,
|
|
108
126
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ r("span", { className: w("h-1.5 w-1.5 rounded-full", T[e.status]) }),
|
|
110
128
|
e.name
|
|
111
129
|
]
|
|
112
130
|
},
|
|
113
131
|
e.name
|
|
114
|
-
)) : /* @__PURE__ */
|
|
115
|
-
|
|
132
|
+
)) : /* @__PURE__ */ r("span", { children: "Integrations" }),
|
|
133
|
+
o.ok > 0 && /* @__PURE__ */ r(
|
|
116
134
|
"span",
|
|
117
135
|
{
|
|
118
136
|
"data-integrations-badge": "ok",
|
|
119
137
|
className: "rounded bg-emerald-50 px-1 text-[10.5px] font-semibold text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400",
|
|
120
|
-
children:
|
|
138
|
+
children: o.ok
|
|
121
139
|
}
|
|
122
140
|
),
|
|
123
|
-
|
|
141
|
+
o.pending > 0 && /* @__PURE__ */ r(
|
|
124
142
|
"span",
|
|
125
143
|
{
|
|
126
144
|
"data-integrations-badge": "pending",
|
|
127
145
|
className: "rounded bg-sky-50 px-1 text-[10.5px] font-semibold text-sky-700 dark:bg-sky-500/10 dark:text-sky-400",
|
|
128
|
-
children:
|
|
146
|
+
children: o.pending
|
|
129
147
|
}
|
|
130
148
|
),
|
|
131
|
-
|
|
149
|
+
i > 0 && /* @__PURE__ */ r(
|
|
132
150
|
"span",
|
|
133
151
|
{
|
|
134
152
|
"data-integrations-badge": "attention",
|
|
135
153
|
className: "rounded bg-red-50 px-1 text-[10.5px] font-semibold text-red-700 dark:bg-red-500/10 dark:text-red-400",
|
|
136
|
-
children:
|
|
154
|
+
children: i
|
|
137
155
|
}
|
|
138
156
|
)
|
|
139
157
|
]
|
|
140
158
|
}
|
|
141
159
|
),
|
|
142
|
-
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
160
|
+
p && /* @__PURE__ */ r(G, { open: !0, onOpenChange: (e) => !e && n(!1), children: /* @__PURE__ */ d(X, { className: "p-5", style: { width: "75%", maxWidth: "75%" }, children: [
|
|
161
|
+
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ d(Z, { className: "flex items-center gap-2 text-[15px]", children: [
|
|
162
|
+
/* @__PURE__ */ r(b, { className: "h-4 w-4 text-nvr-cyan" }),
|
|
145
163
|
"Integrations",
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
164
|
+
/* @__PURE__ */ d("span", { className: "text-[12px] font-normal text-slate-400", children: [
|
|
165
|
+
o.partners.length,
|
|
148
166
|
" partner",
|
|
149
|
-
|
|
167
|
+
o.partners.length !== 1 ? "s" : "",
|
|
150
168
|
" ·",
|
|
151
169
|
" ",
|
|
152
|
-
|
|
170
|
+
m.length,
|
|
153
171
|
" request",
|
|
154
|
-
|
|
155
|
-
|
|
172
|
+
m.length !== 1 ? "s" : "",
|
|
173
|
+
i > 0 && /* @__PURE__ */ d("span", { className: "ml-1 text-red-600 dark:text-red-400", children: [
|
|
156
174
|
"· ",
|
|
157
|
-
|
|
175
|
+
i,
|
|
158
176
|
" need",
|
|
159
|
-
|
|
177
|
+
i === 1 ? "s" : "",
|
|
160
178
|
" attention"
|
|
161
179
|
] })
|
|
162
180
|
] })
|
|
163
181
|
] }) }),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
182
|
+
/* @__PURE__ */ d(ee, { className: "max-h-[65vh] space-y-2 overflow-y-auto", children: [
|
|
183
|
+
/* @__PURE__ */ r(
|
|
184
|
+
z,
|
|
167
185
|
{
|
|
168
|
-
collection:
|
|
186
|
+
collection: t,
|
|
169
187
|
itemId: String(s),
|
|
170
|
-
onShowRequest: (e) =>
|
|
171
|
-
onJump: () =>
|
|
188
|
+
onShowRequest: (e) => N(e),
|
|
189
|
+
onJump: () => n(!1)
|
|
172
190
|
}
|
|
173
191
|
),
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
|
|
192
|
+
y.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-1.5 pb-2", "data-integrations-partner-status": !0, children: [
|
|
193
|
+
/* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Partner status" }),
|
|
194
|
+
/* @__PURE__ */ r(
|
|
195
|
+
W,
|
|
178
196
|
{
|
|
179
|
-
collection:
|
|
197
|
+
collection: t,
|
|
180
198
|
itemId: s,
|
|
181
|
-
lines:
|
|
182
|
-
remediationEnabled:
|
|
199
|
+
lines: y,
|
|
200
|
+
remediationEnabled: K,
|
|
183
201
|
actions: {
|
|
184
|
-
newestSubmissionByApi:
|
|
185
|
-
onRetry: (e) =>
|
|
186
|
-
onView: (e) =>
|
|
202
|
+
newestSubmissionByApi: k,
|
|
203
|
+
onRetry: (e) => f.mutate(e),
|
|
204
|
+
onView: (e) => N(e),
|
|
187
205
|
onCheck: () => {
|
|
188
|
-
|
|
206
|
+
a.invalidateQueries({
|
|
189
207
|
queryKey: [
|
|
190
208
|
"integration-obligations",
|
|
191
209
|
"record",
|
|
192
|
-
|
|
210
|
+
t,
|
|
193
211
|
String(s)
|
|
194
212
|
]
|
|
195
|
-
}),
|
|
196
|
-
queryKey: ["erp-submissions",
|
|
197
|
-
}),
|
|
213
|
+
}), a.invalidateQueries({
|
|
214
|
+
queryKey: ["erp-submissions", t, String(s)]
|
|
215
|
+
}), x.message("Checking with the partner status…");
|
|
198
216
|
},
|
|
199
217
|
// The pipeline panel takes over (save, requirements
|
|
200
218
|
// dialog, run) — this dialog gets out of its way.
|
|
201
|
-
onRanTransition: () =>
|
|
219
|
+
onRanTransition: () => n(!1)
|
|
202
220
|
}
|
|
203
221
|
}
|
|
204
222
|
)
|
|
205
223
|
] }),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
224
|
+
m.length > 0 && /* @__PURE__ */ r("p", { className: "pt-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Requests sent" }),
|
|
225
|
+
m.length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "No request has been sent from this record yet." }),
|
|
226
|
+
m.map((e) => /* @__PURE__ */ r(
|
|
227
|
+
U,
|
|
210
228
|
{
|
|
211
229
|
sub: e,
|
|
212
|
-
initialOpen:
|
|
213
|
-
onRetry: (
|
|
214
|
-
retrying:
|
|
215
|
-
onShowPath: (
|
|
216
|
-
|
|
230
|
+
initialOpen: h === e.id,
|
|
231
|
+
onRetry: (l) => f.mutate(l),
|
|
232
|
+
retrying: f.isPending,
|
|
233
|
+
onShowPath: (l) => {
|
|
234
|
+
n(!1), g(l);
|
|
217
235
|
}
|
|
218
236
|
},
|
|
219
|
-
`${e.id}:${
|
|
237
|
+
`${e.id}:${h === e.id ? "focus" : ""}`
|
|
220
238
|
))
|
|
221
239
|
] })
|
|
222
240
|
] }) }),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
241
|
+
/* @__PURE__ */ r(
|
|
242
|
+
te,
|
|
225
243
|
{
|
|
226
|
-
target:
|
|
244
|
+
target: c != null ? {
|
|
227
245
|
source: "core:outbound",
|
|
228
|
-
id: String(
|
|
229
|
-
record: { collection:
|
|
246
|
+
id: String(c),
|
|
247
|
+
record: { collection: t, item: String(s) }
|
|
230
248
|
} : null,
|
|
231
|
-
onClose: () =>
|
|
249
|
+
onClose: () => g(null)
|
|
232
250
|
}
|
|
233
251
|
)
|
|
234
252
|
] });
|
|
235
253
|
}
|
|
236
254
|
export {
|
|
237
|
-
|
|
255
|
+
fe as ExternalRequestsChip,
|
|
256
|
+
xe as useExternalRequestsShown
|
|
238
257
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const u = 3, p = 50, E = 16, A = 20, g = 200,
|
|
1
|
+
const u = 3, p = 50, E = 16, A = 20, g = 200, c = [
|
|
2
2
|
"slate",
|
|
3
3
|
"blue",
|
|
4
4
|
"cyan",
|
|
@@ -13,7 +13,7 @@ function f(e) {
|
|
|
13
13
|
const t = typeof e.name == "string" ? e.name.replace(/\s+/g, " ").trim().slice(0, 60) : "", n = typeof e.id == "string" ? e.id.replace(/[^A-Za-z0-9_-]/g, "").slice(0, 40) : "";
|
|
14
14
|
if (!t || !n) return null;
|
|
15
15
|
const r = (Array.isArray(e.parts) ? e.parts : []).filter(
|
|
16
|
-
(
|
|
16
|
+
(a) => l.includes(a)
|
|
17
17
|
), s = { id: n, name: t, parts: [...new Set(r)] };
|
|
18
18
|
return (e.col_span === null || typeof e.col_span == "number") && (s.col_span = e.col_span === null ? null : Math.min(12, Math.max(1, Math.round(e.col_span)))), o(e.overrides) && (s.overrides = e.overrides), (e.lock_conditions === null || typeof e.lock_conditions == "string") && (s.lock_conditions = e.lock_conditions), s;
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ function d(e) {
|
|
|
27
27
|
}
|
|
28
28
|
if (!o(t)) return null;
|
|
29
29
|
const n = {};
|
|
30
|
-
if (t.focus_first === !0 && (n.focus_first = !0), t.enter_next === !0 && (n.enter_next = !0), t.adaptive === !0 && (n.adaptive = !0), t.glossary === !1 && (n.glossary = !1), t.density === "compact" && (n.density = "compact"), t.tour === !0 && (n.tour = !0), typeof t.adaptive_threshold == "number" && Number.isFinite(t.adaptive_threshold)) {
|
|
30
|
+
if (t.focus_first === !0 && (n.focus_first = !0), t.enter_next === !0 && (n.enter_next = !0), t.adaptive === !0 && (n.adaptive = !0), t.glossary === !1 && (n.glossary = !1), t.density === "compact" && (n.density = "compact"), t.tour === !0 && (n.tour = !0), t.external_requests === !1 && (n.external_requests = !1), typeof t.adaptive_threshold == "number" && Number.isFinite(t.adaptive_threshold)) {
|
|
31
31
|
const r = Math.min(50, Math.max(1, Math.round(t.adaptive_threshold)));
|
|
32
32
|
r !== 3 && (n.adaptive_threshold = r);
|
|
33
33
|
}
|
|
@@ -38,13 +38,13 @@ function d(e) {
|
|
|
38
38
|
r.length && (n.tab_order = r);
|
|
39
39
|
}
|
|
40
40
|
if (o(t.badge)) {
|
|
41
|
-
const r = typeof t.badge.tag == "string" ? t.badge.tag.replace(/\s+/g, " ").trim().slice(0, 16) : "", s =
|
|
41
|
+
const r = typeof t.badge.tag == "string" ? t.badge.tag.replace(/\s+/g, " ").trim().slice(0, 16) : "", s = c.includes(t.badge.color) ? t.badge.color : "slate";
|
|
42
42
|
r && (n.badge = { tag: r, color: s });
|
|
43
43
|
}
|
|
44
44
|
if (Array.isArray(t.presets)) {
|
|
45
45
|
const r = /* @__PURE__ */ new Set(), s = [];
|
|
46
|
-
for (const
|
|
47
|
-
const i = f(
|
|
46
|
+
for (const a of t.presets) {
|
|
47
|
+
const i = f(a);
|
|
48
48
|
if (i && !r.has(i.id) && (r.add(i.id), s.push(i)), s.length >= 20) break;
|
|
49
49
|
}
|
|
50
50
|
s.length && (n.presets = s);
|
|
@@ -58,7 +58,7 @@ function h(e, t) {
|
|
|
58
58
|
return e < (t.adaptive_threshold ?? 3);
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
c as BADGE_COLORS,
|
|
62
62
|
E as ENTRY_BADGE_TAG_MAX,
|
|
63
63
|
A as ENTRY_PRESETS_MAX,
|
|
64
64
|
g as ENTRY_TAB_ORDER_MAX,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const r = (e) => e === "accepted" ? "ok" : e === "failed" || e === "rejected" ? "attention" : e === "pending" ? "pending" : "neutral";
|
|
2
|
-
function
|
|
3
|
-
const n = [],
|
|
2
|
+
function l(e, o, i = () => "") {
|
|
3
|
+
const n = [], s = /* @__PURE__ */ new Set();
|
|
4
4
|
for (const t of e) {
|
|
5
5
|
const a = t.tone === "positive" ? "ok" : t.tone === "danger" ? "attention" : t.outcome === "pending" ? "pending" : "neutral";
|
|
6
|
-
n.push({ name: t.api, status: a, tip: `${t.api} · ${t.text}` }),
|
|
6
|
+
n.push({ name: t.api, status: a, tip: `${t.api} · ${t.text}` }), s.add(t.api.toLowerCase());
|
|
7
7
|
}
|
|
8
|
-
for (const t of
|
|
8
|
+
for (const t of o) {
|
|
9
9
|
const a = t.external_api_name ?? (t.external_api != null ? `#${t.external_api}` : "External");
|
|
10
|
-
|
|
10
|
+
s.has(a.toLowerCase()) || (s.add(a.toLowerCase()), n.push({
|
|
11
11
|
name: a,
|
|
12
12
|
status: r(t.status),
|
|
13
13
|
tip: `${a} · ${t.status} · ${i(t.updated_at ?? t.created_at)}${t.last_error ? ` — ${t.last_error.slice(0, 120)}` : ""}`
|
|
@@ -20,6 +20,10 @@ function p(e, s, i = () => "") {
|
|
|
20
20
|
pending: n.filter((t) => t.status === "pending").length
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
function u(e) {
|
|
24
|
+
return e.layoutOn ? e.obligations === null || e.submissions === null ? null : e.partnerIntegration !== !1 || e.obligations > 0 || e.submissions > 0 : !1;
|
|
25
|
+
}
|
|
23
26
|
export {
|
|
24
|
-
|
|
27
|
+
u as externalRequestsShown,
|
|
28
|
+
l as integrationChipSummary
|
|
25
29
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { applyLayoutOps as _, HEADER_GROUP_KEY as o, newPlacement as m } from "./layout-ops.js";
|
|
2
|
+
const i = "__owners__", l = -1, u = (e) => !(e.is_visible === 0 || e.is_visible === !1), n = (e) => e.field === i && e.group_key === o;
|
|
3
|
+
function a(e) {
|
|
4
|
+
return e.some(n) ? !1 : e.some(
|
|
5
|
+
(t) => (t.field === "__pipeline__" || t.field === i) && t.group_key !== o && u(t)
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
function g(e) {
|
|
9
|
+
const t = e.assignments.find(n);
|
|
10
|
+
if (t)
|
|
11
|
+
return { show: u(t) && (e.design || e.ownersConfigured !== !1), auto: !1 };
|
|
12
|
+
const r = e.showPipeline && !e.isNew && a(e.assignments) && (e.design || e.ownersConfigured === !0);
|
|
13
|
+
return { show: r, auto: r };
|
|
14
|
+
}
|
|
15
|
+
const p = (e) => {
|
|
16
|
+
const t = e.layout.layout_type;
|
|
17
|
+
return t == null || t === "grouped";
|
|
18
|
+
}, f = (e) => e.placements.filter((t) => t.group_key === o).sort((t, r) => t.sort - r.sort);
|
|
19
|
+
function y(e) {
|
|
20
|
+
var s;
|
|
21
|
+
if (!p(e) || !a(e.placements)) return e;
|
|
22
|
+
const t = ((s = f(e)[0]) == null ? void 0 : s.sort) ?? 0, r = {
|
|
23
|
+
...m(i, o),
|
|
24
|
+
id: l,
|
|
25
|
+
sort: t - 1
|
|
26
|
+
};
|
|
27
|
+
return _({ ...e, placements: [...e.placements, r] }, [
|
|
28
|
+
{ op: "layout_update", patch: {} }
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
const d = (e) => {
|
|
32
|
+
const t = (r) => !!r && (r.group_key === o || r.field === i);
|
|
33
|
+
switch (e.op) {
|
|
34
|
+
case "place":
|
|
35
|
+
return e.group_key === o;
|
|
36
|
+
case "move":
|
|
37
|
+
return t(e.from) || e.to_group_key === o;
|
|
38
|
+
case "update_placement":
|
|
39
|
+
case "remove":
|
|
40
|
+
return t(e.at);
|
|
41
|
+
default:
|
|
42
|
+
return !1;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
function h(e, t) {
|
|
46
|
+
const s = f(e).findIndex((c) => n(c) && c.id === l);
|
|
47
|
+
return s < 0 || !t.some(d) ? t : [{ op: "place", field: i, group_key: o, index: s }, ...t];
|
|
48
|
+
}
|
|
49
|
+
function v(e, t) {
|
|
50
|
+
const r = e.placements.filter((s) => !n(s));
|
|
51
|
+
return !t.some((s) => s.op === "remove" && n(s.at)) || !a(r) ? t : t.map(
|
|
52
|
+
(s) => s.op === "remove" && n(s.at) ? { op: "update_placement", at: s.at, patch: { is_visible: !1 } } : s
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
i as OWNERS_FIELD,
|
|
57
|
+
l as VIRTUAL_OWNERS_ID,
|
|
58
|
+
h as materializeOwnersOps,
|
|
59
|
+
a as ownersAutoQualifies,
|
|
60
|
+
g as ownersHeaderTile,
|
|
61
|
+
v as rewriteOwnersRemove,
|
|
62
|
+
y as withAutoOwnersTile
|
|
63
|
+
};
|