@deviceinsight/ng-ui-scale-lib 9.18.8 → 9.20.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/{AccessEditModal-a02b50a1.js → AccessEditModal-ee0139fb.js} +24 -23
- package/dist/BundleManagementContainer-093786e5.js +20 -0
- package/dist/{BundlesContainer-498d7121.js → BundlesContainer-54c9cc3a.js} +114 -110
- package/dist/{ContextBarContext-f2968fee.js → ContextBarContext-0c28ce9d.js} +38292 -46174
- package/dist/{DatapointImport-0610eed8.js → DatapointImport-6d394cb5.js} +126 -122
- package/dist/{FileUploadInput-aea4f866.js → FileUploadInput-a23ba785.js} +3 -3
- package/dist/{Files-25853de9.js → Files-4fc0415e.js} +23 -19
- package/dist/GlobalPowerBiReports-f9bf0765.js +11079 -0
- package/dist/{Graph-ad8ad6f9.js → Graph-2840eac2.js} +4 -1
- package/dist/JsonSettingWidget-8908d40b.js +57 -0
- package/dist/{LicensesEditPage-e6c71c43.js → LicensesEditPage-3332b87c.js} +33 -30
- package/dist/{LicensesList-d28c9799.js → LicensesList-6254cd37.js} +17 -13
- package/dist/{PropertiesEditPage-85bc5517.js → PropertiesEditPage-5b148652.js} +24 -21
- package/dist/{PropertiesList-fcf0d837.js → PropertiesList-06478803.js} +17 -13
- package/dist/{TemplateEditPage-a34efc41.js → TemplateEditPage-94088888.js} +28 -23
- package/dist/TemplateTextInput-e8861a0f.js +50 -0
- package/dist/{TemplatesListPage-ce7fea1d.js → TemplatesListPage-866246c6.js} +55 -51
- package/dist/{UserGroupAssignments-8fd3c47d.js → UserGroupAssignments-6feae326.js} +36 -32
- package/dist/{UserGroupTheme-0e8a16c4.js → UserGroupTheme-7ee8e92e.js} +14 -11
- package/dist/api.d.ts +3 -0
- package/dist/api.js +59 -56
- package/dist/{index-e2b27256.js → index-34a2015c.js} +7 -7
- package/dist/index.js +2761 -2765
- package/dist/objectWithoutPropertiesLoose-a4604547.js +26 -0
- package/dist/{react-router-7b367edf.js → react-router-d38ecdf4.js} +113 -108
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/BundleManagementContainer-dbac0259.js +0 -17
- package/dist/GlobalPowerBiReports-06c92d0e.js +0 -11078
- package/dist/JsonSettingWidget-c471537a.js +0 -54
- package/dist/TemplateTextInput-fe5912e7.js +0 -47
- package/dist/extends-0a3e0827.js +0 -13
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ah as S, bf as P, aw as e, ag as r, bl as A, b7 as I, d5 as T, aQ as F, b4 as re, aj as ae, d6 as ie, cn as q, d7 as oe } from "./ContextBarContext-0c28ce9d.js";
|
|
2
2
|
import { useEffect as D, useState as V, useRef as ce, useCallback as ue, createElement as he } from "react";
|
|
3
3
|
import { useLocation as me } from "react-router-dom";
|
|
4
4
|
import { createBundle as xe, deleteBundleFile as je, createBundleFile as fe, releaseBundleVersion as Ee, fetchBundleVersion as G, fetchBundleFiles as z, createBundleVersion as ge, deleteBundleVersion as Be, downloadBundleFile as be, fetchBundleVersions as W, deleteBundle as Ve, fetchAllBundles as De } from "@deviceinsight/ng-ui-api-client";
|
|
5
5
|
import { messageBoxSuccess as $, messageBoxError as H, ReactableWithClientSidePagination as Ne, Reactable as Te, ContentHeader as ve } from "@deviceinsight/ng-ui-components";
|
|
6
|
-
import
|
|
6
|
+
import "react-i18next";
|
|
7
|
+
import { Modal as p, SpinnerContainer as N, Button as j, Icon as v, Label as pe, AccordionItem as _e, Accordion as ye } from "@deviceinsight/ng-ui-basic-components";
|
|
7
8
|
import { B as c, Q, a as Ce } from "./consts-012135e5.js";
|
|
8
|
-
import { F as Le } from "./FileUploadInput-
|
|
9
|
+
import { F as Le } from "./FileUploadInput-a23ba785.js";
|
|
9
10
|
import { u as Se, b as Ae } from "./useCanDeleteBundleVersion-64f35949.js";
|
|
11
|
+
import "i18next";
|
|
12
|
+
import "ux4iot-react";
|
|
10
13
|
import "react-dom";
|
|
11
14
|
const Y = (n) => {
|
|
12
15
|
n && setTimeout(() => n.focus(), 0);
|
|
13
16
|
}, Z = (n, t) => {
|
|
14
17
|
D(() => {
|
|
15
|
-
const s = (
|
|
16
|
-
t || (
|
|
18
|
+
const s = (d) => {
|
|
19
|
+
t || (d.code === "Enter" || d.code === "NumpadEnter") && n();
|
|
17
20
|
};
|
|
18
21
|
return document.addEventListener("keydown", s), () => {
|
|
19
22
|
document.removeEventListener("keydown", s);
|
|
@@ -21,8 +24,8 @@ const Y = (n) => {
|
|
|
21
24
|
}, [n, t]);
|
|
22
25
|
}, Ie = ({ setOpen: n, loadBundles: t }) => {
|
|
23
26
|
const { t: s } = S(), {
|
|
24
|
-
handleSubmit:
|
|
25
|
-
control:
|
|
27
|
+
handleSubmit: d,
|
|
28
|
+
control: l,
|
|
26
29
|
formState: { isSubmitting: a }
|
|
27
30
|
} = P({ defaultValues: { name: "" } }), i = (o) => xe(o).then(() => {
|
|
28
31
|
t(), n(!1), $(
|
|
@@ -30,11 +33,11 @@ const Y = (n) => {
|
|
|
30
33
|
);
|
|
31
34
|
}).catch((h) => {
|
|
32
35
|
console.error("bundle creation error", h), H(/* @__PURE__ */ e.jsx(r, { i18nKey: "bundlemanagement.createBundleError", children: "Could not save bundle" }));
|
|
33
|
-
}), u = () =>
|
|
36
|
+
}), u = () => d(i, (o) => {
|
|
34
37
|
console.warn("Validation error", o);
|
|
35
38
|
})();
|
|
36
39
|
return Z(u, !1), /* @__PURE__ */ e.jsx(
|
|
37
|
-
|
|
40
|
+
p,
|
|
38
41
|
{
|
|
39
42
|
width: 400,
|
|
40
43
|
header: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundle.create.title", children: "Create new Bundle" }),
|
|
@@ -42,7 +45,7 @@ const Y = (n) => {
|
|
|
42
45
|
A,
|
|
43
46
|
{
|
|
44
47
|
name: "name",
|
|
45
|
-
control:
|
|
48
|
+
control: l,
|
|
46
49
|
rules: {
|
|
47
50
|
required: s("bundleManagement.bundles.name.required", {
|
|
48
51
|
defaultValue: "Name is required"
|
|
@@ -92,15 +95,15 @@ const Y = (n) => {
|
|
|
92
95
|
}
|
|
93
96
|
);
|
|
94
97
|
}, O = (n, t, s) => {
|
|
95
|
-
n && n.some((
|
|
98
|
+
n && n.some((d) => !d.condition || d.condition(s) ? (t(/* @__PURE__ */ e.jsx(r, { i18nKey: d.id, children: d.defaultValue })), !0) : !1);
|
|
96
99
|
};
|
|
97
100
|
function g({
|
|
98
101
|
requestFunction: n,
|
|
99
102
|
errorMessages: t,
|
|
100
103
|
successMessages: s,
|
|
101
|
-
initialData:
|
|
104
|
+
initialData: d
|
|
102
105
|
}) {
|
|
103
|
-
const [
|
|
106
|
+
const [l, a] = V(d), [i, u] = V(!1), [o, h] = V(void 0), m = ce(!0), b = ue(async (...B) => {
|
|
104
107
|
try {
|
|
105
108
|
h(void 0), u(!0);
|
|
106
109
|
const f = await n(...B);
|
|
@@ -113,25 +116,25 @@ function g({
|
|
|
113
116
|
}, [n, t, s]);
|
|
114
117
|
return D(() => (m.current = !0, () => {
|
|
115
118
|
m.current = !1;
|
|
116
|
-
}), [n, t, s]), { run: b, data:
|
|
119
|
+
}), [n, t, s]), { run: b, data: l, loading: i, error: o };
|
|
117
120
|
}
|
|
118
121
|
const K = (n) => n ? /* @__PURE__ */ e.jsx("span", { children: re(n, { showTimezone: !1 }) }) : "-", Fe = ({
|
|
119
122
|
onViewDetails: n,
|
|
120
123
|
onDelete: t,
|
|
121
124
|
onEdit: s
|
|
122
|
-
},
|
|
125
|
+
}, d) => [
|
|
123
126
|
{
|
|
124
127
|
name: "name",
|
|
125
128
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.name", children: "Name" }),
|
|
126
129
|
sortable: !0,
|
|
127
|
-
render: (
|
|
130
|
+
render: (l) => /* @__PURE__ */ e.jsx(
|
|
128
131
|
"a",
|
|
129
132
|
{
|
|
130
133
|
href: "edit",
|
|
131
134
|
onClick: (a) => {
|
|
132
|
-
a.preventDefault(), n(
|
|
135
|
+
a.preventDefault(), n(l.id);
|
|
133
136
|
},
|
|
134
|
-
children:
|
|
137
|
+
children: l.name
|
|
135
138
|
}
|
|
136
139
|
),
|
|
137
140
|
width: "15%"
|
|
@@ -140,48 +143,48 @@ const K = (n) => n ? /* @__PURE__ */ e.jsx("span", { children: re(n, { showTimez
|
|
|
140
143
|
name: "description",
|
|
141
144
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.description", children: "Description" }),
|
|
142
145
|
sortable: !0,
|
|
143
|
-
render: ({ description:
|
|
146
|
+
render: ({ description: l }) => /* @__PURE__ */ e.jsx("span", { children: l }),
|
|
144
147
|
width: "20%"
|
|
145
148
|
},
|
|
146
149
|
{
|
|
147
150
|
name: "fileCount",
|
|
148
151
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.files", children: "Files" }),
|
|
149
152
|
sortable: !0,
|
|
150
|
-
render: ({ fileCount:
|
|
153
|
+
render: ({ fileCount: l }) => /* @__PURE__ */ e.jsx("span", { children: l || "-" }),
|
|
151
154
|
width: "10%"
|
|
152
155
|
},
|
|
153
156
|
{
|
|
154
157
|
name: "draft",
|
|
155
158
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.status", children: "Status" }),
|
|
156
159
|
sortable: !0,
|
|
157
|
-
render: ({ draft:
|
|
160
|
+
render: ({ draft: l }) => /* @__PURE__ */ e.jsx("span", { children: l ? /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.draft", children: "Draft" }) : /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.published", children: "Published" }) }),
|
|
158
161
|
width: "10%"
|
|
159
162
|
},
|
|
160
163
|
{
|
|
161
164
|
name: "createdAt",
|
|
162
165
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.createdAt", children: "Created at" }),
|
|
163
166
|
sortable: !0,
|
|
164
|
-
render: ({ createdAt:
|
|
167
|
+
render: ({ createdAt: l }) => /* @__PURE__ */ e.jsx("span", { children: K(l) })
|
|
165
168
|
},
|
|
166
169
|
{
|
|
167
170
|
name: "releasedAt",
|
|
168
171
|
label: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.releasedAt", children: "Published at" }),
|
|
169
172
|
sortable: !0,
|
|
170
|
-
render: ({ releasedAt:
|
|
173
|
+
render: ({ releasedAt: l }) => /* @__PURE__ */ e.jsx("span", { children: l ? K(l) : "-" })
|
|
171
174
|
},
|
|
172
175
|
{
|
|
173
176
|
name: "delete",
|
|
174
177
|
label: "",
|
|
175
178
|
width: "5%",
|
|
176
179
|
align: "right",
|
|
177
|
-
render: (
|
|
178
|
-
|
|
180
|
+
render: (l) => /* @__PURE__ */ e.jsx(F, { authorities: ["WRITE_BUNDLE"], children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
181
|
+
l.draft && /* @__PURE__ */ e.jsx(
|
|
179
182
|
j,
|
|
180
183
|
{
|
|
181
184
|
naked: !0,
|
|
182
185
|
small: !0,
|
|
183
|
-
onClick: () => s(
|
|
184
|
-
title:
|
|
186
|
+
onClick: () => s(l.id),
|
|
187
|
+
title: d("bundleversion.edit", {
|
|
185
188
|
defaultValue: "Edit Bundle Version"
|
|
186
189
|
}),
|
|
187
190
|
"data-testid": c.DELETE_VERSION_ICON,
|
|
@@ -193,10 +196,10 @@ const K = (n) => n ? /* @__PURE__ */ e.jsx("span", { children: re(n, { showTimez
|
|
|
193
196
|
{
|
|
194
197
|
naked: !0,
|
|
195
198
|
small: !0,
|
|
196
|
-
onClick: () => t(
|
|
197
|
-
title:
|
|
199
|
+
onClick: () => t(l),
|
|
200
|
+
title: d("bundleversion.delete", {
|
|
198
201
|
defaultValue: "Delete Bundle Version",
|
|
199
|
-
version:
|
|
202
|
+
version: l.name
|
|
200
203
|
}),
|
|
201
204
|
"data-testid": c.DELETE_VERSION_ICON,
|
|
202
205
|
children: /* @__PURE__ */ e.jsx(v, { del: !0 })
|
|
@@ -206,7 +209,7 @@ const K = (n) => n ? /* @__PURE__ */ e.jsx("span", { children: re(n, { showTimez
|
|
|
206
209
|
}
|
|
207
210
|
], Me = /^[a-zA-Z0-9_.-]*$/;
|
|
208
211
|
function we({ header: n, formContext: t, onSubmit: s }) {
|
|
209
|
-
const { t:
|
|
212
|
+
const { t: d } = S(), { control: l } = t;
|
|
210
213
|
return Z(s, !1), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
211
214
|
/* @__PURE__ */ e.jsx(
|
|
212
215
|
"h3",
|
|
@@ -222,20 +225,20 @@ function we({ header: n, formContext: t, onSubmit: s }) {
|
|
|
222
225
|
A,
|
|
223
226
|
{
|
|
224
227
|
name: "name",
|
|
225
|
-
control:
|
|
228
|
+
control: l,
|
|
226
229
|
rules: {
|
|
227
|
-
required:
|
|
230
|
+
required: d("version.name.required", {
|
|
228
231
|
defaultValue: "Name is required."
|
|
229
232
|
}),
|
|
230
233
|
pattern: {
|
|
231
234
|
value: Me,
|
|
232
|
-
message:
|
|
235
|
+
message: d("version.name.pattern", {
|
|
233
236
|
defaultValue: "Name can only contain latin characters, number, dots and underscores."
|
|
234
237
|
})
|
|
235
238
|
},
|
|
236
239
|
maxLength: {
|
|
237
240
|
value: 50,
|
|
238
|
-
message:
|
|
241
|
+
message: d("version.name.maxLength", {
|
|
239
242
|
defaultValue: "Name cannot be longer than 50 characters"
|
|
240
243
|
})
|
|
241
244
|
}
|
|
@@ -259,11 +262,11 @@ function we({ header: n, formContext: t, onSubmit: s }) {
|
|
|
259
262
|
A,
|
|
260
263
|
{
|
|
261
264
|
name: "description",
|
|
262
|
-
control:
|
|
265
|
+
control: l,
|
|
263
266
|
rules: {
|
|
264
267
|
maxLength: {
|
|
265
268
|
value: 250,
|
|
266
|
-
message:
|
|
269
|
+
message: d("version.description.maxLength", {
|
|
267
270
|
defaultValue: "Description cannot be longer than 250 characters"
|
|
268
271
|
})
|
|
269
272
|
}
|
|
@@ -345,7 +348,7 @@ const J = [
|
|
|
345
348
|
)
|
|
346
349
|
}
|
|
347
350
|
], X = ({ count: n }) => /* @__PURE__ */ e.jsx(
|
|
348
|
-
|
|
351
|
+
pe,
|
|
349
352
|
{
|
|
350
353
|
className: "neutral",
|
|
351
354
|
style: {
|
|
@@ -374,10 +377,11 @@ const J = [
|
|
|
374
377
|
Ne,
|
|
375
378
|
{
|
|
376
379
|
columnDefs: t,
|
|
377
|
-
uniqueItemKey: (
|
|
380
|
+
uniqueItemKey: (d) => `${d.name}_${d.size}`,
|
|
378
381
|
paginationSettings: Re,
|
|
379
382
|
items: n,
|
|
380
|
-
isLoading: s
|
|
383
|
+
isLoading: s,
|
|
384
|
+
tableName: "files"
|
|
381
385
|
}
|
|
382
386
|
)
|
|
383
387
|
] }) }), ne = ({ bundle: n, version: t }) => /* @__PURE__ */ e.jsxs("div", { className: "bundle-version-info", children: [
|
|
@@ -432,7 +436,7 @@ const J = [
|
|
|
432
436
|
}, Ye = "DUPLICATE_FILE_NAME", Ze = ({
|
|
433
437
|
bundle: n,
|
|
434
438
|
version: t,
|
|
435
|
-
fileLoader: { run: s, data:
|
|
439
|
+
fileLoader: { run: s, data: d, loading: l }
|
|
436
440
|
}) => {
|
|
437
441
|
const { t: a } = S(), i = t ? t.id : "", { run: u, loading: o } = g({
|
|
438
442
|
requestFunction: je,
|
|
@@ -454,8 +458,8 @@ const J = [
|
|
|
454
458
|
/* @__PURE__ */ e.jsx(
|
|
455
459
|
ee,
|
|
456
460
|
{
|
|
457
|
-
isLoading: o || m ||
|
|
458
|
-
files:
|
|
461
|
+
isLoading: o || m || l,
|
|
462
|
+
files: d || [],
|
|
459
463
|
columnDefs: f
|
|
460
464
|
}
|
|
461
465
|
),
|
|
@@ -467,12 +471,12 @@ const J = [
|
|
|
467
471
|
},
|
|
468
472
|
onChange: (E) => {
|
|
469
473
|
if (E) {
|
|
470
|
-
const
|
|
471
|
-
|
|
474
|
+
const _ = new FormData();
|
|
475
|
+
_.append("file", E), B(_);
|
|
472
476
|
}
|
|
473
477
|
}
|
|
474
478
|
},
|
|
475
|
-
|
|
479
|
+
d ? d.length : 1
|
|
476
480
|
) })
|
|
477
481
|
] });
|
|
478
482
|
}, Je = {
|
|
@@ -484,7 +488,7 @@ const J = [
|
|
|
484
488
|
}, en = {
|
|
485
489
|
id: "bundlemanagement.releaseBundleVersionSuccess",
|
|
486
490
|
defaultValue: "The version was published"
|
|
487
|
-
},
|
|
491
|
+
}, y = {
|
|
488
492
|
id: "bundlemanagement.modalCloseButton",
|
|
489
493
|
defaultValue: "Close"
|
|
490
494
|
}, C = {
|
|
@@ -496,21 +500,21 @@ const J = [
|
|
|
496
500
|
}, R = {
|
|
497
501
|
id: "bundlemanagement.modalSaveAndProceedButton",
|
|
498
502
|
defaultValue: "Save and Proceed"
|
|
499
|
-
}, nn = [te], tn = [se], sn = [ze],
|
|
500
|
-
const
|
|
503
|
+
}, nn = [te], tn = [se], sn = [ze], ln = [Ge], dn = [en], rn = ({ bundle: n, versionId: t, setVersionId: s, onClose: d }) => {
|
|
504
|
+
const l = P({
|
|
501
505
|
defaultValues: {
|
|
502
506
|
name: "",
|
|
503
507
|
description: ""
|
|
504
508
|
}
|
|
505
|
-
}), { handleSubmit: a } =
|
|
509
|
+
}), { handleSubmit: a } = l, i = (f) => ge(n.id, f).then((E) => s(E.id)), u = () => a(i, (f) => {
|
|
506
510
|
console.warn("Validation error", f);
|
|
507
511
|
})(), o = g({
|
|
508
512
|
requestFunction: u,
|
|
509
513
|
errorMessages: sn
|
|
510
514
|
}), h = g({
|
|
511
515
|
requestFunction: Ee,
|
|
512
|
-
errorMessages:
|
|
513
|
-
successMessages:
|
|
516
|
+
errorMessages: ln,
|
|
517
|
+
successMessages: dn
|
|
514
518
|
}), m = g({
|
|
515
519
|
requestFunction: G,
|
|
516
520
|
errorMessages: nn
|
|
@@ -523,7 +527,7 @@ const J = [
|
|
|
523
527
|
}, [t, b, n]);
|
|
524
528
|
const B = !!(x.data && x.data.length);
|
|
525
529
|
return /* @__PURE__ */ e.jsx(
|
|
526
|
-
|
|
530
|
+
p,
|
|
527
531
|
{
|
|
528
532
|
width: 500,
|
|
529
533
|
header: t ? /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.editversion", children: "Add Files" }) : /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.addversion", children: "Create new Version" }),
|
|
@@ -531,7 +535,7 @@ const J = [
|
|
|
531
535
|
N,
|
|
532
536
|
{
|
|
533
537
|
show: h.loading || m.loading && !m.data || o.loading,
|
|
534
|
-
children: t ? /* @__PURE__ */ e.jsx(Ze, { bundle: n, version: m.data, fileLoader: x }) : /* @__PURE__ */ e.jsx(we, { header: n.name, formContext:
|
|
538
|
+
children: t ? /* @__PURE__ */ e.jsx(Ze, { bundle: n, version: m.data, fileLoader: x }) : /* @__PURE__ */ e.jsx(we, { header: n.name, formContext: l, onSubmit: u })
|
|
535
539
|
}
|
|
536
540
|
),
|
|
537
541
|
footer: t ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -539,24 +543,24 @@ const J = [
|
|
|
539
543
|
j,
|
|
540
544
|
{
|
|
541
545
|
primary: !0,
|
|
542
|
-
onClick: () => h.run(n.id, t || "").then(
|
|
546
|
+
onClick: () => h.run(n.id, t || "").then(d),
|
|
543
547
|
disabled: !B || h.loading,
|
|
544
548
|
children: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundlemanagement.publish", children: "Publish" })
|
|
545
549
|
}
|
|
546
550
|
),
|
|
547
|
-
/* @__PURE__ */ e.jsx(j, { onClick:
|
|
551
|
+
/* @__PURE__ */ e.jsx(j, { onClick: d, "data-testid": c.CANCEL_SAVE_VERSION_BUTTON, children: /* @__PURE__ */ e.jsx(r, { i18nKey: y.id, children: y.defaultValue }) })
|
|
548
552
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
549
553
|
/* @__PURE__ */ e.jsx(
|
|
550
554
|
j,
|
|
551
555
|
{
|
|
552
556
|
primary: !0,
|
|
553
557
|
onClick: o.run,
|
|
554
|
-
disabled:
|
|
558
|
+
disabled: l.formState.isSubmitting || o.loading,
|
|
555
559
|
"data-testid": c.SAVE_VERSION_BUTTON,
|
|
556
560
|
children: /* @__PURE__ */ e.jsx(r, { i18nKey: R.id, children: R.defaultValue })
|
|
557
561
|
}
|
|
558
562
|
),
|
|
559
|
-
/* @__PURE__ */ e.jsx(j, { onClick:
|
|
563
|
+
/* @__PURE__ */ e.jsx(j, { onClick: d, "data-testid": c.CANCEL_SAVE_VERSION_BUTTON, children: /* @__PURE__ */ e.jsx(r, { i18nKey: T.cancel.id, children: T.cancel.defaultValue }) })
|
|
560
564
|
] })
|
|
561
565
|
}
|
|
562
566
|
);
|
|
@@ -574,22 +578,22 @@ const J = [
|
|
|
574
578
|
"Do you really want to delete the version ",
|
|
575
579
|
/* @__PURE__ */ e.jsx("strong", { children: n }),
|
|
576
580
|
"?"
|
|
577
|
-
] }) }) }) }), cn = ({ version: n, canBeDeleted: t, error: s, processing:
|
|
581
|
+
] }) }) }) }), cn = ({ version: n, canBeDeleted: t, error: s, processing: d }) => /* @__PURE__ */ e.jsx(N, { show: d, children: /* @__PURE__ */ e.jsx(
|
|
578
582
|
"div",
|
|
579
583
|
{
|
|
580
584
|
style: {
|
|
581
585
|
minHeight: 50
|
|
582
586
|
},
|
|
583
|
-
children: !
|
|
587
|
+
children: !d && (t ? on(n.name) : an(n.name, s))
|
|
584
588
|
}
|
|
585
|
-
) }), un = [qe], hn = [Xe], mn = ({ bundle: n, version: t, onCancel: s, loadVersions:
|
|
586
|
-
const { run:
|
|
589
|
+
) }), un = [qe], hn = [Xe], mn = ({ bundle: n, version: t, onCancel: s, loadVersions: d }) => {
|
|
590
|
+
const { run: l } = g({
|
|
587
591
|
requestFunction: Be,
|
|
588
592
|
errorMessages: un,
|
|
589
593
|
successMessages: hn
|
|
590
|
-
}), a = Se(n, t), i = () =>
|
|
594
|
+
}), a = Se(n, t), i = () => l(n.id, t.id).then(d).then(s);
|
|
591
595
|
return /* @__PURE__ */ e.jsx(
|
|
592
|
-
|
|
596
|
+
p,
|
|
593
597
|
{
|
|
594
598
|
header: /* @__PURE__ */ e.jsx(r, { i18nKey: U.id, children: U.defaultValue }),
|
|
595
599
|
content: /* @__PURE__ */ e.jsx(cn, { version: t, ...a }),
|
|
@@ -600,9 +604,9 @@ const J = [
|
|
|
600
604
|
width: 500
|
|
601
605
|
}
|
|
602
606
|
);
|
|
603
|
-
}, xn = [te], jn = [se], fn = ({ bundle: n, versionId: t, onClose: s, t:
|
|
607
|
+
}, xn = [te], jn = [se], fn = ({ bundle: n, versionId: t, onClose: s, t: d }) => {
|
|
604
608
|
const {
|
|
605
|
-
run:
|
|
609
|
+
run: l,
|
|
606
610
|
data: a,
|
|
607
611
|
loading: i
|
|
608
612
|
} = g({
|
|
@@ -621,11 +625,11 @@ const J = [
|
|
|
621
625
|
window.location.replace(f.downloadLink);
|
|
622
626
|
}),
|
|
623
627
|
errorMessages: [Pe]
|
|
624
|
-
}), b = Ke(m,
|
|
628
|
+
}), b = Ke(m, d);
|
|
625
629
|
return D(() => {
|
|
626
|
-
t && (
|
|
627
|
-
}, [u,
|
|
628
|
-
|
|
630
|
+
t && (l(n.id, t), u(n.id, t));
|
|
631
|
+
}, [u, l, t, n]), /* @__PURE__ */ e.jsx(
|
|
632
|
+
p,
|
|
629
633
|
{
|
|
630
634
|
width: 500,
|
|
631
635
|
header: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.viewVersion", children: "Version Details" }),
|
|
@@ -640,12 +644,12 @@ const J = [
|
|
|
640
644
|
}
|
|
641
645
|
)
|
|
642
646
|
] }) }),
|
|
643
|
-
footer: /* @__PURE__ */ e.jsx(j, { onClick: s, "data-testid": c.MODAL_CLOSE_BUTTON, children: /* @__PURE__ */ e.jsx(r, { i18nKey:
|
|
647
|
+
footer: /* @__PURE__ */ e.jsx(j, { onClick: s, "data-testid": c.MODAL_CLOSE_BUTTON, children: /* @__PURE__ */ e.jsx(r, { i18nKey: y.id, children: y.defaultValue }) })
|
|
644
648
|
}
|
|
645
649
|
);
|
|
646
650
|
}, En = {
|
|
647
651
|
getRowClass: (n) => n.draft ? "draft" : "released"
|
|
648
|
-
}, gn = ({ columnDefs: n, paginationSettings: t, setPaginationSettings: s, versions:
|
|
652
|
+
}, gn = ({ columnDefs: n, paginationSettings: t, setPaginationSettings: s, versions: d, loading: l }) => /* @__PURE__ */ e.jsx(N, { show: l, children: /* @__PURE__ */ e.jsxs(
|
|
649
653
|
"div",
|
|
650
654
|
{
|
|
651
655
|
className: "bundle-version-table",
|
|
@@ -655,7 +659,7 @@ const J = [
|
|
|
655
659
|
children: [
|
|
656
660
|
/* @__PURE__ */ e.jsxs("h2", { children: [
|
|
657
661
|
/* @__PURE__ */ e.jsx(r, { i18nKey: "bundleversion.title", children: "Versions" }),
|
|
658
|
-
/* @__PURE__ */ e.jsx(X, { count:
|
|
662
|
+
/* @__PURE__ */ e.jsx(X, { count: d && d.totalElements })
|
|
659
663
|
] }),
|
|
660
664
|
/* @__PURE__ */ e.jsx(
|
|
661
665
|
Te,
|
|
@@ -672,7 +676,7 @@ const J = [
|
|
|
672
676
|
direction: i
|
|
673
677
|
}
|
|
674
678
|
}),
|
|
675
|
-
pageable:
|
|
679
|
+
pageable: d,
|
|
676
680
|
rowDef: En,
|
|
677
681
|
"data-testid": "bundle-versions-table"
|
|
678
682
|
}
|
|
@@ -687,10 +691,10 @@ const J = [
|
|
|
687
691
|
direction: "DESC"
|
|
688
692
|
}
|
|
689
693
|
}, bn = [We], Vn = ({ bundle: n, isOpen: t }) => {
|
|
690
|
-
const { t: s } = S(), [
|
|
694
|
+
const { t: s } = S(), [d, l] = V(!1), [a, i] = V(void 0), [u, o] = V(void 0), [h, m] = V(void 0), x = q();
|
|
691
695
|
D(() => {
|
|
692
|
-
const
|
|
693
|
-
w &&
|
|
696
|
+
const de = x.get(Q), w = x.get(Ce);
|
|
697
|
+
w && de === n.id && i(w);
|
|
694
698
|
}, [x, n]);
|
|
695
699
|
const b = Fe(
|
|
696
700
|
{
|
|
@@ -701,8 +705,8 @@ const J = [
|
|
|
701
705
|
s
|
|
702
706
|
), [B, f] = V(Bn), {
|
|
703
707
|
run: E,
|
|
704
|
-
data:
|
|
705
|
-
loading:
|
|
708
|
+
data: _,
|
|
709
|
+
loading: le
|
|
706
710
|
} = g({
|
|
707
711
|
requestFunction: W,
|
|
708
712
|
errorMessages: bn
|
|
@@ -713,17 +717,17 @@ const J = [
|
|
|
713
717
|
/* @__PURE__ */ e.jsx(
|
|
714
718
|
gn,
|
|
715
719
|
{
|
|
716
|
-
versions:
|
|
720
|
+
versions: _,
|
|
717
721
|
paginationSettings: B,
|
|
718
722
|
setPaginationSettings: f,
|
|
719
723
|
columnDefs: b,
|
|
720
|
-
loading:
|
|
724
|
+
loading: le
|
|
721
725
|
}
|
|
722
726
|
),
|
|
723
727
|
/* @__PURE__ */ e.jsx(F, { authorities: ["WRITE_BUNDLE"], children: /* @__PURE__ */ e.jsxs(
|
|
724
728
|
j,
|
|
725
729
|
{
|
|
726
|
-
onClick: () =>
|
|
730
|
+
onClick: () => l(!0),
|
|
727
731
|
"data-testid": c.CREATE_VERSION_BUTTON,
|
|
728
732
|
children: [
|
|
729
733
|
/* @__PURE__ */ e.jsx(v, { add: !0 }),
|
|
@@ -740,14 +744,14 @@ const J = [
|
|
|
740
744
|
loadVersions: M
|
|
741
745
|
}
|
|
742
746
|
),
|
|
743
|
-
(
|
|
747
|
+
(d || u) && /* @__PURE__ */ e.jsx(
|
|
744
748
|
rn,
|
|
745
749
|
{
|
|
746
750
|
bundle: n,
|
|
747
751
|
versionId: u,
|
|
748
752
|
setVersionId: o,
|
|
749
753
|
onClose: () => {
|
|
750
|
-
|
|
754
|
+
l(!1), o(void 0), M();
|
|
751
755
|
}
|
|
752
756
|
}
|
|
753
757
|
),
|
|
@@ -762,14 +766,14 @@ const J = [
|
|
|
762
766
|
)
|
|
763
767
|
] });
|
|
764
768
|
}, Dn = (n) => {
|
|
765
|
-
const { bundle: t, onDelete: s, isOpen:
|
|
769
|
+
const { bundle: t, onDelete: s, isOpen: d } = n, { id: l, name: a } = t;
|
|
766
770
|
return /* @__PURE__ */ he(
|
|
767
|
-
|
|
771
|
+
_e,
|
|
768
772
|
{
|
|
769
773
|
...n,
|
|
770
|
-
"data-testid": c.ACCORDION_ITEM +
|
|
774
|
+
"data-testid": c.ACCORDION_ITEM + l,
|
|
771
775
|
title: a,
|
|
772
|
-
key:
|
|
776
|
+
key: l,
|
|
773
777
|
tools: [
|
|
774
778
|
/* @__PURE__ */ e.jsx(
|
|
775
779
|
F,
|
|
@@ -794,22 +798,22 @@ const J = [
|
|
|
794
798
|
)
|
|
795
799
|
]
|
|
796
800
|
},
|
|
797
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(Vn, { bundle: t, isOpen: !!
|
|
801
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(Vn, { bundle: t, isOpen: !!d }) })
|
|
798
802
|
);
|
|
799
803
|
}, Nn = (n, t) => {
|
|
800
804
|
const s = n.get(Q);
|
|
801
|
-
return !t || !t.length || !s ? 0 : t.reduce((
|
|
805
|
+
return !t || !t.length || !s ? 0 : t.reduce((d, l, a) => l.id === s ? a : d, 0);
|
|
802
806
|
}, Tn = ({ bundles: n, onDelete: t, isLoading: s }) => {
|
|
803
|
-
const
|
|
807
|
+
const d = q(), l = Nn(d, n);
|
|
804
808
|
return /* @__PURE__ */ e.jsxs(N, { show: s, children: [
|
|
805
|
-
/* @__PURE__ */ e.jsx(
|
|
809
|
+
/* @__PURE__ */ e.jsx(ye, { accordionClass: "bundles", defaultOpenPageIndex: l, children: (n || []).map((a) => /* @__PURE__ */ e.jsx(Dn, { bundle: a, onDelete: t }, a.name)) }, l),
|
|
806
810
|
!s && (!n || !n.length) && /* @__PURE__ */ e.jsx(r, { i18nKey: "bundleManagement.noBundles", children: "There are currently no bundles" })
|
|
807
811
|
] });
|
|
808
812
|
}, vn = (n, t) => /* @__PURE__ */ e.jsx("div", { "data-testid": c.DELETE_BUNDLE_DIALOG, children: t || /* @__PURE__ */ e.jsx("p", { children: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundlemanagement.deleteBundleModalBodyError", children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
809
813
|
"The bundle ",
|
|
810
814
|
/* @__PURE__ */ e.jsx("strong", { children: n }),
|
|
811
815
|
" cannot be deleted."
|
|
812
|
-
] }) }) }) }),
|
|
816
|
+
] }) }) }) }), pn = (n, t) => /* @__PURE__ */ e.jsxs("div", { "data-testid": c.DELETE_BUNDLE_DIALOG, children: [
|
|
813
817
|
/* @__PURE__ */ e.jsx("p", { "data-testid": "deleteBundleModalBody1", children: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundlemanagement.deleteBundleModalBody1", children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
814
818
|
"Do you really want to delete the bundle ",
|
|
815
819
|
/* @__PURE__ */ e.jsx("strong", { children: n }),
|
|
@@ -821,47 +825,47 @@ const J = [
|
|
|
821
825
|
" version(s) and the associated files."
|
|
822
826
|
] }) }) }),
|
|
823
827
|
/* @__PURE__ */ e.jsx("p", { "data-testid": "deleteBundleModalBody3", children: /* @__PURE__ */ e.jsx(r, { i18nKey: "bundlemanagement.deleteBundleModalBody3", children: "This action cannot be undone." }) })
|
|
824
|
-
] }),
|
|
828
|
+
] }), _n = ({ bundle: n, canBeDeleted: t, error: s, processing: d }) => {
|
|
825
829
|
const {
|
|
826
|
-
run:
|
|
830
|
+
run: l,
|
|
827
831
|
data: a,
|
|
828
832
|
loading: i
|
|
829
833
|
} = g({
|
|
830
834
|
requestFunction: W
|
|
831
835
|
});
|
|
832
836
|
return D(() => {
|
|
833
|
-
t &&
|
|
834
|
-
}, [
|
|
837
|
+
t && l(n.id);
|
|
838
|
+
}, [l, n, t]), /* @__PURE__ */ e.jsx(N, { show: d || i, children: /* @__PURE__ */ e.jsx(
|
|
835
839
|
"div",
|
|
836
840
|
{
|
|
837
841
|
style: {
|
|
838
842
|
minHeight: 50
|
|
839
843
|
},
|
|
840
|
-
children: !
|
|
844
|
+
children: !d && !i && (t ? pn(n.name, a ? a.totalElements.toString() : void 0) : vn(n.name, s))
|
|
841
845
|
}
|
|
842
846
|
) });
|
|
843
|
-
},
|
|
844
|
-
const { run:
|
|
847
|
+
}, yn = [ke], Cn = [Je], Ln = ({ bundle: n, onCancel: t, loadBundles: s }) => {
|
|
848
|
+
const { run: d } = g({
|
|
845
849
|
requestFunction: Ve,
|
|
846
|
-
errorMessages:
|
|
850
|
+
errorMessages: yn,
|
|
847
851
|
successMessages: Cn
|
|
848
|
-
}),
|
|
852
|
+
}), l = Ae(n), a = () => d(n.id).then(s).then(t);
|
|
849
853
|
return /* @__PURE__ */ e.jsx(
|
|
850
|
-
|
|
854
|
+
p,
|
|
851
855
|
{
|
|
852
856
|
header: /* @__PURE__ */ e.jsx(r, { i18nKey: k.id, children: k.defaultValue }),
|
|
853
|
-
content: /* @__PURE__ */ e.jsx(
|
|
857
|
+
content: /* @__PURE__ */ e.jsx(_n, { bundle: n, ...l }),
|
|
854
858
|
footer: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
855
|
-
/* @__PURE__ */ e.jsx(j, { primary: !0, disabled: !
|
|
859
|
+
/* @__PURE__ */ e.jsx(j, { primary: !0, disabled: !l.canBeDeleted, onClick: a, children: /* @__PURE__ */ e.jsx(r, { i18nKey: C.id, children: C.defaultValue }) }),
|
|
856
860
|
/* @__PURE__ */ e.jsx(j, { onClick: t, children: /* @__PURE__ */ e.jsx(r, { i18nKey: L.id, children: L.defaultValue }) })
|
|
857
861
|
] }),
|
|
858
862
|
width: 500
|
|
859
863
|
}
|
|
860
864
|
);
|
|
861
|
-
}, Sn = [Ue],
|
|
865
|
+
}, Sn = [Ue], zn = () => {
|
|
862
866
|
const n = me(), [t, s] = V(!1), {
|
|
863
|
-
data:
|
|
864
|
-
loading:
|
|
867
|
+
data: d,
|
|
868
|
+
loading: l,
|
|
865
869
|
run: a
|
|
866
870
|
} = g({
|
|
867
871
|
requestFunction: De,
|
|
@@ -891,7 +895,7 @@ const J = [
|
|
|
891
895
|
onClick: h
|
|
892
896
|
}
|
|
893
897
|
),
|
|
894
|
-
/* @__PURE__ */ e.jsx(Tn, { bundles:
|
|
898
|
+
/* @__PURE__ */ e.jsx(Tn, { bundles: d, onDelete: u, isLoading: l }),
|
|
895
899
|
i && /* @__PURE__ */ e.jsx(
|
|
896
900
|
Ln,
|
|
897
901
|
{
|
|
@@ -904,5 +908,5 @@ const J = [
|
|
|
904
908
|
] });
|
|
905
909
|
};
|
|
906
910
|
export {
|
|
907
|
-
|
|
911
|
+
zn as default
|
|
908
912
|
};
|