@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.
Files changed (32) hide show
  1. package/dist/{AccessEditModal-a02b50a1.js → AccessEditModal-ee0139fb.js} +24 -23
  2. package/dist/BundleManagementContainer-093786e5.js +20 -0
  3. package/dist/{BundlesContainer-498d7121.js → BundlesContainer-54c9cc3a.js} +114 -110
  4. package/dist/{ContextBarContext-f2968fee.js → ContextBarContext-0c28ce9d.js} +38292 -46174
  5. package/dist/{DatapointImport-0610eed8.js → DatapointImport-6d394cb5.js} +126 -122
  6. package/dist/{FileUploadInput-aea4f866.js → FileUploadInput-a23ba785.js} +3 -3
  7. package/dist/{Files-25853de9.js → Files-4fc0415e.js} +23 -19
  8. package/dist/GlobalPowerBiReports-f9bf0765.js +11079 -0
  9. package/dist/{Graph-ad8ad6f9.js → Graph-2840eac2.js} +4 -1
  10. package/dist/JsonSettingWidget-8908d40b.js +57 -0
  11. package/dist/{LicensesEditPage-e6c71c43.js → LicensesEditPage-3332b87c.js} +33 -30
  12. package/dist/{LicensesList-d28c9799.js → LicensesList-6254cd37.js} +17 -13
  13. package/dist/{PropertiesEditPage-85bc5517.js → PropertiesEditPage-5b148652.js} +24 -21
  14. package/dist/{PropertiesList-fcf0d837.js → PropertiesList-06478803.js} +17 -13
  15. package/dist/{TemplateEditPage-a34efc41.js → TemplateEditPage-94088888.js} +28 -23
  16. package/dist/TemplateTextInput-e8861a0f.js +50 -0
  17. package/dist/{TemplatesListPage-ce7fea1d.js → TemplatesListPage-866246c6.js} +55 -51
  18. package/dist/{UserGroupAssignments-8fd3c47d.js → UserGroupAssignments-6feae326.js} +36 -32
  19. package/dist/{UserGroupTheme-0e8a16c4.js → UserGroupTheme-7ee8e92e.js} +14 -11
  20. package/dist/api.d.ts +3 -0
  21. package/dist/api.js +59 -56
  22. package/dist/{index-e2b27256.js → index-34a2015c.js} +7 -7
  23. package/dist/index.js +2761 -2765
  24. package/dist/objectWithoutPropertiesLoose-a4604547.js +26 -0
  25. package/dist/{react-router-7b367edf.js → react-router-d38ecdf4.js} +113 -108
  26. package/dist/style.css +1 -1
  27. package/package.json +4 -4
  28. package/dist/BundleManagementContainer-dbac0259.js +0 -17
  29. package/dist/GlobalPowerBiReports-06c92d0e.js +0 -11078
  30. package/dist/JsonSettingWidget-c471537a.js +0 -54
  31. package/dist/TemplateTextInput-fe5912e7.js +0 -47
  32. package/dist/extends-0a3e0827.js +0 -13
@@ -1,13 +1,16 @@
1
- import { az as e, ai as r, d8 as v, bP as z, df as $, aj as R, dg as B, bo as S, dh as M, ba as q, bf as U, bi as H, bl as J, by as Q, bT as X, af as Y } from "./ContextBarContext-f2968fee.js";
2
- import Z, { useState as C, useRef as D, useContext as O, useEffect as N } from "react";
1
+ import { aw as e, ag as r, d5 as v, bN as B, dc as $, ah as R, dd as M, bl as S, de as z, b7 as q, bc as U, bf as H, bi as J, bw as Q, bR as X, ad as Y } from "./ContextBarContext-0c28ce9d.js";
2
+ import Z, { useState as C, useRef as D, useContext as O, useEffect as w } from "react";
3
3
  import { useParams as ee, useHistory as te, useLocation as ae } from "react-router-dom";
4
4
  import { fetchEmailTemplateById as ne, fetchEmailTemplates as se, createEmailTemplate as ie, updateEmailTemplate as oe, deleteEmailTemplate as le } from "@deviceinsight/ng-ui-api-client";
5
5
  import { Modal as _, Button as k, useConfirm as re, Accordion as ce, AccordionItem as de, Icon as A, ButtonRow as ue, SpinnerContainer as me } from "@deviceinsight/ng-ui-basic-components";
6
6
  import { ReactableWithClientSidePagination as W, nanoid10 as fe, messageBoxError as K, ContentHeader as pe } from "@deviceinsight/ng-ui-components";
