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