@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,9 +1,12 @@
|
|
|
1
|
-
import { a5 as so, a6 as ro,
|
|
1
|
+
import { a5 as so, a6 as ro, aw as mn } from "./ContextBarContext-0c28ce9d.js";
|
|
2
2
|
import { useRef as gn, useCallback as oo, useEffect as ao } from "react";
|
|
3
3
|
import { SpinnerContainer as ho } from "@deviceinsight/ng-ui-basic-components";
|
|
4
4
|
import "react-router-dom";
|
|
5
5
|
import "@deviceinsight/ng-ui-components";
|
|
6
|
+
import "react-i18next";
|
|
7
|
+
import "i18next";
|
|
6
8
|
import "@deviceinsight/ng-ui-api-client";
|
|
9
|
+
import "ux4iot-react";
|
|
7
10
|
import "react-dom";
|
|
8
11
|
var yn = { exports: {} };
|
|
9
12
|
/**
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { dc as S, dj as j, aw as a, cy as y, ag as C } from "./ContextBarContext-0c28ce9d.js";
|
|
2
|
+
import { useState as d, useEffect as g, useCallback as v } from "react";
|
|
3
|
+
import { C as V, j as b } from "./index-34a2015c.js";
|
|
4
|
+
import "react-i18next";
|
|
5
|
+
import "react-router-dom";
|
|
6
|
+
import "@deviceinsight/ng-ui-basic-components";
|
|
7
|
+
import "@deviceinsight/ng-ui-components";
|
|
8
|
+
import "i18next";
|
|
9
|
+
import "@deviceinsight/ng-ui-api-client";
|
|
10
|
+
import "ux4iot-react";
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import "./objectWithoutPropertiesLoose-a4604547.js";
|
|
13
|
+
function T({ setting: e, ...c }) {
|
|
14
|
+
const { setValue: o, setError: i, clearErrors: n, control: p } = S(), {
|
|
15
|
+
field: r,
|
|
16
|
+
fieldState: { error: s }
|
|
17
|
+
} = j({ name: e.name, control: p }), [f, l] = d(""), [m, h] = d(!1);
|
|
18
|
+
g(() => {
|
|
19
|
+
if (!m && r.value) {
|
|
20
|
+
const t = JSON.stringify(r.value, null, 2);
|
|
21
|
+
l(t), h(!0);
|
|
22
|
+
}
|
|
23
|
+
}, [r.value, m]);
|
|
24
|
+
const x = v(
|
|
25
|
+
(t) => {
|
|
26
|
+
try {
|
|
27
|
+
l(t);
|
|
28
|
+
const u = t === "" ? void 0 : JSON.parse(t);
|
|
29
|
+
o(e.name, u, { shouldValidate: !0, shouldDirty: !0 }), n(e.name);
|
|
30
|
+
} catch {
|
|
31
|
+
i(e.name, { message: "Invalid JSON syntax" });
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[n, i, o, e.name]
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ a.jsx(a.Fragment, { children: /* @__PURE__ */ a.jsx(
|
|
37
|
+
y,
|
|
38
|
+
{
|
|
39
|
+
label: /* @__PURE__ */ a.jsx(C, { i18nKey: `appSettings.property.${e.name}`, children: e.name }),
|
|
40
|
+
error: (s == null ? void 0 : s.message) ?? "",
|
|
41
|
+
size: "full-width",
|
|
42
|
+
children: /* @__PURE__ */ a.jsx(
|
|
43
|
+
V,
|
|
44
|
+
{
|
|
45
|
+
"data-testid": c["data-testid"],
|
|
46
|
+
onChange: x,
|
|
47
|
+
value: f,
|
|
48
|
+
basicSetup: { lineNumbers: !0 },
|
|
49
|
+
extensions: [b()]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
T as default
|
|
57
|
+
};
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ah as K, bf as C, aw as e, ag as n, bl as y, b7 as b, bR as V } from "./ContextBarContext-0c28ce9d.js";
|
|
2
2
|
import { useState as d, useEffect as v } from "react";
|
|
3
|
-
import { Prompt as q, useHistory as
|
|
4
|
-
import { fetchLicenses as
|
|
5
|
-
import { SpinnerContainer as U, ButtonRow as
|
|
6
|
-
import { messageBoxError as P, ContentHeader as
|
|
3
|
+
import { Prompt as q, useHistory as B, useLocation as H, useParams as R } from "react-router-dom";
|
|
4
|
+
import { fetchLicenses as T, fetchLicenseByName as D, updateLicense as I, createLicense as k } from "@deviceinsight/ng-ui-api-client";
|
|
5
|
+
import { SpinnerContainer as U, ButtonRow as A, Button as N, Spinner as O } from "@deviceinsight/ng-ui-basic-components";
|
|
6
|
+
import { messageBoxError as P, ContentHeader as z, messageBoxSuccess as F } from "@deviceinsight/ng-ui-components";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "i18next";
|
|
9
|
+
import "ux4iot-react";
|
|
7
10
|
import "react-dom";
|
|
8
11
|
function G({ editedLicense: c, onSubmit: u, onCancel: r }) {
|
|
9
|
-
const { t
|
|
12
|
+
const { t } = K(), {
|
|
10
13
|
handleSubmit: p,
|
|
11
14
|
control: l,
|
|
12
|
-
formState: { isSubmitting:
|
|
15
|
+
formState: { isSubmitting: a, isDirty: x },
|
|
13
16
|
setError: g
|
|
14
17
|
} = C({
|
|
15
18
|
defaultValues: c ?? { name: "", displayName: "", description: "" }
|
|
16
19
|
}), [j, m] = d([]), [f, L] = d(!1);
|
|
17
20
|
v(() => {
|
|
18
|
-
L(!0),
|
|
21
|
+
L(!0), T().then(m).catch(() => {
|
|
19
22
|
P(/* @__PURE__ */ e.jsx(n, { i18nKey: "licenses.form.fetchingError", children: "Fetching licenses failed" }));
|
|
20
23
|
}).finally(() => L(!1));
|
|
21
24
|
}, []);
|
|
22
|
-
function
|
|
23
|
-
return c ? void 0 : j.some((h) => h.name === i) ?
|
|
25
|
+
function w(i) {
|
|
26
|
+
return c ? void 0 : j.some((h) => h.name === i) ? t("licenses.form.validation.nameInUse", {
|
|
24
27
|
defaultValue: "A license with the same technical name already exists"
|
|
25
28
|
}) : void 0;
|
|
26
29
|
}
|
|
27
|
-
function
|
|
30
|
+
function E() {
|
|
28
31
|
return p(async (s) => {
|
|
29
32
|
var h, S;
|
|
30
33
|
try {
|
|
31
34
|
await u(s);
|
|
32
35
|
} catch (o) {
|
|
33
36
|
o && o.response && o.response.status === 409 && ((h = o.response.data) != null && h.message) && g("name", {
|
|
34
|
-
message:
|
|
37
|
+
message: t("licenses.form.validation.nameInUse", {
|
|
35
38
|
defaultValue: (S = o.response.data) == null ? void 0 : S.message
|
|
36
39
|
})
|
|
37
40
|
});
|
|
@@ -40,17 +43,17 @@ function G({ editedLicense: c, onSubmit: u, onCancel: r }) {
|
|
|
40
43
|
console.warn("Validation error", s);
|
|
41
44
|
})();
|
|
42
45
|
}
|
|
43
|
-
return /* @__PURE__ */ e.jsxs(U, { show:
|
|
46
|
+
return /* @__PURE__ */ e.jsxs(U, { show: a || f, className: "di license-form", children: [
|
|
44
47
|
/* @__PURE__ */ e.jsx(
|
|
45
48
|
y,
|
|
46
49
|
{
|
|
47
50
|
control: l,
|
|
48
51
|
name: "name",
|
|
49
52
|
rules: {
|
|
50
|
-
required:
|
|
53
|
+
required: t("licenses.form.validation.nameRequired", {
|
|
51
54
|
defaultValue: "Please enter the technical name"
|
|
52
55
|
}),
|
|
53
|
-
validate:
|
|
56
|
+
validate: w
|
|
54
57
|
},
|
|
55
58
|
render: ({ field: i, fieldState: { error: s } }) => /* @__PURE__ */ e.jsx(
|
|
56
59
|
b,
|
|
@@ -70,7 +73,7 @@ function G({ editedLicense: c, onSubmit: u, onCancel: r }) {
|
|
|
70
73
|
control: l,
|
|
71
74
|
name: "displayName",
|
|
72
75
|
rules: {
|
|
73
|
-
required:
|
|
76
|
+
required: t("licenses.form.validation.displayNameRequired", {
|
|
74
77
|
defaultValue: "Please enter the display name"
|
|
75
78
|
})
|
|
76
79
|
},
|
|
@@ -99,33 +102,33 @@ function G({ editedLicense: c, onSubmit: u, onCancel: r }) {
|
|
|
99
102
|
)
|
|
100
103
|
}
|
|
101
104
|
),
|
|
102
|
-
/* @__PURE__ */ e.jsxs(
|
|
103
|
-
/* @__PURE__ */ e.jsx(N, { primary: !0, onClick:
|
|
104
|
-
/* @__PURE__ */ e.jsx(N, { disabled:
|
|
105
|
+
/* @__PURE__ */ e.jsxs(A, { dividing: !0, children: [
|
|
106
|
+
/* @__PURE__ */ e.jsx(N, { primary: !0, onClick: E, disabled: a, children: /* @__PURE__ */ e.jsx(n, { i18nKey: "general.actions.save", children: "Save" }) }),
|
|
107
|
+
/* @__PURE__ */ e.jsx(N, { disabled: a, onClick: r, children: /* @__PURE__ */ e.jsx(n, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
|
|
105
108
|
] }),
|
|
106
|
-
/* @__PURE__ */ e.jsx(q, { message: "", when: x && !
|
|
109
|
+
/* @__PURE__ */ e.jsx(q, { message: "", when: x && !a })
|
|
107
110
|
] });
|
|
108
111
|
}
|
|
109
|
-
function
|
|
110
|
-
const c =
|
|
112
|
+
function se() {
|
|
113
|
+
const c = B(), { pathname: u } = H(), { licenseName: r } = R(), [t, p] = d(), [l, a] = d(!1), [x, g] = d(!1);
|
|
111
114
|
if (v(() => {
|
|
112
|
-
r && (
|
|
115
|
+
r && (a(!0), D(r).then(p).catch(() => {
|
|
113
116
|
P(/* @__PURE__ */ e.jsx(n, { i18nKey: "licenses.editPage.fetchingError", children: "Fetching license failed" })), g(!0);
|
|
114
|
-
}).finally(() =>
|
|
117
|
+
}).finally(() => a(!1)));
|
|
115
118
|
}, [r]), x)
|
|
116
119
|
return /* @__PURE__ */ e.jsx(V, {});
|
|
117
120
|
if (l)
|
|
118
|
-
return /* @__PURE__ */ e.jsx(
|
|
121
|
+
return /* @__PURE__ */ e.jsx(O, { center: !0 });
|
|
119
122
|
const j = async (f) => {
|
|
120
|
-
r ? (await
|
|
123
|
+
r ? (await I(f), F(/* @__PURE__ */ e.jsx(n, { i18nKey: "licenses.updateSuccess", children: "License updated" }))) : (await k(f), F(/* @__PURE__ */ e.jsx(n, { i18nKey: "licenses.createSuccess", children: "License created" }))), m();
|
|
121
124
|
}, m = () => {
|
|
122
125
|
c.push(u.substring(0, u.lastIndexOf("/")));
|
|
123
126
|
};
|
|
124
127
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
125
128
|
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
129
|
+
z,
|
|
127
130
|
{
|
|
128
|
-
title:
|
|
131
|
+
title: t ? {
|
|
129
132
|
id: "licenses.edit.title",
|
|
130
133
|
defaultValue: "Edit License"
|
|
131
134
|
} : {
|
|
@@ -135,9 +138,9 @@ function _() {
|
|
|
135
138
|
parentPageLink: !0
|
|
136
139
|
}
|
|
137
140
|
),
|
|
138
|
-
/* @__PURE__ */ e.jsx(G, { editedLicense:
|
|
141
|
+
/* @__PURE__ */ e.jsx(G, { editedLicense: t, onSubmit: j, onCancel: m })
|
|
139
142
|
] });
|
|
140
143
|
}
|
|
141
144
|
export {
|
|
142
|
-
|
|
145
|
+
se as default
|
|
143
146
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aw as s, ag as a, ah as y, d7 as b, db as g, aQ as j } from "./ContextBarContext-0c28ce9d.js";
|
|
2
2
|
import { useState as c, useEffect as f } from "react";
|
|
3
3
|
import { Link as u } from "react-router-dom";
|
|
4
|
-
import { fetchRolesForLicense as
|
|
4
|
+
import { fetchRolesForLicense as N, fetchLicenses as C, deleteLicense as E } from "@deviceinsight/ng-ui-api-client";
|
|
5
5
|
import { messageBoxError as h, ContentHeader as S } from "@deviceinsight/ng-ui-components";
|
|
6
|
-
import { useConfirm as
|
|
6
|
+
import { useConfirm as w, Button as D, Icon as I } from "@deviceinsight/ng-ui-basic-components";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "i18next";
|
|
9
|
+
import "ux4iot-react";
|
|
7
10
|
import "react-dom";
|
|
8
|
-
function
|
|
11
|
+
function T({ license: t }) {
|
|
9
12
|
const [e, n] = c([]), [r, o] = c(!1);
|
|
10
13
|
return f(() => {
|
|
11
|
-
o(!0),
|
|
14
|
+
o(!0), N(t).then(n).catch(() => {
|
|
12
15
|
h(
|
|
13
16
|
/* @__PURE__ */ s.jsxs(a, { i18nKey: "license.roles.fetchingError", children: [
|
|
14
17
|
"Can't fetch the roles of the following license: ",
|
|
@@ -56,7 +59,7 @@ function K(t) {
|
|
|
56
59
|
{
|
|
57
60
|
name: "roles",
|
|
58
61
|
label: /* @__PURE__ */ s.jsx(a, { i18nKey: "licenses.tableHeaders.roles", children: "Roles" }),
|
|
59
|
-
render: (e) => /* @__PURE__ */ s.jsx(
|
|
62
|
+
render: (e) => /* @__PURE__ */ s.jsx(T, { license: e.name })
|
|
60
63
|
},
|
|
61
64
|
{
|
|
62
65
|
name: "actions",
|
|
@@ -64,7 +67,7 @@ function K(t) {
|
|
|
64
67
|
width: "10%",
|
|
65
68
|
align: "right",
|
|
66
69
|
render: (e) => /* @__PURE__ */ s.jsx(j, { authorities: ["MANAGE_LICENSES"], children: /* @__PURE__ */ s.jsx(
|
|
67
|
-
|
|
70
|
+
D,
|
|
68
71
|
{
|
|
69
72
|
naked: !0,
|
|
70
73
|
title: {
|
|
@@ -72,19 +75,19 @@ function K(t) {
|
|
|
72
75
|
defaultValue: "Delete this License"
|
|
73
76
|
},
|
|
74
77
|
onClick: () => t(e),
|
|
75
|
-
children: /* @__PURE__ */ s.jsx(
|
|
78
|
+
children: /* @__PURE__ */ s.jsx(I, { del: !0 })
|
|
76
79
|
}
|
|
77
80
|
) })
|
|
78
81
|
}
|
|
79
82
|
];
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
const [t, e] = c(!1), [n, r] = c([]), o =
|
|
84
|
+
function $() {
|
|
85
|
+
const [t, e] = c(!1), [n, r] = c([]), o = w(), { t: i } = y(), p = /* @__PURE__ */ s.jsx(a, { i18nKey: "portalAdmin.sidebarElements.licenses.create", children: "Create new license" });
|
|
83
86
|
f(() => {
|
|
84
87
|
(async () => {
|
|
85
88
|
try {
|
|
86
89
|
e(!0);
|
|
87
|
-
const m = await
|
|
90
|
+
const m = await C();
|
|
88
91
|
r(m);
|
|
89
92
|
} finally {
|
|
90
93
|
e(!1);
|
|
@@ -136,11 +139,12 @@ function z() {
|
|
|
136
139
|
isLoading: t,
|
|
137
140
|
uniqueItemKey: (l) => l.name,
|
|
138
141
|
paginationSettings: A,
|
|
139
|
-
"data-testid": "licenses-table"
|
|
142
|
+
"data-testid": "licenses-table",
|
|
143
|
+
tableName: "licenses"
|
|
140
144
|
}
|
|
141
145
|
)
|
|
142
146
|
] });
|
|
143
147
|
}
|
|
144
148
|
export {
|
|
145
|
-
|
|
149
|
+
$ as default
|
|
146
150
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useLocation as
|
|
1
|
+
import { aw as e, cy as E, aN as V, dk as F, dc as L, dj as B, ag as d, ah as G, bf as D, bi as R, bl as h, b7 as w, dl as U, dh as P, dm as k, al as M, dn as H, dp as X, bR as _, aX as Y, dq as $ } from "./ContextBarContext-0c28ce9d.js";
|
|
2
|
+
import { useState as T, useEffect as z } from "react";
|
|
3
|
+
import { useLocation as J, useHistory as Q, useParams as W } from "react-router-dom";
|
|
4
4
|
import { getPropertyById as Z, updateProperty as ee, createProperty as re } from "@deviceinsight/ng-ui-api-client";
|
|
5
5
|
import { Button as v, Checkbox as A, Icon as O, ButtonRow as te, Spinner as se } from "@deviceinsight/ng-ui-basic-components";
|
|
6
6
|
import { messageBoxError as K, ContentHeader as ae } from "@deviceinsight/ng-ui-components";
|
|
7
|
-
import
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import { P as ne } from "./react-router-d38ecdf4.js";
|
|
9
|
+
import "i18next";
|
|
10
|
+
import "ux4iot-react";
|
|
8
11
|
import "react-dom";
|
|
9
|
-
import "./
|
|
12
|
+
import "./objectWithoutPropertiesLoose-a4604547.js";
|
|
10
13
|
function le(r) {
|
|
11
14
|
const { options: s, children: x, onChange: c, values: i, ...t } = r;
|
|
12
15
|
function a(u) {
|
|
@@ -30,7 +33,7 @@ function ie() {
|
|
|
30
33
|
getValues: r,
|
|
31
34
|
formState: { errors: s },
|
|
32
35
|
trigger: x
|
|
33
|
-
} = L(), [c, i] =
|
|
36
|
+
} = L(), [c, i] = T(!!r("allowedValues")), {
|
|
34
37
|
field: { value: t, onChange: a },
|
|
35
38
|
fieldState: { invalid: u }
|
|
36
39
|
} = B({
|
|
@@ -116,12 +119,12 @@ function ue({ editedProperty: r, isReadonly: s, onSubmit: x, onCancel: c }) {
|
|
|
116
119
|
async function l(o) {
|
|
117
120
|
try {
|
|
118
121
|
await x(o);
|
|
119
|
-
} catch (
|
|
120
|
-
if (M.isAxiosError(
|
|
121
|
-
const { fieldName: N, message: C } = H(
|
|
122
|
+
} catch (S) {
|
|
123
|
+
if (M.isAxiosError(S)) {
|
|
124
|
+
const { fieldName: N, message: C } = H(S, i);
|
|
122
125
|
N ? b(N, { message: C }) : K(C);
|
|
123
126
|
} else
|
|
124
|
-
K(
|
|
127
|
+
K(X(i));
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
return u(l, (o) => {
|
|
@@ -129,7 +132,7 @@ function ue({ editedProperty: r, isReadonly: s, onSubmit: x, onCancel: c }) {
|
|
|
129
132
|
})();
|
|
130
133
|
}
|
|
131
134
|
const p = f("type"), m = !!r, j = p === "STRING" || p === "TEXT", I = !!f("allowedValues");
|
|
132
|
-
return /* @__PURE__ */ e.jsx(
|
|
135
|
+
return /* @__PURE__ */ e.jsx(R, { ...t, children: /* @__PURE__ */ e.jsxs("div", { className: "property-form", children: [
|
|
133
136
|
/* @__PURE__ */ e.jsx(
|
|
134
137
|
h,
|
|
135
138
|
{
|
|
@@ -158,7 +161,7 @@ function ue({ editedProperty: r, isReadonly: s, onSubmit: x, onCancel: c }) {
|
|
|
158
161
|
name: "type",
|
|
159
162
|
control: a,
|
|
160
163
|
render: ({ field: l }) => /* @__PURE__ */ e.jsx(
|
|
161
|
-
|
|
164
|
+
U,
|
|
162
165
|
{
|
|
163
166
|
label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.type", children: "Type" }),
|
|
164
167
|
...l,
|
|
@@ -175,14 +178,14 @@ function ue({ editedProperty: r, isReadonly: s, onSubmit: x, onCancel: c }) {
|
|
|
175
178
|
name: "entityTargets",
|
|
176
179
|
control: a,
|
|
177
180
|
rules: { validate: (l) => l.length === 0 ? "Required" : void 0 },
|
|
178
|
-
render: ({ field: { value: l, onChange: o }, fieldState: { error:
|
|
181
|
+
render: ({ field: { value: l, onChange: o }, fieldState: { error: S } }) => /* @__PURE__ */ e.jsx(
|
|
179
182
|
le,
|
|
180
183
|
{
|
|
181
184
|
label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.entityTargets", children: "Entity targets" }),
|
|
182
185
|
values: l,
|
|
183
186
|
onChange: o,
|
|
184
187
|
options: de,
|
|
185
|
-
error:
|
|
188
|
+
error: S ? i("properties.form.validation.entityTargets.required", {
|
|
186
189
|
defaultValue: "Please select a at least one entity target"
|
|
187
190
|
}) : void 0,
|
|
188
191
|
required: !0,
|
|
@@ -325,8 +328,8 @@ function q(r) {
|
|
|
325
328
|
}
|
|
326
329
|
return r;
|
|
327
330
|
}
|
|
328
|
-
function
|
|
329
|
-
const { pathname: r } =
|
|
331
|
+
function Ne() {
|
|
332
|
+
const { pathname: r } = J(), s = Q(), { propertyKey: x } = W(), [c, i] = T(void 0), [t, a] = T(!0), [u, f] = T(!1);
|
|
330
333
|
async function b(m) {
|
|
331
334
|
try {
|
|
332
335
|
const j = await Z(m);
|
|
@@ -337,20 +340,20 @@ function Se() {
|
|
|
337
340
|
a(!1);
|
|
338
341
|
}
|
|
339
342
|
}
|
|
340
|
-
|
|
343
|
+
z(() => {
|
|
341
344
|
x && x !== "create" ? b(x) : a(!1);
|
|
342
345
|
}, [x]);
|
|
343
346
|
function g() {
|
|
344
347
|
s.push(r.substring(0, r.lastIndexOf("/")));
|
|
345
348
|
}
|
|
346
349
|
async function y(m) {
|
|
347
|
-
c ? await ee(q(m)) : await re(q(m)),
|
|
350
|
+
c ? await ee(q(m)) : await re(q(m)), $(me), g();
|
|
348
351
|
}
|
|
349
352
|
function n() {
|
|
350
353
|
g();
|
|
351
354
|
}
|
|
352
355
|
if (u)
|
|
353
|
-
return /* @__PURE__ */ e.jsx(
|
|
356
|
+
return /* @__PURE__ */ e.jsx(_, {});
|
|
354
357
|
const p = pe(!c);
|
|
355
358
|
return t ? /* @__PURE__ */ e.jsx(se, { center: !0 }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
356
359
|
/* @__PURE__ */ e.jsx(ae, { title: p, parentPageLink: !0 }),
|
|
@@ -358,7 +361,7 @@ function Se() {
|
|
|
358
361
|
ue,
|
|
359
362
|
{
|
|
360
363
|
editedProperty: c,
|
|
361
|
-
isReadonly: !!c && !
|
|
364
|
+
isReadonly: !!c && !Y(["UPDATE_PROPERTY"]),
|
|
362
365
|
onSubmit: y,
|
|
363
366
|
onCancel: n
|
|
364
367
|
}
|
|
@@ -366,5 +369,5 @@ function Se() {
|
|
|
366
369
|
] });
|
|
367
370
|
}
|
|
368
371
|
export {
|
|
369
|
-
|
|
372
|
+
Ne as default
|
|
370
373
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useContext as
|
|
1
|
+
import { aX as c, aw as t, ag as a, bc as f, ah as y, d7 as b, db as m } from "./ContextBarContext-0c28ce9d.js";
|
|
2
|
+
import { useContext as T, useState as h, useEffect as P } from "react";
|
|
3
3
|
import { deleteProperty as A } from "@deviceinsight/ng-ui-api-client";
|
|
4
|
-
import { Bubble as
|
|
4
|
+
import { Bubble as g, Button as x, Icon as I, withConfirm as O } from "@deviceinsight/ng-ui-basic-components";
|
|
5
5
|
import { ContentHeader as E } from "@deviceinsight/ng-ui-components";
|
|
6
6
|
import { Link as v } from "react-router-dom";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "i18next";
|
|
9
|
+
import "ux4iot-react";
|
|
7
10
|
import "react-dom";
|
|
8
11
|
const D = [
|
|
9
12
|
"name",
|
|
@@ -29,7 +32,7 @@ const D = [
|
|
|
29
32
|
"definitionId"
|
|
30
33
|
];
|
|
31
34
|
function G(n, l) {
|
|
32
|
-
const o =
|
|
35
|
+
const o = c(["DELETE_PROPERTY"]);
|
|
33
36
|
return [
|
|
34
37
|
{
|
|
35
38
|
name: "propertyKey",
|
|
@@ -172,7 +175,7 @@ function G(n, l) {
|
|
|
172
175
|
const r = D.includes(e.key);
|
|
173
176
|
if (o) {
|
|
174
177
|
const i = /* @__PURE__ */ t.jsx(
|
|
175
|
-
|
|
178
|
+
x,
|
|
176
179
|
{
|
|
177
180
|
naked: !0,
|
|
178
181
|
title: {
|
|
@@ -181,11 +184,11 @@ function G(n, l) {
|
|
|
181
184
|
},
|
|
182
185
|
onClick: () => l(e),
|
|
183
186
|
disabled: r,
|
|
184
|
-
children: /* @__PURE__ */ t.jsx(
|
|
187
|
+
children: /* @__PURE__ */ t.jsx(I, { del: !0 })
|
|
185
188
|
}
|
|
186
189
|
);
|
|
187
190
|
return r ? /* @__PURE__ */ t.jsx(
|
|
188
|
-
|
|
191
|
+
g,
|
|
189
192
|
{
|
|
190
193
|
content: /* @__PURE__ */ t.jsx(a, { i18nKey: "properties.tableHeaders.reserved", children: "This property is reserved and can't be deleted" }),
|
|
191
194
|
children: i
|
|
@@ -205,7 +208,7 @@ const C = {
|
|
|
205
208
|
direction: "ASC"
|
|
206
209
|
}
|
|
207
210
|
}, V = ({ confirm: n }) => {
|
|
208
|
-
const { properties: l, reloadProperties: o } =
|
|
211
|
+
const { properties: l, reloadProperties: o } = T(f), [e, r] = h(!1), { t: i } = y(), d = /* @__PURE__ */ t.jsx(a, { i18nKey: "portalAdmin.sidebarElements.properties.create", children: "Create new property" });
|
|
209
212
|
async function p() {
|
|
210
213
|
try {
|
|
211
214
|
r(!0), await o();
|
|
@@ -213,7 +216,7 @@ const C = {
|
|
|
213
216
|
r(!1);
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
|
-
|
|
219
|
+
P(() => {
|
|
217
220
|
p();
|
|
218
221
|
}, []);
|
|
219
222
|
async function u(s) {
|
|
@@ -248,18 +251,19 @@ const C = {
|
|
|
248
251
|
}
|
|
249
252
|
),
|
|
250
253
|
/* @__PURE__ */ t.jsx(
|
|
251
|
-
|
|
254
|
+
m,
|
|
252
255
|
{
|
|
253
256
|
columnDefs: G(i, u),
|
|
254
257
|
items: l,
|
|
255
258
|
isLoading: e,
|
|
256
259
|
uniqueItemKey: (s) => s.key,
|
|
257
260
|
paginationSettings: C,
|
|
258
|
-
"data-testid": "properties-table"
|
|
261
|
+
"data-testid": "properties-table",
|
|
262
|
+
tableName: "properties"
|
|
259
263
|
}
|
|
260
264
|
)
|
|
261
265
|
] });
|
|
262
|
-
},
|
|
266
|
+
}, _ = O(V);
|
|
263
267
|
export {
|
|
264
|
-
|
|
268
|
+
_ as default
|
|
265
269
|
};
|