@nivaro/react 0.3.13 → 0.3.15
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/slots/pipeline/OwnersSection.js +79 -75
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +33 -2
- package/dist/index.js +520 -516
- package/dist/shared/components/CollectionBrowserView.js +2393 -2318
- package/dist/shared/components/DataTable.js +347 -335
- package/dist/shared/components/ItemEditForm.js +5278 -5149
- package/dist/shared/components/ListLoadError.js +33 -0
- package/dist/shared/components/PageRenderer.js +562 -529
- package/dist/shared/components/ProfileView.js +53 -51
- package/dist/shared/components/RecordReadView.js +119 -117
- package/dist/shared/components/ReportView.js +1268 -1241
- package/dist/shared/components/cbv/export-rows.js +69 -0
- package/dist/shared/components/cbv/saved-view-risk.js +35 -0
- package/dist/shared/components/cbv/unknown-fields.js +18 -0
- package/dist/shared/components/integrations/console/AlertsView.js +27 -25
- package/dist/shared/components/integrations/console/EventsView.js +244 -209
- package/dist/shared/components/item-edit/CatalogPickerField.js +946 -878
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +84 -57
- package/dist/shared/components/item-edit/FieldAffordances.js +63 -61
- package/dist/shared/components/item-edit/FieldRow.js +195 -179
- package/dist/shared/components/item-edit/FilePickerField.js +257 -254
- package/dist/shared/components/item-edit/HeaderTools.js +139 -95
- package/dist/shared/components/item-edit/InlineTableField.js +2087 -2075
- package/dist/shared/components/item-edit/RowComments.js +1 -3
- package/dist/shared/components/item-edit/SummaryPanel.js +62 -62
- package/dist/shared/components/item-edit/UserChip.js +113 -113
- package/dist/shared/components/item-edit/file-download.js +18 -0
- package/dist/shared/components/item-edit/line-qty.js +67 -32
- package/dist/shared/components/item-edit/save-refusal.js +23 -0
- package/dist/shared/components/monitoring/TrafficMiniMap.js +9 -9
- package/dist/shared/components/panels/CommentPanel.js +30 -30
- package/dist/shared/components/panels/ItemLockBanner.js +207 -185
- package/dist/shared/components/panels/PipelinePanel.js +915 -786
- package/dist/shared/components/pipeline/PipelineEditorView.js +45 -25
- package/dist/shared/components/profile/DelegationCard.js +1 -1
- package/dist/shared/components/profile/session-actions.js +24 -24
- package/dist/shared/components/queue/QueueItemSheet.js +18 -18
- package/dist/shared/components/queue/QueueWorklist.js +517 -504
- package/dist/shared/components/ui/dropdown-menu.js +8 -7
- package/dist/shared/lib/draft-store.js +60 -33
- package/dist/shared/lib/leave-guard.js +38 -0
- package/dist/shared/lib/load-error.js +38 -17
- package/dist/shared/lib/summary-mode.js +25 -25
- package/dist/shared/lib/table-pins.js +23 -0
- package/dist/shared/lib/validation-rules.js +55 -51
- package/package.json +1 -1
|
@@ -1,70 +1,73 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { get as
|
|
4
|
-
import { initials as
|
|
5
|
-
|
|
1
|
+
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useRef as E, useEffect as g, useCallback as W } from "react";
|
|
3
|
+
import { get as _, del as F, post as H } from "../../../lib/commands.js";
|
|
4
|
+
import { initials as U } from "./HistoryTimeline.js";
|
|
5
|
+
import { userErrorMessage as N } from "../../../shared/lib/safe-error.js";
|
|
6
|
+
function K({
|
|
6
7
|
collection: l,
|
|
7
8
|
itemId: u,
|
|
8
9
|
states: c,
|
|
9
10
|
client: r
|
|
10
11
|
}) {
|
|
11
|
-
const [f,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const [f, k] = a([]), [j, S] = a([]), [b, B] = a(!0), [x, h] = a(!1), [o, p] = a(""), [C, w] = a(""), [m, A] = a(!1), [O, M] = a(!1), [L, v] = a(null), i = E(!0);
|
|
13
|
+
g(() => (i.current = !0, () => {
|
|
14
|
+
i.current = !1;
|
|
14
15
|
}), []);
|
|
15
|
-
const s =
|
|
16
|
+
const s = W(async () => {
|
|
17
|
+
var e;
|
|
16
18
|
if (r)
|
|
17
19
|
try {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
const d = await r.request(
|
|
21
|
+
_(`/pipelines/instance/${l}/${u}/owners`)
|
|
20
22
|
);
|
|
21
|
-
|
|
23
|
+
i.current && (k(d.data ?? []), M(((e = d.meta) == null ? void 0 : e.can_add) === !0));
|
|
22
24
|
} catch {
|
|
23
|
-
|
|
25
|
+
i.current && k([]);
|
|
24
26
|
} finally {
|
|
25
|
-
|
|
27
|
+
i.current && B(!1);
|
|
26
28
|
}
|
|
27
29
|
}, [r, l, u]);
|
|
28
|
-
|
|
30
|
+
g(() => {
|
|
29
31
|
s();
|
|
30
|
-
}, [s]),
|
|
31
|
-
r && r.request(
|
|
32
|
-
|
|
32
|
+
}, [s]), g(() => {
|
|
33
|
+
r && r.request(_("/users", { limit: 200, sort: "first_name" })).then((e) => {
|
|
34
|
+
i.current && S(e.data ?? []);
|
|
33
35
|
}).catch(() => {
|
|
34
36
|
});
|
|
35
37
|
}, [r]);
|
|
36
|
-
const
|
|
38
|
+
const R = (e) => {
|
|
37
39
|
if (!e) return null;
|
|
38
|
-
const d = c.find((
|
|
40
|
+
const d = c.find((y) => y.id === e) ?? c.find((y) => y.key === e);
|
|
39
41
|
return (d == null ? void 0 : d.label) ?? e;
|
|
40
42
|
};
|
|
41
|
-
async function
|
|
42
|
-
if (!(!r || !o ||
|
|
43
|
-
|
|
43
|
+
async function $() {
|
|
44
|
+
if (!(!r || !o || m)) {
|
|
45
|
+
A(!0), v(null);
|
|
44
46
|
try {
|
|
45
47
|
await r.request(
|
|
46
|
-
|
|
48
|
+
H(`/pipelines/instance/${l}/${u}/owners`, {
|
|
47
49
|
user: o,
|
|
48
|
-
state:
|
|
50
|
+
state: C || void 0
|
|
49
51
|
})
|
|
50
52
|
), h(!1), p(""), w(""), await s();
|
|
51
|
-
} catch {
|
|
53
|
+
} catch (e) {
|
|
54
|
+
i.current && v(N(e, "Failed to add owner"));
|
|
52
55
|
} finally {
|
|
53
|
-
|
|
56
|
+
i.current && A(!1);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
async function
|
|
60
|
+
async function q(e) {
|
|
58
61
|
if (r)
|
|
59
62
|
try {
|
|
60
|
-
await r.request(
|
|
63
|
+
await r.request(F(`/pipelines/instance-owners/${e}`)), await s();
|
|
61
64
|
} catch {
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ t("div", { "data-nf-owners-section": !0, children: [
|
|
68
|
+
/* @__PURE__ */ t("div", { "data-nf-owners-header": !0, children: [
|
|
69
|
+
/* @__PURE__ */ t("span", { "data-nf-owners-title": !0, children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
68
71
|
"svg",
|
|
69
72
|
{
|
|
70
73
|
"aria-hidden": "true",
|
|
@@ -77,22 +80,22 @@ function N({
|
|
|
77
80
|
strokeLinecap: "round",
|
|
78
81
|
strokeLinejoin: "round",
|
|
79
82
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ n("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
|
|
84
|
+
/* @__PURE__ */ n("circle", { cx: "9", cy: "7", r: "4" }),
|
|
85
|
+
/* @__PURE__ */ n("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
|
|
86
|
+
/* @__PURE__ */ n("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
|
|
84
87
|
]
|
|
85
88
|
}
|
|
86
89
|
),
|
|
87
90
|
"Owners",
|
|
88
|
-
|
|
91
|
+
b ? /* @__PURE__ */ n("span", { "data-nf-skeleton": !0, style: { display: "inline-block", width: 16, height: 10 } }) : /* @__PURE__ */ t("span", { "data-nf-owners-count": !0, children: [
|
|
89
92
|
"(",
|
|
90
93
|
f.length,
|
|
91
94
|
")"
|
|
92
95
|
] })
|
|
93
96
|
] }),
|
|
94
|
-
!
|
|
95
|
-
/* @__PURE__ */
|
|
97
|
+
!x && O && /* @__PURE__ */ t("button", { type: "button", "data-nf-owners-add-btn": !0, onClick: () => h(!0), children: [
|
|
98
|
+
/* @__PURE__ */ t(
|
|
96
99
|
"svg",
|
|
97
100
|
{
|
|
98
101
|
"aria-hidden": "true",
|
|
@@ -105,47 +108,47 @@ function N({
|
|
|
105
108
|
strokeLinecap: "round",
|
|
106
109
|
strokeLinejoin: "round",
|
|
107
110
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ n("path", { d: "M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
|
|
112
|
+
/* @__PURE__ */ n("circle", { cx: "8.5", cy: "7", r: "4" }),
|
|
113
|
+
/* @__PURE__ */ n("line", { x1: "20", y1: "8", x2: "20", y2: "14" }),
|
|
114
|
+
/* @__PURE__ */ n("line", { x1: "23", y1: "11", x2: "17", y2: "11" })
|
|
112
115
|
]
|
|
113
116
|
}
|
|
114
117
|
),
|
|
115
118
|
"Add"
|
|
116
119
|
] })
|
|
117
120
|
] }),
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */
|
|
121
|
+
b ? /* @__PURE__ */ t("div", { "data-nf-owners-loading": !0, children: [
|
|
122
|
+
/* @__PURE__ */ n(
|
|
120
123
|
"span",
|
|
121
124
|
{
|
|
122
125
|
"data-nf-skeleton": !0,
|
|
123
126
|
style: { height: 28, display: "block", borderRadius: 6, marginBottom: 6 }
|
|
124
127
|
}
|
|
125
128
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ n(
|
|
127
130
|
"span",
|
|
128
131
|
{
|
|
129
132
|
"data-nf-skeleton": !0,
|
|
130
133
|
style: { height: 28, width: "75%", display: "block", borderRadius: 6 }
|
|
131
134
|
}
|
|
132
135
|
)
|
|
133
|
-
] }) : f.length === 0 ? /* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
136
|
+
] }) : f.length === 0 ? /* @__PURE__ */ n("p", { "data-nf-empty": !0, children: "No owners assigned." }) : /* @__PURE__ */ n("div", { "data-nf-owner-list": !0, children: f.map((e) => /* @__PURE__ */ t("div", { "data-nf-owner-row": !0, children: [
|
|
137
|
+
/* @__PURE__ */ n("span", { "data-nf-owner-avatar": !0, children: U(e.first_name, e.last_name, e.email) }),
|
|
138
|
+
/* @__PURE__ */ t("div", { "data-nf-owner-info": !0, children: [
|
|
139
|
+
/* @__PURE__ */ n("span", { "data-nf-owner-name": !0, children: [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email }),
|
|
140
|
+
/* @__PURE__ */ n("span", { "data-nf-owner-email": !0, children: e.email })
|
|
138
141
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ n("span", { "data-nf-owner-scope": !0, children: e.state ? R(e.state) : "all states" }),
|
|
143
|
+
/* @__PURE__ */ n(
|
|
141
144
|
"button",
|
|
142
145
|
{
|
|
143
146
|
type: "button",
|
|
144
147
|
"data-nf-icon-btn": !0,
|
|
145
148
|
"data-nf-icon-btn-danger": !0,
|
|
146
149
|
title: "Remove",
|
|
147
|
-
onClick: () => void
|
|
148
|
-
children: /* @__PURE__ */
|
|
150
|
+
onClick: () => void q(e.id),
|
|
151
|
+
children: /* @__PURE__ */ t(
|
|
149
152
|
"svg",
|
|
150
153
|
{
|
|
151
154
|
"aria-hidden": "true",
|
|
@@ -158,55 +161,56 @@ function N({
|
|
|
158
161
|
strokeLinecap: "round",
|
|
159
162
|
strokeLinejoin: "round",
|
|
160
163
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
165
|
+
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
163
166
|
]
|
|
164
167
|
}
|
|
165
168
|
)
|
|
166
169
|
}
|
|
167
170
|
)
|
|
168
171
|
] }, e.id)) }),
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
172
|
+
x && /* @__PURE__ */ t("div", { "data-nf-owners-form": !0, children: [
|
|
173
|
+
/* @__PURE__ */ n("p", { "data-nf-owners-form-title": !0, children: "Add owner" }),
|
|
174
|
+
/* @__PURE__ */ t("select", { value: o, onChange: (e) => p(e.target.value), "data-nf-task-input": !0, children: [
|
|
175
|
+
/* @__PURE__ */ n("option", { value: "", children: "Select a user…" }),
|
|
173
176
|
j.map((e) => {
|
|
174
177
|
const d = [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email;
|
|
175
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ n("option", { value: e.id, children: d }, e.id);
|
|
176
179
|
})
|
|
177
180
|
] }),
|
|
178
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ t(
|
|
179
182
|
"select",
|
|
180
183
|
{
|
|
181
|
-
value:
|
|
184
|
+
value: C,
|
|
182
185
|
onChange: (e) => w(e.target.value),
|
|
183
186
|
"data-nf-task-input": !0,
|
|
184
187
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
c.map((e) => /* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ n("option", { value: "", children: "All states" }),
|
|
189
|
+
c.map((e) => /* @__PURE__ */ n("option", { value: e.id, children: e.label }, e.id))
|
|
187
190
|
]
|
|
188
191
|
}
|
|
189
192
|
),
|
|
190
|
-
/* @__PURE__ */ n("
|
|
191
|
-
|
|
193
|
+
L ? /* @__PURE__ */ n("span", { role: "alert", "data-nf-owners-error": !0, children: L }) : null,
|
|
194
|
+
/* @__PURE__ */ t("div", { "data-nf-confirm-actions": !0, children: [
|
|
195
|
+
/* @__PURE__ */ n(
|
|
192
196
|
"button",
|
|
193
197
|
{
|
|
194
198
|
type: "button",
|
|
195
199
|
"data-nf-btn-ghost": !0,
|
|
196
200
|
onClick: () => {
|
|
197
|
-
h(!1), p(""), w("");
|
|
201
|
+
h(!1), p(""), w(""), v(null);
|
|
198
202
|
},
|
|
199
203
|
children: "Cancel"
|
|
200
204
|
}
|
|
201
205
|
),
|
|
202
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ n(
|
|
203
207
|
"button",
|
|
204
208
|
{
|
|
205
209
|
type: "button",
|
|
206
210
|
"data-nf-btn-primary": !0,
|
|
207
|
-
disabled: !o ||
|
|
208
|
-
onClick: () => void
|
|
209
|
-
children:
|
|
211
|
+
disabled: !o || m,
|
|
212
|
+
onClick: () => void $(),
|
|
213
|
+
children: m ? "…" : "Add"
|
|
210
214
|
}
|
|
211
215
|
)
|
|
212
216
|
] })
|
|
@@ -214,5 +218,5 @@ function N({
|
|
|
214
218
|
] });
|
|
215
219
|
}
|
|
216
220
|
export {
|
|
217
|
-
|
|
221
|
+
K as OwnersSection
|
|
218
222
|
};
|