@deviceinsight/ng-ui-scale-lib 10.2.2 → 10.3.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-kndFZDt-.js → AccessEditModal-EVgqtRQn.js} +17 -17
- package/dist/{AccessEditModal-kndFZDt-.js.map → AccessEditModal-EVgqtRQn.js.map} +1 -1
- package/dist/{BundleManagementContainer-vMlhg6fJ.js → BundleManagementContainer-48Mfx5AV.js} +4 -4
- package/dist/{BundleManagementContainer-vMlhg6fJ.js.map → BundleManagementContainer-48Mfx5AV.js.map} +1 -1
- package/dist/{BundlesContainer-CaC__bAh.js → BundlesContainer-nZS9tMML.js} +40 -40
- package/dist/{BundlesContainer-CaC__bAh.js.map → BundlesContainer-nZS9tMML.js.map} +1 -1
- package/dist/{DatapointImport-Cq8cifAI.js → DatapointImport-DGgPh1uk.js} +10 -10
- package/dist/DatapointImport-DGgPh1uk.js.map +1 -0
- package/dist/{FileUploadInput-DSyHVZUT.js → FileUploadInput-COocUgkB.js} +2 -2
- package/dist/{FileUploadInput-DSyHVZUT.js.map → FileUploadInput-COocUgkB.js.map} +1 -1
- package/dist/{Files-CJ7EHXzr.js → Files-DfQGLE39.js} +3 -3
- package/dist/{Files-CJ7EHXzr.js.map → Files-DfQGLE39.js.map} +1 -1
- package/dist/{GlobalPowerBiReports-PsiWcApU.js → GlobalPowerBiReports-B1nYGKvp.js} +2 -2
- package/dist/{GlobalPowerBiReports-PsiWcApU.js.map → GlobalPowerBiReports-B1nYGKvp.js.map} +1 -1
- package/dist/{JsonSettingWidget-CpZmTuBe.js → JsonSettingWidget-CGANHs8P.js} +9 -9
- package/dist/JsonSettingWidget-CGANHs8P.js.map +1 -0
- package/dist/{LicensesEditPage-CwGor2gV.js → LicensesEditPage-D1I6dogi.js} +11 -11
- package/dist/{LicensesEditPage-CwGor2gV.js.map → LicensesEditPage-D1I6dogi.js.map} +1 -1
- package/dist/{LicensesList-DWQlVNdR.js → LicensesList-CYyuylk_.js} +2 -2
- package/dist/{LicensesList-DWQlVNdR.js.map → LicensesList-CYyuylk_.js.map} +1 -1
- package/dist/{PropertiesEditPage-C4jjCoPp.js → PropertiesEditPage-BOlFs_u9.js} +29 -29
- package/dist/{PropertiesEditPage-C4jjCoPp.js.map → PropertiesEditPage-BOlFs_u9.js.map} +1 -1
- package/dist/{PropertiesList-CBLvLopM.js → PropertiesList-DCPkWqaf.js} +5 -5
- package/dist/{PropertiesList-CBLvLopM.js.map → PropertiesList-DCPkWqaf.js.map} +1 -1
- package/dist/{TemplateEditPage-d-3_n4YW.js → TemplateEditPage-BeV5ZSVV.js} +25 -25
- package/dist/{TemplateEditPage-d-3_n4YW.js.map → TemplateEditPage-BeV5ZSVV.js.map} +1 -1
- package/dist/{TemplateTextInput-CQ6XJiql.js → TemplateTextInput-EDyDopjf.js} +2 -2
- package/dist/{TemplateTextInput-CQ6XJiql.js.map → TemplateTextInput-EDyDopjf.js.map} +1 -1
- package/dist/{TemplatesListPage-roTvuqft.js → TemplatesListPage-BVAiLKAE.js} +13 -13
- package/dist/{TemplatesListPage-roTvuqft.js.map → TemplatesListPage-BVAiLKAE.js.map} +1 -1
- package/dist/{UserGroupAssignments-DTXRBp_V.js → UserGroupAssignments-C7c3INUy.js} +10 -10
- package/dist/{UserGroupAssignments-DTXRBp_V.js.map → UserGroupAssignments-C7c3INUy.js.map} +1 -1
- package/dist/{UserGroupTheme-CAHBWb9Q.js → UserGroupTheme-CFaudF3q.js} +5 -5
- package/dist/{UserGroupTheme-CAHBWb9Q.js.map → UserGroupTheme-CFaudF3q.js.map} +1 -1
- package/dist/api.js +23 -23
- package/dist/index.js +567 -562
- package/dist/index.js.map +1 -1
- package/dist/{setTitle-CjnK8p-J.js → setTitle-Cyf8DxtL.js} +4569 -4565
- package/dist/setTitle-Cyf8DxtL.js.map +1 -0
- package/package.json +11 -10
- package/dist/DatapointImport-Cq8cifAI.js.map +0 -1
- package/dist/JsonSettingWidget-CpZmTuBe.js.map +0 -1
- package/dist/api.d.ts +0 -1192
- package/dist/index.d.ts +0 -7
- package/dist/setTitle-CjnK8p-J.js.map +0 -1
- package/dist/setupRuntimeEnv.js +0 -27
|
@@ -3,28 +3,28 @@ import { useState as f, useContext as U } from "react";
|
|
|
3
3
|
import { searchUserGroups as I } from "@deviceinsight/ng-ui-api-client";
|
|
4
4
|
import { Modal as x, Button as G, SpinnerContainer as b } from "@deviceinsight/ng-ui-basic-components";
|
|
5
5
|
import { InfoBox as O } from "@deviceinsight/ng-ui-components";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
function
|
|
6
|
+
import { z as _, u as k, t as E, a as r, b7 as F, c2 as K, bV as M, c3 as W, k as z, c4 as S } from "./setTitle-Cyf8DxtL.js";
|
|
7
|
+
const L = "usergroupsWithoutAccessToTemplate";
|
|
8
|
+
function N(o) {
|
|
9
9
|
return {
|
|
10
|
-
fields:
|
|
11
|
-
search: (
|
|
10
|
+
fields: z,
|
|
11
|
+
search: (t, s) => I(o(t), s)
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
|
|
14
|
+
function v(o, t) {
|
|
15
|
+
return t ? S(
|
|
16
|
+
t.filter((s) => !o.includes(s)),
|
|
17
17
|
!1
|
|
18
|
-
) : S(
|
|
18
|
+
) : S(o, !0);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function q({ onSave: o, onCancel: t, loading: s, template: n }) {
|
|
21
21
|
const [i, T] = f([]), [c, C] = f(!0), { user: l } = U(_), u = n && n.accountGroupsWithAccess || [], y = c ? l.accountGroupIds ?? [] : null, { t: p } = k(), h = E(["ACCESS_TO_ALL_NOTIFICATION_TEMPLATES"]), A = n?.accountGroupsWithAccess ?? [], d = [...i, ...A].some(
|
|
22
22
|
(a) => l.accountGroupIds.includes(a)
|
|
23
23
|
), g = !h && !d || s;
|
|
24
24
|
return /* @__PURE__ */ e(
|
|
25
25
|
x,
|
|
26
26
|
{
|
|
27
|
-
onOutsideClick:
|
|
27
|
+
onOutsideClick: t,
|
|
28
28
|
header: /* @__PURE__ */ e(r, { i18nKey: "notificationTemplate.access.modal.title", children: "Authorize User Groups to access this template" }),
|
|
29
29
|
content: /* @__PURE__ */ m(b, { show: s, children: [
|
|
30
30
|
/* @__PURE__ */ e("h2", { children: /* @__PURE__ */ e(r, { i18nKey: "notificationTemplate.access.modal.headline", children: "Add User Groups" }) }),
|
|
@@ -41,8 +41,8 @@ function D({ onSave: t, onCancel: o, loading: s, template: n }) {
|
|
|
41
41
|
/* @__PURE__ */ e(
|
|
42
42
|
K,
|
|
43
43
|
{
|
|
44
|
-
searchContext:
|
|
45
|
-
searchConfig: v(
|
|
44
|
+
searchContext: L,
|
|
45
|
+
searchConfig: N(v(u, y)),
|
|
46
46
|
columnDefinitions: W(!0),
|
|
47
47
|
uniqueItemKey: (a) => a.id,
|
|
48
48
|
pageSize: 5,
|
|
@@ -75,16 +75,16 @@ function D({ onSave: t, onCancel: o, loading: s, template: n }) {
|
|
|
75
75
|
{
|
|
76
76
|
primary: !0,
|
|
77
77
|
disabled: g,
|
|
78
|
-
onClick: () =>
|
|
78
|
+
onClick: () => o([...u, ...i], n),
|
|
79
79
|
children: /* @__PURE__ */ e(r, { i18nKey: "general.actions.save", children: "Save" })
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */ e(G, { onClick: () =>
|
|
82
|
+
/* @__PURE__ */ e(G, { onClick: () => t(), children: /* @__PURE__ */ e(r, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
|
|
83
83
|
] })
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
q as A
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=AccessEditModal-
|
|
90
|
+
//# sourceMappingURL=AccessEditModal-EVgqtRQn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessEditModal-
|
|
1
|
+
{"version":3,"file":"AccessEditModal-EVgqtRQn.js","sources":["../ng-ui-scale/src/modules/templates/templateForm/AccessEditModal.tsx"],"sourcesContent":["import {useContext, useState} from 'react';\n\nimport {type NotificationTemplate, searchUserGroups, type UserGroup} from '@deviceinsight/ng-ui-api-client';\nimport {Button, Modal, SpinnerContainer} from '@deviceinsight/ng-ui-basic-components';\nimport {InfoBox} from '@deviceinsight/ng-ui-components';\n\nimport warning_icon from 'assets/svg/icon_warning_triangle.svg';\nimport BulkSelectFilterTable from 'components/filtertable/BulkSelectFilterTable';\nimport Checkbox from 'components/inputs/checkbox/Checkbox';\nimport {getColumnDefs} from 'components/reactable/commonColumnDefs/usergroups';\nimport {UserContext} from 'contexts/user/UserContext';\nimport {Trans, useTranslation} from 'i18n';\nimport {userGroupFields} from 'modules/contextSearch/fields';\nimport {buildIdSearchClosure} from 'modules/contextSearch/searchExpressionHelper';\n// import {userGroupFields} from 'modules/search/fields';\n// import {SearchConfig} from 'modules/search/types';\nimport type {SearchConfig} from 'modules/contextSearch/types';\n// import {buildIdSearchClosure} from 'modules/search/searchExpressionHelper';\nimport {hasAuthorities} from 'utils/hasAuthorities';\n\nconst SEARCH_CONTEXT_GROUPS_WITHOUT_ACCESS = 'usergroupsWithoutAccessToTemplate';\n\ntype Props = {\n\tonSave: (accountGroupIds: number[], template?: NotificationTemplate) => Promise<void> | void;\n\tonCancel: () => void;\n\tloading: boolean;\n\ttemplate?: NotificationTemplate;\n};\n\nfunction getSearchConfig(queryModifier: (arg0: string) => string): SearchConfig<UserGroup> {\n\treturn {\n\t\tfields: userGroupFields,\n\t\tsearch: (query, paginationSettings) => searchUserGroups(queryModifier(query), paginationSettings),\n\t};\n}\n\nfunction buildSearchQuery(excludedIds: number[], availableIds: number[] | null) {\n\tif (!availableIds) {\n\t\treturn buildIdSearchClosure(excludedIds, true);\n\t}\n\n\treturn buildIdSearchClosure(\n\t\tavailableIds.filter(id => !excludedIds.includes(id)),\n\t\tfalse,\n\t);\n}\n\nfunction AccessEditModal({onSave, onCancel, loading, template}: Props) {\n\tconst [selectedUserGroupIds, setSelectedUserGroupIds] = useState<number[]>([]);\n\tconst [showMyGroups, setShowMyGroups] = useState(true);\n\tconst {user} = useContext(UserContext);\n\tconst accountGroupsWithAccess = (template && template.accountGroupsWithAccess) || [];\n\tconst userGroupIdsFilter = showMyGroups ? (user.accountGroupIds ?? []) : null;\n\n\tconst {t} = useTranslation();\n\tconst hasAccessToAllTemplates = hasAuthorities(['ACCESS_TO_ALL_NOTIFICATION_TEMPLATES'] as string[]);\n\tconst currentTemplateUserGroupIds = template?.accountGroupsWithAccess ?? [];\n\tconst isOwnUserGroupSelected = [...selectedUserGroupIds, ...currentTemplateUserGroupIds].some(id =>\n\t\tuser.accountGroupIds.includes(id),\n\t);\n\n\tconst disabled = (!hasAccessToAllTemplates && !isOwnUserGroupSelected) || loading;\n\treturn (\n\t\t<Modal\n\t\t\tonOutsideClick={onCancel}\n\t\t\theader={\n\t\t\t\t<Trans i18nKey=\"notificationTemplate.access.modal.title\">\n\t\t\t\t\tAuthorize User Groups to access this template\n\t\t\t\t</Trans>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<SpinnerContainer show={loading}>\n\t\t\t\t\t<h2>{<Trans i18nKey=\"notificationTemplate.access.modal.headline\">Add User Groups</Trans>}</h2>\n\t\t\t\t\t{!hasAccessToAllTemplates && !isOwnUserGroupSelected && (\n\t\t\t\t\t\t<InfoBox\n\t\t\t\t\t\t\ttype=\"warning\"\n\t\t\t\t\t\t\ticon={warning_icon}\n\t\t\t\t\t\t\tmessage={t('notificationTemplate.access.modal.ownUserGroupRequired', {\n\t\t\t\t\t\t\t\tdefaultValue:\n\t\t\t\t\t\t\t\t\t'You have to at least select one of your own groups, to not lose access to the notification template.',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<BulkSelectFilterTable\n\t\t\t\t\t\tkey={showMyGroups ? 'withUserGroupFilter' : 'withoutUserGroupFilter'}\n\t\t\t\t\t\tsearchContext={SEARCH_CONTEXT_GROUPS_WITHOUT_ACCESS}\n\t\t\t\t\t\tsearchConfig={getSearchConfig(buildSearchQuery(accountGroupsWithAccess, userGroupIdsFilter))}\n\t\t\t\t\t\tcolumnDefinitions={getColumnDefs(true)}\n\t\t\t\t\t\tuniqueItemKey={accountGroup => accountGroup.id}\n\t\t\t\t\t\tpageSize={5}\n\t\t\t\t\t\tonSelectSome={setSelectedUserGroupIds}\n\t\t\t\t\t\textraHeaderComponent={() => (\n\t\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\tmarginLeft: '50px',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={showMyGroups}\n\t\t\t\t\t\t\t\tonChange={setShowMyGroups}\n\t\t\t\t\t\t\t\tlabel={t('notificationTemplate.access.modal.showOnlyMyGroups', {\n\t\t\t\t\t\t\t\t\tdefaultValue: 'Show only my groups',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\thorizontal\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tsearchInputScope=\"notification-template-access-modal\"\n\t\t\t\t\t\ttableName=\"notification-template-access-modal-table\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Trans i18nKey=\"notificationTemplate.access.modal.note\">\n\t\t\t\t\t\tPlease select User Groups to authorise them to access and work with this template.\n\t\t\t\t\t</Trans>\n\t\t\t\t</SpinnerContainer>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t<>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tprimary\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonClick={() => onSave([...accountGroupsWithAccess, ...selectedUserGroupIds], template)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Trans i18nKey=\"general.actions.save\">Save</Trans>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button onClick={() => onCancel()}>\n\t\t\t\t\t\t<Trans i18nKey=\"general.actions.cancel\">Cancel</Trans>\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default AccessEditModal;\n"],"names":["SEARCH_CONTEXT_GROUPS_WITHOUT_ACCESS","getSearchConfig","queryModifier","userGroupFields","query","paginationSettings","searchUserGroups","buildSearchQuery","excludedIds","availableIds","buildIdSearchClosure","id","AccessEditModal","onSave","onCancel","loading","template","selectedUserGroupIds","setSelectedUserGroupIds","useState","showMyGroups","setShowMyGroups","user","useContext","UserContext","accountGroupsWithAccess","userGroupIdsFilter","t","useTranslation","hasAccessToAllTemplates","hasAuthorities","currentTemplateUserGroupIds","isOwnUserGroupSelected","disabled","jsx","Modal","Trans","jsxs","SpinnerContainer","InfoBox","warning_icon","BulkSelectFilterTable","getColumnDefs","accountGroup","Checkbox","Fragment","Button"],"mappings":"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"}
|
package/dist/{BundleManagementContainer-vMlhg6fJ.js → BundleManagementContainer-48Mfx5AV.js}
RENAMED
|
@@ -2,15 +2,15 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useContext as r, useEffect as m } from "react";
|
|
3
3
|
import { useLocation as s } from "react-router-dom";
|
|
4
4
|
import { messageBoxDismissGroup as a } from "@deviceinsight/ng-ui-components";
|
|
5
|
-
import {
|
|
5
|
+
import { aD as f } from "./setTitle-Cyf8DxtL.js";
|
|
6
6
|
import { M as i } from "./consts-CZ_QkIyI.js";
|
|
7
|
-
function
|
|
7
|
+
function d({ children: t }) {
|
|
8
8
|
const { setContextInfo: o } = r(f), { pathname: e } = s();
|
|
9
9
|
return m(() => (o(), () => {
|
|
10
10
|
a(i), o();
|
|
11
11
|
}), [e, o]), /* @__PURE__ */ n("div", { children: t });
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
d as default
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=BundleManagementContainer-
|
|
16
|
+
//# sourceMappingURL=BundleManagementContainer-48Mfx5AV.js.map
|
package/dist/{BundleManagementContainer-vMlhg6fJ.js.map → BundleManagementContainer-48Mfx5AV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleManagementContainer-
|
|
1
|
+
{"version":3,"file":"BundleManagementContainer-48Mfx5AV.js","sources":["../ng-ui-scale/src/modules/bundleManagement/BundleManagementContainer.tsx"],"sourcesContent":["import {type ReactNode, useContext, useEffect} from 'react';\nimport {useLocation} from 'react-router-dom';\n\nimport {messageBoxDismissGroup} from '@deviceinsight/ng-ui-components';\n\nimport {ContextInfoContext} from 'contexts/contextInfo/ContextInfoContext';\nimport './bundleManagement.scss';\n\nimport {MODULE_ID} from './consts';\n\ntype Props = {\n\tchildren: ReactNode;\n};\nexport default function BundleManagementContainer({children}: Props) {\n\tconst {setContextInfo} = useContext(ContextInfoContext);\n\tconst {pathname} = useLocation();\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: TODO\n\tuseEffect(() => {\n\t\tsetContextInfo();\n\t\treturn () => {\n\t\t\tmessageBoxDismissGroup(MODULE_ID);\n\t\t\tsetContextInfo();\n\t\t};\n\t}, [pathname, setContextInfo]);\n\treturn <div>{children}</div>;\n}\n"],"names":["BundleManagementContainer","children","setContextInfo","useContext","ContextInfoContext","pathname","useLocation","useEffect","messageBoxDismissGroup","MODULE_ID","jsx"],"mappings":";;;;;;AAaA,SAAwBA,EAA0B,EAAC,UAAAC,KAAkB;AACpE,QAAM,EAAC,gBAAAC,EAAA,IAAkBC,EAAWC,CAAkB,GAChD,EAAC,UAAAC,EAAA,IAAYC,EAAA;AAEnB,SAAAC,EAAU,OACTL,EAAA,GACO,MAAM;AACZ,IAAAM,EAAuBC,CAAS,GAChCP,EAAA;AAAA,EACD,IACE,CAACG,GAAUH,CAAc,CAAC,GACtB,gBAAAQ,EAAC,SAAK,UAAAT,GAAS;AACvB;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { useState as N, useRef as oe, useCallback as se, useEffect as _, createElement as ce } from "react";
|
|
3
3
|
import { useLocation as ue } from "react-router-dom";
|
|
4
|
-
import { deleteBundleVersion as he, fetchBundleVersion as z, fetchBundleFiles as W, downloadBundleFile as me, deleteBundleFile as fe, createBundleFile as Ee, releaseBundleVersion as
|
|
4
|
+
import { deleteBundleVersion as he, fetchBundleVersion as z, fetchBundleFiles as W, downloadBundleFile as me, deleteBundleFile as fe, createBundleFile as Ee, releaseBundleVersion as be, createBundleVersion as Be, fetchBundleVersions as $, createBundle as ge, deleteBundle as Ve, fetchAllBundles as De } from "@deviceinsight/ng-ui-api-client";
|
|
5
5
|
import { messageBoxSuccess as H, messageBoxError as Q, ReactableWithClientSidePagination as Ne, Reactable as Te, ContentHeader as ve } from "@deviceinsight/ng-ui-components";
|
|
6
6
|
import "react-i18next";
|
|
7
|
-
import { a,
|
|
8
|
-
import { Button as
|
|
7
|
+
import { a, an as K, a9 as _e, u as w, Q as O, cb as ye, b_ as p, bg as j, bN as pe } from "./setTitle-Cyf8DxtL.js";
|
|
8
|
+
import { Button as b, Icon as C, SpinnerContainer as y, Modal as L, Label as Ce, AccordionItem as Le, Accordion as Se } from "@deviceinsight/ng-ui-basic-components";
|
|
9
9
|
import { B as c, Q as Y, a as Ae } from "./consts-CZ_QkIyI.js";
|
|
10
10
|
import { u as Ie, b as Me } from "./useCanDeleteBundleVersion-CUD1pDJ0.js";
|
|
11
11
|
import { Controller as F, useForm as Z } from "react-hook-form";
|
|
12
12
|
import { get as we } from "lodash";
|
|
13
|
-
import { F as Oe } from "./FileUploadInput-
|
|
13
|
+
import { F as Oe } from "./FileUploadInput-COocUgkB.js";
|
|
14
14
|
const Fe = {
|
|
15
15
|
id: "bundlemanagement.fetchAllBundlesError",
|
|
16
16
|
defaultValue: "The bundles could not be loaded"
|
|
@@ -56,7 +56,7 @@ function V({
|
|
|
56
56
|
successMessages: l,
|
|
57
57
|
initialData: r
|
|
58
58
|
}) {
|
|
59
|
-
const [d, i] = N(r), [o, h] = N(!1), [u, m] = N(void 0), f = oe(!0),
|
|
59
|
+
const [d, i] = N(r), [o, h] = N(!1), [u, m] = N(void 0), f = oe(!0), B = se(
|
|
60
60
|
async (...D) => {
|
|
61
61
|
try {
|
|
62
62
|
m(void 0), h(!0);
|
|
@@ -72,7 +72,7 @@ function V({
|
|
|
72
72
|
);
|
|
73
73
|
return _(() => (f.current = !0, () => {
|
|
74
74
|
f.current = !1;
|
|
75
|
-
}), [n, t, l]), { run:
|
|
75
|
+
}), [n, t, l]), { run: B, data: d, loading: o, error: u };
|
|
76
76
|
}
|
|
77
77
|
const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone: !1 }) }) : "-", We = ({
|
|
78
78
|
onViewDetails: n,
|
|
@@ -135,7 +135,7 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
135
135
|
align: "right",
|
|
136
136
|
render: (d) => /* @__PURE__ */ e(K, { authorities: ["WRITE_BUNDLE"], children: /* @__PURE__ */ s(v, { children: [
|
|
137
137
|
d.draft && /* @__PURE__ */ e(
|
|
138
|
-
|
|
138
|
+
b,
|
|
139
139
|
{
|
|
140
140
|
naked: !0,
|
|
141
141
|
small: !0,
|
|
@@ -148,7 +148,7 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
151
|
+
b,
|
|
152
152
|
{
|
|
153
153
|
naked: !0,
|
|
154
154
|
small: !0,
|
|
@@ -218,8 +218,8 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
218
218
|
header: /* @__PURE__ */ e(a, { i18nKey: x.id, children: x.defaultValue }),
|
|
219
219
|
content: /* @__PURE__ */ e(Ze, { version: t, ...i }),
|
|
220
220
|
footer: /* @__PURE__ */ s("div", { children: [
|
|
221
|
-
/* @__PURE__ */ e(
|
|
222
|
-
/* @__PURE__ */ e(
|
|
221
|
+
/* @__PURE__ */ e(b, { primary: !0, disabled: !i.canBeDeleted, onClick: o, children: /* @__PURE__ */ e(a, { i18nKey: I.id, children: I.defaultValue }) }),
|
|
222
|
+
/* @__PURE__ */ e(b, { onClick: l, children: /* @__PURE__ */ e(a, { i18nKey: M.id, children: M.defaultValue }) })
|
|
223
223
|
] }),
|
|
224
224
|
width: 500
|
|
225
225
|
}
|
|
@@ -249,7 +249,7 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
249
249
|
label: "",
|
|
250
250
|
align: "right",
|
|
251
251
|
render: (l) => /* @__PURE__ */ e(
|
|
252
|
-
|
|
252
|
+
b,
|
|
253
253
|
{
|
|
254
254
|
naked: !0,
|
|
255
255
|
small: !0,
|
|
@@ -270,7 +270,7 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
270
270
|
label: "",
|
|
271
271
|
align: "right",
|
|
272
272
|
render: (l) => /* @__PURE__ */ e(
|
|
273
|
-
|
|
273
|
+
b,
|
|
274
274
|
{
|
|
275
275
|
naked: !0,
|
|
276
276
|
small: !0,
|
|
@@ -348,7 +348,7 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
348
348
|
} = V({
|
|
349
349
|
requestFunction: W,
|
|
350
350
|
errorMessages: rn
|
|
351
|
-
}), { run: f, loading:
|
|
351
|
+
}), { run: f, loading: B } = V({
|
|
352
352
|
requestFunction: (E) => me(n.id, t, E.id).then((T) => {
|
|
353
353
|
window.location.replace(T.downloadLink);
|
|
354
354
|
}),
|
|
@@ -366,13 +366,13 @@ const P = (n) => n ? /* @__PURE__ */ e("span", { children: _e(n, { showTimezone:
|
|
|
366
366
|
/* @__PURE__ */ e(
|
|
367
367
|
te,
|
|
368
368
|
{
|
|
369
|
-
isLoading:
|
|
369
|
+
isLoading: B || m,
|
|
370
370
|
files: u || [],
|
|
371
371
|
columnDefs: D
|
|
372
372
|
}
|
|
373
373
|
)
|
|
374
374
|
] }) }),
|
|
375
|
-
footer: /* @__PURE__ */ e(
|
|
375
|
+
footer: /* @__PURE__ */ e(b, { onClick: l, "data-testid": c.MODAL_CLOSE_BUTTON, children: /* @__PURE__ */ e(a, { i18nKey: A.id, children: A.defaultValue }) })
|
|
376
376
|
}
|
|
377
377
|
);
|
|
378
378
|
}, on = {
|
|
@@ -519,7 +519,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
519
519
|
},
|
|
520
520
|
ze
|
|
521
521
|
]
|
|
522
|
-
}),
|
|
522
|
+
}), B = () => l(n.id, o), D = (g) => h(n.id, o, g.id).then(B), E = (g) => m(n.id, o, g, ye()).then(B), T = nn(D, i);
|
|
523
523
|
return _(() => {
|
|
524
524
|
o && l(n.id, o);
|
|
525
525
|
}, [l, o, n]), /* @__PURE__ */ s("div", { className: "bundle-version", children: [
|
|
@@ -548,32 +548,32 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
548
548
|
r ? r.length : 1
|
|
549
549
|
) })
|
|
550
550
|
] });
|
|
551
|
-
}, fn = [J], En = [X],
|
|
551
|
+
}, fn = [J], En = [X], bn = [Pe], Bn = [ke], gn = [Qe], Vn = ({ bundle: n, versionId: t, setVersionId: l, onClose: r }) => {
|
|
552
552
|
const d = Z({
|
|
553
553
|
defaultValues: {
|
|
554
554
|
name: "",
|
|
555
555
|
description: ""
|
|
556
556
|
}
|
|
557
|
-
}), { handleSubmit: i } = d, o = (T) =>
|
|
557
|
+
}), { handleSubmit: i } = d, o = (T) => Be(n.id, T).then((g) => l(g.id)), h = () => i(o, (T) => {
|
|
558
558
|
console.warn("Validation error", T);
|
|
559
559
|
})(), u = V({
|
|
560
560
|
requestFunction: h,
|
|
561
|
-
errorMessages:
|
|
561
|
+
errorMessages: bn
|
|
562
562
|
}), m = V({
|
|
563
|
-
requestFunction:
|
|
564
|
-
errorMessages:
|
|
563
|
+
requestFunction: be,
|
|
564
|
+
errorMessages: Bn,
|
|
565
565
|
successMessages: gn
|
|
566
566
|
}), f = V({
|
|
567
567
|
requestFunction: z,
|
|
568
568
|
errorMessages: fn
|
|
569
|
-
}),
|
|
569
|
+
}), B = V({
|
|
570
570
|
requestFunction: W,
|
|
571
571
|
errorMessages: En
|
|
572
572
|
}), { run: D } = f;
|
|
573
573
|
_(() => {
|
|
574
574
|
t && D(n.id, t);
|
|
575
575
|
}, [t, D, n]);
|
|
576
|
-
const E = !!(
|
|
576
|
+
const E = !!(B.data && B.data.length);
|
|
577
577
|
return /* @__PURE__ */ e(
|
|
578
578
|
L,
|
|
579
579
|
{
|
|
@@ -583,12 +583,12 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
583
583
|
y,
|
|
584
584
|
{
|
|
585
585
|
show: m.loading || f.loading && !f.data || u.loading,
|
|
586
|
-
children: t ? /* @__PURE__ */ e(mn, { bundle: n, version: f.data, fileLoader:
|
|
586
|
+
children: t ? /* @__PURE__ */ e(mn, { bundle: n, version: f.data, fileLoader: B }) : /* @__PURE__ */ e(un, { header: n.name, formContext: d, onSubmit: h })
|
|
587
587
|
}
|
|
588
588
|
),
|
|
589
589
|
footer: t ? /* @__PURE__ */ s(v, { children: [
|
|
590
590
|
/* @__PURE__ */ e(
|
|
591
|
-
|
|
591
|
+
b,
|
|
592
592
|
{
|
|
593
593
|
primary: !0,
|
|
594
594
|
onClick: () => m.run(n.id, t || "").then(r),
|
|
@@ -596,10 +596,10 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
596
596
|
children: /* @__PURE__ */ e(a, { i18nKey: "bundlemanagement.publish", children: "Publish" })
|
|
597
597
|
}
|
|
598
598
|
),
|
|
599
|
-
/* @__PURE__ */ e(
|
|
599
|
+
/* @__PURE__ */ e(b, { onClick: r, "data-testid": c.CANCEL_SAVE_VERSION_BUTTON, children: /* @__PURE__ */ e(a, { i18nKey: A.id, children: A.defaultValue }) })
|
|
600
600
|
] }) : /* @__PURE__ */ s(v, { children: [
|
|
601
601
|
/* @__PURE__ */ e(
|
|
602
|
-
|
|
602
|
+
b,
|
|
603
603
|
{
|
|
604
604
|
primary: !0,
|
|
605
605
|
onClick: u.run,
|
|
@@ -608,7 +608,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
608
608
|
children: /* @__PURE__ */ e(a, { i18nKey: q.id, children: q.defaultValue })
|
|
609
609
|
}
|
|
610
610
|
),
|
|
611
|
-
/* @__PURE__ */ e(
|
|
611
|
+
/* @__PURE__ */ e(b, { onClick: r, "data-testid": c.CANCEL_SAVE_VERSION_BUTTON, children: /* @__PURE__ */ e(a, { i18nKey: p.cancel.id, children: p.cancel.defaultValue }) })
|
|
612
612
|
] })
|
|
613
613
|
}
|
|
614
614
|
);
|
|
@@ -620,11 +620,11 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
620
620
|
direction: "DESC"
|
|
621
621
|
}
|
|
622
622
|
}, Nn = [qe], Tn = ({ bundle: n, isOpen: t }) => {
|
|
623
|
-
const { t: l } = w(), [r, d] = N(!1), [i, o] = N(void 0), [h, u] = N(void 0), [m, f] = N(void 0),
|
|
623
|
+
const { t: l } = w(), [r, d] = N(!1), [i, o] = N(void 0), [h, u] = N(void 0), [m, f] = N(void 0), B = j();
|
|
624
624
|
_(() => {
|
|
625
|
-
const ie =
|
|
625
|
+
const ie = B.get(Y), U = B.get(Ae);
|
|
626
626
|
U && ie === n.id && o(U);
|
|
627
|
-
}, [
|
|
627
|
+
}, [B, n]);
|
|
628
628
|
const D = We(
|
|
629
629
|
{
|
|
630
630
|
onViewDetails: o,
|
|
@@ -654,7 +654,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
654
654
|
}
|
|
655
655
|
),
|
|
656
656
|
/* @__PURE__ */ e(K, { authorities: ["WRITE_BUNDLE"], children: /* @__PURE__ */ s(
|
|
657
|
-
|
|
657
|
+
b,
|
|
658
658
|
{
|
|
659
659
|
onClick: () => d(!0),
|
|
660
660
|
"data-testid": c.CREATE_VERSION_BUTTON,
|
|
@@ -709,7 +709,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
709
709
|
{
|
|
710
710
|
authorities: ["DELETE_BUNDLE"],
|
|
711
711
|
children: /* @__PURE__ */ e(
|
|
712
|
-
|
|
712
|
+
b,
|
|
713
713
|
{
|
|
714
714
|
naked: !0,
|
|
715
715
|
onClick: () => l(t),
|
|
@@ -773,13 +773,13 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
773
773
|
})
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
|
-
render: ({ field: { value: u, onChange: m, onBlur: f }, fieldState: { error:
|
|
776
|
+
render: ({ field: { value: u, onChange: m, onBlur: f }, fieldState: { error: B } }) => /* @__PURE__ */ e(
|
|
777
777
|
O,
|
|
778
778
|
{
|
|
779
779
|
value: u,
|
|
780
780
|
onChange: m,
|
|
781
781
|
onBlur: f,
|
|
782
|
-
error:
|
|
782
|
+
error: B?.message,
|
|
783
783
|
required: !0,
|
|
784
784
|
label: /* @__PURE__ */ e(a, { i18nKey: "bundle.name", children: "Name" }),
|
|
785
785
|
"data-testid": c.BUNDLE_NAME_INPUT,
|
|
@@ -790,7 +790,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
790
790
|
) }) }),
|
|
791
791
|
footer: /* @__PURE__ */ s("div", { children: [
|
|
792
792
|
/* @__PURE__ */ e(
|
|
793
|
-
|
|
793
|
+
b,
|
|
794
794
|
{
|
|
795
795
|
primary: !0,
|
|
796
796
|
"data-testid": c.SAVE_BUNDLE_BUTTON,
|
|
@@ -800,7 +800,7 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
800
800
|
}
|
|
801
801
|
),
|
|
802
802
|
/* @__PURE__ */ e(
|
|
803
|
-
|
|
803
|
+
b,
|
|
804
804
|
{
|
|
805
805
|
onClick: () => n(!1),
|
|
806
806
|
"data-testid": c.CANCEL_SAVE_BUNDLE_BUTTON,
|
|
@@ -857,8 +857,8 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
857
857
|
header: /* @__PURE__ */ e(a, { i18nKey: G.id, children: G.defaultValue }),
|
|
858
858
|
content: /* @__PURE__ */ e(Sn, { bundle: n, ...d }),
|
|
859
859
|
footer: /* @__PURE__ */ s("div", { children: [
|
|
860
|
-
/* @__PURE__ */ e(
|
|
861
|
-
/* @__PURE__ */ e(
|
|
860
|
+
/* @__PURE__ */ e(b, { primary: !0, disabled: !d.canBeDeleted, onClick: i, children: /* @__PURE__ */ e(a, { i18nKey: I.id, children: I.defaultValue }) }),
|
|
861
|
+
/* @__PURE__ */ e(b, { onClick: t, children: /* @__PURE__ */ e(a, { i18nKey: M.id, children: M.defaultValue }) })
|
|
862
862
|
] }),
|
|
863
863
|
width: 500
|
|
864
864
|
}
|
|
@@ -911,4 +911,4 @@ const hn = "DUPLICATE_FILE_NAME", mn = ({
|
|
|
911
911
|
export {
|
|
912
912
|
Hn as default
|
|
913
913
|
};
|
|
914
|
-
//# sourceMappingURL=BundlesContainer-
|
|
914
|
+
//# sourceMappingURL=BundlesContainer-nZS9tMML.js.map
|