7
- import { P as he } from "./react-router-7b367edf.js";
8
- import { A as xe } from "./AccessEditModal-a02b50a1.js";
7
+ import { P as he } from "./react-router-d38ecdf4.js";
8
+ import "react-i18next";
9
+ import { A as xe } from "./AccessEditModal-ee0139fb.js";
10
+ import "i18next";
11
+ import "ux4iot-react";
9
12
  import "react-dom";
10
- import "./extends-0a3e0827.js";
13
+ import "./objectWithoutPropertiesLoose-a4604547.js";
11
14
  const je = (t) => [
12
15
  {
13
16
  name: "locale",
@@ -38,7 +41,8 @@ const je = (t) => [
38
41
  direction: "ASC"
39
42
  }
40
43
  },
41
- isLoading: !1
44
+ isLoading: !1,
45
+ tableName: "localePicker"
42
46
  }
43
47
  ),
44
48
  footer: /* @__PURE__ */ e.jsx(k, { onClick: n, children: /* @__PURE__ */ e.jsx(r, { i18nKey: v.cancel.id, children: v.cancel.defaultValue }) }),
@@ -59,7 +63,7 @@ const je = (t) => [
59
63
  render: (a) => /* @__PURE__ */ e.jsx("div", { onClick: () => t(a), className: "clickable", children: a })
60
64
  }
61
65
  ], ge = () => {
62
- const { assetProperties: t, assetGroupProperties: a } = z();
66
+ const { assetProperties: t, assetGroupProperties: a } = B();
63
67
  return {
64
68
  assetProperties: t.filter((n) => !n.key.startsWith("_") && n.deletable),
65
69
  assetGroupProperties: a.filter(
@@ -87,14 +91,15 @@ const je = (t) => [
87
91
  direction: "ASC"
88
92
  }
89
93
  },
90
- isLoading: !1
94
+ isLoading: !1,
95
+ tableName: "variablePicker"
91
96
  }
92
97
  ),
93
98
  footer: /* @__PURE__ */ e.jsx(k, { onClick: a, children: /* @__PURE__ */ e.jsx(r, { i18nKey: v.cancel.id, children: v.cancel.defaultValue }) }),
94
99
  width: 600
95
100
  }
96
101
  );
