@plumile/backoffice-react 0.1.150 → 0.1.152
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 +1 -0
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +192 -144
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +0 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -0
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +0 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +0 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +73 -244
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js +193 -0
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +8 -10
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +130 -133
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js +10 -9
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +5 -5
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeRedirect.js +13 -0
- package/lib/esm/pages/BackofficeRedirect.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +100 -97
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts +9 -0
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailUnknownPageRedirect.d.ts.map +1 -1
- package/lib/types/pages/BackofficeRedirect.d.ts +7 -0
- package/lib/types/pages/BackofficeRedirect.d.ts.map +1 -0
- package/lib/types/router/createBackofficeRoutes.d.ts +3 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -5,43 +5,42 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
5
5
|
import * as s from "react-relay";
|
|
6
6
|
import c from "@plumile/router/routing/RoutingContext.js";
|
|
7
7
|
import { BACKOFFICE_LIST_DEFAULTS as l } from "@plumile/backoffice-core/constants.js";
|
|
8
|
-
import u from "@plumile/router/
|
|
9
|
-
import {
|
|
10
|
-
import { r as f } from "@plumile/router/tools.js";
|
|
8
|
+
import { getResourcePage as u } from "@plumile/router/ResourcePage.js";
|
|
9
|
+
import { r as d } from "@plumile/router/tools.js";
|
|
11
10
|
//#region src/router/createBackofficeRoutes.tsx
|
|
12
|
-
var { loadQuery:
|
|
11
|
+
var { loadQuery: f, usePreloadedQuery: p } = s, m = u("WrapperPage", async () => ({ default: (await import("@plumile/ui/pages/WrapperPage.js")).WrapperPage })), h = u("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), g = u("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), _ = u("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), v = u("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), y = u("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), b = u("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), x = u("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), S = u("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), C = u("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), w = u("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), T = u("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), E = u("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), D = ({ pathname: e }) => {
|
|
13
12
|
let t = i(c);
|
|
14
13
|
return a(() => {
|
|
15
14
|
t?.history.set({ pathname: e });
|
|
16
15
|
}, [e, t]), null;
|
|
17
|
-
},
|
|
16
|
+
}, ee = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ o(t, {
|
|
18
17
|
permissionsQuery: r,
|
|
19
18
|
prepared: n?.permissionsQuery ?? null,
|
|
20
19
|
authStatus: null,
|
|
21
20
|
activeGroupId: i,
|
|
22
21
|
children: e
|
|
23
|
-
}),
|
|
24
|
-
let l =
|
|
22
|
+
}), O = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i, authStatusQuery: a, authStatusPrepared: s, loginRedirectPath: c }) => {
|
|
23
|
+
let l = p(a, s);
|
|
25
24
|
return l?.isLoggedIn === !0 ? /* @__PURE__ */ o(t, {
|
|
26
25
|
permissionsQuery: r,
|
|
27
26
|
prepared: n?.permissionsQuery ?? null,
|
|
28
27
|
authStatus: l,
|
|
29
28
|
activeGroupId: i,
|
|
30
29
|
children: e
|
|
31
|
-
}) : /* @__PURE__ */ o(
|
|
32
|
-
},
|
|
30
|
+
}) : /* @__PURE__ */ o(D, { pathname: c });
|
|
31
|
+
}, k = (e) => {
|
|
33
32
|
let t = e.trim();
|
|
34
33
|
return t === "" || t === "/" ? "" : t.replace(/^\/+|\/+$/g, "");
|
|
35
|
-
},
|
|
34
|
+
}, A = (e) => {
|
|
36
35
|
let t = e.trim();
|
|
37
36
|
return t === "" ? "/" : `/${t}`.replace(/\/+/g, "/");
|
|
38
|
-
},
|
|
37
|
+
}, j = (e, t) => {
|
|
39
38
|
let n = t.replace(/^\/+|\/+$/g, "");
|
|
40
39
|
return e === "" ? n : n === "" ? e : `${e}/${n}`;
|
|
41
|
-
},
|
|
42
|
-
let n =
|
|
40
|
+
}, M = (e, t) => A(j(e, t)), N = (e) => e.trim().replace(/^\/+|\/+$/g, ""), P = (e, t) => {
|
|
41
|
+
let n = A(e), r = t === "" ? "" : `/${t}`;
|
|
43
42
|
return r !== "" && n.startsWith(r) ? n.slice(r.length).replace(/^\/+/, "") : n.replace(/^\/+/, "");
|
|
44
|
-
},
|
|
43
|
+
}, F = (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,7 +50,7 @@ var { loadQuery: p, usePreloadedQuery: m } = s, h = d("WrapperPage", async () =>
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
return null;
|
|
54
|
-
},
|
|
53
|
+
}, I = (e) => {
|
|
55
54
|
let t = new URLSearchParams();
|
|
56
55
|
return Object.entries(e).forEach(([e, n]) => {
|
|
57
56
|
if (n != null) {
|
|
@@ -64,34 +63,37 @@ var { loadQuery: p, usePreloadedQuery: m } = s, h = d("WrapperPage", async () =>
|
|
|
64
63
|
t.set(e, String(n));
|
|
65
64
|
}
|
|
66
65
|
}), t;
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
}, L = (e, t) => {
|
|
67
|
+
let n = N(t);
|
|
68
|
+
return e.detailPages?.find((e) => N(e.pathSegment) === n) ?? null;
|
|
69
|
+
}, R = (e, t) => L(e, t)?.id ?? t, z = d;
|
|
70
|
+
function B(i) {
|
|
71
|
+
let { basePath: a, entityManifest: s, entityRegistry: c, sidebar: u, auth: d, dashboard: p } = i, A = r(i.dashboards), N = k(a), L = j(N, "login"), R = j(N, "login/reset"), B = j(N, "login/reset/complete"), V = j(N, "verify-email"), te = j(N, "accept-invitation"), ne = M(N, "login"), H = t(s, u), U = n(H, u), W = e(H, u), G = /* @__PURE__ */ new Map();
|
|
72
|
+
W.forEach((e, t) => {
|
|
71
73
|
G.set(t, e.groupId);
|
|
72
74
|
});
|
|
73
|
-
let K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J =
|
|
74
|
-
let t = await
|
|
75
|
+
let K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J = u?.permissionsQuery, Y = async ({ context: e }) => {
|
|
76
|
+
let t = await d.session.load();
|
|
75
77
|
return {
|
|
76
|
-
permissionsQuery: J == null ? null :
|
|
77
|
-
authStatusQuery: t.authStatusQuery == null ? null :
|
|
78
|
+
permissionsQuery: J == null ? null : f(e.relayEnvironment, J, {}),
|
|
79
|
+
authStatusQuery: t.authStatusQuery == null ? null : f(e.relayEnvironment, t.authStatusQuery, {}, { fetchPolicy: "network-only" })
|
|
78
80
|
};
|
|
79
|
-
}, X = async () =>
|
|
81
|
+
}, X = async () => p == null ? null : {
|
|
80
82
|
dashboardId: "dashboard",
|
|
81
|
-
config: await
|
|
82
|
-
}, Z = ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e }), re =
|
|
83
|
+
config: await p.load()
|
|
84
|
+
}, Z = ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e }), re = z({
|
|
83
85
|
path: "",
|
|
84
|
-
resourcePage:
|
|
86
|
+
resourcePage: b,
|
|
85
87
|
prepare: X,
|
|
86
88
|
render: Z
|
|
87
|
-
}), ie =
|
|
89
|
+
}), ie = z({
|
|
88
90
|
path: "dashboard",
|
|
89
|
-
resourcePage:
|
|
91
|
+
resourcePage: b,
|
|
90
92
|
prepare: X,
|
|
91
93
|
render: Z
|
|
92
|
-
}),
|
|
94
|
+
}), ae = A.map((e) => z({
|
|
93
95
|
path: `dashboard/${e.id}`,
|
|
94
|
-
resourcePage:
|
|
96
|
+
resourcePage: b,
|
|
95
97
|
prepare: async () => {
|
|
96
98
|
let t = await e.module.load();
|
|
97
99
|
return {
|
|
@@ -100,10 +102,10 @@ function z(i) {
|
|
|
100
102
|
};
|
|
101
103
|
},
|
|
102
104
|
render: Z
|
|
103
|
-
})),
|
|
104
|
-
let t =
|
|
105
|
-
path:
|
|
106
|
-
resourcePage:
|
|
105
|
+
})), Q = Object.values(s).filter((e) => e.kind === "list-detail"), oe = U.map((e) => {
|
|
106
|
+
let t = z({
|
|
107
|
+
path: P(e.hub.href, N),
|
|
108
|
+
resourcePage: x,
|
|
107
109
|
prepare: () => ({
|
|
108
110
|
hubId: e.hub.id,
|
|
109
111
|
hub: e.hub
|
|
@@ -111,22 +113,22 @@ function z(i) {
|
|
|
111
113
|
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
112
114
|
});
|
|
113
115
|
return e.groupId != null && q.set(t, e.groupId), t;
|
|
114
|
-
}), se =
|
|
115
|
-
let t = e.routes.list, n =
|
|
116
|
+
}), se = Q.map((e) => {
|
|
117
|
+
let t = e.routes.list, n = P(t, N), r = [];
|
|
116
118
|
if (e.hasList) {
|
|
117
|
-
let t =
|
|
119
|
+
let t = z({
|
|
118
120
|
path: "",
|
|
119
|
-
resourcePage:
|
|
121
|
+
resourcePage: g,
|
|
120
122
|
prepareSearchBehavior: "path",
|
|
121
123
|
prepare: async ({ context: t, query: n }) => {
|
|
122
124
|
let { config: r } = await c.loadListEntity(e.id), { list: i, listUrlCodec: a, listDefaults: o } = r;
|
|
123
125
|
if (a == null || o == null) throw Error(`Backoffice entity ${e.id} does not expose a list configuration.`);
|
|
124
|
-
let s =
|
|
126
|
+
let s = I(n), u = a.parse(s), { pageSize: d } = l, p = {
|
|
125
127
|
where: u.where,
|
|
126
128
|
sort: u.sort ?? o.sort,
|
|
127
129
|
count: d,
|
|
128
130
|
cursor: null
|
|
129
|
-
}, m = i.buildQueryVariables(
|
|
131
|
+
}, m = i.buildQueryVariables(p), h = f(t.relayEnvironment, i.query, m);
|
|
130
132
|
return {
|
|
131
133
|
entityId: e.id,
|
|
132
134
|
entityManifest: e,
|
|
@@ -146,11 +148,11 @@ function z(i) {
|
|
|
146
148
|
});
|
|
147
149
|
K.set(t, e.id), r.push(t);
|
|
148
150
|
}
|
|
149
|
-
let i =
|
|
151
|
+
let i = z({
|
|
150
152
|
path: ":id",
|
|
151
|
-
resourcePage:
|
|
153
|
+
resourcePage: v,
|
|
152
154
|
prepare: async ({ context: t, variables: n }) => {
|
|
153
|
-
let { config: r } = await c.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o =
|
|
155
|
+
let { config: r } = await c.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);
|
|
154
156
|
return {
|
|
155
157
|
entityId: e.id,
|
|
156
158
|
entityManifest: e,
|
|
@@ -170,24 +172,23 @@ function z(i) {
|
|
|
170
172
|
});
|
|
171
173
|
},
|
|
172
174
|
children: [
|
|
173
|
-
|
|
175
|
+
z({
|
|
174
176
|
path: "",
|
|
175
|
-
resourcePage:
|
|
177
|
+
resourcePage: m,
|
|
176
178
|
prepare: ({ variables: t }) => {
|
|
177
179
|
let n = String(t.id ?? "").trim();
|
|
178
180
|
return { redirectTo: n === "" ? null : e.routes.detailPage(n, e.defaultDetailPageId ?? "overview") };
|
|
179
181
|
},
|
|
180
182
|
render: ({ prepared: e }) => {
|
|
181
183
|
let t = e.redirectTo ?? null;
|
|
182
|
-
|
|
183
|
-
throw new u(t);
|
|
184
|
+
return t == null ? null : /* @__PURE__ */ o(D, { pathname: t });
|
|
184
185
|
}
|
|
185
186
|
}),
|
|
186
|
-
...(e.detailPages ?? []).map((t) =>
|
|
187
|
+
...(e.detailPages ?? []).map((t) => z({
|
|
187
188
|
path: t.pathSegment,
|
|
188
|
-
resourcePage:
|
|
189
|
+
resourcePage: _,
|
|
189
190
|
prepare: async ({ context: n, variables: r }) => {
|
|
190
|
-
let i = String(r.id ?? ""), a = await c.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s =
|
|
191
|
+
let i = String(r.id ?? ""), a = await c.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);
|
|
191
192
|
return {
|
|
192
193
|
entityId: e.id,
|
|
193
194
|
entityManifest: e,
|
|
@@ -210,9 +211,9 @@ function z(i) {
|
|
|
210
211
|
});
|
|
211
212
|
}
|
|
212
213
|
})),
|
|
213
|
-
|
|
214
|
+
z({
|
|
214
215
|
path: ":pagePath",
|
|
215
|
-
resourcePage:
|
|
216
|
+
resourcePage: y,
|
|
216
217
|
prepare: async ({ variables: t }) => {
|
|
217
218
|
let n = await c.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
|
|
218
219
|
return {
|
|
@@ -234,14 +235,14 @@ function z(i) {
|
|
|
234
235
|
})
|
|
235
236
|
]
|
|
236
237
|
});
|
|
237
|
-
return K.set(i, e.id), r.push(i),
|
|
238
|
+
return K.set(i, e.id), r.push(i), z({
|
|
238
239
|
path: n,
|
|
239
240
|
children: r,
|
|
240
|
-
resourcePage:
|
|
241
|
+
resourcePage: m
|
|
241
242
|
});
|
|
242
243
|
}), ce = Object.values(s).filter((e) => e.kind === "tool").map((e) => {
|
|
243
|
-
let t =
|
|
244
|
-
path:
|
|
244
|
+
let t = z({
|
|
245
|
+
path: P(e.routes.list, N),
|
|
245
246
|
resourcePage: i.toolsOperationPage ?? null,
|
|
246
247
|
prepare: async () => {
|
|
247
248
|
let t = await c.loadToolEntity(e.id);
|
|
@@ -262,27 +263,27 @@ function z(i) {
|
|
|
262
263
|
}
|
|
263
264
|
});
|
|
264
265
|
return K.set(t, e.id), t;
|
|
265
|
-
}), le =
|
|
266
|
-
path:
|
|
267
|
-
resourcePage:
|
|
266
|
+
}), le = z({
|
|
267
|
+
path: N,
|
|
268
|
+
resourcePage: h,
|
|
268
269
|
prepareSearchBehavior: "path",
|
|
269
270
|
prepare: Y,
|
|
270
271
|
render: ({ children: e, prepared: t, route: n, Component: r }) => {
|
|
271
272
|
if (r == null) return null;
|
|
272
|
-
let i = t, a =
|
|
273
|
-
return l != null && i?.authStatusQuery != null ? /* @__PURE__ */ o(
|
|
273
|
+
let i = t, a = F(n, K), s = a == null ? F(n, q) : G.get(a) ?? null, c = r, l = d.session.get()?.authStatusQuery ?? null;
|
|
274
|
+
return l != null && i?.authStatusQuery != null ? /* @__PURE__ */ o(O, {
|
|
274
275
|
Component: c,
|
|
275
276
|
preparedLayout: i,
|
|
276
|
-
permissionsQuery:
|
|
277
|
+
permissionsQuery: u?.permissionsQuery,
|
|
277
278
|
activeGroupId: s,
|
|
278
279
|
authStatusQuery: l,
|
|
279
280
|
authStatusPrepared: i.authStatusQuery,
|
|
280
|
-
loginRedirectPath:
|
|
281
|
+
loginRedirectPath: ne,
|
|
281
282
|
children: e
|
|
282
|
-
}) : /* @__PURE__ */ o(
|
|
283
|
+
}) : /* @__PURE__ */ o(ee, {
|
|
283
284
|
Component: c,
|
|
284
285
|
preparedLayout: i,
|
|
285
|
-
permissionsQuery:
|
|
286
|
+
permissionsQuery: u?.permissionsQuery,
|
|
286
287
|
activeGroupId: s,
|
|
287
288
|
children: e
|
|
288
289
|
});
|
|
@@ -292,57 +293,59 @@ function z(i) {
|
|
|
292
293
|
...oe,
|
|
293
294
|
...se,
|
|
294
295
|
...ce,
|
|
295
|
-
...
|
|
296
|
+
...ae,
|
|
296
297
|
ie
|
|
297
298
|
]
|
|
298
299
|
}), $ = [
|
|
299
|
-
|
|
300
|
-
path:
|
|
301
|
-
resourcePage:
|
|
300
|
+
z({
|
|
301
|
+
path: L,
|
|
302
|
+
resourcePage: S,
|
|
302
303
|
prepare: async ({ context: e }) => {
|
|
303
|
-
let t = await
|
|
304
|
-
return { query:
|
|
304
|
+
let t = await d.login.load();
|
|
305
|
+
return { query: f(e.relayEnvironment, t.loginQuery, {}) };
|
|
305
306
|
},
|
|
306
307
|
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
|
|
307
308
|
}),
|
|
308
|
-
|
|
309
|
-
path:
|
|
310
|
-
resourcePage:
|
|
311
|
-
prepare: async () => (await
|
|
309
|
+
z({
|
|
310
|
+
path: R,
|
|
311
|
+
resourcePage: C,
|
|
312
|
+
prepare: async () => (await d.passwordResetRequest.load(), null),
|
|
312
313
|
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
313
314
|
}),
|
|
314
|
-
|
|
315
|
-
path:
|
|
316
|
-
resourcePage:
|
|
317
|
-
prepare: async () => (await
|
|
315
|
+
z({
|
|
316
|
+
path: B,
|
|
317
|
+
resourcePage: w,
|
|
318
|
+
prepare: async () => (await d.passwordResetComplete.load(), null),
|
|
318
319
|
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
319
320
|
}),
|
|
320
|
-
|
|
321
|
+
z({
|
|
321
322
|
path: V,
|
|
322
|
-
resourcePage:
|
|
323
|
-
prepare: async () => (await
|
|
323
|
+
resourcePage: T,
|
|
324
|
+
prepare: async () => (await d.verifyEmail.load(), null),
|
|
324
325
|
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
325
326
|
})
|
|
326
327
|
];
|
|
327
|
-
return (
|
|
328
|
-
path:
|
|
329
|
-
resourcePage:
|
|
330
|
-
prepare: async () => (await
|
|
328
|
+
return (d.hasAcceptInvitation === !0 || d.acceptInvitation != null) && $.push(z({
|
|
329
|
+
path: te,
|
|
330
|
+
resourcePage: E,
|
|
331
|
+
prepare: async () => (await d.acceptInvitation?.load(), null),
|
|
331
332
|
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
|
|
332
333
|
})), $.push(le), $;
|
|
333
334
|
}
|
|
334
|
-
var
|
|
335
|
-
normalizeBaseSegment:
|
|
336
|
-
normalizePath:
|
|
337
|
-
buildScopedPath:
|
|
338
|
-
buildScopedAbsolutePath:
|
|
339
|
-
buildRelativePath:
|
|
340
|
-
resolveActiveEntityIdFromRoute:
|
|
341
|
-
|
|
335
|
+
var V = {
|
|
336
|
+
normalizeBaseSegment: k,
|
|
337
|
+
normalizePath: A,
|
|
338
|
+
buildScopedPath: j,
|
|
339
|
+
buildScopedAbsolutePath: M,
|
|
340
|
+
buildRelativePath: P,
|
|
341
|
+
resolveActiveEntityIdFromRoute: F,
|
|
342
|
+
resolveDetailPageIdForPath: R,
|
|
343
|
+
resolveDetailPageManifestByPath: L,
|
|
344
|
+
toSearchParams: I,
|
|
342
345
|
validateBackofficeDashboardRegistrations: r,
|
|
343
|
-
BackofficeLayoutRouteWithAuthStatus:
|
|
346
|
+
BackofficeLayoutRouteWithAuthStatus: O
|
|
344
347
|
};
|
|
345
348
|
//#endregion
|
|
346
|
-
export {
|
|
349
|
+
export { E as BackofficeAcceptInvitationPageResource, b as BackofficeDashboardPageResource, v as BackofficeEntityDetailLayoutPageResource, _ as BackofficeEntityDetailPageResource, y as BackofficeEntityDetailUnknownPageRedirectResource, g as BackofficeEntityListPageResource, x as BackofficeHubPageResource, h as BackofficeLayoutPageResource, S as BackofficeLoginPageResource, w as BackofficePasswordResetCompletePageResource, C as BackofficePasswordResetRequestPageResource, T as BackofficeVerifyEmailPageResource, m as WrapperPageResource, V as __test, B as createBackofficeRoutes, B as default };
|
|
347
350
|
|
|
348
351
|
//# sourceMappingURL=createBackofficeRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useContext,\n useEffect,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\nimport HttpRedirect from '@plumile/router/errors/HttpRedirect.js';\nimport {\n getResourcePage,\n type ResourcePage,\n} from '@plumile/router/ResourcePage.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { r } from '@plumile/router/tools.js';\nimport { type AnyRoute, type Route } from '@plumile/router/types.js';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeDashboardConfig,\n BackofficeEntityManifestMap,\n BackofficePreparedDetailLayoutRoute,\n BackofficePreparedDetailPageRoute,\n BackofficePreparedListRoute,\n BackofficePreparedToolRoute,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardRegistration,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\nimport { validateBackofficeDashboardRegistrations } from '../provider/dashboardRegistrations.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n dashboards?: readonly BackofficeDashboardRegistration[];\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui/pages/WrapperPage.js')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedDetailUnknownPage = {\n id: string;\n pagePath: string;\n entityManifest: BackofficeEntityManifestMap[string];\n entityConfig: BackofficeResolvedDetailLayoutFacetConfigBase;\n};\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\nexport type BackofficePreparedDashboardRoute = {\n dashboardId: string;\n config: BackofficeDashboardConfig;\n};\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeLoginRedirect = ({\n loginRedirectPath,\n}: {\n loginRedirectPath: string;\n}): null => {\n const router = useContext(RoutingContext);\n\n useEffect(() => {\n router?.history.set({\n pathname: loginRedirectPath,\n });\n }, [loginRedirectPath, router]);\n\n return null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n return <BackofficeLoginRedirect loginRedirectPath={loginRedirectPath} />;\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst toSearchParams = (query: Record<string, unknown>): URLSearchParams => {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => {\n if (entry == null) {\n return;\n }\n params.append(key, String(entry));\n });\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n params.set(key, String(value));\n });\n return params;\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, any>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const dashboards = validateBackofficeDashboardRegistrations(input.dashboards);\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const prepareRootDashboard =\n async (): Promise<BackofficePreparedDashboardRoute | null> => {\n if (dashboard == null) {\n return null;\n }\n const config = await dashboard.load();\n return {\n dashboardId: 'dashboard',\n config,\n };\n };\n const renderDashboard = ({\n prepared,\n Component,\n }: {\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardComponent = Component as ComponentType<{\n prepared?: unknown;\n }>;\n return <DashboardComponent prepared={prepared} />;\n };\n\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const secondaryDashboardRoutes = dashboards.map((registration) => {\n return rBackoffice({\n path: `dashboard/${registration.id}`,\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n const config = await registration.module.load();\n return {\n dashboardId: registration.id,\n config,\n } satisfies BackofficePreparedDashboardRoute;\n },\n render: renderDashboard,\n });\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<any, any>[] = [];\n\n if (entityManifestItem.hasList) {\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list, listUrlCodec, listDefaults } = config;\n if (listUrlCodec == null || listDefaults == null) {\n throw new Error(\n `Backoffice entity ${entityManifestItem.id} does not expose a list configuration.`,\n );\n }\n const params = toSearchParams(query);\n const state = listUrlCodec.parse(params);\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n children.push(listRoute);\n }\n\n const detailLayoutRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId ?? 'overview',\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n throw new HttpRedirect(redirectTo);\n },\n }),\n ...(entityManifestItem.detailPages ?? []).map((pageManifest) => {\n return rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageResource,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig:\n pageModule.config as unknown as BackofficeResolvedDetailLayoutFacetConfigBase,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n }),\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail = prepared as PreparedDetailUnknownPage;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutRoute, entityManifestItem.id);\n children.push(detailLayoutRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n ...secondaryDashboardRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, any>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n toSearchParams,\n validateBackofficeDashboardRegistrations,\n BackofficeLayoutRouteWithAuthStatus,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;;;;;;AAkDA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAiB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,qCAAqC,YAC9D,EACF,GAEa,IACX,EACE,wBAEA,YAAY,OAAO,mCACrB,GAEW,IACX,EACE,4BAEA,YAAY,OAAO,uCACrB,GAEW,IACX,EACE,8BAEA,YAAY,OAAO,yCACrB,GAEW,IACX,EACE,oCAEA,YAAY,OAAO,+CACrB,GAEW,IACX,EACE,6CAEA,YAAY,OAAO,wDACrB,GAEW,IACX,EACE,2BAEA,YAAY,OAAO,sCACrB,GAEW,IAAiD,EAC5D,qBAEA,YAAY,OAAO,gCACrB,GAEa,IAAmD,EAC9D,uBAEA,YAAY,OAAO,kCACrB,GAEa,IACX,EACE,sCAEA,YAAY,OAAO,iDACrB,GAEW,IACX,EACE,uCAEA,YAAY,OAAO,kDACrB,GAEW,IACX,EACE,6BAEA,YAAY,OAAO,wCACrB,GAEW,IACX,EACE,kCAEA,YAAY,OAAO,6CACrB,GA8CI,KAA2B,EAC/B,2BAGU;CACV,IAA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B,KAAK,GAC9B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,sBAAsB,KAAK,GAC/B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,YAAY,KAAK,GACrB;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;CACH;CAuBA,QArBI,EAAK,wBAAwB,MAAQ,EAAK,oBAAoB,SAChE,EAAO,KACL,EAAY;EACV,MAAM;EACN,cAAc;EACd,SAAS,aACP,MAAM,EAAK,kBAAkB,KAAK,GAC3B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;CAEvB,CAAC,CACH,GAGF,EAAO,KAAK,EAAW,GAEhB;AACT;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useContext,\n useEffect,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\nimport {\n getResourcePage,\n type ResourcePage,\n} from '@plumile/router/ResourcePage.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { r } from '@plumile/router/tools.js';\nimport { type AnyRoute, type Route } from '@plumile/router/types.js';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeDashboardConfig,\n BackofficeDetailPageManifestItem,\n BackofficeEntityManifestItem,\n BackofficeEntityManifestMap,\n BackofficePreparedDetailLayoutRoute,\n BackofficePreparedDetailPageRoute,\n BackofficePreparedListRoute,\n BackofficePreparedToolRoute,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardRegistration,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\nimport { validateBackofficeDashboardRegistrations } from '../provider/dashboardRegistrations.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n dashboards?: readonly BackofficeDashboardRegistration[];\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui/pages/WrapperPage.js')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\nexport type BackofficePreparedDashboardRoute = {\n dashboardId: string;\n config: BackofficeDashboardConfig;\n};\n\ntype PreparedDetailUnknownPage = {\n id: string;\n pagePath: string;\n entityManifest: BackofficeEntityManifestMap[string];\n entityConfig: BackofficeResolvedDetailLayoutFacetConfigBase;\n};\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeHistoryRedirect = ({\n pathname,\n}: {\n pathname: string;\n}): null => {\n const router = useContext(RoutingContext);\n\n useEffect(() => {\n router?.history.set({\n pathname,\n });\n }, [pathname, router]);\n\n return null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n return <BackofficeHistoryRedirect pathname={loginRedirectPath} />;\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst normalizePagePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst toSearchParams = (query: Record<string, unknown>): URLSearchParams => {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => {\n if (entry == null) {\n return;\n }\n params.append(key, String(entry));\n });\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n params.set(key, String(value));\n });\n return params;\n};\n\nconst resolveDetailPageManifestByPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): BackofficeDetailPageManifestItem | null => {\n const pagePath = normalizePagePath(rawPagePath);\n return (\n entityManifestItem.detailPages?.find((page) => {\n return normalizePagePath(page.pathSegment) === pagePath;\n }) ?? null\n );\n};\n\nconst resolveDetailPageIdForPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): string => {\n return (\n resolveDetailPageManifestByPath(entityManifestItem, rawPagePath)?.id ??\n rawPagePath\n );\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, any>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const dashboards = validateBackofficeDashboardRegistrations(input.dashboards);\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const prepareRootDashboard =\n async (): Promise<BackofficePreparedDashboardRoute | null> => {\n if (dashboard == null) {\n return null;\n }\n const config = await dashboard.load();\n return {\n dashboardId: 'dashboard',\n config,\n };\n };\n const renderDashboard = ({\n prepared,\n Component,\n }: {\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardComponent = Component as ComponentType<{\n prepared?: unknown;\n }>;\n return <DashboardComponent prepared={prepared} />;\n };\n\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const secondaryDashboardRoutes = dashboards.map((registration) => {\n return rBackoffice({\n path: `dashboard/${registration.id}`,\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n const config = await registration.module.load();\n return {\n dashboardId: registration.id,\n config,\n } satisfies BackofficePreparedDashboardRoute;\n },\n render: renderDashboard,\n });\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<any, any>[] = [];\n\n if (entityManifestItem.hasList) {\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list, listUrlCodec, listDefaults } = config;\n if (listUrlCodec == null || listDefaults == null) {\n throw new Error(\n `Backoffice entity ${entityManifestItem.id} does not expose a list configuration.`,\n );\n }\n const params = toSearchParams(query);\n const state = listUrlCodec.parse(params);\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n children.push(listRoute);\n }\n\n const detailLayoutRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId ?? 'overview',\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n return <BackofficeHistoryRedirect pathname={redirectTo} />;\n },\n }),\n ...(entityManifestItem.detailPages ?? []).map((pageManifest) => {\n return rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageResource,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig:\n pageModule.config as unknown as BackofficeResolvedDetailLayoutFacetConfigBase,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n }),\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail = prepared as PreparedDetailUnknownPage;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutRoute, entityManifestItem.id);\n children.push(detailLayoutRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n ...secondaryDashboardRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, any>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n resolveDetailPageIdForPath,\n resolveDetailPageManifestByPath,\n toSearchParams,\n validateBackofficeDashboardRegistrations,\n BackofficeLayoutRouteWithAuthStatus,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;;;;;AAmDA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAiB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,qCAAqC,YAC9D,EACF,GAEa,IACX,EACE,wBAEA,YAAY,OAAO,mCACrB,GAEW,IACX,EACE,4BAEA,YAAY,OAAO,uCACrB,GAEW,IACX,EACE,8BAEA,YAAY,OAAO,yCACrB,GAEW,IACX,EACE,oCAEA,YAAY,OAAO,+CACrB,GAEW,IACX,EACE,6CAEA,YAAY,OAAO,wDACrB,GAEW,IACX,EACE,2BAEA,YAAY,OAAO,sCACrB,GAEW,IAAiD,EAC5D,qBAEA,YAAY,OAAO,gCACrB,GAEa,IAAmD,EAC9D,uBAEA,YAAY,OAAO,kCACrB,GAEa,IACX,EACE,sCAEA,YAAY,OAAO,iDACrB,GAEW,IACX,EACE,uCAEA,YAAY,OAAO,kDACrB,GAEW,IACX,EACE,6BAEA,YAAY,OAAO,wCACrB,GAEW,IACX,EACE,kCAEA,YAAY,OAAO,6CACrB,GA8CI,KAA6B,EACjC,kBAGU;CACV,IAAM,IAAS,EAAW,CAAc;CAQxC,OANA,QAAgB;EACd,GAAQ,QAAQ,IAAI,EAClB,YACF,CAAC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Ea,EAAS;GAC3B;GACA,SAAS,EAAE,aAAU,mBACf,KAAa,OACR,OAEF,kBAAC,GAAD,EAAqB,YAAW,CAAA;EAE3C,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,qBAAqB,KAAK,GAC9B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,sBAAsB,KAAK,GAC/B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,YAAY,KAAK,GACrB;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;CACH;CAuBA,QArBI,EAAK,wBAAwB,MAAQ,EAAK,oBAAoB,SAChE,EAAO,KACL,EAAY;EACV,MAAM;EACN,cAAc;EACd,SAAS,aACP,MAAM,EAAK,kBAAkB,KAAK,GAC3B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;CAEvB,CAAC,CACH,GAGF,EAAO,KAAK,EAAW,GAEhB;AACT;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAiGF,eAAO,MAAM,gCAAgC,GAAI,IAAI,EAAG,+CAMrD,qCAAqC,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAiGF,eAAO,MAAM,gCAAgC,GAAI,IAAI,EAAG,+CAMrD,qCAAqC,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,OAAO,GAAG,IA46B9D,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeDashboardPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeDashboardPage.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"BackofficeDashboardPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeDashboardPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,GAAG,EAAY,MAAM,OAAO,CAAC;AAyBjD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AAyJ5F,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,gCAAgC,GAAG,IAAI,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,eAErC,4BAA4B,KAAG,GAAG,CAAC,OAyErC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BackofficeDashboardWidget } from '@plumile/backoffice-core/types.js';
|
|
3
|
+
export type BackofficeDashboardWidgetContentProps = {
|
|
4
|
+
widget: BackofficeDashboardWidget;
|
|
5
|
+
globalData: unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare const BackofficeDashboardWidgetContent: ({ widget, globalData, }: BackofficeDashboardWidgetContentProps) => JSX.Element | null;
|
|
8
|
+
export default BackofficeDashboardWidgetContent;
|
|
9
|
+
//# sourceMappingURL=BackofficeDashboardWidgetContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackofficeDashboardWidgetContent.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeDashboardWidgetContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,mCAAmC,CAAC;AAwB3C,MAAM,MAAM,qCAAqC,GAAG;IAClD,MAAM,EAAE,yBAAyB,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AA0TF,eAAO,MAAM,gCAAgC,GAAI,yBAG9C,qCAAqC,KAAG,GAAG,CAAC,OAAO,GAAG,IAMxD,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailLayoutPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailLayoutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailLayoutPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailLayoutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,EACV,4BAA4B,EAC5B,mCAAmC,EACnC,yCAAyC,EAC1C,MAAM,mCAAmC,CAAC;AAM3C,MAAM,MAAM,qCAAqC,GAAG;IAClD,cAAc,EAAE,4BAA4B,CAAC;IAC7C,MAAM,EAAE,yCAAyC,CAAC;IAClD,QAAQ,EAAE,mCAAmC,CAAC;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,iCAI9C,qCAAqC,KAAG,GAAG,CAAC,OA6B9C,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAiD,MAAM,OAAO,CAAC;AAEhF,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAUnD,OAAO,KAAK,EACV,6CAA6C,EAE7C,2CAA2C,EAC5C,MAAM,mCAAmC,CAAC;AA2E3C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,6CAA6C,CAAC;IACtD,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,2CAA2C,CAAC;QACxD,SAAS,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAk2BF,eAAO,MAAM,0BAA0B,GAAI,uBAGxC,+BAA+B,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailPage.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAiD,MAAM,OAAO,CAAC;AAEhF,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAUnD,OAAO,KAAK,EACV,6CAA6C,EAE7C,2CAA2C,EAC5C,MAAM,mCAAmC,CAAC;AA2E3C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,6CAA6C,CAAC;IACtD,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,2CAA2C,CAAC;QACxD,SAAS,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAk2BF,eAAO,MAAM,0BAA0B,GAAI,uBAGxC,+BAA+B,KAAG,GAAG,CAAC,OA4BxC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailUnknownPageRedirect.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailUnknownPageRedirect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailUnknownPageRedirect.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailUnknownPageRedirect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EACV,4BAA4B,EAC5B,yCAAyC,EAC1C,MAAM,mCAAmC,CAAC;AAM3C,MAAM,MAAM,8CAA8C,GAAG;IAC3D,cAAc,EAAE,4BAA4B,CAAC;IAC7C,MAAM,EAAE,yCAAyC,CAAC;IAClD,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,yCAAyC,GAAI,uBAGvD,8CAA8C,KAAG,GAAG,CAAC,OAmBvD,CAAC;AAEF,eAAe,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export type BackofficeRedirectProps = {
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const BackofficeRedirect: ({ to, }: BackofficeRedirectProps) => JSX.Element | null;
|
|
6
|
+
export default BackofficeRedirect;
|
|
7
|
+
//# sourceMappingURL=BackofficeRedirect.d.ts.map
|