@plumile/backoffice-react 0.2.6 → 0.2.8
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/README.md +23 -0
- package/lib/esm/auth/backofficeAuthHeaders.js +2 -9
- package/lib/esm/auth/backofficeAuthHeaders.js.map +1 -1
- package/lib/esm/hooks/useAuthenticatedRouter.js +79 -0
- package/lib/esm/hooks/useAuthenticatedRouter.js.map +1 -0
- package/lib/esm/index.js +26 -24
- package/lib/esm/provider/BackofficeProvider.js +141 -140
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/provider/BackofficeRouterBoundary.js +22 -0
- package/lib/esm/provider/BackofficeRouterBoundary.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +188 -184
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/auth/backofficeAuthHeaders.d.ts +1 -1
- package/lib/types/auth/backofficeAuthHeaders.d.ts.map +1 -1
- package/lib/types/hooks/useAuthenticatedRouter.d.ts +18 -0
- package/lib/types/hooks/useAuthenticatedRouter.d.ts.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/BackofficeRouterBoundary.d.ts +9 -0
- package/lib/types/provider/BackofficeRouterBoundary.d.ts.map +1 -0
- package/lib/types/provider/types.d.ts +2 -1
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +3 -2
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +11 -11
- package/lib/esm/provider/useBackofficeAuthRouteGate.js +0 -39
- package/lib/esm/provider/useBackofficeAuthRouteGate.js.map +0 -1
- package/lib/types/provider/useBackofficeAuthRouteGate.d.ts +0 -2
- package/lib/types/provider/useBackofficeAuthRouteGate.d.ts.map +0 -1
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { buildEntityGroupLookup as e, resolveSidebarGroups as t, resolveSidebarHubEntries as n } from "../components/backoffice/layout/sidebarUtils.js";
|
|
2
2
|
import { validateBackofficeDashboardRegistrations as r } from "../provider/dashboardRegistrations.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
3
|
+
import { BackofficeRouteFallback as i } from "../components/backoffice/routing/BackofficeRouteFallback.js";
|
|
4
|
+
import { BackofficeEntityDetailManifestFallback as a } from "../pages/detail/BackofficeEntityDetailManifestFallback.js";
|
|
5
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
+
import * as s from "react-relay";
|
|
7
|
+
import { BACKOFFICE_LIST_DEFAULTS as c } from "@plumile/backoffice-core/constants.js";
|
|
8
|
+
import { getResourcePage as l } from "@plumile/router/ResourcePage.js";
|
|
9
|
+
import u from "@plumile/router/routing/RouteRedirect.js";
|
|
10
10
|
import { r as d } from "@plumile/router/tools.js";
|
|
11
11
|
//#region src/router/createBackofficeRoutes.tsx
|
|
12
|
-
var { loadQuery: f, usePreloadedQuery: p } =
|
|
13
|
-
let t = a(l);
|
|
14
|
-
return o(() => {
|
|
15
|
-
t?.history.set({ pathname: e });
|
|
16
|
-
}, [e, t]), null;
|
|
17
|
-
}, ie = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ s(t, {
|
|
12
|
+
var { loadQuery: f, usePreloadedQuery: p } = s, m = l("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), h = l("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), g = l("BackofficeEntityListShellPage", async () => import("../pages/BackofficeEntityListShellPage.js")), _ = l("BackofficeEntityListDataPage", async () => import("../pages/BackofficeEntityListDataPage.js")), v = l("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), y = l("BackofficeEntityDetailFramePage", async () => import("../pages/BackofficeEntityDetailFramePage.js")), b = l("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), x = l("BackofficeEntityDetailPageConfigPage", async () => import("../pages/BackofficeEntityDetailPageConfigPage.js")), S = l("BackofficeEntityDetailShellPage", async () => import("../pages/BackofficeEntityDetailShellPage.js")), ee = l("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), C = l("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), w = l("BackofficeDashboardShellPage", async () => import("../pages/BackofficeDashboardShellPage.js")), T = l("BackofficeToolShellPage", async () => import("../pages/BackofficeToolShellPage.js")), E = l("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), D = l("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), O = l("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), k = l("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), A = l("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), j = l("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), te = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ o(t, {
|
|
18
13
|
permissionsQuery: r,
|
|
19
14
|
prepared: n?.permissionsQuery ?? null,
|
|
20
15
|
authStatus: null,
|
|
21
16
|
activeGroupId: i,
|
|
22
17
|
children: e
|
|
23
|
-
}),
|
|
24
|
-
let
|
|
25
|
-
return
|
|
18
|
+
}), M = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: a, authStatusQuery: s, authStatusPrepared: c, loginRedirectPath: l, preparedSegment: d }) => {
|
|
19
|
+
let f = p(s, c);
|
|
20
|
+
return f?.isLoggedIn === !0 ? /* @__PURE__ */ o(t, {
|
|
26
21
|
permissionsQuery: r,
|
|
27
22
|
prepared: n?.permissionsQuery ?? null,
|
|
28
|
-
authStatus:
|
|
29
|
-
activeGroupId:
|
|
23
|
+
authStatus: f,
|
|
24
|
+
activeGroupId: a,
|
|
30
25
|
children: e
|
|
31
|
-
}) : /* @__PURE__ */
|
|
32
|
-
|
|
26
|
+
}) : /* @__PURE__ */ o(u, {
|
|
27
|
+
pathname: l,
|
|
28
|
+
preparedSegment: d,
|
|
29
|
+
fallback: /* @__PURE__ */ o(i, {})
|
|
30
|
+
});
|
|
31
|
+
}, N = (e) => {
|
|
33
32
|
let t = e.trim();
|
|
34
33
|
return t === "" || t === "/" ? "" : t.replace(/^\/+|\/+$/g, "");
|
|
35
|
-
},
|
|
34
|
+
}, P = (e) => {
|
|
36
35
|
let t = e.trim();
|
|
37
36
|
return t === "" ? "/" : `/${t}`.replace(/\/+/g, "/");
|
|
38
|
-
},
|
|
37
|
+
}, F = (e, t) => {
|
|
39
38
|
let n = t.replace(/^\/+|\/+$/g, "");
|
|
40
39
|
return e === "" ? n : n === "" ? e : `${e}/${n}`;
|
|
41
|
-
},
|
|
42
|
-
let n =
|
|
40
|
+
}, I = (e, t) => P(F(e, t)), L = (e) => e.trim().replace(/^\/+|\/+$/g, ""), R = (e, t) => {
|
|
41
|
+
let n = P(e), r = t === "" ? "" : `/${t}`;
|
|
43
42
|
return r !== "" && n.startsWith(r) ? n.slice(r.length).replace(/^\/+/, "") : n.replace(/^\/+/, "");
|
|
44
|
-
},
|
|
43
|
+
}, z = (e, t) => {
|
|
45
44
|
if (e?.routes == null) return null;
|
|
46
45
|
for (let n = e.routes.length - 1; n >= 0; --n) {
|
|
47
46
|
let r = e.routes[n];
|
|
@@ -51,53 +50,53 @@ var { loadQuery: f, usePreloadedQuery: p } = c, m = u("BackofficeLayoutPage", as
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
return null;
|
|
54
|
-
},
|
|
55
|
-
let n =
|
|
56
|
-
return e.detailPages?.find((e) =>
|
|
57
|
-
},
|
|
58
|
-
function
|
|
59
|
-
let { basePath:
|
|
53
|
+
}, B = (e, t) => {
|
|
54
|
+
let n = L(t);
|
|
55
|
+
return e.detailPages?.find((e) => L(e.pathSegment) === n) ?? null;
|
|
56
|
+
}, V = (e, t) => B(e, t)?.id ?? t, H = d;
|
|
57
|
+
function U(s) {
|
|
58
|
+
let { basePath: l, entityManifest: d, entityRegistry: p, sidebar: P, auth: L, dashboard: B } = s, U = r(s.dashboards), W = N(l), ne = F(W, "login"), re = F(W, "login/reset"), ie = F(W, "login/reset/complete"), ae = F(W, "verify-email"), oe = F(W, "accept-invitation"), se = I(W, "login"), G = t(d, P), ce = n(G, P), le = e(G, P), K = /* @__PURE__ */ new Map();
|
|
60
59
|
le.forEach((e, t) => {
|
|
61
|
-
|
|
60
|
+
K.set(t, e.groupId);
|
|
62
61
|
});
|
|
63
|
-
let
|
|
64
|
-
let t = await
|
|
62
|
+
let q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = P?.permissionsQuery, ue = async ({ context: e }) => {
|
|
63
|
+
let t = await L.session.load();
|
|
65
64
|
return {
|
|
66
|
-
permissionsQuery:
|
|
65
|
+
permissionsQuery: Y == null ? null : f(e.relayEnvironment, Y, {}),
|
|
67
66
|
authStatusQuery: t.authStatusQuery == null ? null : f(e.relayEnvironment, t.authStatusQuery, {}, { fetchPolicy: "network-only" })
|
|
68
67
|
};
|
|
69
|
-
},
|
|
68
|
+
}, X = async () => B == null ? null : {
|
|
70
69
|
dashboardId: "dashboard",
|
|
71
|
-
config: await
|
|
72
|
-
},
|
|
70
|
+
config: await B.load()
|
|
71
|
+
}, de = () => B == null ? null : { dashboardId: "dashboard" }, Z = ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e }), Q = ({ children: e, prepared: t, Component: n }) => n == null ? null : /* @__PURE__ */ o(n, {
|
|
73
72
|
prepared: t,
|
|
74
73
|
children: e
|
|
75
|
-
}),
|
|
74
|
+
}), fe = H({
|
|
76
75
|
path: "",
|
|
77
|
-
resourcePage:
|
|
78
|
-
prepare:
|
|
76
|
+
resourcePage: w,
|
|
77
|
+
prepare: de,
|
|
79
78
|
render: Q,
|
|
80
|
-
children: [
|
|
79
|
+
children: [H({
|
|
81
80
|
path: "",
|
|
82
|
-
resourcePage:
|
|
83
|
-
prepare:
|
|
81
|
+
resourcePage: C,
|
|
82
|
+
prepare: X,
|
|
84
83
|
render: Z
|
|
85
84
|
})]
|
|
86
|
-
}),
|
|
85
|
+
}), pe = H({
|
|
87
86
|
path: "dashboard",
|
|
88
|
-
resourcePage:
|
|
89
|
-
prepare:
|
|
87
|
+
resourcePage: w,
|
|
88
|
+
prepare: de,
|
|
90
89
|
render: Q,
|
|
91
|
-
children: [
|
|
90
|
+
children: [H({
|
|
92
91
|
path: "",
|
|
93
|
-
resourcePage:
|
|
94
|
-
prepare:
|
|
92
|
+
resourcePage: C,
|
|
93
|
+
prepare: X,
|
|
95
94
|
render: Z
|
|
96
95
|
})]
|
|
97
|
-
}),
|
|
98
|
-
let t =
|
|
96
|
+
}), me = U.map((e) => {
|
|
97
|
+
let t = H({
|
|
99
98
|
path: "",
|
|
100
|
-
resourcePage:
|
|
99
|
+
resourcePage: C,
|
|
101
100
|
prepare: async () => {
|
|
102
101
|
let t = await e.module.load();
|
|
103
102
|
return {
|
|
@@ -108,9 +107,9 @@ function H(a) {
|
|
|
108
107
|
},
|
|
109
108
|
render: Z
|
|
110
109
|
});
|
|
111
|
-
return
|
|
110
|
+
return H({
|
|
112
111
|
path: `dashboard/${e.id}`,
|
|
113
|
-
resourcePage:
|
|
112
|
+
resourcePage: w,
|
|
114
113
|
prepare: () => ({
|
|
115
114
|
dashboardId: e.id,
|
|
116
115
|
label: e.label
|
|
@@ -118,61 +117,61 @@ function H(a) {
|
|
|
118
117
|
render: Q,
|
|
119
118
|
children: [t]
|
|
120
119
|
});
|
|
121
|
-
}),
|
|
122
|
-
let t =
|
|
123
|
-
path:
|
|
124
|
-
resourcePage:
|
|
120
|
+
}), he = Object.values(d).filter((e) => e.kind === "list-detail"), ge = ce.map((e) => {
|
|
121
|
+
let t = H({
|
|
122
|
+
path: R(e.hub.href, W),
|
|
123
|
+
resourcePage: E,
|
|
125
124
|
prepare: () => ({
|
|
126
125
|
hubId: e.hub.id,
|
|
127
126
|
hub: e.hub
|
|
128
127
|
}),
|
|
129
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
128
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
130
129
|
});
|
|
131
|
-
return e.groupId != null &&
|
|
132
|
-
}),
|
|
133
|
-
let t = e.routes.list, n =
|
|
134
|
-
let n = String(t?.params.id ?? ""), r = typeof t?.params.pagePath == "string" ? t.params.pagePath : null,
|
|
135
|
-
return /* @__PURE__ */
|
|
130
|
+
return e.groupId != null && J.set(t, e.groupId), t;
|
|
131
|
+
}), _e = he.map((e) => {
|
|
132
|
+
let t = e.routes.list, n = R(t, W), r = [], s = ({ match: t }) => {
|
|
133
|
+
let n = String(t?.params.id ?? ""), r = typeof t?.params.pagePath == "string" ? t.params.pagePath : null, i = r == null ? e.defaultDetailPageId : V(e, r);
|
|
134
|
+
return /* @__PURE__ */ o(a, {
|
|
136
135
|
entityManifest: e,
|
|
137
136
|
id: n,
|
|
138
|
-
pageId:
|
|
137
|
+
pageId: i,
|
|
139
138
|
pagePath: r
|
|
140
139
|
});
|
|
141
140
|
};
|
|
142
141
|
if (e.hasList) {
|
|
143
|
-
let t =
|
|
142
|
+
let t = H({
|
|
144
143
|
path: "",
|
|
145
144
|
querySchema: e.listNavigation.querySchema,
|
|
146
145
|
resourcePage: _,
|
|
147
146
|
prepareSearchBehavior: "path",
|
|
148
147
|
prepare: async ({ context: t, filters: n, query: r }) => {
|
|
149
|
-
let { config: i } = await
|
|
148
|
+
let { config: i } = await p.loadListEntity(e.id), { list: a } = i, { defaults: o } = e.listNavigation, s = {};
|
|
150
149
|
typeof r.sort == "string" && (s.sort = r.sort);
|
|
151
|
-
let
|
|
152
|
-
filters:
|
|
150
|
+
let l = n, u = e.listNavigation.decode({
|
|
151
|
+
filters: l,
|
|
153
152
|
query: s
|
|
154
|
-
}), { pageSize: d } =
|
|
153
|
+
}), { pageSize: d } = c, m = {
|
|
155
154
|
where: u.where,
|
|
156
155
|
sort: u.sort ?? o.sort,
|
|
157
156
|
count: d,
|
|
158
157
|
cursor: null
|
|
159
|
-
},
|
|
158
|
+
}, h = a.buildQueryVariables(m), g = f(t.relayEnvironment, a.query, h);
|
|
160
159
|
return {
|
|
161
160
|
entityId: e.id,
|
|
162
161
|
entityManifest: e,
|
|
163
162
|
entityConfig: i,
|
|
164
|
-
query:
|
|
163
|
+
query: g
|
|
165
164
|
};
|
|
166
165
|
},
|
|
167
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
166
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
168
167
|
});
|
|
169
|
-
|
|
170
|
-
let n =
|
|
168
|
+
q.set(t, e.id);
|
|
169
|
+
let n = H({
|
|
171
170
|
path: "",
|
|
172
171
|
resourcePage: h,
|
|
173
172
|
prepareSearchBehavior: "path",
|
|
174
173
|
prepare: async () => {
|
|
175
|
-
let { config: t } = await
|
|
174
|
+
let { config: t } = await p.loadListEntity(e.id);
|
|
176
175
|
return {
|
|
177
176
|
entityId: e.id,
|
|
178
177
|
entityManifest: e,
|
|
@@ -182,7 +181,7 @@ function H(a) {
|
|
|
182
181
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
183
182
|
if (n == null) return null;
|
|
184
183
|
let r = t;
|
|
185
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ o(n, {
|
|
186
185
|
entityManifest: r.entityManifest,
|
|
187
186
|
config: r.entityConfig,
|
|
188
187
|
prepared: r,
|
|
@@ -191,8 +190,8 @@ function H(a) {
|
|
|
191
190
|
},
|
|
192
191
|
children: [t]
|
|
193
192
|
});
|
|
194
|
-
|
|
195
|
-
let i =
|
|
193
|
+
q.set(n, e.id);
|
|
194
|
+
let i = H({
|
|
196
195
|
path: "",
|
|
197
196
|
resourcePage: g,
|
|
198
197
|
prepareSearchBehavior: "path",
|
|
@@ -203,7 +202,7 @@ function H(a) {
|
|
|
203
202
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
204
203
|
if (n == null) return null;
|
|
205
204
|
let r = t;
|
|
206
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ o(n, {
|
|
207
206
|
entityManifest: r.entityManifest,
|
|
208
207
|
prepared: r,
|
|
209
208
|
children: e
|
|
@@ -211,16 +210,16 @@ function H(a) {
|
|
|
211
210
|
},
|
|
212
211
|
children: [n]
|
|
213
212
|
});
|
|
214
|
-
|
|
213
|
+
q.set(i, e.id), r.push(i);
|
|
215
214
|
}
|
|
216
|
-
let
|
|
217
|
-
let n =
|
|
215
|
+
let l = e.detailPages.map((t) => {
|
|
216
|
+
let n = H({
|
|
218
217
|
path: "",
|
|
219
218
|
resourcePage: v,
|
|
220
219
|
suspenseBoundary: "segment",
|
|
221
|
-
fallback:
|
|
220
|
+
fallback: s,
|
|
222
221
|
prepare: async ({ context: n, variables: r }) => {
|
|
223
|
-
let i = String(r.id ?? ""), a = await
|
|
222
|
+
let i = String(r.id ?? ""), a = await p.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s = f(n.relayEnvironment, a.config.page.query, o.variables);
|
|
224
223
|
return {
|
|
225
224
|
entityId: e.id,
|
|
226
225
|
entityManifest: e,
|
|
@@ -232,16 +231,16 @@ function H(a) {
|
|
|
232
231
|
pagePath: t.pathSegment
|
|
233
232
|
};
|
|
234
233
|
},
|
|
235
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
234
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
236
235
|
});
|
|
237
|
-
|
|
238
|
-
let r =
|
|
236
|
+
q.set(n, e.id);
|
|
237
|
+
let r = H({
|
|
239
238
|
path: t.pathSegment,
|
|
240
239
|
resourcePage: x,
|
|
241
240
|
suspenseBoundary: "segment",
|
|
242
|
-
fallback:
|
|
241
|
+
fallback: s,
|
|
243
242
|
prepare: async ({ variables: n }) => {
|
|
244
|
-
let r = String(n.id ?? ""), [i, a] = await Promise.all([
|
|
243
|
+
let r = String(n.id ?? ""), [i, a] = await Promise.all([p.loadDetailPageEntity(e.id, t.id), p.loadDetailLayoutEntity(e.id)]);
|
|
245
244
|
return {
|
|
246
245
|
entityId: e.id,
|
|
247
246
|
entityManifest: e,
|
|
@@ -255,7 +254,7 @@ function H(a) {
|
|
|
255
254
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
256
255
|
if (n == null) return null;
|
|
257
256
|
let r = t;
|
|
258
|
-
return /* @__PURE__ */
|
|
257
|
+
return /* @__PURE__ */ o(n, {
|
|
259
258
|
config: r.entityConfig,
|
|
260
259
|
prepared: r,
|
|
261
260
|
children: e
|
|
@@ -263,14 +262,14 @@ function H(a) {
|
|
|
263
262
|
},
|
|
264
263
|
children: [n]
|
|
265
264
|
});
|
|
266
|
-
return
|
|
267
|
-
}),
|
|
265
|
+
return q.set(r, e.id), r;
|
|
266
|
+
}), d = H({
|
|
268
267
|
path: "",
|
|
269
268
|
resourcePage: b,
|
|
270
269
|
suspenseBoundary: "segment",
|
|
271
|
-
fallback:
|
|
270
|
+
fallback: s,
|
|
272
271
|
prepare: async ({ context: t, variables: n }) => {
|
|
273
|
-
let { config: r } = await
|
|
272
|
+
let { config: r } = await p.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o = f(t.relayEnvironment, r.layoutPage.query, a.variables);
|
|
274
273
|
return {
|
|
275
274
|
entityId: e.id,
|
|
276
275
|
entityManifest: e,
|
|
@@ -282,7 +281,7 @@ function H(a) {
|
|
|
282
281
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
283
282
|
if (n == null) return null;
|
|
284
283
|
let r = t;
|
|
285
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ o(n, {
|
|
286
285
|
entityManifest: r.entityManifest,
|
|
287
286
|
config: r.entityConfig,
|
|
288
287
|
prepared: r,
|
|
@@ -290,25 +289,29 @@ function H(a) {
|
|
|
290
289
|
});
|
|
291
290
|
},
|
|
292
291
|
children: [
|
|
293
|
-
|
|
292
|
+
H({
|
|
294
293
|
path: "",
|
|
295
294
|
prepare: ({ variables: t }) => {
|
|
296
295
|
let n = String(t.id ?? "").trim();
|
|
297
296
|
return { redirectTo: n === "" ? null : e.routes.detailPage(n, e.defaultDetailPageId) };
|
|
298
297
|
},
|
|
299
|
-
render: ({ prepared: e }) => {
|
|
300
|
-
let
|
|
301
|
-
return
|
|
298
|
+
render: ({ prepared: e, preparedSegment: t }) => {
|
|
299
|
+
let n = e.redirectTo ?? null;
|
|
300
|
+
return n == null ? null : /* @__PURE__ */ o(u, {
|
|
301
|
+
pathname: n,
|
|
302
|
+
preparedSegment: t,
|
|
303
|
+
fallback: /* @__PURE__ */ o(i, {})
|
|
304
|
+
});
|
|
302
305
|
}
|
|
303
306
|
}),
|
|
304
|
-
...
|
|
305
|
-
|
|
307
|
+
...l,
|
|
308
|
+
H({
|
|
306
309
|
path: ":pagePath",
|
|
307
|
-
resourcePage:
|
|
310
|
+
resourcePage: ee,
|
|
308
311
|
suspenseBoundary: "segment",
|
|
309
|
-
fallback:
|
|
312
|
+
fallback: s,
|
|
310
313
|
prepare: async ({ variables: t }) => {
|
|
311
|
-
let n = await
|
|
314
|
+
let n = await p.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
|
|
312
315
|
return {
|
|
313
316
|
entityId: e.id,
|
|
314
317
|
entityManifest: e,
|
|
@@ -320,7 +323,7 @@ function H(a) {
|
|
|
320
323
|
render: ({ prepared: e, Component: t }) => {
|
|
321
324
|
if (t == null) return null;
|
|
322
325
|
let n = e;
|
|
323
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ o(t, {
|
|
324
327
|
entityManifest: n.entityManifest,
|
|
325
328
|
config: n.entityConfig,
|
|
326
329
|
prepared: n
|
|
@@ -329,14 +332,14 @@ function H(a) {
|
|
|
329
332
|
})
|
|
330
333
|
]
|
|
331
334
|
});
|
|
332
|
-
|
|
333
|
-
let
|
|
335
|
+
q.set(d, e.id);
|
|
336
|
+
let m = H({
|
|
334
337
|
path: "",
|
|
335
338
|
resourcePage: S,
|
|
336
339
|
suspenseBoundary: "segment",
|
|
337
|
-
fallback:
|
|
340
|
+
fallback: s,
|
|
338
341
|
prepare: ({ variables: t }) => {
|
|
339
|
-
let n = String(t.id ?? ""), r = typeof t.pagePath == "string" ? t.pagePath : null, i = r == null ? e.defaultDetailPageId :
|
|
342
|
+
let n = String(t.id ?? ""), r = typeof t.pagePath == "string" ? t.pagePath : null, i = r == null ? e.defaultDetailPageId : V(e, r);
|
|
340
343
|
return {
|
|
341
344
|
entityId: e.id,
|
|
342
345
|
entityManifest: e,
|
|
@@ -348,20 +351,20 @@ function H(a) {
|
|
|
348
351
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
349
352
|
if (n == null) return null;
|
|
350
353
|
let r = t;
|
|
351
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ o(n, {
|
|
352
355
|
entityManifest: r.entityManifest,
|
|
353
356
|
prepared: r,
|
|
354
357
|
children: e
|
|
355
358
|
});
|
|
356
359
|
},
|
|
357
|
-
children: [
|
|
360
|
+
children: [d]
|
|
358
361
|
});
|
|
359
|
-
|
|
360
|
-
let
|
|
362
|
+
q.set(m, e.id);
|
|
363
|
+
let C = H({
|
|
361
364
|
path: ":id",
|
|
362
365
|
resourcePage: y,
|
|
363
366
|
suspenseBoundary: "segment",
|
|
364
|
-
fallback:
|
|
367
|
+
fallback: s,
|
|
365
368
|
prepare: ({ variables: t }) => {
|
|
366
369
|
let n = String(t.id ?? "");
|
|
367
370
|
return {
|
|
@@ -373,25 +376,25 @@ function H(a) {
|
|
|
373
376
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
374
377
|
if (n == null) return null;
|
|
375
378
|
let r = t;
|
|
376
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ o(n, {
|
|
377
380
|
entityManifest: r.entityManifest,
|
|
378
381
|
prepared: r,
|
|
379
382
|
children: e
|
|
380
383
|
});
|
|
381
384
|
},
|
|
382
|
-
children: [
|
|
385
|
+
children: [m]
|
|
383
386
|
});
|
|
384
|
-
return
|
|
387
|
+
return q.set(C, e.id), r.push(C), H({
|
|
385
388
|
path: n,
|
|
386
389
|
children: r,
|
|
387
390
|
suspenseBoundary: "segment"
|
|
388
391
|
});
|
|
389
|
-
}),
|
|
390
|
-
let t =
|
|
392
|
+
}), ve = Object.values(d).filter((e) => e.kind === "tool").map((e) => {
|
|
393
|
+
let t = R(e.routes.list, W), n = H({
|
|
391
394
|
path: "",
|
|
392
|
-
resourcePage:
|
|
395
|
+
resourcePage: s.toolsOperationPage ?? null,
|
|
393
396
|
prepare: async () => {
|
|
394
|
-
let t = await
|
|
397
|
+
let t = await p.loadToolEntity(e.id);
|
|
395
398
|
return {
|
|
396
399
|
entityId: e.id,
|
|
397
400
|
entityManifest: e,
|
|
@@ -401,17 +404,17 @@ function H(a) {
|
|
|
401
404
|
render: ({ prepared: e, Component: t }) => {
|
|
402
405
|
if (t == null) return null;
|
|
403
406
|
let n = e;
|
|
404
|
-
return /* @__PURE__ */
|
|
407
|
+
return /* @__PURE__ */ o(t, {
|
|
405
408
|
entityManifest: n.entityManifest,
|
|
406
409
|
operation: n.entityConfig.tool.operation,
|
|
407
410
|
toolId: n.entityConfig.id
|
|
408
411
|
});
|
|
409
412
|
}
|
|
410
413
|
});
|
|
411
|
-
|
|
412
|
-
let r =
|
|
414
|
+
q.set(n, e.id);
|
|
415
|
+
let r = H({
|
|
413
416
|
path: t,
|
|
414
|
-
resourcePage:
|
|
417
|
+
resourcePage: T,
|
|
415
418
|
prepare: () => ({
|
|
416
419
|
entityId: e.id,
|
|
417
420
|
entityManifest: e
|
|
@@ -419,7 +422,7 @@ function H(a) {
|
|
|
419
422
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
420
423
|
if (n == null) return null;
|
|
421
424
|
let r = t;
|
|
422
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ o(n, {
|
|
423
426
|
entityManifest: r.entityManifest,
|
|
424
427
|
prepared: r,
|
|
425
428
|
children: e
|
|
@@ -427,90 +430,91 @@ function H(a) {
|
|
|
427
430
|
},
|
|
428
431
|
children: [n]
|
|
429
432
|
});
|
|
430
|
-
return
|
|
431
|
-
}),
|
|
432
|
-
path:
|
|
433
|
+
return q.set(r, e.id), r;
|
|
434
|
+
}), ye = H({
|
|
435
|
+
path: W,
|
|
433
436
|
resourcePage: m,
|
|
434
437
|
prepareSearchBehavior: "path",
|
|
435
438
|
suspenseBoundary: "segment",
|
|
436
439
|
prepare: ue,
|
|
437
|
-
render: ({ children: e, prepared: t, route: n, Component: r }) => {
|
|
440
|
+
render: ({ children: e, prepared: t, route: n, Component: r, preparedSegment: i }) => {
|
|
438
441
|
if (r == null) return null;
|
|
439
|
-
let
|
|
440
|
-
return
|
|
441
|
-
Component:
|
|
442
|
-
preparedLayout:
|
|
443
|
-
permissionsQuery:
|
|
444
|
-
activeGroupId:
|
|
445
|
-
authStatusQuery:
|
|
446
|
-
authStatusPrepared:
|
|
442
|
+
let a = t, s = z(n, q), c = s == null ? z(n, J) : K.get(s) ?? null, l = r, u = L.session.get()?.authStatusQuery ?? null;
|
|
443
|
+
return u != null && a?.authStatusQuery != null ? /* @__PURE__ */ o(M, {
|
|
444
|
+
Component: l,
|
|
445
|
+
preparedLayout: a,
|
|
446
|
+
permissionsQuery: P?.permissionsQuery,
|
|
447
|
+
activeGroupId: c,
|
|
448
|
+
authStatusQuery: u,
|
|
449
|
+
authStatusPrepared: a.authStatusQuery,
|
|
447
450
|
loginRedirectPath: se,
|
|
451
|
+
preparedSegment: i,
|
|
448
452
|
children: e
|
|
449
|
-
}) : /* @__PURE__ */
|
|
450
|
-
Component:
|
|
451
|
-
preparedLayout:
|
|
452
|
-
permissionsQuery:
|
|
453
|
-
activeGroupId:
|
|
453
|
+
}) : /* @__PURE__ */ o(te, {
|
|
454
|
+
Component: l,
|
|
455
|
+
preparedLayout: a,
|
|
456
|
+
permissionsQuery: P?.permissionsQuery,
|
|
457
|
+
activeGroupId: c,
|
|
454
458
|
children: e
|
|
455
459
|
});
|
|
456
460
|
},
|
|
457
461
|
children: [
|
|
458
|
-
|
|
459
|
-
...he,
|
|
462
|
+
fe,
|
|
460
463
|
...ge,
|
|
461
464
|
..._e,
|
|
462
|
-
...
|
|
463
|
-
|
|
465
|
+
...ve,
|
|
466
|
+
...me,
|
|
467
|
+
pe
|
|
464
468
|
]
|
|
465
469
|
}), $ = [
|
|
466
|
-
|
|
467
|
-
path:
|
|
468
|
-
resourcePage:
|
|
470
|
+
H({
|
|
471
|
+
path: ne,
|
|
472
|
+
resourcePage: D,
|
|
469
473
|
prepare: async ({ context: e }) => {
|
|
470
|
-
let t = await
|
|
474
|
+
let t = await L.login.load();
|
|
471
475
|
return { query: f(e.relayEnvironment, t.loginQuery, {}) };
|
|
472
476
|
},
|
|
473
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
477
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
474
478
|
}),
|
|
475
|
-
|
|
476
|
-
path:
|
|
477
|
-
resourcePage:
|
|
478
|
-
prepare: async () => (await
|
|
479
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
479
|
+
H({
|
|
480
|
+
path: re,
|
|
481
|
+
resourcePage: O,
|
|
482
|
+
prepare: async () => (await L.passwordResetRequest.load(), null),
|
|
483
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
480
484
|
}),
|
|
481
|
-
|
|
482
|
-
path:
|
|
483
|
-
resourcePage:
|
|
484
|
-
prepare: async () => (await
|
|
485
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
485
|
+
H({
|
|
486
|
+
path: ie,
|
|
487
|
+
resourcePage: k,
|
|
488
|
+
prepare: async () => (await L.passwordResetComplete.load(), null),
|
|
489
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
486
490
|
}),
|
|
487
|
-
|
|
491
|
+
H({
|
|
488
492
|
path: ae,
|
|
489
|
-
resourcePage:
|
|
490
|
-
prepare: async () => (await
|
|
491
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
493
|
+
resourcePage: A,
|
|
494
|
+
prepare: async () => (await L.verifyEmail.load(), null),
|
|
495
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
492
496
|
})
|
|
493
497
|
];
|
|
494
|
-
return (
|
|
498
|
+
return (L.hasAcceptInvitation === !0 || L.acceptInvitation != null) && $.push(H({
|
|
495
499
|
path: oe,
|
|
496
|
-
resourcePage:
|
|
497
|
-
prepare: async () => (await
|
|
498
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
499
|
-
})), $.push(
|
|
500
|
+
resourcePage: j,
|
|
501
|
+
prepare: async () => (await L.acceptInvitation?.load(), null),
|
|
502
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
503
|
+
})), $.push(ye), $;
|
|
500
504
|
}
|
|
501
|
-
var
|
|
502
|
-
normalizeBaseSegment:
|
|
503
|
-
normalizePath:
|
|
504
|
-
buildScopedPath:
|
|
505
|
-
buildScopedAbsolutePath:
|
|
506
|
-
buildRelativePath:
|
|
507
|
-
resolveActiveEntityIdFromRoute:
|
|
508
|
-
resolveDetailPageIdForPath:
|
|
509
|
-
resolveDetailPageManifestByPath:
|
|
505
|
+
var W = {
|
|
506
|
+
normalizeBaseSegment: N,
|
|
507
|
+
normalizePath: P,
|
|
508
|
+
buildScopedPath: F,
|
|
509
|
+
buildScopedAbsolutePath: I,
|
|
510
|
+
buildRelativePath: R,
|
|
511
|
+
resolveActiveEntityIdFromRoute: z,
|
|
512
|
+
resolveDetailPageIdForPath: V,
|
|
513
|
+
resolveDetailPageManifestByPath: B,
|
|
510
514
|
validateBackofficeDashboardRegistrations: r,
|
|
511
|
-
BackofficeLayoutRouteWithAuthStatus:
|
|
515
|
+
BackofficeLayoutRouteWithAuthStatus: M
|
|
512
516
|
};
|
|
513
517
|
//#endregion
|
|
514
|
-
export {
|
|
518
|
+
export { j as BackofficeAcceptInvitationPageResource, C as BackofficeDashboardPageResource, w as BackofficeDashboardShellPageResource, y as BackofficeEntityDetailFramePageResource, b as BackofficeEntityDetailLayoutPageResource, x as BackofficeEntityDetailPageConfigPageResource, v as BackofficeEntityDetailPageResource, S as BackofficeEntityDetailShellPageResource, ee as BackofficeEntityDetailUnknownPageRedirectResource, _ as BackofficeEntityListDataPageResource, h as BackofficeEntityListPageResource, g as BackofficeEntityListShellPageResource, E as BackofficeHubPageResource, m as BackofficeLayoutPageResource, D as BackofficeLoginPageResource, k as BackofficePasswordResetCompletePageResource, O as BackofficePasswordResetRequestPageResource, T as BackofficeToolShellPageResource, A as BackofficeVerifyEmailPageResource, W as __test, U as createBackofficeRoutes, U as default };
|
|
515
519
|
|
|
516
520
|
//# sourceMappingURL=createBackofficeRoutes.js.map
|