97
- }, G = Z.lazy(() => import("./TemplateTextInput-fe5912e7.js")), ve = (t, a) => t.locale === "default" ? -1 : a.locale === "default" ? 1 : t.locale.localeCompare(a.locale);
102
+ }, G = Z.lazy(() => import("./TemplateTextInput-e8861a0f.js")), ve = (t, a) => t.locale === "default" ? -1 : a.locale === "default" ? 1 : t.locale.localeCompare(a.locale);
98
103
  function Ce() {
99
104
  const t = re(), [a, n] = C(!1), [c, s] = C("message"), {
100
105
  watch: m,
@@ -133,14 +138,14 @@ function Ce() {
133
138
  return /* @__PURE__ */ e.jsxs("div", { className: "notification-content", children: [
134
139
  /* @__PURE__ */ e.jsx("h2", { children: /* @__PURE__ */ e.jsx(r, { i18nKey: "notificationTemplates.form.languages", children: "Languages" }) }),
135
140
  /* @__PURE__ */ e.jsx(ce, { children: [...o].sort(ve).map((x) => {
136
- var w;
137
- const { locale: u } = x, y = /* @__PURE__ */ e.jsx(r, { i18nKey: "notificationTemplate.form.message", children: "Message" }), i = o.indexOf(x), p = !!((w = b.locales) != null && w[i]);
141
+ var N;
142
+ const { locale: u } = x, y = /* @__PURE__ */ e.jsx(r, { i18nKey: "notificationTemplate.form.message", children: "Message" }), i = o.indexOf(x), p = !!((N = b.locales) != null && N[i]);
138
143
  return /* @__PURE__ */ e.jsx(
139
144
  de,
140
145
  {
141
146
  title: /* @__PURE__ */ e.jsxs("span", { className: "notification-locale-header", children: [
142
147
  u,
143
- p && /* @__PURE__ */ e.jsx("img", { src: B, alt: "" })
148
+ p && /* @__PURE__ */ e.jsx("img", { src: M, alt: "" })
144
149
  ] }),
145
150
  tools: [
146
151
  /* @__PURE__ */ e.jsx(
@@ -228,7 +233,7 @@ function Ce() {
228
233
  }
229
234
  function ke() {
230
235
  const { t } = R(), { control: a } = $();
231
- return /* @__PURE__ */ e.jsxs(M, { children: [
236
+ return /* @__PURE__ */ e.jsxs(z, { children: [
232
237
  /* @__PURE__ */ e.jsx(
233
238
  S,
234
239
  {
@@ -267,13 +272,13 @@ function ke() {
267
272
  )
268
273
  ] });
269
274
  }
270
- function we({ onCancel: t, onSubmit: a, disabled: n }) {
275
+ function Ne({ onCancel: t, onSubmit: a, disabled: n }) {
271
276
  return /* @__PURE__ */ e.jsxs(ue, { dividing: !0, children: [
272
277
  /* @__PURE__ */ e.jsx(k, { primary: !0, onClick: a, disabled: n, children: /* @__PURE__ */ e.jsx(r, { i18nKey: v.save.id, children: v.save.defaultValue }) }),
273
278
  /* @__PURE__ */ e.jsx(k, { onClick: t, children: /* @__PURE__ */ e.jsx(r, { i18nKey: v.cancel.id, children: v.cancel.defaultValue }) })
274
279
  ] });
275
280
  }
276
- function Ne() {
281
+ function we() {
277
282
  return {
278
283
  name: `__${fe()}`,
279
284
  locales: [
@@ -289,7 +294,7 @@ function Ne() {
289
294
  }
290
295
  function Se({ onCancel: t, onSubmit: a, editedTemplateData: n }) {
291
296
  const { locales: c } = O(U), s = H({
292
- defaultValues: n ?? Ne()
297
+ defaultValues: n ?? we()
293
298
  }), {
294
299
  handleSubmit: m,
295
300
  setValue: h,
@@ -327,7 +332,7 @@ function Se({ onCancel: t, onSubmit: a, editedTemplateData: n }) {
327
332
  }
328
333
  ) }),
329
334
  /* @__PURE__ */ e.jsx(
330
- we,
335
+ Ne,
331
336
  {
332
337
  onCancel: t,
333
338
  onSubmit: n ? j : () => d(!0),
@@ -355,7 +360,7 @@ function Se({ onCancel: t, onSubmit: a, editedTemplateData: n }) {
355
360
  }
356
361
  function Ve() {
357
362
  const { templateId: t } = ee(), [a, n] = C(void 0), [c, s] = C(void 0), [m, h] = C(!0);
358
- return N(() => {
363
+ return w(() => {
359
364
  if (!t || t === "create") {
360
365
  h(!1);
361
366
  return;
@@ -422,7 +427,7 @@ function Ke(t, a, n) {
422
427
  };
423
428
  }
424
429
  const Ae = (t, a) => t.subject !== a.subject || t.text !== a.text;
425
- function Be() {
430
+ function He() {
426
431
  const { t } = R(), { setContextInfo: a } = O(Q), n = te(), { pathname: c } = ae(), { initialFormData: s, error: m, loading: h } = Ve();
427
432
  async function f(o, l, T) {
428
433
  const j = Le(o), x = Ee(l), u = Ie(T);
@@ -443,7 +448,7 @@ function Be() {
443
448
  ({ locale: i }) => !j.some((p) => p.locale === i)
444
449
  ), y = T === o.displayName ? l.filter((i) => {
445
450
  const p = j.find(
446
- (w) => w.locale === i.locale
451
+ (N) => N.locale === i.locale
447
452
  );
448
453
  return p && Ae(p, i);
449
454
  }) : l.filter(
@@ -467,13 +472,13 @@ function Be() {
467
472
  function d() {
468
473
  n.push("/portaladmin/templates");
469
474
  }
470
- return N(() => {
475
+ return w(() => {
471
476
  a({
472
477
  type: "string",
473
478
  value: (s == null ? void 0 : s.displayName) || (s == null ? void 0 : s.name) || "",
474
479
  pathname: c
475
480
  });
476
- }, [s, c, a]), N(() => () => a(), [a]), N(() => {
481
+ }, [s, c, a]), w(() => () => a(), [a]), w(() => {
477
482
  m && (console.error(m), K(
478
483
  /* @__PURE__ */ e.jsx(r, { i18nKey: "notificationTemplates.form.fetchFailed", children: "An error occurred while trying to fetch the template(s)" })
479
484
  ));
@@ -501,5 +506,5 @@ function Be() {
501
506
  ] });
502
507
  }
503
508
  export {
504
- Be as default
509
+ He as default
505
510
  };
@@ -0,0 +1,50 @@
1
+ import { aw as r, cy as x, aN as n } from "./ContextBarContext-0c28ce9d.js";
2
+ import j from "react";
3
+ import { C as d, j as N } from "./index-34a2015c.js";
4
+ import "react-router-dom";
5
+ import "@deviceinsight/ng-ui-basic-components";
6
+ import "@deviceinsight/ng-ui-components";
7
+ import "react-i18next";
8
+ import "i18next";
9
+ import "@deviceinsight/ng-ui-api-client";
10
+ import "ux4iot-react";
11
+ import "react-dom";
12
+ import "./objectWithoutPropertiesLoose-a4604547.js";
13
+ const S = j.forwardRef(
14
+ ({ onFocus: l, onChange: i, refField: p, renderAs: e, ...a }, s) => {
15
+ function c() {
16
+ l();
17
+ }
18
+ const m = (t, o) => {
19
+ !e || e === "input" ? i == null || i(t.replace(/\n/g, ""), o) : i == null || i(t, o);
20
+ }, { label: f, ...u } = a;
21
+ return /* @__PURE__ */ r.jsx(x, { ...u, label: f, children: /* @__PURE__ */ r.jsx(
22
+ "div",
23
+ {
24
+ className: n("di notification-template-field", {
25
+ textarea: e === "textarea"
26
+ }),
27
+ children: /* @__PURE__ */ r.jsx(
28
+ d,
29
+ {
30
+ ...a,
31
+ basicSetup: {
32
+ lineNumbers: !1,
33
+ highlightActiveLine: !1,
34
+ foldGutter: !1
35
+ },
36
+ onChange: (t, o) => m(t, o),
37
+ onCreateEditor: (t) => {
38
+ p(t), s && (typeof s == "function" ? s(t) : s.current = t);
39
+ },
40
+ onFocus: c,
41
+ extensions: [N()]
42
+ }
43
+ )
44
+ }
45
+ ) });
46
+ }
47
+ );
48
+ export {
49
+ S as default
50
+ };
@@ -1,12 +1,15 @@
1
- import { az as e, ai as s, a_ as y, dd as B, b4 as P, aj as F, bR as V, by as z, am as N, da as W, de as $ } from "./ContextBarContext-f2968fee.js";
1
+ import { aw as e, ag as s, aX as y, da as B, b1 as O, ah as F, bP as V, bw as z, aj as N, d7 as W, db as $ } from "./ContextBarContext-0c28ce9d.js";
2
2
  import { useContext as H, useState as T, useCallback as q, useEffect as Y } from "react";
3
- import { Link as J, useLocation as Q } from "react-router-dom";
4
- import { fetchUserGroupById as O, fetchEmailTemplates as _, fetchEmailTemplateAccessById as X, updateEmailTemplate as Z, deleteEmailTemplate as ee } from "@deviceinsight/ng-ui-api-client";
5
- import { Label as G, Button as g, Icon as te, Modal as ae, withConfirm as ne } from "@deviceinsight/ng-ui-basic-components";
3
+ import { Link as X, useLocation as J } from "react-router-dom";
4
+ import { fetchUserGroupById as P, fetchEmailTemplates as _, fetchEmailTemplateAccessById as Q, updateEmailTemplate as Z, deleteEmailTemplate as ee } from "@deviceinsight/ng-ui-api-client";
5
+ import { Label as G, Button as C, Icon as te, Modal as ae, withConfirm as ne } from "@deviceinsight/ng-ui-basic-components";
6
6
  import { MultiMenu as oe, MultiMenuItem as se, InfoBox as ie, messageBoxError as S, ContentHeader as le } from "@deviceinsight/ng-ui-components";
7
- import { A as re } from "./AccessEditModal-a02b50a1.js";
7
+ import "react-i18next";
8
+ import { A as re } from "./AccessEditModal-ee0139fb.js";
9
+ import "i18next";
10
+ import "ux4iot-react";
8
11
  import "react-dom";
9
- function ce(r, l, c, h, u) {
12
+ function ce(r, l, c, h, m) {
10
13
  return [
11
14
  {
12
15
  name: "displayName",
@@ -17,7 +20,7 @@ function ce(r, l, c, h, u) {
17
20
  filterType: "text",
18
21
  filterFn: (t, n) => (t.displayName || t.name).toLowerCase().indexOf(n.toLowerCase()) >= 0
19
22
  },
20
- render: (t) => t.id ? /* @__PURE__ */ e.jsx(J, { to: `./${t.id}`, children: t.displayName || t.name }) : "-"
23
+ render: (t) => t.id ? /* @__PURE__ */ e.jsx(X, { to: `./${t.id}`, children: t.displayName || t.name }) : "-"
21
24
  },
22
25
  {
23
26
  name: "message",
@@ -48,8 +51,8 @@ function ce(r, l, c, h, u) {
48
51
  const { accountGroupsWithAccess: n } = t;
49
52
  if (!n || !n.length)
50
53
  return null;
51
- function j(i) {
52
- return u.find((d) => d.id === i) || {
54
+ function g(i) {
55
+ return m.find((u) => u.id === i) || {
53
56
  displayName: "-",
54
57
  id: i
55
58
  };
@@ -60,21 +63,21 @@ function ce(r, l, c, h, u) {
60
63
  {
61
64
  menuButton: /* @__PURE__ */ e.jsx(G, { text: `${n.length} User Groups` }),
62
65
  children: n.map((i) => {
63
- const d = j(i), x = n.filter(
64
- (A) => A !== d.id
66
+ const u = g(i), x = n.filter(
67
+ (A) => A !== u.id
65
68
  );
66
69
  return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(
67
70
  G,
68
71
  {
69
- text: d.displayName || d.name,
72
+ text: u.displayName || u.name,
70
73
  onDelete: () => l(x, t)
71
74
  }
72
- ) }, d.id);
75
+ ) }, u.id);
73
76
  })
74
77
  }
75
78
  );
76
79
  {
77
- const i = j(n[0]);
80
+ const i = g(n[0]);
78
81
  return /* @__PURE__ */ e.jsx(
79
82
  G,
80
83
  {
@@ -92,7 +95,7 @@ function ce(r, l, c, h, u) {
92
95
  align: "right",
93
96
  render: (t) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
94
97
  y([["READ_ACCOUNT_GROUP"]]) && /* @__PURE__ */ e.jsx(
95
- g,
98
+ C,
96
99
  {
97
100
  naked: !0,
98
101
  onClick: () => c(t),
@@ -101,7 +104,7 @@ function ce(r, l, c, h, u) {
101
104
  }
102
105
  ),
103
106
  y(["DELETE_NOTIFICATION_TEMPLATE"]) && /* @__PURE__ */ e.jsx(
104
- g,
107
+ C,
105
108
  {
106
109
  naked: !0,
107
110
  onClick: () => r(t),
@@ -111,10 +114,10 @@ function ce(r, l, c, h, u) {
111
114
  )
112
115
  ] })
113
116
  } : null
114
- ].filter(P);
117
+ ].filter(O);
115
118
  }
116
- function ue({ onCancel: r, onSave: l, template: c }) {
117
- const { t: h } = F(), u = y(["ACCESS_TO_ALL_NOTIFICATION_TEMPLATES"]), t = u ? h("notificationTemplate.access.delete.authorized", {
119
+ function me({ onCancel: r, onSave: l, template: c }) {
120
+ const { t: h } = F(), m = y(["ACCESS_TO_ALL_NOTIFICATION_TEMPLATES"]), t = m ? h("notificationTemplate.access.delete.authorized", {
118
121
  defaultValue: "You are about to remove all User Groups from a Template. Please note that for all other Users who don't have such Authorities like you (ACCESS_TO_ALL_NOTIFICATION_TEMPLATES), this Template will then be completely hidden!"
119
122
  }) : h("notificationTemplate.access.delete.unauthorized", {
120
123
  defaultValue: "You are about ot remove the last User Groups from a Template. Please note that you wouldn't be able to see it as you do not have the required Authorities. Please contact your Administrator."
@@ -124,31 +127,31 @@ function ue({ onCancel: r, onSave: l, template: c }) {
124
127
  {
125
128
  onOutsideClick: r,
126
129
  header: /* @__PURE__ */ e.jsx(s, { i18nKey: "notificationTemplate.access.delete.modal.title", children: "Remove all authorised User Groups from this Template" }),
127
- content: /* @__PURE__ */ e.jsx(ie, { type: u ? "warning" : "error", icon: V, message: t }),
130
+ content: /* @__PURE__ */ e.jsx(ie, { type: m ? "warning" : "error", icon: V, message: t }),
128
131
  footer: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
129
- u && /* @__PURE__ */ e.jsx(g, { onClick: () => l([], c), children: /* @__PURE__ */ e.jsx(s, { i18nKey: "general.actions.save", children: "Save" }) }),
130
- /* @__PURE__ */ e.jsx(g, { onClick: () => r(), children: /* @__PURE__ */ e.jsx(s, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
132
+ m && /* @__PURE__ */ e.jsx(C, { onClick: () => l([], c), children: /* @__PURE__ */ e.jsx(s, { i18nKey: "general.actions.save", children: "Save" }) }),
133
+ /* @__PURE__ */ e.jsx(C, { onClick: () => r(), children: /* @__PURE__ */ e.jsx(s, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
131
134
  ] })
132
135
  }
133
136
  );
134
137
  }
135
- const de = {
138
+ const ue = {
136
139
  page: 0,
137
140
  size: 10,
138
141
  sort: {
139
142
  property: "name",
140
143
  direction: "ASC"
141
144
  }
142
- }, me = {
145
+ }, de = {
143
146
  locale: "null",
144
147
  page: 0,
145
148
  size: 2e3
146
149
  };
147
150
  async function pe() {
148
- const r = await _(me);
151
+ const r = await _(de);
149
152
  return await Promise.all(
150
153
  r.map(async (l) => {
151
- const { accountGroupIds: c } = await X(l.id);
154
+ const { accountGroupIds: c } = await Q(l.id);
152
155
  return Promise.resolve({
153
156
  ...l,
154
157
  accountGroupsWithAccess: c,
@@ -158,7 +161,7 @@ async function pe() {
158
161
  );
159
162
  }
160
163
  function fe({ confirm: r }) {
161
- const { setContextInfo: l } = H(z), { pathname: c } = Q(), [h, u] = T([]), [t, n] = T(!0), [j, i] = T(!1), [d, x] = T(!1), [A, I] = T([]), [C, L] = T(), M = /* @__PURE__ */ e.jsx(s, { i18nKey: "portalAdmin.sidebarElements.templates.create", children: "Create new notification template" }), w = q(
164
+ const { setContextInfo: l } = H(z), { pathname: c } = J(), [h, m] = T([]), [t, n] = T(!0), [g, i] = T(!1), [u, x] = T(!1), [A, w] = T([]), [j, L] = T(), M = /* @__PURE__ */ e.jsx(s, { i18nKey: "portalAdmin.sidebarElements.templates.create", children: "Create new notification template" }), I = q(
162
165
  (a) => {
163
166
  l({
164
167
  type: "search",
@@ -180,8 +183,8 @@ function fe({ confirm: r }) {
180
183
  size: 2e3
181
184
  });
182
185
  await Promise.all(o.map((p) => ee(p.id)));
183
- const m = A.filter((p) => p.name !== a.name);
184
- I(m), w(m);
186
+ const d = A.filter((p) => p.name !== a.name);
187
+ w(d), I(d);
185
188
  } catch (o) {
186
189
  console.error("error occured while trying to delete the template", o), S(
187
190
  /* @__PURE__ */ e.jsx(s, { i18nKey: "notificationTemplate.list.deleteTemplate.error", children: "An error occurred while trying to delete the template" })
@@ -206,29 +209,29 @@ function fe({ confirm: r }) {
206
209
  if (o) {
207
210
  n(!0);
208
211
  try {
209
- const m = await _({
212
+ const d = await _({
210
213
  name: o.name,
211
214
  page: 0,
212
215
  size: 2e3
213
216
  }), p = { ...o, accountGroupsWithAccess: a }, f = N.unionBy([p], A, "id");
214
217
  await Promise.all(
215
- m.map(
218
+ d.map(
216
219
  (E) => Z({
217
220
  ...E,
218
221
  accountGroupsWithAccess: a
219
222
  })
220
223
  )
221
224
  );
222
- const K = [
225
+ const R = [
223
226
  ...new Set(
224
227
  N.flatten(
225
228
  f.map(({ accountGroupsWithAccess: E }) => E).filter(Boolean)
226
229
  )
227
230
  )
228
- ], k = await Promise.all(K.map((E) => O(E)));
229
- I(f), u(k), w(f);
230
- } catch (m) {
231
- console.error("error occured while trying to save access on template: ", m), S(
231
+ ], k = await Promise.all(R.map((E) => P(E)));
232
+ w(f), m(k), I(f);
233
+ } catch (d) {
234
+ console.error("error occured while trying to save access on template: ", d), S(
232
235
  /* @__PURE__ */ e.jsx(s, { i18nKey: "notificationTemplate.list.updateTemplate.error", children: "An error occured while trying to save access" })
233
236
  );
234
237
  } finally {
@@ -239,7 +242,7 @@ function fe({ confirm: r }) {
239
242
  function U(a) {
240
243
  L(a), i(!0);
241
244
  }
242
- function R(a) {
245
+ function K(a) {
243
246
  L(a), x(!0);
244
247
  }
245
248
  return Y(() => {
@@ -249,11 +252,11 @@ function fe({ confirm: r }) {
249
252
  const o = await pe();
250
253
  if (a)
251
254
  return;
252
- if (I(o), w(o), y(["READ_ACCOUNT_GROUP"])) {
253
- const m = [
255
+ if (w(o), I(o), y(["READ_ACCOUNT_GROUP"])) {
256
+ const d = [
254
257
  ...new Set(N.flatten(o.map(({ accountGroupsWithAccess: f }) => f)))
255
- ].filter(P), p = await Promise.all(m.map((f) => O(f)));
256
- u(p);
258
+ ].filter(O), p = await Promise.all(d.map((f) => P(f)));
259
+ m(p);
257
260
  }
258
261
  } catch (o) {
259
262
  console.error("error occured while trying to fetch templates: ", o), S(
@@ -291,36 +294,37 @@ function fe({ confirm: r }) {
291
294
  v,
292
295
  b,
293
296
  U,
294
- R,
297
+ K,
295
298
  h
296
299
  ),
297
300
  uniqueItemKey: (a) => `${a.id}`,
298
- paginationSettings: de,
301
+ paginationSettings: ue,
299
302
  items: A,
300
303
  isLoading: t,
301
- "data-testid": "notification-templates-table"
304
+ "data-testid": "notification-templates-table",
305
+ tableName: "notificationTemplates"
302
306
  }
303
307
  ),
304
- j && C && /* @__PURE__ */ e.jsx(
308
+ g && j && /* @__PURE__ */ e.jsx(
305
309
  re,
306
310
  {
307
311
  onCancel: () => i(!1),
308
312
  onSave: b,
309
313
  loading: t,
310
- template: C
314
+ template: j
311
315
  }
312
316
  ),
313
- d && C && /* @__PURE__ */ e.jsx(
314
- ue,
317
+ u && j && /* @__PURE__ */ e.jsx(
318
+ me,
315
319
  {
316
320
  onCancel: () => x(!1),
317
321
  onSave: b,
318
- template: C
322
+ template: j
319
323
  }
320
324
  )
321
325
  ] });
322
326
  }
323
- const ge = ne(fe);
327
+ const be = ne(fe);
324
328
  export {
325
- ge as default
329
+ be as default
326
330
  };
@@ -1,46 +1,49 @@
1
- import { az as e, db as S, aT as E, bi as _, aj as N, ao as R, ai as o, bo as j, ba as y, dc as M } from "./ContextBarContext-f2968fee.js";
1
+ import { aw as e, d8 as S, aQ as E, bf as _, ah as N, al as R, ag as o, bl as j, b7 as y, d9 as M } from "./ContextBarContext-0c28ce9d.js";
2
2
  import { useState as A, useEffect as C } from "react";
3
3
  import { ReactableWithClientSidePagination as U, messageBoxError as T, ContentHeader as w } from "@deviceinsight/ng-ui-components";
4
4
  import { Button as x, Icon as b, Modal as K, useConfirm as V, SpinnerContainer as L } from "@deviceinsight/ng-ui-basic-components";
5
5
  import { getInitialAccountGroupAssignmentRules as v, createInitialAccountGroupAssignmentRule as k, updateInitialAccountGroupAssignmentRule as H, deleteInitialAccountGroupAssignmentRule as q } from "@deviceinsight/ng-ui-api-client";
6
6
  import "react-router-dom";
7
+ import "react-i18next";
8
+ import "i18next";
9
+ import "ux4iot-react";
7
10
  import "react-dom";
8
11
  function D() {
9
- const [n, a] = A([]), [s, i] = A(!1), [f, m] = A(null);
12
+ const [n, a] = A([]), [s, r] = A(!1), [f, m] = A(null);
10
13
  C(() => {
11
- i(!0);
12
- let r = !1;
14
+ r(!0);
15
+ let i = !1;
13
16
  return v().then((l) => {
14
- r || (a(l), i(!1));
17
+ i || (a(l), r(!1));
15
18
  }).catch((l) => {
16
- r || (m(l), i(!1));
19
+ i || (m(l), r(!1));
17
20
  }), () => {
18
- r = !0;
21
+ i = !0;
19
22
  };
20
23
  }, []);
21
- async function g(r) {
24
+ async function g(i) {
22
25
  try {
23
- i(!0);
24
- const l = await k(r);
26
+ r(!0);
27
+ const l = await k(i);
25
28
  a([...n, l]);
26
29
  } finally {
27
- i(!1);
30
+ r(!1);
28
31
  }
29
32
  }
30
- async function c(r, l) {
33
+ async function c(i, l) {
31
34
  try {
32
- i(!0);
33
- const u = await H(r, l);
34
- a(n.map((t) => t.name === r ? u : t));
35
+ r(!0);
36
+ const u = await H(i, l);
37
+ a(n.map((t) => t.name === i ? u : t));
35
38
  } finally {
36
- i(!1);
39
+ r(!1);
37
40
  }
38
41
  }
39
- async function d(r) {
42
+ async function d(i) {
40
43
  try {
41
- i(!0), await q(r), a(n.filter((l) => l.name !== r));
44
+ r(!0), await q(i), a(n.filter((l) => l.name !== i));
42
45
  } finally {
43
- i(!1);
46
+ r(!1);
44
47
  }
45
48
  }
46
49
  return { rules: n, isLoading: s, error: f, createRule: g, editRule: c, deleteRule: d };
@@ -90,11 +93,12 @@ function P({ onEditRuleClick: n, onDeleteRuleClick: a, rules: s }) {
90
93
  U,
91
94
  {
92
95
  columnDefs: F(n, a),
93
- uniqueItemKey: (i) => i.name,
96
+ uniqueItemKey: (r) => r.name,
94
97
  paginationSettings: O,
95
98
  items: s,
96
99
  isLoading: !1,
97
- "data-testid": "user-group-assignments-table"
100
+ "data-testid": "user-group-assignments-table",
101
+ tableName: "userGroupAssignments"
98
102
  }
99
103
  );
100
104
  }
@@ -103,12 +107,12 @@ function W(n) {
103
107
  if (R.isAxiosError(n) && ((a = n.response) != null && a.data)) {
104
108
  const { fieldErrors: s } = n.response.data;
105
109
  if (s)
106
- return s.map(({ field: i }) => i);
110
+ return s.map(({ field: r }) => r);
107
111
  }
108
112
  }
109
113
  function I({ onSubmit: n, onClose: a, value: s }) {
110
114
  const {
111
- handleSubmit: i,
115
+ handleSubmit: r,
112
116
  formState: { isSubmitting: f },
113
117
  control: m,
114
118
  setError: g
@@ -118,7 +122,7 @@ function I({ onSubmit: n, onClose: a, value: s }) {
118
122
  required: c("userGroupAssignments.ruleModal.validation.required", {
119
123
  defaultValue: "Required field"
120
124
  })
121
- }, r = i(async (l) => {
125
+ }, i = r(async (l) => {
122
126
  var u, t;
123
127
  try {
124
128
  await n(l);
@@ -221,24 +225,24 @@ function I({ onSubmit: n, onClose: a, value: s }) {
221
225
  )
222
226
  ] }),
223
227
  footer: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
224
- /* @__PURE__ */ e.jsx(x, { primary: !0, onClick: r, disabled: f, children: /* @__PURE__ */ e.jsx(o, { i18nKey: "general.actions.apply", children: "Apply" }) }),
228
+ /* @__PURE__ */ e.jsx(x, { primary: !0, onClick: i, disabled: f, children: /* @__PURE__ */ e.jsx(o, { i18nKey: "general.actions.apply", children: "Apply" }) }),
225
229
  /* @__PURE__ */ e.jsx(x, { onClick: a, disabled: f, children: /* @__PURE__ */ e.jsx(o, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
226
230
  ] })
227
231
  }
228
232
  );
229
233
  }
230
- function Z() {
231
- const { isLoading: n, rules: a, error: s, createRule: i, editRule: f, deleteRule: m } = D(), [g, c] = A(!1), [d, r] = A(null), l = V(), { t: u } = N();
234
+ function te() {
235
+ const { isLoading: n, rules: a, error: s, createRule: r, editRule: f, deleteRule: m } = D(), [g, c] = A(!1), [d, i] = A(null), l = V(), { t: u } = N();
232
236
  C(() => {
233
237
  s && R.isAxiosError(s) && (T(
234
238
  /* @__PURE__ */ e.jsx(o, { i18nKey: "userGroupAssignments.fetchError", children: "An error occurred while loading the initial user group assignment rules" })
235
239
  ), console.error("Error loading initial user group assignment rules", s));
236
240
  }, [s]);
237
241
  async function t(p) {
238
- await i(p), c(!1);
242
+ await r(p), c(!1);
239
243
  }
240
244
  async function h(p) {
241
- d && (await f(d.name, p), r(null));
245
+ d && (await f(d.name, p), i(null));
242
246
  }
243
247
  async function G(p) {
244
248
  await l({
@@ -265,7 +269,7 @@ function Z() {
265
269
  P,
266
270
  {
267
271
  rules: a,
268
- onEditRuleClick: r,
272
+ onEditRuleClick: i,
269
273
  onDeleteRuleClick: G
270
274
  }
271
275
  ),
@@ -281,7 +285,7 @@ function Z() {
281
285
  d && /* @__PURE__ */ e.jsx(
282
286
  I,
283
287
  {
284
- onClose: () => r(null),
288
+ onClose: () => i(null),
285
289
  onSubmit: h,
286
290
  value: d
287
291
  }
@@ -289,5 +293,5 @@ function Z() {
289
293
  ] });
290
294
  }
291
295
  export {
292
- Z as default
296
+ te as default
293
297
  };