@plumile/backoffice-react 0.1.156 → 0.1.157
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/lib/esm/auth/authRefreshNotice.css.js +1 -0
- package/lib/esm/auth/login/loginPage.css.js +0 -1
- package/lib/esm/auth/login/synchronizeAuthStatusQuery.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -0
- package/lib/esm/components/backoffice/refs/BackofficeLazyEntityCount.js +31 -0
- package/lib/esm/components/backoffice/refs/BackofficeLazyEntityCount.js.map +1 -0
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js +36 -32
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js.map +1 -1
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +0 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +0 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +0 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/index.js +33 -32
- package/lib/esm/pages/BackofficeEntityDetailPage.js +200 -214
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +0 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +2 -2
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.js +76 -269
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/BackofficeLazyEntityCount.d.ts +8 -0
- package/lib/types/components/backoffice/refs/BackofficeLazyEntityCount.d.ts.map +1 -0
- package/lib/types/components/backoffice/refs/BackofficeRelatedCountLink.d.ts +1 -1
- package/lib/types/components/backoffice/refs/BackofficeRelatedCountLink.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +0 -2
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +2 -3
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +1 -6
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
|
|
2
2
|
import { resolveMutationOutcome as t } from "../relay/mutationResult.js";
|
|
3
3
|
import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { BackofficeRelationsSummaryGrid as f } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
|
|
4
|
+
import { resolveToastSpec as r, resolveToastViewActions as i } from "../components/backoffice/actions/toastViewAction.js";
|
|
5
|
+
import { LazyBackofficeEntityActionFormDialog as a } from "../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js";
|
|
6
|
+
import { buildDataTableColumns as o } from "../components/backoffice/columns/buildDataTableColumns.js";
|
|
7
|
+
import { BackofficeDetailBadgeRow as s } from "../components/backoffice/detail/BackofficeDetailBadgeRow.js";
|
|
8
|
+
import { BackofficeDetailFlagTag as c } from "../components/backoffice/detail/BackofficeDetailFlagTag.js";
|
|
9
|
+
import { BackofficeDetailTaggedValue as l } from "../components/backoffice/detail/BackofficeDetailTaggedValue.js";
|
|
10
|
+
import { BackofficeLifecycleTimelineSection as u } from "../components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
|
|
11
|
+
import { BackofficeRelationsSummaryGrid as d } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
|
|
13
12
|
import { layout as ee, primary as te, secondary as ne, stacked as re } from "../components/backoffice/detail/backofficeDetailLayout.css.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
13
|
+
import { BackofficeLazyEntityCount as ie } from "../components/backoffice/refs/BackofficeLazyEntityCount.js";
|
|
14
|
+
import { BackofficeEntityDetailScaffold as f } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
|
|
15
|
+
import { useBackofficeFormats as p } from "../i18n/useBackofficeFormats.js";
|
|
16
|
+
import { useRelayEnvironment as m } from "../relay/useRelayEnvironment.js";
|
|
17
|
+
import { resolveVisibleDetailPages as h } from "./detail/pageResolution.js";
|
|
18
|
+
import { headerActions as ae } from "./backofficeEntityDetailPage.css.js";
|
|
19
|
+
import { extractMutationPayload as oe, isFormMutationAction as g, isMutationAction as se, isRouteAction as ce, resolveLabel as _ } from "./BackofficeEntityDetailPage.helpers.js";
|
|
20
|
+
import { buildFieldItems as le, renderBlocks as ue } from "./BackofficeEntityDetailPage.view-helpers.js";
|
|
21
|
+
import { useBackofficeEntityDetailLayoutContext as v } from "./detail/BackofficeEntityDetailLayoutContext.js";
|
|
22
|
+
import { BackofficeRedirect as y } from "./BackofficeRedirect.js";
|
|
23
|
+
import { useContext as b, useMemo as x, useState as S } from "react";
|
|
24
|
+
import { Fragment as de, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
25
|
+
import { useTranslation as T } from "react-i18next";
|
|
26
|
+
import { Button as E } from "@plumile/ui/atomic/atoms/button/Button.js";
|
|
27
|
+
import { commitMutation as fe, useFragment as pe, usePreloadedQuery as me } from "react-relay";
|
|
28
|
+
import { useToast as he } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
|
|
29
|
+
import ge from "@plumile/router/routing/RoutingContext.js";
|
|
30
|
+
import { FormattedDate as D } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
|
|
31
|
+
import { BACKOFFICE_DATE_TIME_OPTIONS as O } from "@plumile/backoffice-core/constants.js";
|
|
32
|
+
import k from "@plumile/router/routing/Link.js";
|
|
33
|
+
import { Tag as A } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
|
|
34
|
+
import { buildBackofficeFallbackListHref as _e, buildBackofficeListHref as ve, buildBackofficeListLink as ye } from "@plumile/backoffice-core/state/buildListHref.js";
|
|
35
|
+
import { BackofficeDetailSection as j } from "@plumile/ui/backoffice/molecules/backoffice_detail_section/BackofficeDetailSection.js";
|
|
36
|
+
import { BackofficePayloadViewer as M } from "@plumile/ui/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js";
|
|
37
|
+
import { setWhereValue as N } from "@plumile/backoffice-core/filters/where.js";
|
|
38
|
+
import { AuditTimeline as P } from "@plumile/ui/backoffice/organisms/audit_timeline/AuditTimeline.js";
|
|
39
|
+
import { MetricCard as be } from "@plumile/ui/components/dashboard/metric_card/MetricCard.js";
|
|
40
|
+
import { MetricTileGroup as xe } from "@plumile/ui/components/dashboard/metric_tile_group/MetricTileGroup.js";
|
|
41
|
+
import { DataTable as Se } from "@plumile/ui/components/data-table/DataTable.js";
|
|
42
|
+
import { BackofficeKeyValueList as Ce } from "@plumile/ui/backoffice/molecules/backoffice_key_value_list/BackofficeKeyValueList.js";
|
|
43
|
+
import { LinkButton as F } from "@plumile/ui/atomic/atoms/button/LinkButton.js";
|
|
44
|
+
import { BackofficeRelationsMenu as we } from "@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js";
|
|
45
|
+
import { BackofficeScopeStack as Te } from "@plumile/ui/backoffice/molecules/backoffice_scope_stack/BackofficeScopeStack.js";
|
|
46
46
|
import { ChatCheckSvg as I } from "@plumile/ui/icons/ChatCheckSvg.js";
|
|
47
47
|
import { KeyOffSvg as L } from "@plumile/ui/icons/KeyOffSvg.js";
|
|
48
48
|
import { KeySvg as R } from "@plumile/ui/icons/KeySvg.js";
|
|
@@ -58,166 +58,152 @@ import { ShieldLockSvg as q } from "@plumile/ui/icons/ShieldLockSvg.js";
|
|
|
58
58
|
import { ShieldOffSvg as J } from "@plumile/ui/icons/ShieldOffSvg.js";
|
|
59
59
|
import { XBadgeSvg as Y } from "@plumile/ui/icons/XBadgeSvg.js";
|
|
60
60
|
//#region src/pages/BackofficeEntityDetailPage.tsx
|
|
61
|
-
var
|
|
62
|
-
let r = A(e.query, e.getVariables(t, n), { fetchPolicy: X }), i = e.getCount(r);
|
|
63
|
-
return i == null ? null : /* @__PURE__ */ E(T, { children: i });
|
|
64
|
-
}, Oe = ({ count: e, node: t, relationValue: n }) => e == null ? null : /* @__PURE__ */ E(r, {
|
|
65
|
-
fallback: () => null,
|
|
66
|
-
children: /* @__PURE__ */ E(x, {
|
|
67
|
-
fallback: null,
|
|
68
|
-
children: /* @__PURE__ */ E(Z, {
|
|
69
|
-
count: e,
|
|
70
|
-
node: t,
|
|
71
|
-
relationValue: n
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
}), ke = (e) => {
|
|
61
|
+
var Ee = (e) => {
|
|
75
62
|
switch (e) {
|
|
76
|
-
case "shield-lock": return /* @__PURE__ */
|
|
63
|
+
case "shield-lock": return /* @__PURE__ */ C(q, {
|
|
77
64
|
width: 14,
|
|
78
65
|
height: 14,
|
|
79
66
|
"aria-hidden": "true"
|
|
80
67
|
});
|
|
81
|
-
case "shield-off": return /* @__PURE__ */
|
|
68
|
+
case "shield-off": return /* @__PURE__ */ C(J, {
|
|
82
69
|
width: 14,
|
|
83
70
|
height: 14,
|
|
84
71
|
"aria-hidden": "true"
|
|
85
72
|
});
|
|
86
|
-
case "settings-check": return /* @__PURE__ */
|
|
73
|
+
case "settings-check": return /* @__PURE__ */ C(G, {
|
|
87
74
|
width: 14,
|
|
88
75
|
height: 14,
|
|
89
76
|
"aria-hidden": "true"
|
|
90
77
|
});
|
|
91
|
-
case "settings-x": return /* @__PURE__ */
|
|
78
|
+
case "settings-x": return /* @__PURE__ */ C(K, {
|
|
92
79
|
width: 14,
|
|
93
80
|
height: 14,
|
|
94
81
|
"aria-hidden": "true"
|
|
95
82
|
});
|
|
96
|
-
case "x-badge": return /* @__PURE__ */
|
|
83
|
+
case "x-badge": return /* @__PURE__ */ C(Y, {
|
|
97
84
|
width: 14,
|
|
98
85
|
height: 14,
|
|
99
86
|
"aria-hidden": "true"
|
|
100
87
|
});
|
|
101
|
-
case "chat-check": return /* @__PURE__ */
|
|
88
|
+
case "chat-check": return /* @__PURE__ */ C(I, {
|
|
102
89
|
width: 14,
|
|
103
90
|
height: 14,
|
|
104
91
|
"aria-hidden": "true"
|
|
105
92
|
});
|
|
106
|
-
case "key": return /* @__PURE__ */
|
|
93
|
+
case "key": return /* @__PURE__ */ C(R, {
|
|
107
94
|
width: 14,
|
|
108
95
|
height: 14,
|
|
109
96
|
"aria-hidden": "true"
|
|
110
97
|
});
|
|
111
|
-
case "key-off": return /* @__PURE__ */
|
|
98
|
+
case "key-off": return /* @__PURE__ */ C(L, {
|
|
112
99
|
width: 14,
|
|
113
100
|
height: 14,
|
|
114
101
|
"aria-hidden": "true"
|
|
115
102
|
});
|
|
116
|
-
case "lock": return /* @__PURE__ */
|
|
103
|
+
case "lock": return /* @__PURE__ */ C(B, {
|
|
117
104
|
width: 14,
|
|
118
105
|
height: 14,
|
|
119
106
|
"aria-hidden": "true"
|
|
120
107
|
});
|
|
121
|
-
case "lock-open": return /* @__PURE__ */
|
|
108
|
+
case "lock-open": return /* @__PURE__ */ C(z, {
|
|
122
109
|
width: 14,
|
|
123
110
|
height: 14,
|
|
124
111
|
"aria-hidden": "true"
|
|
125
112
|
});
|
|
126
|
-
case "robot-check": return /* @__PURE__ */
|
|
113
|
+
case "robot-check": return /* @__PURE__ */ C(V, {
|
|
127
114
|
width: 14,
|
|
128
115
|
height: 14,
|
|
129
116
|
"aria-hidden": "true"
|
|
130
117
|
});
|
|
131
|
-
case "robot-x": return /* @__PURE__ */
|
|
118
|
+
case "robot-x": return /* @__PURE__ */ C(H, {
|
|
132
119
|
width: 14,
|
|
133
120
|
height: 14,
|
|
134
121
|
"aria-hidden": "true"
|
|
135
122
|
});
|
|
136
|
-
case "rocket": return /* @__PURE__ */
|
|
123
|
+
case "rocket": return /* @__PURE__ */ C(W, {
|
|
137
124
|
width: 14,
|
|
138
125
|
height: 14,
|
|
139
126
|
"aria-hidden": "true"
|
|
140
127
|
});
|
|
141
|
-
case "rocket-off": return /* @__PURE__ */
|
|
128
|
+
case "rocket-off": return /* @__PURE__ */ C(U, {
|
|
142
129
|
width: 14,
|
|
143
130
|
height: 14,
|
|
144
131
|
"aria-hidden": "true"
|
|
145
132
|
});
|
|
146
133
|
default: throw Error(`Unsupported flag icon: ${String(e)}`);
|
|
147
134
|
}
|
|
148
|
-
},
|
|
135
|
+
}, De = (e) => {
|
|
149
136
|
if (e.presentation?.desktop === "secondary" || e.presentation?.group === "scope" || e.presentation?.group === "status") return "secondary";
|
|
150
137
|
let t = e.fields?.map((e) => e.presentation?.group) ?? [];
|
|
151
138
|
return t.length > 0 && t.every((e) => e === "scope" || e === "status") || e.placement === "side" || e.placement === "secondary" ? "secondary" : "primary";
|
|
152
|
-
},
|
|
153
|
-
let { t:
|
|
154
|
-
|
|
139
|
+
}, X = ({ config: h, prepared: v }) => {
|
|
140
|
+
let { t: I } = T(), { t: L } = e(), { formatNumber: R, formatCurrency: z, formatCurrencyTitle: B, formatPercent: V } = p(), { entities: H, entityRegistry: U } = n(), W = b(ge), G = m(), K = he(), [q, J] = S({}), [Y, X] = S(null), Z = (e, t) => {
|
|
141
|
+
J((n) => n[e] === t ? n : {
|
|
155
142
|
...n,
|
|
156
143
|
[e]: t
|
|
157
144
|
});
|
|
158
|
-
}, { page:
|
|
159
|
-
id:
|
|
160
|
-
detailId:
|
|
161
|
-
}),
|
|
162
|
-
let t =
|
|
145
|
+
}, { page: Q } = h, Oe = me(Q.query, v.pageQuery), $ = Q.resolveNode(Oe, {
|
|
146
|
+
id: v.id,
|
|
147
|
+
detailId: v.detailId
|
|
148
|
+
}), ke = $ != null, Ae = pe(Q.fragment, $), je = x(() => Object.fromEntries(Q.content.flatMap((e) => e.kind === "fieldSet" ? e.fields.flatMap((e) => e.type === "relation" ? [e.relation.target] : []) : []).flatMap((e) => {
|
|
149
|
+
let t = H[e];
|
|
163
150
|
return t?.hasList === !0 ? [[e, t.routes.list]] : [];
|
|
164
|
-
})), [
|
|
165
|
-
return
|
|
166
|
-
node:
|
|
151
|
+
})), [H, Q.content]);
|
|
152
|
+
return ke ? /* @__PURE__ */ C(f, {
|
|
153
|
+
node: Ae,
|
|
167
154
|
render: (e) => {
|
|
168
|
-
let n =
|
|
169
|
-
let n =
|
|
155
|
+
let n = Q.toView(e), f = (e, t) => {
|
|
156
|
+
let n = H[e];
|
|
170
157
|
return n == null ? null : n.routes.detail(t);
|
|
171
|
-
}, p = ({ id: e, label: t,
|
|
172
|
-
let { target:
|
|
158
|
+
}, p = ({ id: e, label: t, relation: n, listRoute: r, value: i, where: a }) => {
|
|
159
|
+
let { target: o, filterId: s, whereKey: c, path: l } = n, u = U.getLoadedListEntity(o);
|
|
173
160
|
return {
|
|
174
161
|
id: e,
|
|
175
162
|
label: t,
|
|
176
|
-
count:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
relationValue: o
|
|
163
|
+
count: /* @__PURE__ */ C(ie, {
|
|
164
|
+
entity: o,
|
|
165
|
+
where: a
|
|
180
166
|
}),
|
|
181
|
-
href:
|
|
182
|
-
id:
|
|
183
|
-
value:
|
|
184
|
-
}]) :
|
|
167
|
+
href: u == null ? _e(r, a, [{
|
|
168
|
+
id: s ?? (l == null ? c : `${c}.${l.join(".")}`),
|
|
169
|
+
value: i
|
|
170
|
+
}]) : ve(u.config, { where: a }),
|
|
185
171
|
onClick: async (e) => {
|
|
186
|
-
if (
|
|
172
|
+
if (W == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
187
173
|
e.preventDefault();
|
|
188
|
-
let t =
|
|
189
|
-
|
|
174
|
+
let t = ye((await U.loadListEntity(o)).config, { where: a });
|
|
175
|
+
W.history.push({
|
|
190
176
|
pathname: t.pathname,
|
|
191
177
|
search: t.search === "" ? "" : `?${t.search}`,
|
|
192
178
|
hash: ""
|
|
193
179
|
});
|
|
194
180
|
}
|
|
195
181
|
};
|
|
196
|
-
}, m =
|
|
182
|
+
}, m = Q.actions ?? [], h = [];
|
|
197
183
|
if (m.length > 0) {
|
|
198
184
|
let e = m.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
|
|
199
185
|
e.length > 0 && (h = e.map((e) => {
|
|
200
|
-
let
|
|
201
|
-
return
|
|
186
|
+
let a = _(e.label, I), o = e.ariaLabel == null ? a : _(e.ariaLabel, I), s = e.variant ?? "secondary", c = e.size ?? "small", l = q[e.id] ?? !1, u = l || e.isDisabled?.(n) === !0;
|
|
187
|
+
return ce(e) ? /* @__PURE__ */ C(F, {
|
|
202
188
|
to: e.to(n),
|
|
203
189
|
variant: s,
|
|
204
190
|
size: c,
|
|
205
191
|
isDisabled: u,
|
|
206
192
|
"aria-label": o,
|
|
207
193
|
preloadOnMouseEnter: !0,
|
|
208
|
-
children:
|
|
209
|
-
}, e.id) :
|
|
194
|
+
children: a
|
|
195
|
+
}, e.id) : g(e) ? /* @__PURE__ */ C(E, {
|
|
210
196
|
type: "button",
|
|
211
197
|
variant: s,
|
|
212
198
|
size: c,
|
|
213
199
|
isLoading: !1,
|
|
214
200
|
disabled: u,
|
|
215
201
|
onClick: () => {
|
|
216
|
-
|
|
202
|
+
X(e.id);
|
|
217
203
|
},
|
|
218
204
|
"aria-label": o,
|
|
219
|
-
children:
|
|
220
|
-
}, e.id) :
|
|
205
|
+
children: a
|
|
206
|
+
}, e.id) : se(e) ? /* @__PURE__ */ C(E, {
|
|
221
207
|
type: "button",
|
|
222
208
|
variant: s,
|
|
223
209
|
size: c,
|
|
@@ -225,48 +211,48 @@ var X = "store-or-network", Z = ({ count: e, node: t, relationValue: n }) => {
|
|
|
225
211
|
disabled: u,
|
|
226
212
|
onClick: () => {
|
|
227
213
|
if (l) return;
|
|
228
|
-
let
|
|
229
|
-
|
|
214
|
+
let a = e.getVariables(n);
|
|
215
|
+
Z(e.id, !0), fe(G, {
|
|
230
216
|
mutation: e.mutation,
|
|
231
|
-
variables:
|
|
217
|
+
variables: a,
|
|
232
218
|
updater: (t) => {
|
|
233
219
|
e.updater?.(t, n);
|
|
234
220
|
},
|
|
235
|
-
onCompleted: (
|
|
236
|
-
|
|
237
|
-
let o =
|
|
221
|
+
onCompleted: (a) => {
|
|
222
|
+
Z(e.id, !1);
|
|
223
|
+
let o = oe(a);
|
|
238
224
|
if (o != null) {
|
|
239
|
-
let
|
|
240
|
-
e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (
|
|
225
|
+
let i = L("actions.form.errors.invalidPayload");
|
|
226
|
+
e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (i = _(e.toasts.error.title, I)) : i = _(e.toasts.error.message, I);
|
|
241
227
|
let a = t(o, {
|
|
242
|
-
defaultErrorMessage:
|
|
228
|
+
defaultErrorMessage: i,
|
|
243
229
|
mapReason: (t) => {
|
|
244
230
|
let r = e.mapErrorReason?.(t, n);
|
|
245
|
-
return r == null ? null : typeof r == "function" ?
|
|
231
|
+
return r == null ? null : typeof r == "function" ? _(r, I) : String(r);
|
|
246
232
|
}
|
|
247
233
|
});
|
|
248
234
|
if (!a.ok) {
|
|
249
235
|
let t = Error(a.message);
|
|
250
236
|
if (e.onError?.(t, n), e.toasts?.error != null) {
|
|
251
|
-
let t =
|
|
252
|
-
|
|
237
|
+
let t = r(e.toasts.error, I);
|
|
238
|
+
K.error(t.title, t.message);
|
|
253
239
|
}
|
|
254
240
|
return;
|
|
255
241
|
}
|
|
256
242
|
}
|
|
257
|
-
if (e.onCompleted?.(
|
|
258
|
-
let t =
|
|
243
|
+
if (e.onCompleted?.(a, n), e.toasts?.success != null) {
|
|
244
|
+
let t = r(e.toasts.success, I), o = i({
|
|
259
245
|
toast: e.toasts.success,
|
|
260
|
-
response:
|
|
246
|
+
response: a,
|
|
261
247
|
node: n,
|
|
262
|
-
tApp:
|
|
263
|
-
entities:
|
|
264
|
-
defaultLabel:
|
|
248
|
+
tApp: I,
|
|
249
|
+
entities: H,
|
|
250
|
+
defaultLabel: L("actions.view"),
|
|
265
251
|
navigateTo: (e) => {
|
|
266
|
-
|
|
252
|
+
W?.history.push({ pathname: e });
|
|
267
253
|
}
|
|
268
254
|
});
|
|
269
|
-
|
|
255
|
+
K.push({
|
|
270
256
|
kind: "info",
|
|
271
257
|
title: t.title,
|
|
272
258
|
message: t.message,
|
|
@@ -275,138 +261,138 @@ var X = "store-or-network", Z = ({ count: e, node: t, relationValue: n }) => {
|
|
|
275
261
|
}
|
|
276
262
|
},
|
|
277
263
|
onError: (t) => {
|
|
278
|
-
if (
|
|
279
|
-
let t =
|
|
280
|
-
|
|
264
|
+
if (Z(e.id, !1), e.onError?.(t, n), e.toasts?.error != null) {
|
|
265
|
+
let t = r(e.toasts.error, I);
|
|
266
|
+
K.error(t.title, t.message);
|
|
281
267
|
}
|
|
282
268
|
}
|
|
283
269
|
});
|
|
284
270
|
},
|
|
285
271
|
"aria-label": o,
|
|
286
|
-
children:
|
|
272
|
+
children: a
|
|
287
273
|
}, e.id) : null;
|
|
288
274
|
}));
|
|
289
275
|
}
|
|
290
|
-
let
|
|
291
|
-
|
|
292
|
-
let
|
|
276
|
+
let v = m.find((e) => e.id === Y), { content: y } = Q, b = [], x = [], S = [];
|
|
277
|
+
y.forEach((e, t) => {
|
|
278
|
+
let r = De(e) === "secondary" ? x : b;
|
|
293
279
|
if (e.kind === "fieldSet") {
|
|
294
|
-
let
|
|
295
|
-
tApp:
|
|
296
|
-
t:
|
|
297
|
-
resolveEntityHref:
|
|
298
|
-
formatNumber:
|
|
299
|
-
formatCurrency:
|
|
300
|
-
formatCurrencyTitle:
|
|
301
|
-
formatPercent:
|
|
280
|
+
let i = _(e.title, I), a = e.description == null ? void 0 : _(e.description, I), { items: o, relationItems: u, customNodes: d } = le(e.fields, n, {
|
|
281
|
+
tApp: I,
|
|
282
|
+
t: L,
|
|
283
|
+
resolveEntityHref: f,
|
|
284
|
+
formatNumber: R,
|
|
285
|
+
formatCurrency: z,
|
|
286
|
+
formatCurrencyTitle: B,
|
|
287
|
+
formatPercent: V,
|
|
302
288
|
relationEntityListRoutes: je,
|
|
303
289
|
resolveRelationItem: p,
|
|
304
|
-
setWhereValue:
|
|
305
|
-
renderTag: (e, t) => /* @__PURE__ */
|
|
290
|
+
setWhereValue: N,
|
|
291
|
+
renderTag: (e, t) => /* @__PURE__ */ C(A, {
|
|
306
292
|
tone: e,
|
|
307
293
|
children: t
|
|
308
294
|
}),
|
|
309
|
-
renderBadgeRow: (e) => /* @__PURE__ */
|
|
310
|
-
renderDate: (e, t) => /* @__PURE__ */
|
|
295
|
+
renderBadgeRow: (e) => /* @__PURE__ */ C(s, { items: e }),
|
|
296
|
+
renderDate: (e, t) => /* @__PURE__ */ C(D, {
|
|
311
297
|
value: e,
|
|
312
|
-
options:
|
|
298
|
+
options: O,
|
|
313
299
|
fallback: t
|
|
314
300
|
}),
|
|
315
|
-
renderFlagTag: (e) => /* @__PURE__ */
|
|
301
|
+
renderFlagTag: (e) => /* @__PURE__ */ C(c, {
|
|
316
302
|
tone: e.tone,
|
|
317
|
-
icon: e.iconName == null ? void 0 :
|
|
303
|
+
icon: e.iconName == null ? void 0 : Ee(e.iconName),
|
|
318
304
|
label: e.label
|
|
319
305
|
}),
|
|
320
|
-
renderLink: (e, t) => /* @__PURE__ */
|
|
306
|
+
renderLink: (e, t) => /* @__PURE__ */ C(k, {
|
|
321
307
|
to: e,
|
|
322
308
|
preloadOnMouseEnter: !0,
|
|
323
309
|
children: t
|
|
324
310
|
}),
|
|
325
|
-
renderTaggedValue: (e, t) => /* @__PURE__ */
|
|
311
|
+
renderTaggedValue: (e, t) => /* @__PURE__ */ C(l, {
|
|
326
312
|
tag: e,
|
|
327
313
|
value: t
|
|
328
314
|
}),
|
|
329
|
-
wrapCustomNode: (e, t) => /* @__PURE__ */
|
|
315
|
+
wrapCustomNode: (e, t) => /* @__PURE__ */ C("div", { children: t }, e)
|
|
330
316
|
});
|
|
331
|
-
if (
|
|
332
|
-
|
|
333
|
-
}), !(
|
|
334
|
-
|
|
335
|
-
title:
|
|
336
|
-
description:
|
|
337
|
-
items:
|
|
338
|
-
children:
|
|
339
|
-
}, `${
|
|
317
|
+
if (u.forEach((e) => {
|
|
318
|
+
S.some((t) => t.id === e.id) || S.push(e);
|
|
319
|
+
}), !(o.length > 0 || d.length > 0)) return;
|
|
320
|
+
r.push(/* @__PURE__ */ C(j, {
|
|
321
|
+
title: i,
|
|
322
|
+
description: a,
|
|
323
|
+
items: o.length > 0 ? o : void 0,
|
|
324
|
+
children: d
|
|
325
|
+
}, `${i}-${t}`));
|
|
340
326
|
return;
|
|
341
327
|
}
|
|
342
|
-
let
|
|
343
|
-
tApp:
|
|
344
|
-
t:
|
|
345
|
-
resolveEntityHref:
|
|
328
|
+
let i = ue([e], n, {
|
|
329
|
+
tApp: I,
|
|
330
|
+
t: L,
|
|
331
|
+
resolveEntityHref: f,
|
|
346
332
|
keyPrefix: String(t),
|
|
347
|
-
renderLink: (e, t) => /* @__PURE__ */
|
|
333
|
+
renderLink: (e, t) => /* @__PURE__ */ C(k, {
|
|
348
334
|
to: e,
|
|
349
335
|
preloadOnMouseEnter: !0,
|
|
350
336
|
children: t
|
|
351
337
|
}),
|
|
352
|
-
renderDate: (e, t) => /* @__PURE__ */
|
|
338
|
+
renderDate: (e, t) => /* @__PURE__ */ C(D, {
|
|
353
339
|
value: e,
|
|
354
|
-
options:
|
|
340
|
+
options: O,
|
|
355
341
|
fallback: t
|
|
356
342
|
}),
|
|
357
|
-
renderTag: (e, t) => /* @__PURE__ */
|
|
343
|
+
renderTag: (e, t) => /* @__PURE__ */ C(A, {
|
|
358
344
|
tone: e,
|
|
359
345
|
children: t
|
|
360
346
|
}),
|
|
361
|
-
renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */
|
|
347
|
+
renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */ C(j, {
|
|
362
348
|
title: t,
|
|
363
349
|
description: n,
|
|
364
|
-
children: i.length > 0 && /* @__PURE__ */
|
|
350
|
+
children: i.length > 0 && /* @__PURE__ */ C(xe, {
|
|
365
351
|
density: r ?? "comfortable",
|
|
366
352
|
minColumn: "180",
|
|
367
|
-
children: i.map((e) => /* @__PURE__ */
|
|
353
|
+
children: i.map((e) => /* @__PURE__ */ C(be, {
|
|
368
354
|
label: e.label,
|
|
369
355
|
value: e.value,
|
|
370
356
|
hint: e.hint,
|
|
371
357
|
tone: e.tone ?? "neutral",
|
|
372
358
|
density: r ?? "comfortable",
|
|
373
359
|
copyValue: e.copyValue,
|
|
374
|
-
copyLabel:
|
|
375
|
-
copiedLabel:
|
|
360
|
+
copyLabel: L("common.actions.copy"),
|
|
361
|
+
copiedLabel: L("common.actions.copied")
|
|
376
362
|
}, e.id))
|
|
377
363
|
})
|
|
378
364
|
}, e),
|
|
379
|
-
renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */
|
|
365
|
+
renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ C(u, {
|
|
380
366
|
title: t,
|
|
381
367
|
description: n,
|
|
382
368
|
events: r
|
|
383
369
|
}, e),
|
|
384
|
-
renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */
|
|
370
|
+
renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ C(j, {
|
|
385
371
|
title: t,
|
|
386
372
|
description: n,
|
|
387
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ C(P, { events: r })
|
|
388
374
|
}, e),
|
|
389
|
-
renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */
|
|
375
|
+
renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */ C(d, {
|
|
390
376
|
title: t,
|
|
391
377
|
items: n
|
|
392
378
|
}, e),
|
|
393
|
-
renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */
|
|
379
|
+
renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */ C(Te, {
|
|
394
380
|
title: t,
|
|
395
381
|
items: n
|
|
396
382
|
}, e),
|
|
397
|
-
renderCustomSection: (e, t, n) => /* @__PURE__ */
|
|
383
|
+
renderCustomSection: (e, t, n) => /* @__PURE__ */ C(j, {
|
|
398
384
|
title: t,
|
|
399
385
|
children: n
|
|
400
386
|
}, e),
|
|
401
|
-
wrapCustomNode: (e, t) => /* @__PURE__ */
|
|
402
|
-
resolveTableColumns: (e) =>
|
|
403
|
-
tApp:
|
|
404
|
-
t:
|
|
387
|
+
wrapCustomNode: (e, t) => /* @__PURE__ */ C("div", { children: t }, e),
|
|
388
|
+
resolveTableColumns: (e) => o(e, {
|
|
389
|
+
tApp: I,
|
|
390
|
+
t: L
|
|
405
391
|
}),
|
|
406
|
-
renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */
|
|
392
|
+
renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ C(j, {
|
|
407
393
|
title: t,
|
|
408
394
|
description: n,
|
|
409
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ C(Se, {
|
|
410
396
|
columns: r,
|
|
411
397
|
rows: i,
|
|
412
398
|
getRowId: (e, t) => {
|
|
@@ -418,75 +404,75 @@ var X = "store-or-network", Z = ({ count: e, node: t, relationValue: n }) => {
|
|
|
418
404
|
}
|
|
419
405
|
})
|
|
420
406
|
}, e),
|
|
421
|
-
renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */
|
|
407
|
+
renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ C(j, {
|
|
422
408
|
title: t,
|
|
423
409
|
description: n,
|
|
424
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ C(M, {
|
|
425
411
|
content: r,
|
|
426
412
|
format: i,
|
|
427
|
-
emptyState:
|
|
413
|
+
emptyState: L("common.notAvailable")
|
|
428
414
|
})
|
|
429
415
|
}, e),
|
|
430
|
-
renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */
|
|
416
|
+
renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ C(j, {
|
|
431
417
|
title: t,
|
|
432
418
|
description: n,
|
|
433
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ C(Ce, { items: r })
|
|
434
420
|
}, e)
|
|
435
421
|
})[0];
|
|
436
|
-
|
|
422
|
+
i != null && r.push(i);
|
|
437
423
|
});
|
|
438
|
-
let
|
|
439
|
-
label:
|
|
440
|
-
items:
|
|
424
|
+
let T = S.length > 0 ? /* @__PURE__ */ C(we, {
|
|
425
|
+
label: L("relations.menu.label"),
|
|
426
|
+
items: S
|
|
441
427
|
}) : null;
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
-
h.length > 0 ||
|
|
444
|
-
className:
|
|
445
|
-
children: [h.length > 0 && /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ w(de, { children: [
|
|
429
|
+
h.length > 0 || T != null ? /* @__PURE__ */ w("div", {
|
|
430
|
+
className: ae,
|
|
431
|
+
children: [h.length > 0 && /* @__PURE__ */ C("div", {
|
|
446
432
|
className: "txvbqbfpn txvbqbey txvbqblsh txvbqbhdl txvbqbh7g",
|
|
447
433
|
children: h
|
|
448
|
-
}),
|
|
434
|
+
}), T != null && /* @__PURE__ */ C("div", {
|
|
449
435
|
className: "txvbqbfpn txvbqbey txvbqb10mr txvbqbb49 txvbqbbkc txvbqb2sj txvbqb7tt",
|
|
450
|
-
children:
|
|
436
|
+
children: T
|
|
451
437
|
})]
|
|
452
438
|
}) : null,
|
|
453
|
-
|
|
439
|
+
x.length > 0 ? /* @__PURE__ */ w("div", {
|
|
454
440
|
className: ee,
|
|
455
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ C("div", {
|
|
456
442
|
className: te,
|
|
457
|
-
children:
|
|
458
|
-
}), /* @__PURE__ */
|
|
443
|
+
children: b
|
|
444
|
+
}), /* @__PURE__ */ C("aside", {
|
|
459
445
|
className: ne,
|
|
460
|
-
children:
|
|
446
|
+
children: x
|
|
461
447
|
})]
|
|
462
|
-
}) : /* @__PURE__ */
|
|
448
|
+
}) : /* @__PURE__ */ C("div", {
|
|
463
449
|
className: re,
|
|
464
|
-
children:
|
|
450
|
+
children: b
|
|
465
451
|
}),
|
|
466
|
-
|
|
452
|
+
v != null && g(v) && /* @__PURE__ */ C(a, {
|
|
467
453
|
isOpen: !0,
|
|
468
|
-
action:
|
|
454
|
+
action: v,
|
|
469
455
|
node: n,
|
|
470
456
|
onClose: () => {
|
|
471
|
-
|
|
457
|
+
X(null);
|
|
472
458
|
}
|
|
473
459
|
})
|
|
474
460
|
] });
|
|
475
461
|
}
|
|
476
|
-
}) : /* @__PURE__ */
|
|
477
|
-
},
|
|
478
|
-
let { layoutView: n } =
|
|
462
|
+
}) : /* @__PURE__ */ C(y, { to: h.routes.list });
|
|
463
|
+
}, Z = ({ config: e, prepared: t }) => {
|
|
464
|
+
let { layoutView: n } = v(), r = h({
|
|
479
465
|
mainPage: e.pages.mainPage,
|
|
480
466
|
subPages: e.pages.subPages,
|
|
481
467
|
activePagePath: t.pagePath,
|
|
482
468
|
node: n
|
|
483
469
|
});
|
|
484
|
-
return !r.hasVisiblePages || r.activePage == null ? /* @__PURE__ */
|
|
470
|
+
return !r.hasVisiblePages || r.activePage == null ? /* @__PURE__ */ C(y, { to: e.routes.list }) : r.activePage.id === t.pageId ? /* @__PURE__ */ C(X, {
|
|
485
471
|
config: t.pageConfig,
|
|
486
472
|
prepared: t
|
|
487
|
-
}) : /* @__PURE__ */
|
|
473
|
+
}) : /* @__PURE__ */ C(y, { to: e.routes.detailPage(t.id, r.activePage.id) });
|
|
488
474
|
};
|
|
489
475
|
//#endregion
|
|
490
|
-
export {
|
|
476
|
+
export { Z as BackofficeEntityDetailPage, Z as default };
|
|
491
477
|
|
|
492
478
|
//# sourceMappingURL=BackofficeEntityDetailPage.js.map
|