@declarion/react 0.106.0 → 0.109.0
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-lib/api/agents.js +8 -7
- package/dist-lib/api/client.js +48 -49
- package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
- package/dist-lib/components/agents/ChatAttachments.js +144 -0
- package/dist-lib/components/agents/transcript-runs.js +1 -1
- package/dist-lib/components/chrome/AssociationTabs.js +89 -75
- package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
- package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
- package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
- package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
- package/dist-lib/components/fields/RefCombobox.js +53 -48
- package/dist-lib/components/fields/index.js +1 -0
- package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
- package/dist-lib/components/params/ParamsBlock.js +18 -15
- package/dist-lib/components/params/param-editors.js +60 -54
- package/dist-lib/components/primitives/RetryButton.js +14 -0
- package/dist-lib/components/primitives/StatTile.js +42 -34
- package/dist-lib/hooks/useAgentConversation.js +18 -13
- package/dist-lib/hooks/useParams.js +54 -52
- package/dist-lib/hooks/useSchema.js +5 -2
- package/dist-lib/hooks/useTimelineData.js +26 -24
- package/dist-lib/index.d.ts +89 -5
- package/dist-lib/index.js +95 -93
- package/dist-lib/lib/read-display-state.js +19 -0
- package/dist-lib/stores/auth.js +1 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
- package/package.json +1 -1
|
@@ -11,16 +11,16 @@ import { Select as l, TextInput as u } from "../../primitives/Fields.js";
|
|
|
11
11
|
import { useAllParams as d, useCarrierParamOverrides as ee } from "../../../hooks/useParams.js";
|
|
12
12
|
import { PageHeader as f } from "../../chrome/PageHeader.js";
|
|
13
13
|
import { dataTableCellStyle as p, dataTableHeadCellStyle as m, dataTableStyle as h } from "../../primitives/dataTableStyles.js";
|
|
14
|
-
import { EditParamDialog as
|
|
15
|
-
import { PageShell as
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { jsx as
|
|
14
|
+
import { EditParamDialog as g, ErrorLine as _, ResetParamControl as v, ValuePreview as te, paramSourceName as y, paramTenantEditable as b, useParamRefLabels as x } from "../../params/param-editors.js";
|
|
15
|
+
import { PageShell as S } from "../../chrome/PageShell.js";
|
|
16
|
+
import { useMemo as C, useState as w } from "react";
|
|
17
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
18
18
|
//#region src/components/pages/tenant-params/TenantParamsPage.impl.tsx
|
|
19
|
-
var
|
|
19
|
+
var D = "my_tenant", ne = [
|
|
20
20
|
"yaml",
|
|
21
21
|
"env",
|
|
22
22
|
"tenant"
|
|
23
|
-
],
|
|
23
|
+
], re = [
|
|
24
24
|
"21%",
|
|
25
25
|
"17%",
|
|
26
26
|
"9%",
|
|
@@ -28,77 +28,80 @@ var E = "my_tenant", D = [
|
|
|
28
28
|
"15%",
|
|
29
29
|
"11%",
|
|
30
30
|
"20%"
|
|
31
|
-
],
|
|
31
|
+
], O = {
|
|
32
32
|
...p,
|
|
33
33
|
overflow: "hidden",
|
|
34
34
|
textOverflow: "ellipsis",
|
|
35
35
|
whiteSpace: "nowrap"
|
|
36
|
-
},
|
|
36
|
+
}, ie = {
|
|
37
37
|
...p,
|
|
38
38
|
whiteSpace: "nowrap",
|
|
39
39
|
textAlign: "right"
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function k(e) {
|
|
42
42
|
return e === "tenant" ? "violet" : e === "env" ? "amber" : "slate";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let r = a(), i = a("errors"), p = e((e) => e.activeTenant?.id) ?? "", { isPhone:
|
|
46
|
-
carrierEntityCode:
|
|
44
|
+
function A(n) {
|
|
45
|
+
let r = a(), i = a("errors"), p = e((e) => e.activeTenant?.id) ?? "", { isPhone: v } = o(), b = d("tenant"), [k, A] = w(""), [N, P] = w(""), [F, I] = w(""), [L, R] = w(!1), [z, B] = w(null), { overrideByCode: V, missingParams: H, isLoading: U, retry: W, error: G, clearError: K, save: q, reset: J } = ee({
|
|
46
|
+
carrierEntityCode: D,
|
|
47
47
|
rowId: p
|
|
48
48
|
}), Y = async (e, t) => {
|
|
49
|
-
await q(e, t) &&
|
|
50
|
-
}, X =
|
|
49
|
+
await q(e, t) && B((t) => t === e ? null : t);
|
|
50
|
+
}, X = C(() => b.data ?? [], [b.data]), { data: Z } = t(), Q = C(() => {
|
|
51
51
|
let e = new Map((Z?.enums?.parameter_category?.values ?? []).map((e) => [e.code, r(e.name) || e.code]));
|
|
52
52
|
return (t) => t ? e.get(t) ?? t : "";
|
|
53
|
-
}, [Z, r]),
|
|
53
|
+
}, [Z, r]), ae = C(() => Array.from(new Set(X.map((e) => e.category).filter(Boolean))).map((e) => ({
|
|
54
54
|
value: e,
|
|
55
55
|
label: Q(e)
|
|
56
56
|
})).sort((e, t) => e.label.localeCompare(t.label, r.language)), [
|
|
57
57
|
X,
|
|
58
58
|
Q,
|
|
59
59
|
r.language
|
|
60
|
-
]),
|
|
61
|
-
let e =
|
|
62
|
-
return X.filter((t) => !(
|
|
60
|
+
]), oe = C(() => {
|
|
61
|
+
let e = k.trim().toLowerCase();
|
|
62
|
+
return X.filter((t) => !(N && t.category !== N || F && t.source !== F || L && !V.has(t.code) || e && !`${t.code} ${r(t.name)}`.toLowerCase().includes(e))).sort((e, t) => (r(e.name) || e.code).localeCompare(r(t.name) || t.code, r.language) || e.code.localeCompare(t.code));
|
|
63
63
|
}, [
|
|
64
64
|
r,
|
|
65
65
|
X,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]),
|
|
72
|
-
let t =
|
|
66
|
+
k,
|
|
67
|
+
N,
|
|
68
|
+
F,
|
|
69
|
+
L,
|
|
70
|
+
V
|
|
71
|
+
]), se = b.isLoading || U, ce = x(X), $ = oe.map((e) => {
|
|
72
|
+
let t = V.get(e.code);
|
|
73
73
|
return {
|
|
74
74
|
param: e,
|
|
75
|
-
state: /* @__PURE__ */
|
|
75
|
+
state: /* @__PURE__ */ T(j, {
|
|
76
76
|
param: e,
|
|
77
77
|
override: t
|
|
78
78
|
}),
|
|
79
|
-
value: /* @__PURE__ */
|
|
79
|
+
value: /* @__PURE__ */ T(te, {
|
|
80
80
|
type: e.type,
|
|
81
81
|
value: e.value,
|
|
82
82
|
values: e.values,
|
|
83
|
-
label:
|
|
83
|
+
label: ce(e),
|
|
84
84
|
maxWidth: "100%"
|
|
85
85
|
}),
|
|
86
|
-
actions: /* @__PURE__ */
|
|
86
|
+
actions: /* @__PURE__ */ T(M, {
|
|
87
87
|
param: e,
|
|
88
88
|
stored: t !== void 0,
|
|
89
89
|
onEdit: () => {
|
|
90
|
-
K(),
|
|
90
|
+
K(), B(e);
|
|
91
91
|
},
|
|
92
92
|
onReset: (e) => void J(e)
|
|
93
93
|
})
|
|
94
94
|
};
|
|
95
95
|
});
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
header: /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ E(S, {
|
|
97
|
+
header: /* @__PURE__ */ T(f, { description: r("params.tenant.subtitle", "Tenant configuration. Editing a value stores a tenant override; Reset restores the platform default.") }),
|
|
98
98
|
children: [
|
|
99
|
-
G && /* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
G && /* @__PURE__ */ T(_, { text: G }),
|
|
100
|
+
H && /* @__PURE__ */ T(_, {
|
|
101
|
+
text: i("param.overrides_unreadable", "The current parameter overrides could not be read."),
|
|
102
|
+
onRetry: W
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ E("div", {
|
|
102
105
|
"data-testid": "tenant-params-filters",
|
|
103
106
|
style: {
|
|
104
107
|
display: "flex",
|
|
@@ -107,63 +110,63 @@ function j(n) {
|
|
|
107
110
|
alignItems: "center"
|
|
108
111
|
},
|
|
109
112
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ T("div", {
|
|
111
114
|
style: {
|
|
112
115
|
minWidth: 200,
|
|
113
116
|
flex: 1
|
|
114
117
|
},
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
value:
|
|
117
|
-
onChange:
|
|
118
|
+
children: /* @__PURE__ */ T(u, {
|
|
119
|
+
value: k,
|
|
120
|
+
onChange: A,
|
|
118
121
|
placeholder: r("params.search", "Search name or code…")
|
|
119
122
|
})
|
|
120
123
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ T("div", {
|
|
122
125
|
style: { minWidth: 160 },
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
-
value:
|
|
126
|
+
children: /* @__PURE__ */ T(l, {
|
|
127
|
+
value: N,
|
|
125
128
|
options: [{
|
|
126
129
|
value: "",
|
|
127
130
|
label: r("params.filter.all_categories", "All categories")
|
|
128
|
-
}, ...
|
|
129
|
-
onChange:
|
|
131
|
+
}, ...ae],
|
|
132
|
+
onChange: P
|
|
130
133
|
})
|
|
131
134
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ T("div", {
|
|
133
136
|
style: { minWidth: 140 },
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
value:
|
|
137
|
+
children: /* @__PURE__ */ T(l, {
|
|
138
|
+
value: F,
|
|
136
139
|
options: [{
|
|
137
140
|
value: "",
|
|
138
141
|
label: r("params.filter.all_sources", "All sources")
|
|
139
|
-
}, ...
|
|
142
|
+
}, ...ne.map((e) => ({
|
|
140
143
|
value: e,
|
|
141
144
|
label: y(r, e)
|
|
142
145
|
}))],
|
|
143
|
-
onChange:
|
|
146
|
+
onChange: I
|
|
144
147
|
})
|
|
145
148
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ E("label", {
|
|
147
150
|
style: {
|
|
148
151
|
display: "flex",
|
|
149
152
|
alignItems: "center",
|
|
150
153
|
gap: 6,
|
|
151
154
|
fontSize: 12
|
|
152
155
|
},
|
|
153
|
-
children: [/* @__PURE__ */
|
|
154
|
-
value:
|
|
155
|
-
onChange:
|
|
156
|
+
children: [/* @__PURE__ */ T(s, {
|
|
157
|
+
value: L,
|
|
158
|
+
onChange: R
|
|
156
159
|
}), r("params.filter.overridden_only", "Overridden only")]
|
|
157
160
|
})
|
|
158
161
|
]
|
|
159
162
|
}),
|
|
160
|
-
|
|
163
|
+
se ? /* @__PURE__ */ T("div", {
|
|
161
164
|
style: {
|
|
162
165
|
padding: "24px 0",
|
|
163
166
|
textAlign: "center"
|
|
164
167
|
},
|
|
165
|
-
children: /* @__PURE__ */
|
|
166
|
-
}) : $.length === 0 ? /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ T(c, { size: 18 })
|
|
169
|
+
}) : $.length === 0 ? /* @__PURE__ */ T("div", {
|
|
167
170
|
style: {
|
|
168
171
|
padding: 16,
|
|
169
172
|
color: "var(--text-4)",
|
|
@@ -171,14 +174,14 @@ function j(n) {
|
|
|
171
174
|
fontSize: 12.5
|
|
172
175
|
},
|
|
173
176
|
children: r("params.empty", "No parameters match.")
|
|
174
|
-
}) :
|
|
177
|
+
}) : v ? /* @__PURE__ */ T("div", {
|
|
175
178
|
"data-testid": "tenant-params-cards",
|
|
176
179
|
style: {
|
|
177
180
|
display: "flex",
|
|
178
181
|
flexDirection: "column",
|
|
179
182
|
gap: 8
|
|
180
183
|
},
|
|
181
|
-
children: $.map(({ param: e, state: t, value: n, actions: i }) => /* @__PURE__ */
|
|
184
|
+
children: $.map(({ param: e, state: t, value: n, actions: i }) => /* @__PURE__ */ E("div", {
|
|
182
185
|
"data-testid": `tenant-param-row-${e.code}`,
|
|
183
186
|
style: {
|
|
184
187
|
border: "1px solid var(--border)",
|
|
@@ -191,14 +194,14 @@ function j(n) {
|
|
|
191
194
|
minWidth: 0
|
|
192
195
|
},
|
|
193
196
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ E("div", {
|
|
195
198
|
style: {
|
|
196
199
|
display: "flex",
|
|
197
200
|
alignItems: "center",
|
|
198
201
|
gap: 8,
|
|
199
202
|
minWidth: 0
|
|
200
203
|
},
|
|
201
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ T("div", {
|
|
202
205
|
style: {
|
|
203
206
|
flex: 1,
|
|
204
207
|
minWidth: 0,
|
|
@@ -210,7 +213,7 @@ function j(n) {
|
|
|
210
213
|
children: r(e.name) || e.code
|
|
211
214
|
}), t]
|
|
212
215
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ T("div", {
|
|
214
217
|
className: "mono",
|
|
215
218
|
style: {
|
|
216
219
|
fontSize: 11.5,
|
|
@@ -219,18 +222,18 @@ function j(n) {
|
|
|
219
222
|
},
|
|
220
223
|
children: e.code
|
|
221
224
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ T("div", {
|
|
223
226
|
style: { minWidth: 0 },
|
|
224
227
|
children: n
|
|
225
228
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ E("div", {
|
|
227
230
|
style: {
|
|
228
231
|
display: "flex",
|
|
229
232
|
alignItems: "center",
|
|
230
233
|
gap: 6,
|
|
231
234
|
flexWrap: "wrap"
|
|
232
235
|
},
|
|
233
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ T("span", {
|
|
234
237
|
style: {
|
|
235
238
|
flex: 1,
|
|
236
239
|
fontSize: 11.5,
|
|
@@ -241,7 +244,7 @@ function j(n) {
|
|
|
241
244
|
})
|
|
242
245
|
]
|
|
243
246
|
}, e.code))
|
|
244
|
-
}) : /* @__PURE__ */
|
|
247
|
+
}) : /* @__PURE__ */ T("div", {
|
|
245
248
|
"data-testid": "tenant-params-table",
|
|
246
249
|
style: {
|
|
247
250
|
border: "1px solid var(--border)",
|
|
@@ -249,77 +252,77 @@ function j(n) {
|
|
|
249
252
|
background: "var(--surface)",
|
|
250
253
|
overflow: "hidden"
|
|
251
254
|
},
|
|
252
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ E("table", {
|
|
253
256
|
style: {
|
|
254
257
|
...h,
|
|
255
258
|
tableLayout: "fixed"
|
|
256
259
|
},
|
|
257
260
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ T("colgroup", { children: re.map((e, t) => /* @__PURE__ */ T("col", { style: { width: e } }, t)) }),
|
|
262
|
+
/* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [
|
|
263
|
+
/* @__PURE__ */ T("th", {
|
|
261
264
|
style: m,
|
|
262
265
|
children: r("params.column.name", "Name")
|
|
263
266
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ T("th", {
|
|
265
268
|
style: m,
|
|
266
269
|
children: r("params.column.code", "Code")
|
|
267
270
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ T("th", {
|
|
269
272
|
style: m,
|
|
270
273
|
children: r("params.column.category", "Category")
|
|
271
274
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ T("th", {
|
|
273
276
|
style: m,
|
|
274
277
|
children: r("params.column.type", "Type")
|
|
275
278
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ T("th", {
|
|
277
280
|
style: m,
|
|
278
281
|
children: r("params.value", "Value")
|
|
279
282
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ T("th", {
|
|
281
284
|
style: m,
|
|
282
285
|
children: r("params.column.source", "Source")
|
|
283
286
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ T("th", { style: m })
|
|
285
288
|
] }) }),
|
|
286
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ T("tbody", { children: $.map(({ param: e, state: t, value: n, actions: i }) => /* @__PURE__ */ E("tr", {
|
|
287
290
|
"data-testid": `tenant-param-row-${e.code}`,
|
|
288
291
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
style:
|
|
292
|
+
/* @__PURE__ */ T("td", {
|
|
293
|
+
style: O,
|
|
291
294
|
title: r(e.name) || e.code,
|
|
292
295
|
children: r(e.name) || e.code
|
|
293
296
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
style:
|
|
297
|
+
/* @__PURE__ */ T("td", {
|
|
298
|
+
style: O,
|
|
296
299
|
title: e.code,
|
|
297
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ T("span", {
|
|
298
301
|
className: "mono",
|
|
299
302
|
style: { color: "var(--text-3)" },
|
|
300
303
|
children: e.code
|
|
301
304
|
})
|
|
302
305
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
style:
|
|
306
|
+
/* @__PURE__ */ T("td", {
|
|
307
|
+
style: O,
|
|
305
308
|
title: e.category,
|
|
306
309
|
children: Q(e.category) || "—"
|
|
307
310
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
style:
|
|
311
|
+
/* @__PURE__ */ T("td", {
|
|
312
|
+
style: O,
|
|
310
313
|
title: e.type,
|
|
311
314
|
children: e.type
|
|
312
315
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
style:
|
|
316
|
+
/* @__PURE__ */ T("td", {
|
|
317
|
+
style: O,
|
|
315
318
|
children: n
|
|
316
319
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
style:
|
|
320
|
+
/* @__PURE__ */ T("td", {
|
|
321
|
+
style: O,
|
|
319
322
|
children: t
|
|
320
323
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
style:
|
|
324
|
+
/* @__PURE__ */ T("td", {
|
|
325
|
+
style: ie,
|
|
323
326
|
children: i
|
|
324
327
|
})
|
|
325
328
|
]
|
|
@@ -327,58 +330,58 @@ function j(n) {
|
|
|
327
330
|
]
|
|
328
331
|
})
|
|
329
332
|
}),
|
|
330
|
-
|
|
331
|
-
param:
|
|
332
|
-
current:
|
|
333
|
+
z && /* @__PURE__ */ T(g, {
|
|
334
|
+
param: z,
|
|
335
|
+
current: V.get(z.code)?.value ?? z.value,
|
|
333
336
|
error: G,
|
|
334
337
|
onCancel: () => {
|
|
335
|
-
|
|
338
|
+
B(null), K();
|
|
336
339
|
},
|
|
337
|
-
onSave: (e) => Y(
|
|
340
|
+
onSave: (e) => Y(z, e)
|
|
338
341
|
})
|
|
339
342
|
]
|
|
340
343
|
});
|
|
341
344
|
}
|
|
342
|
-
function
|
|
345
|
+
function j({ param: e, override: t }) {
|
|
343
346
|
let n = a();
|
|
344
|
-
return t !== void 0 && e.source !== "tenant" ? /* @__PURE__ */
|
|
347
|
+
return t !== void 0 && e.source !== "tenant" ? /* @__PURE__ */ T("span", {
|
|
345
348
|
"data-testid": `tenant-param-not-applied-${e.code}`,
|
|
346
349
|
title: n("params.tenant.not_applied_hint", "This tenant is set to {value}, and it no longer satisfies the parameter's declaration. Source of the value in effect: {source}. Reset to remove it, or edit it to a value the declaration accepts.", {
|
|
347
350
|
value: JSON.stringify(t.value),
|
|
348
351
|
source: y(n, e.source)
|
|
349
352
|
}),
|
|
350
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ T(i, {
|
|
351
354
|
tone: "amber",
|
|
352
355
|
size: "xs",
|
|
353
356
|
dot: !0,
|
|
354
357
|
children: n("params.not_applied", "not applied")
|
|
355
358
|
})
|
|
356
|
-
}) : /* @__PURE__ */
|
|
357
|
-
tone:
|
|
359
|
+
}) : /* @__PURE__ */ T(i, {
|
|
360
|
+
tone: k(e.source),
|
|
358
361
|
size: "xs",
|
|
359
362
|
children: y(n, e.source)
|
|
360
363
|
});
|
|
361
364
|
}
|
|
362
|
-
function
|
|
365
|
+
function M({ param: e, stored: t, onEdit: i, onReset: o }) {
|
|
363
366
|
let s = a();
|
|
364
|
-
return b(e) ? /* @__PURE__ */
|
|
367
|
+
return b(e) ? /* @__PURE__ */ E("span", {
|
|
365
368
|
style: {
|
|
366
369
|
display: "inline-flex",
|
|
367
370
|
flexWrap: "wrap",
|
|
368
371
|
justifyContent: "flex-end",
|
|
369
372
|
gap: 6
|
|
370
373
|
},
|
|
371
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ T(r, {
|
|
372
375
|
size: "xs",
|
|
373
|
-
icon: /* @__PURE__ */
|
|
376
|
+
icon: /* @__PURE__ */ T(n.edit, { size: 12 }),
|
|
374
377
|
onClick: i,
|
|
375
378
|
children: s("params.edit", "Edit")
|
|
376
|
-
}), t && /* @__PURE__ */
|
|
379
|
+
}), t && /* @__PURE__ */ T(v, {
|
|
377
380
|
param: e,
|
|
378
381
|
description: s("params.reset_confirm.tenant_description", "The value this tenant set is removed, and the platform default applies again."),
|
|
379
382
|
onReset: o
|
|
380
383
|
})]
|
|
381
|
-
}) : /* @__PURE__ */
|
|
384
|
+
}) : /* @__PURE__ */ E("span", {
|
|
382
385
|
title: s("params.tenant.read_only_hint", "Not editable at tenant scope (its declared scopes do not admit tenant)."),
|
|
383
386
|
style: {
|
|
384
387
|
display: "inline-flex",
|
|
@@ -388,11 +391,11 @@ function N({ param: e, stored: t, onEdit: i, onReset: o }) {
|
|
|
388
391
|
fontSize: 11
|
|
389
392
|
},
|
|
390
393
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ T(n.lock, { size: 12 }),
|
|
392
395
|
" ",
|
|
393
396
|
s("params.read_only", "read-only")
|
|
394
397
|
]
|
|
395
398
|
});
|
|
396
399
|
}
|
|
397
400
|
//#endregion
|
|
398
|
-
export {
|
|
401
|
+
export { A as TenantParamsPage };
|
|
@@ -16,28 +16,31 @@ function y(e, t) {
|
|
|
16
16
|
return e ? e.filter((e) => e.scopes?.includes(t)) : [];
|
|
17
17
|
}
|
|
18
18
|
function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w, writeOneByOne: T }) {
|
|
19
|
-
let E = r(), D = r("errors"), O = o(), k = m(() => y(O.data, x), [O.data, x]), [A, j] = h(null), { overrideByCode: M, missingParams: N, isLoading: P,
|
|
19
|
+
let E = r(), D = r("errors"), O = o(), k = m(() => y(O.data, x), [O.data, x]), [A, j] = h(null), { overrideByCode: M, missingParams: N, isLoading: P, retry: F, error: I, clearError: L, save: R, reset: z } = s({
|
|
20
20
|
carrierEntityCode: b,
|
|
21
21
|
rowId: S,
|
|
22
22
|
enabled: k.length > 0,
|
|
23
23
|
writeOneByOne: T
|
|
24
|
-
}),
|
|
25
|
-
let t =
|
|
24
|
+
}), B = v(x) === "object", V = m(() => k.map((e) => {
|
|
25
|
+
let t = B ? M.get(e.code) : void 0;
|
|
26
26
|
return t ? {
|
|
27
27
|
...e,
|
|
28
28
|
value: t.value
|
|
29
29
|
} : e;
|
|
30
30
|
}), [
|
|
31
31
|
k,
|
|
32
|
-
|
|
32
|
+
B,
|
|
33
33
|
M
|
|
34
|
-
]),
|
|
35
|
-
await
|
|
34
|
+
]), H = p(V), U = async (e, t) => {
|
|
35
|
+
await R(e, t) && j((t) => t === e ? null : t);
|
|
36
36
|
};
|
|
37
37
|
return k.length === 0 ? null : /* @__PURE__ */ _(i, {
|
|
38
38
|
title: C ?? E("params.title", "Parameters"),
|
|
39
39
|
icon: w ?? /* @__PURE__ */ g(e.settings, { size: 14 }),
|
|
40
|
-
children: [N ? /* @__PURE__ */ g(l, {
|
|
40
|
+
children: [N ? /* @__PURE__ */ g(l, {
|
|
41
|
+
text: D("param.overrides_unreadable", "The current parameter overrides could not be read."),
|
|
42
|
+
onRetry: F
|
|
43
|
+
}) : P ? /* @__PURE__ */ g("div", {
|
|
41
44
|
style: { padding: "8px 0" },
|
|
42
45
|
children: /* @__PURE__ */ g(a, { size: 16 })
|
|
43
46
|
}) : /* @__PURE__ */ _("div", {
|
|
@@ -46,8 +49,8 @@ function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w,
|
|
|
46
49
|
flexDirection: "column",
|
|
47
50
|
gap: 10
|
|
48
51
|
},
|
|
49
|
-
children: [
|
|
50
|
-
let i = M.get(r.code), a = i !== void 0, o = a && (
|
|
52
|
+
children: [I && !A && /* @__PURE__ */ g(l, { text: I }), V.map((r) => {
|
|
53
|
+
let i = M.get(r.code), a = i !== void 0, o = a && (B || r.source === v(x));
|
|
51
54
|
return /* @__PURE__ */ _("div", {
|
|
52
55
|
"data-testid": `param-row-${r.code}`,
|
|
53
56
|
style: {
|
|
@@ -69,7 +72,7 @@ function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w,
|
|
|
69
72
|
type: r.type,
|
|
70
73
|
value: r.value,
|
|
71
74
|
values: r.values,
|
|
72
|
-
label:
|
|
75
|
+
label: H(r)
|
|
73
76
|
}),
|
|
74
77
|
o && /* @__PURE__ */ g(n, {
|
|
75
78
|
tone: "violet",
|
|
@@ -92,14 +95,14 @@ function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w,
|
|
|
92
95
|
size: "xs",
|
|
93
96
|
icon: /* @__PURE__ */ g(e.edit, { size: 12 }),
|
|
94
97
|
onClick: () => {
|
|
95
|
-
|
|
98
|
+
L(), j(r);
|
|
96
99
|
},
|
|
97
100
|
children: E("params.edit", "Edit")
|
|
98
101
|
}),
|
|
99
102
|
a && /* @__PURE__ */ g(u, {
|
|
100
103
|
param: r,
|
|
101
104
|
description: E("params.reset_confirm.block_description", "The value set here is removed, and the value it inherits applies again."),
|
|
102
|
-
onReset: (e) => void
|
|
105
|
+
onReset: (e) => void z(e)
|
|
103
106
|
})
|
|
104
107
|
]
|
|
105
108
|
}, r.code);
|
|
@@ -107,11 +110,11 @@ function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w,
|
|
|
107
110
|
}), A && /* @__PURE__ */ g(c, {
|
|
108
111
|
param: A,
|
|
109
112
|
current: M.get(A.code)?.value ?? A.value,
|
|
110
|
-
error:
|
|
113
|
+
error: I,
|
|
111
114
|
onCancel: () => {
|
|
112
|
-
j(null),
|
|
115
|
+
j(null), L();
|
|
113
116
|
},
|
|
114
|
-
onSave: (e) =>
|
|
117
|
+
onSave: (e) => U(A, e)
|
|
115
118
|
})]
|
|
116
119
|
});
|
|
117
120
|
}
|