@sensinum/strapi-plugin-xecp 5.0.0 → 5.0.2
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 +3 -3
- package/dist/admin/{App-CpfEDpzY.mjs → App-COKB0PXI.mjs} +722 -691
- package/dist/admin/App-CxQAwCC4.js +30 -0
- package/dist/admin/{de-bbLKG0Z0.js → de-B5M8juGn.js} +1 -1
- package/dist/admin/{de-C25k5cq2.mjs → de-Bc7t3sCO.mjs} +4 -0
- package/dist/admin/{en-B08MBp2G.mjs → en-16Qqparh.mjs} +4 -0
- package/dist/admin/{en-CN9XhSjy.js → en-DXWBDgkB.js} +1 -1
- package/dist/admin/{fr-C0XfkZIq.mjs → fr-CMzm8jIl.mjs} +4 -0
- package/dist/admin/{fr-CrIyMsIk.js → fr-CPWgcURq.js} +1 -1
- package/dist/admin/{index-CerJW5f6.js → index-BNa83Wfu.js} +1 -1
- package/dist/admin/{index-pRp3V-Jg.mjs → index-Bgk0cBQK.mjs} +5 -5
- package/dist/admin/{index-C273gErB.mjs → index-BnS-25UL.mjs} +228 -217
- package/dist/admin/index-C0CxNaV6.js +1 -0
- package/dist/admin/{index-BBbEUakb.mjs → index-DQgqKBmR.mjs} +1 -1
- package/dist/admin/{index-CYCygSmH.js → index-ogQgaRcB.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/{pl-DFGTrhGA.js → pl-Blw4wk9g.js} +1 -1
- package/dist/admin/{pl-CPolzlPI.mjs → pl-CuTaHdsS.mjs} +4 -0
- package/dist/server/index.js +10 -8
- package/dist/server/index.mjs +7790 -6587
- package/package.json +2 -1
- package/dist/admin/App-DNMEZr-V.js +0 -30
- package/dist/admin/index-BgeTCjkL.js +0 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useFetchClient as
|
|
3
|
-
import { Link as
|
|
4
|
-
import { U as _, g as a, P as
|
|
5
|
-
import { L as wt, S as
|
|
6
|
-
import { Combobox as
|
|
7
|
-
import { WarningCircle as
|
|
8
|
-
import { useState as L, useEffect as
|
|
9
|
-
import { useIntl as
|
|
1
|
+
import { jsx as o, jsxs as u, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useFetchClient as k, useRBAC as St, useQueryParams as Ct, Page as Z, Layouts as Qe, Pagination as Ee } from "@strapi/strapi/admin";
|
|
3
|
+
import { Link as Me, Routes as bt, Route as He } from "react-router-dom";
|
|
4
|
+
import { U as _, g as a, P as ke } from "./index-Bgk0cBQK.mjs";
|
|
5
|
+
import { L as wt, S as It, P as Et, Q as vt } from "./queryKeys-rUHP1d6p.mjs";
|
|
6
|
+
import { Combobox as Tt, ComboboxOption as kt, Modal as N, Button as E, Flex as f, Typography as h, Link as Re, EmptyStateLayout as W, Tooltip as qe, Checkbox as Le, Badge as z, Table as _e, Thead as Ke, Tr as H, Th as F, Tbody as De, Td as v, Accordion as q, Divider as xt, Box as Mt, ProgressBar as Rt, Loader as ve } from "@strapi/design-system";
|
|
7
|
+
import { WarningCircle as Ae, Information as qt } from "@strapi/icons";
|
|
8
|
+
import { useState as L, useEffect as ne, Fragment as Lt, useMemo as Je, useRef as Ze, useCallback as Ve } from "react";
|
|
9
|
+
import { useIntl as b } from "react-intl";
|
|
10
10
|
import ae from "zod";
|
|
11
|
-
import { A as
|
|
12
|
-
import { useQuery as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { get: e } =
|
|
16
|
-
return
|
|
11
|
+
import { A as I, T as V } from "./TruncatedTypography-Df3hMZdB.mjs";
|
|
12
|
+
import { useQuery as U, useQueryClient as oe, useMutation as ue } from "@tanstack/react-query";
|
|
13
|
+
import Be from "styled-components";
|
|
14
|
+
const _t = 120 * 1e3, Kt = () => {
|
|
15
|
+
const { get: e } = k();
|
|
16
|
+
return U({
|
|
17
17
|
queryKey: [wt, "status"],
|
|
18
|
-
staleTime:
|
|
18
|
+
staleTime: _t,
|
|
19
19
|
queryFn: async () => {
|
|
20
20
|
const { data: t } = await e(`/${_}/license/status`);
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
},
|
|
25
|
-
const [c, d] = L(() =>
|
|
26
|
-
return
|
|
27
|
-
d(
|
|
28
|
-
}, [i, r]), /* @__PURE__ */
|
|
29
|
-
|
|
24
|
+
}, Ye = (e, t) => t ? e.find((n) => n.value === t)?.label ?? "" : "", Dt = ({ name: e, onClear: t, onChange: n, options: r, value: i, placeholder: s, disabled: l }) => {
|
|
25
|
+
const [c, d] = L(() => Ye(r, i));
|
|
26
|
+
return ne(() => {
|
|
27
|
+
d(Ye(r, i));
|
|
28
|
+
}, [i, r]), /* @__PURE__ */ o(
|
|
29
|
+
Tt,
|
|
30
30
|
{
|
|
31
31
|
name: e,
|
|
32
32
|
autocomplete: "list",
|
|
33
33
|
onClear: t,
|
|
34
|
-
onChange:
|
|
34
|
+
onChange: n,
|
|
35
35
|
placeholder: s,
|
|
36
36
|
onTextValueChange: d,
|
|
37
37
|
value: i,
|
|
38
38
|
textValue: c,
|
|
39
39
|
disabled: l,
|
|
40
40
|
width: "100%",
|
|
41
|
-
children: r.map(({ key: m, label: p, value:
|
|
41
|
+
children: r.map(({ key: m, label: p, value: y }) => /* @__PURE__ */ o(kt, { value: y, children: p }, m))
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
},
|
|
44
|
+
}, At = "90vh", me = ({
|
|
45
45
|
open: e,
|
|
46
46
|
onClose: t,
|
|
47
|
-
title:
|
|
47
|
+
title: n,
|
|
48
48
|
children: r,
|
|
49
49
|
isConfirmButtonLoading: i = !1,
|
|
50
50
|
confirmButtonText: s,
|
|
@@ -54,75 +54,75 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
54
54
|
showConfirmButton: m = !0,
|
|
55
55
|
fillMaxHeight: p = !1
|
|
56
56
|
}) => {
|
|
57
|
-
const { formatMessage:
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
57
|
+
const { formatMessage: y } = b();
|
|
58
|
+
return /* @__PURE__ */ o(N.Root, { open: e, onOpenChange: () => t(), children: /* @__PURE__ */ u(N.Content, { style: p ? { height: At } : void 0, children: [
|
|
59
|
+
/* @__PURE__ */ o(N.Header, { children: /* @__PURE__ */ o(N.Title, { children: n }) }),
|
|
60
|
+
/* @__PURE__ */ o(N.Body, { children: r }),
|
|
61
|
+
/* @__PURE__ */ o(N.Footer, { style: m ? void 0 : { justifyContent: "flex-end" }, children: m ? /* @__PURE__ */ u(A, { children: [
|
|
62
|
+
/* @__PURE__ */ o(N.Close, { children: /* @__PURE__ */ o(E, { variant: "tertiary", onClick: t, children: d || y({ id: a("common.button.close") }) }) }),
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
E,
|
|
65
65
|
{
|
|
66
66
|
loading: i,
|
|
67
67
|
disabled: l,
|
|
68
68
|
onClick: c,
|
|
69
|
-
children: s ||
|
|
69
|
+
children: s || y({ id: a("common.button.submit") })
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
|
-
] }) : /* @__PURE__ */
|
|
72
|
+
] }) : /* @__PURE__ */ o(N.Close, { children: /* @__PURE__ */ o(E, { variant: "tertiary", onClick: t, children: d || y({ id: a("common.button.close") }) }) }) })
|
|
73
73
|
] }) });
|
|
74
|
-
},
|
|
74
|
+
}, We = (e) => /^[\w]+(?:\.[\w]+)+$/.test(e), Bt = (e) => {
|
|
75
75
|
if (typeof e != "object" || e === null)
|
|
76
76
|
return;
|
|
77
77
|
const t = e.response?.data?.error?.message;
|
|
78
78
|
if (typeof t == "string")
|
|
79
79
|
return t;
|
|
80
|
-
const
|
|
81
|
-
return typeof
|
|
80
|
+
const n = e.message;
|
|
81
|
+
return typeof n == "string" ? n : void 0;
|
|
82
82
|
}, ge = (e, t) => {
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
-
},
|
|
83
|
+
const n = Bt(e);
|
|
84
|
+
return n && We(n) ? t({ id: a(n) }) : t({ id: a("homePage.error") });
|
|
85
|
+
}, Nt = (e, t) => e && We(e) ? t({ id: a(e) }) : null, ee = {
|
|
86
86
|
all: ["sync"],
|
|
87
|
-
lists: () => [...
|
|
88
|
-
list: (e) => [...
|
|
89
|
-
},
|
|
87
|
+
lists: () => [...ee.all, "list"],
|
|
88
|
+
list: (e) => [...ee.lists(), { uid: e }]
|
|
89
|
+
}, ze = "entities-comparison", Ft = ({
|
|
90
90
|
uid: e,
|
|
91
91
|
page: t = 1,
|
|
92
|
-
pageSize:
|
|
92
|
+
pageSize: n = 10,
|
|
93
93
|
enabled: r = !0
|
|
94
94
|
}) => {
|
|
95
|
-
const { get: i } =
|
|
96
|
-
return
|
|
97
|
-
queryKey: [
|
|
95
|
+
const { get: i } = k();
|
|
96
|
+
return U({
|
|
97
|
+
queryKey: [ze, { uid: e, page: t, pageSize: n }],
|
|
98
98
|
queryFn: async () => {
|
|
99
99
|
const { data: s } = await i(
|
|
100
|
-
`/${_}/entity-comparison/${e}?page=${t}&pageSize=${
|
|
100
|
+
`/${_}/entity-comparison/${e}?page=${t}&pageSize=${n}`
|
|
101
101
|
);
|
|
102
102
|
return s;
|
|
103
103
|
},
|
|
104
104
|
enabled: !!e && r
|
|
105
105
|
});
|
|
106
|
-
},
|
|
107
|
-
e.invalidateQueries({ queryKey: [
|
|
106
|
+
}, et = (e) => {
|
|
107
|
+
e.invalidateQueries({ queryKey: [ze] });
|
|
108
108
|
}, he = (e, t) => {
|
|
109
|
-
e.invalidateQueries({ queryKey: t ?
|
|
110
|
-
},
|
|
111
|
-
const { post: e } =
|
|
109
|
+
e.invalidateQueries({ queryKey: t ? ee.list(t) : ee.lists() }), et(e);
|
|
110
|
+
}, Ot = () => {
|
|
111
|
+
const { post: e } = k(), t = oe();
|
|
112
112
|
return ue({
|
|
113
|
-
mutationFn: async (
|
|
114
|
-
onSuccess: (
|
|
113
|
+
mutationFn: async (n) => await e(`/${_}/snapshot/${n}/sync`),
|
|
114
|
+
onSuccess: (n, r) => {
|
|
115
115
|
he(t, r);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
},
|
|
119
|
-
const { formatMessage: r } =
|
|
118
|
+
}, tt = ({ open: e, onClose: t, contentTypeUid: n }) => {
|
|
119
|
+
const { formatMessage: r } = b(), {
|
|
120
120
|
mutate: i,
|
|
121
121
|
isPending: s,
|
|
122
122
|
error: l,
|
|
123
123
|
reset: c
|
|
124
|
-
} =
|
|
125
|
-
return /* @__PURE__ */
|
|
124
|
+
} = Ot();
|
|
125
|
+
return /* @__PURE__ */ o(
|
|
126
126
|
me,
|
|
127
127
|
{
|
|
128
128
|
open: e,
|
|
@@ -130,7 +130,7 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
130
130
|
t(), c();
|
|
131
131
|
},
|
|
132
132
|
onSubmit: () => {
|
|
133
|
-
i(
|
|
133
|
+
i(n, {
|
|
134
134
|
onSuccess: t
|
|
135
135
|
});
|
|
136
136
|
},
|
|
@@ -140,28 +140,28 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
140
140
|
confirmButtonText: r({
|
|
141
141
|
id: a("homePage.modal.getNewSnapshot.confirmButtonText")
|
|
142
142
|
}),
|
|
143
|
-
isConfirmButtonDisabled: s || !
|
|
143
|
+
isConfirmButtonDisabled: s || !n,
|
|
144
144
|
isConfirmButtonLoading: s,
|
|
145
|
-
children: /* @__PURE__ */ u(
|
|
146
|
-
/* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ u(f, { direction: "column", gap: 4, alignItems: "stretch", children: [
|
|
146
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: r({
|
|
147
147
|
id: a("homePage.modal.getNewSnapshot.description")
|
|
148
148
|
}) }),
|
|
149
|
-
l && /* @__PURE__ */
|
|
149
|
+
l && /* @__PURE__ */ o(h, { variant: "omega", textColor: "danger500", children: ge(l, r) })
|
|
150
150
|
] })
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
},
|
|
153
|
+
}, Ut = ({
|
|
154
154
|
contentTypeUid: e,
|
|
155
155
|
selectedPromotionsLength: t,
|
|
156
|
-
syncedAt:
|
|
156
|
+
syncedAt: n,
|
|
157
157
|
isGetSnapshotDisabled: r = !1,
|
|
158
158
|
hasSnapshot: i,
|
|
159
159
|
clearSelectedPromotions: s,
|
|
160
160
|
canExecute: l
|
|
161
161
|
}) => {
|
|
162
|
-
const { formatMessage: c } =
|
|
162
|
+
const { formatMessage: c } = b(), [d, m] = L(!1);
|
|
163
163
|
return /* @__PURE__ */ u(
|
|
164
|
-
|
|
164
|
+
f,
|
|
165
165
|
{
|
|
166
166
|
direction: "row",
|
|
167
167
|
justifyContent: "space-between",
|
|
@@ -169,22 +169,22 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
169
169
|
marginBottom: 1,
|
|
170
170
|
marginTop: 1,
|
|
171
171
|
children: [
|
|
172
|
-
e && i ? /* @__PURE__ */ u(
|
|
173
|
-
/* @__PURE__ */
|
|
172
|
+
e && i ? /* @__PURE__ */ u(f, { direction: "row", gap: 3, alignItems: "center", children: [
|
|
173
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: c(
|
|
174
174
|
{ id: a("homePage.selectedEntities") },
|
|
175
175
|
{ count: t }
|
|
176
176
|
) }),
|
|
177
|
-
t > 0 && l ? /* @__PURE__ */
|
|
177
|
+
t > 0 && l ? /* @__PURE__ */ o(E, { variant: "secondary", onClick: s, children: c({ id: a("homePage.clearSelectedEntities") }) }) : null
|
|
178
178
|
] }) : null,
|
|
179
|
-
|
|
180
|
-
/* @__PURE__ */
|
|
179
|
+
n ? /* @__PURE__ */ u(f, { direction: "row", gap: 3, alignItems: "center", children: [
|
|
180
|
+
/* @__PURE__ */ o(h, { variant: "omega", textColor: "neutral600", children: c(
|
|
181
181
|
{ id: a("homePage.lastSync") },
|
|
182
182
|
{
|
|
183
|
-
lastSync: new Date(
|
|
183
|
+
lastSync: new Date(n).toLocaleString()
|
|
184
184
|
}
|
|
185
185
|
) }),
|
|
186
|
-
l ? /* @__PURE__ */
|
|
187
|
-
|
|
186
|
+
l ? /* @__PURE__ */ o(
|
|
187
|
+
E,
|
|
188
188
|
{
|
|
189
189
|
variant: "secondary",
|
|
190
190
|
onClick: () => m(!0),
|
|
@@ -195,8 +195,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
195
195
|
}
|
|
196
196
|
) : null
|
|
197
197
|
] }) : null,
|
|
198
|
-
l ? /* @__PURE__ */
|
|
199
|
-
|
|
198
|
+
l ? /* @__PURE__ */ o(
|
|
199
|
+
tt,
|
|
200
200
|
{
|
|
201
201
|
open: d,
|
|
202
202
|
onClose: () => m(!1),
|
|
@@ -206,10 +206,10 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
206
206
|
]
|
|
207
207
|
}
|
|
208
208
|
);
|
|
209
|
-
},
|
|
210
|
-
const { formatMessage: t } =
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
|
|
209
|
+
}, $t = ({ canReadSettings: e }) => {
|
|
210
|
+
const { formatMessage: t } = b();
|
|
211
|
+
return /* @__PURE__ */ o(
|
|
212
|
+
I,
|
|
213
213
|
{
|
|
214
214
|
title: t({ id: a("homePage.alert.invalidLicense.title") }),
|
|
215
215
|
variant: "danger",
|
|
@@ -218,41 +218,41 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
218
218
|
e ? "homePage.alert.invalidLicense.description" : "homePage.alert.invalidLicense.readOnlyDescription"
|
|
219
219
|
)
|
|
220
220
|
}),
|
|
221
|
-
action: e ? /* @__PURE__ */
|
|
221
|
+
action: e ? /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(Re, { tag: Me, to: "/settings/xecp/about", children: t({ id: a("homePage.alert.invalidLicense.linkText") }) }) }) : void 0
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
|
-
},
|
|
225
|
-
const { formatMessage:
|
|
224
|
+
}, Gt = ({ compareSchemasData: e, errorCompareSchemas: t }) => {
|
|
225
|
+
const { formatMessage: n } = b(), r = e && !e?.isMatch, i = () => n(r ? { id: a("homePage.alert.schemaMismatch.title") } : { id: a("homePage.error") }), s = () => {
|
|
226
226
|
switch (!0) {
|
|
227
227
|
case r:
|
|
228
|
-
return
|
|
228
|
+
return n({ id: a("homePage.alert.schemaMismatch.description") });
|
|
229
229
|
case !!t:
|
|
230
230
|
return t;
|
|
231
231
|
default:
|
|
232
|
-
return
|
|
232
|
+
return n({ id: a("homePage.somethingWentWrong") });
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
return /* @__PURE__ */
|
|
236
|
-
},
|
|
235
|
+
return /* @__PURE__ */ o(I, { title: i(), variant: "danger", children: s() });
|
|
236
|
+
}, Qt = ({
|
|
237
237
|
contentTypeUid: e,
|
|
238
238
|
hasExistingSnapshot: t,
|
|
239
|
-
unconfiguredRelationsError:
|
|
239
|
+
unconfiguredRelationsError: n,
|
|
240
240
|
isGetSnapshotDisabled: r = !1,
|
|
241
241
|
canExecute: i,
|
|
242
242
|
canReadSettings: s
|
|
243
243
|
}) => {
|
|
244
|
-
const { formatMessage: l } =
|
|
245
|
-
return !t && !
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
244
|
+
const { formatMessage: l } = b(), [c, d] = L(!1);
|
|
245
|
+
return !t && !n ? /* @__PURE__ */ u(A, { children: [
|
|
246
|
+
/* @__PURE__ */ o(
|
|
247
|
+
W,
|
|
248
248
|
{
|
|
249
249
|
content: l({
|
|
250
250
|
id: a(
|
|
251
251
|
i ? "homePage.alert.noSync.description" : "homePage.alert.noSync.readOnlyDescription"
|
|
252
252
|
)
|
|
253
253
|
}),
|
|
254
|
-
action: i ? /* @__PURE__ */
|
|
255
|
-
|
|
254
|
+
action: i ? /* @__PURE__ */ o(
|
|
255
|
+
E,
|
|
256
256
|
{
|
|
257
257
|
onClick: () => d(!0),
|
|
258
258
|
disabled: r,
|
|
@@ -261,23 +261,23 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
261
261
|
) : void 0
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
|
-
i ? /* @__PURE__ */
|
|
265
|
-
|
|
264
|
+
i ? /* @__PURE__ */ o(
|
|
265
|
+
tt,
|
|
266
266
|
{
|
|
267
267
|
open: c,
|
|
268
268
|
onClose: () => d(!1),
|
|
269
269
|
contentTypeUid: e
|
|
270
270
|
}
|
|
271
271
|
) : null
|
|
272
|
-
] }) : /* @__PURE__ */ u(
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
] }) : /* @__PURE__ */ u(A, { children: [
|
|
273
|
+
n ? /* @__PURE__ */ o(
|
|
274
|
+
I,
|
|
275
275
|
{
|
|
276
276
|
title: l({
|
|
277
277
|
id: a("homePage.alert.unconfiguredRelations.title")
|
|
278
278
|
}),
|
|
279
279
|
variant: "danger",
|
|
280
|
-
action: s ? /* @__PURE__ */
|
|
280
|
+
action: s ? /* @__PURE__ */ o(Re, { tag: Me, to: "/settings/xecp/configuration", children: l({
|
|
281
281
|
id: a("homePage.alert.unconfiguredRelations.linkText")
|
|
282
282
|
}) }) : void 0,
|
|
283
283
|
description: l(
|
|
@@ -286,19 +286,19 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
286
286
|
s ? "homePage.alert.unconfiguredRelations.description" : "homePage.alert.unconfiguredRelations.readOnlyDescription"
|
|
287
287
|
)
|
|
288
288
|
},
|
|
289
|
-
{ relations:
|
|
289
|
+
{ relations: n.unconfiguredRelations.join(", ") }
|
|
290
290
|
)
|
|
291
291
|
}
|
|
292
292
|
) : null,
|
|
293
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ o(W, { content: l({ id: a("homePage.emptyState") }) })
|
|
294
294
|
] });
|
|
295
|
-
},
|
|
295
|
+
}, Ne = (e) => [
|
|
296
296
|
e,
|
|
297
297
|
...e.localizations ?? []
|
|
298
|
-
],
|
|
299
|
-
const
|
|
300
|
-
return
|
|
301
|
-
},
|
|
298
|
+
], nt = (e) => (e ?? []).flatMap(Ne), Ht = (e, t) => {
|
|
299
|
+
const n = t?.find((r) => r.documentId === e);
|
|
300
|
+
return n ? Ne(n) : [];
|
|
301
|
+
}, Vt = (e) => {
|
|
302
302
|
const t = e[0];
|
|
303
303
|
return t ? {
|
|
304
304
|
...t,
|
|
@@ -306,24 +306,24 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
306
306
|
} : null;
|
|
307
307
|
}, pe = (e, t) => {
|
|
308
308
|
if (!t) return e.uniqueKeyValue;
|
|
309
|
-
const
|
|
310
|
-
return typeof
|
|
309
|
+
const n = e?.[t];
|
|
310
|
+
return typeof n == "string" || typeof n == "number" ? String(n) : e.uniqueKeyValue;
|
|
311
311
|
}, se = (e) => ({
|
|
312
312
|
documentId: e.documentId,
|
|
313
313
|
locale: e.locale ?? "default"
|
|
314
|
-
}),
|
|
314
|
+
}), te = (e, t) => e.documentId === t.documentId && e.locale === t.locale, ce = (e, t) => t.some((n) => te(n, se(e))), Yt = (e) => [...new Set(e.map((t) => t.documentId))], jt = (e, t) => {
|
|
315
315
|
if (e.length === 0)
|
|
316
316
|
return !1;
|
|
317
|
-
const
|
|
318
|
-
return
|
|
319
|
-
},
|
|
320
|
-
const
|
|
321
|
-
return new Set([...e].filter((r) =>
|
|
322
|
-
},
|
|
317
|
+
const n = e.filter((r) => t.has(r)).length;
|
|
318
|
+
return n === 0 ? !1 : n === e.length ? !0 : "indeterminate";
|
|
319
|
+
}, Xt = (e, t) => {
|
|
320
|
+
const n = new Set(t);
|
|
321
|
+
return new Set([...e].filter((r) => n.has(r)));
|
|
322
|
+
}, Jt = "homePage.missingUniqueKey", le = {
|
|
323
323
|
single: "homePage.hint.missingUniqueKey.single",
|
|
324
324
|
allLocales: "homePage.hint.missingUniqueKey.allLocales",
|
|
325
325
|
someLocales: "homePage.hint.missingUniqueKey.someLocales"
|
|
326
|
-
},
|
|
326
|
+
}, Y = (e, t) => e !== "up_to_date" && t !== "missing_unique_key", Zt = (e) => {
|
|
327
327
|
switch (!0) {
|
|
328
328
|
case e.every((t) => t.warning === "missing_unique_key"):
|
|
329
329
|
return "allLocales";
|
|
@@ -332,39 +332,39 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
332
332
|
default:
|
|
333
333
|
return null;
|
|
334
334
|
}
|
|
335
|
-
},
|
|
335
|
+
}, ot = (e, t, n) => {
|
|
336
336
|
if (!e)
|
|
337
337
|
return "homePage.tooltip.noExecutePermission";
|
|
338
338
|
switch (!0) {
|
|
339
339
|
case t === "up_to_date":
|
|
340
340
|
return "homePage.tooltip.upToDate";
|
|
341
|
-
case
|
|
341
|
+
case n === "missing_unique_key":
|
|
342
342
|
return le.single;
|
|
343
343
|
default:
|
|
344
344
|
return null;
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, rt = (e, t) => {
|
|
347
347
|
if (!e)
|
|
348
348
|
return "homePage.tooltip.noExecutePermission";
|
|
349
349
|
switch (!0) {
|
|
350
|
-
case t.some((
|
|
350
|
+
case t.some((n) => Y(n.status, n.warning)):
|
|
351
351
|
return null;
|
|
352
|
-
case t.every((
|
|
352
|
+
case t.every((n) => n.status === "up_to_date"):
|
|
353
353
|
return "homePage.tooltip.allEntitiesUpToDate";
|
|
354
|
-
case t.every((
|
|
354
|
+
case t.every((n) => n.warning === "missing_unique_key"):
|
|
355
355
|
return le.allLocales;
|
|
356
356
|
default:
|
|
357
357
|
return le.someLocales;
|
|
358
358
|
}
|
|
359
|
-
},
|
|
359
|
+
}, xe = ({
|
|
360
360
|
checked: e,
|
|
361
361
|
onCheckedChange: t,
|
|
362
|
-
disable:
|
|
362
|
+
disable: n = !1,
|
|
363
363
|
tooltipLabel: r = ""
|
|
364
|
-
}) => /* @__PURE__ */
|
|
365
|
-
const { formatMessage: t } =
|
|
366
|
-
return e === "default" ? /* @__PURE__ */
|
|
367
|
-
},
|
|
364
|
+
}) => /* @__PURE__ */ o("div", { onClick: (i) => i.stopPropagation(), children: /* @__PURE__ */ o(qe, { label: n ? r : "", align: "start", children: /* @__PURE__ */ o(Le, { checked: e, onCheckedChange: t, disabled: n }) }) }), ye = ({ locale: e }) => {
|
|
365
|
+
const { formatMessage: t } = b();
|
|
366
|
+
return e === "default" ? /* @__PURE__ */ o(z, { variant: "neutral", children: t({ id: a("homePage.promotionResults.locale.nonLocalized") }) }) : /* @__PURE__ */ o(z, { variant: "neutral", children: e });
|
|
367
|
+
}, Wt = (e) => {
|
|
368
368
|
switch (e) {
|
|
369
369
|
case "new":
|
|
370
370
|
return "homePage.table.status.new";
|
|
@@ -375,7 +375,7 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
375
375
|
default:
|
|
376
376
|
return "homePage.table.status.new";
|
|
377
377
|
}
|
|
378
|
-
},
|
|
378
|
+
}, zt = (e) => {
|
|
379
379
|
switch (e) {
|
|
380
380
|
case "new":
|
|
381
381
|
return "success";
|
|
@@ -386,36 +386,36 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
386
386
|
default:
|
|
387
387
|
return "success";
|
|
388
388
|
}
|
|
389
|
-
},
|
|
390
|
-
const { formatMessage: t } =
|
|
391
|
-
return /* @__PURE__ */
|
|
392
|
-
id: a(
|
|
389
|
+
}, it = ({ status: e }) => {
|
|
390
|
+
const { formatMessage: t } = b();
|
|
391
|
+
return /* @__PURE__ */ o(z, { variant: zt(e), children: t({
|
|
392
|
+
id: a(Wt(e))
|
|
393
393
|
}) });
|
|
394
|
-
},
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
] }) }) : null, fe = ({ uniqueKey: e, missingUniqueKeyScope: t, maxCharacters:
|
|
398
|
-
const { formatMessage: r } =
|
|
394
|
+
}, en = ({ shouldShow: e, message: t, tooltipLabel: n }) => e ? /* @__PURE__ */ o(qe, { label: n, align: "start", children: /* @__PURE__ */ u(f, { direction: "row", gap: 1, alignItems: "center", children: [
|
|
395
|
+
/* @__PURE__ */ o(Ae, { fill: "warning500", width: 20, height: 20 }),
|
|
396
|
+
/* @__PURE__ */ o(h, { variant: "pi", textColor: "warning500", children: t })
|
|
397
|
+
] }) }) : null, fe = ({ uniqueKey: e, missingUniqueKeyScope: t, maxCharacters: n = 40 }) => {
|
|
398
|
+
const { formatMessage: r } = b();
|
|
399
399
|
if (!t)
|
|
400
|
-
return /* @__PURE__ */
|
|
401
|
-
|
|
400
|
+
return /* @__PURE__ */ o(
|
|
401
|
+
V,
|
|
402
402
|
{
|
|
403
|
-
maxCharacters:
|
|
403
|
+
maxCharacters: n,
|
|
404
404
|
text: e || "N/A",
|
|
405
405
|
variant: "pi",
|
|
406
406
|
textColor: "neutral600"
|
|
407
407
|
}
|
|
408
408
|
);
|
|
409
409
|
const i = r({
|
|
410
|
-
id: a(
|
|
410
|
+
id: a(Jt)
|
|
411
411
|
}), s = r({
|
|
412
412
|
id: a(le[t])
|
|
413
|
-
}), l = /* @__PURE__ */
|
|
414
|
-
return t === "someLocales" && e ? /* @__PURE__ */ u(
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
|
|
413
|
+
}), l = /* @__PURE__ */ o(en, { shouldShow: !0, tooltipLabel: s, message: i });
|
|
414
|
+
return t === "someLocales" && e ? /* @__PURE__ */ u(f, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
415
|
+
/* @__PURE__ */ o(
|
|
416
|
+
V,
|
|
417
417
|
{
|
|
418
|
-
maxCharacters:
|
|
418
|
+
maxCharacters: n,
|
|
419
419
|
text: e,
|
|
420
420
|
variant: "pi",
|
|
421
421
|
textColor: "neutral600"
|
|
@@ -423,10 +423,10 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
423
423
|
),
|
|
424
424
|
l
|
|
425
425
|
] }) : l;
|
|
426
|
-
},
|
|
426
|
+
}, at = ({
|
|
427
427
|
entryTitle: e,
|
|
428
428
|
uniqueKey: t,
|
|
429
|
-
missingUniqueKeyScope:
|
|
429
|
+
missingUniqueKeyScope: n,
|
|
430
430
|
locale: r,
|
|
431
431
|
titleMaxCharacters: i = 60,
|
|
432
432
|
checked: s,
|
|
@@ -435,8 +435,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
435
435
|
checkboxTooltipLabel: d,
|
|
436
436
|
status: m
|
|
437
437
|
}) => {
|
|
438
|
-
const p = /* @__PURE__ */
|
|
439
|
-
|
|
438
|
+
const p = /* @__PURE__ */ o(
|
|
439
|
+
V,
|
|
440
440
|
{
|
|
441
441
|
maxCharacters: i,
|
|
442
442
|
text: e,
|
|
@@ -444,10 +444,10 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
444
444
|
fontWeight: "semiBold"
|
|
445
445
|
}
|
|
446
446
|
);
|
|
447
|
-
return /* @__PURE__ */ u(
|
|
448
|
-
/* @__PURE__ */ u(
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
|
|
447
|
+
return /* @__PURE__ */ u(A, { children: [
|
|
448
|
+
/* @__PURE__ */ u(f, { direction: "row", gap: 4, alignItems: "center", children: [
|
|
449
|
+
/* @__PURE__ */ o(
|
|
450
|
+
xe,
|
|
451
451
|
{
|
|
452
452
|
checked: s,
|
|
453
453
|
onCheckedChange: l,
|
|
@@ -455,27 +455,27 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
455
455
|
tooltipLabel: d
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
|
-
r ? /* @__PURE__ */ u(
|
|
459
|
-
/* @__PURE__ */
|
|
458
|
+
r ? /* @__PURE__ */ u(f, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
459
|
+
/* @__PURE__ */ o(ye, { locale: r }),
|
|
460
460
|
p
|
|
461
461
|
] }) : p,
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ o(fe, { uniqueKey: t, missingUniqueKeyScope: n })
|
|
463
463
|
] }),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ o(it, { status: m })
|
|
465
465
|
] });
|
|
466
|
-
},
|
|
466
|
+
}, tn = ({
|
|
467
467
|
entryTitle: e,
|
|
468
468
|
uniqueKey: t,
|
|
469
|
-
status:
|
|
469
|
+
status: n,
|
|
470
470
|
warning: r,
|
|
471
471
|
locale: i,
|
|
472
472
|
isChecked: s,
|
|
473
473
|
onCheckItemChange: l,
|
|
474
474
|
canExecute: c
|
|
475
475
|
}) => {
|
|
476
|
-
const { formatMessage: d } =
|
|
477
|
-
return /* @__PURE__ */
|
|
478
|
-
|
|
476
|
+
const { formatMessage: d } = b(), m = !c || !Y(n, r), p = ot(c, n, r);
|
|
477
|
+
return /* @__PURE__ */ o(
|
|
478
|
+
f,
|
|
479
479
|
{
|
|
480
480
|
direction: "row",
|
|
481
481
|
justifyContent: "space-between",
|
|
@@ -487,8 +487,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
487
487
|
},
|
|
488
488
|
grow: 1,
|
|
489
489
|
gap: 4,
|
|
490
|
-
children: /* @__PURE__ */
|
|
491
|
-
|
|
490
|
+
children: /* @__PURE__ */ o(
|
|
491
|
+
at,
|
|
492
492
|
{
|
|
493
493
|
entryTitle: e,
|
|
494
494
|
uniqueKey: t,
|
|
@@ -498,22 +498,22 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
498
498
|
onCheckedChange: l,
|
|
499
499
|
checkboxDisabled: m,
|
|
500
500
|
checkboxTooltipLabel: p ? d({ id: a(p) }) : void 0,
|
|
501
|
-
status:
|
|
501
|
+
status: n
|
|
502
502
|
}
|
|
503
503
|
)
|
|
504
504
|
}
|
|
505
505
|
);
|
|
506
|
-
},
|
|
506
|
+
}, nn = ({
|
|
507
507
|
isAllCheckedInEntity: e,
|
|
508
508
|
onCheckAllInEntity: t,
|
|
509
|
-
entityWithLocalizations:
|
|
509
|
+
entityWithLocalizations: n,
|
|
510
510
|
selectedPromotions: r,
|
|
511
511
|
onCheckItemChange: i,
|
|
512
512
|
isIndeterminate: s,
|
|
513
513
|
contentTypeMainField: l,
|
|
514
514
|
canExecute: c
|
|
515
515
|
}) => {
|
|
516
|
-
const { formatMessage: d } =
|
|
516
|
+
const { formatMessage: d } = b(), m = [
|
|
517
517
|
{
|
|
518
518
|
key: "checkbox"
|
|
519
519
|
},
|
|
@@ -533,58 +533,58 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
533
533
|
key: "status",
|
|
534
534
|
label: d({ id: a("homePage.table.status") })
|
|
535
535
|
}
|
|
536
|
-
], p = !
|
|
537
|
-
(g) =>
|
|
538
|
-
),
|
|
536
|
+
], p = !n?.some(
|
|
537
|
+
(g) => Y(g.status, g.warning)
|
|
538
|
+
), y = rt(
|
|
539
539
|
c,
|
|
540
|
-
|
|
540
|
+
n ?? []
|
|
541
541
|
);
|
|
542
|
-
return /* @__PURE__ */ u(
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
|
|
542
|
+
return /* @__PURE__ */ u(_e, { colCount: m.length, rowCount: n?.length ?? 0, children: [
|
|
543
|
+
/* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ o(H, { children: m.map((g) => /* @__PURE__ */ o(F, { children: g.key === "checkbox" ? /* @__PURE__ */ o(
|
|
544
|
+
xe,
|
|
545
545
|
{
|
|
546
546
|
checked: s ? "indeterminate" : e,
|
|
547
547
|
onCheckedChange: t,
|
|
548
548
|
disable: p || !c,
|
|
549
|
-
tooltipLabel:
|
|
549
|
+
tooltipLabel: y ? d({ id: a(y) }) : ""
|
|
550
550
|
}
|
|
551
|
-
) : /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
const
|
|
551
|
+
) : /* @__PURE__ */ o(h, { variant: "sigma", children: g.label }) }, g.key)) }) }),
|
|
552
|
+
/* @__PURE__ */ o(De, { children: n?.map((g) => {
|
|
553
|
+
const P = !c || !Y(g.status, g.warning), C = ot(
|
|
554
554
|
c,
|
|
555
555
|
g.status,
|
|
556
556
|
g.warning
|
|
557
557
|
);
|
|
558
|
-
return /* @__PURE__ */ u(
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
|
|
558
|
+
return /* @__PURE__ */ u(H, { children: [
|
|
559
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(
|
|
560
|
+
xe,
|
|
561
561
|
{
|
|
562
562
|
checked: ce(g, r),
|
|
563
563
|
onCheckedChange: i(g),
|
|
564
|
-
disable:
|
|
565
|
-
tooltipLabel:
|
|
564
|
+
disable: P,
|
|
565
|
+
tooltipLabel: C ? d({ id: a(C) }) : ""
|
|
566
566
|
}
|
|
567
567
|
) }),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
|
|
568
|
+
/* @__PURE__ */ o(v, { children: g?.locale ? /* @__PURE__ */ o(ye, { locale: g.locale }) : null }),
|
|
569
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(
|
|
570
|
+
V,
|
|
571
571
|
{
|
|
572
572
|
maxCharacters: 50,
|
|
573
573
|
text: pe(g, l) || ""
|
|
574
574
|
}
|
|
575
575
|
) }),
|
|
576
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(
|
|
577
577
|
fe,
|
|
578
578
|
{
|
|
579
579
|
uniqueKey: g?.uniqueKeyValue,
|
|
580
580
|
missingUniqueKeyScope: g?.warning === "missing_unique_key" ? "single" : null
|
|
581
581
|
}
|
|
582
582
|
) }),
|
|
583
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(it, { status: g?.status }) })
|
|
584
584
|
] }, `${g.documentId}-${g.locale}`);
|
|
585
585
|
}) })
|
|
586
586
|
] });
|
|
587
|
-
},
|
|
587
|
+
}, on = Be(q.Trigger)`
|
|
588
588
|
width: 100%;
|
|
589
589
|
& > span:first-child {
|
|
590
590
|
width: 100%;
|
|
@@ -594,10 +594,10 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
594
594
|
width: 100%;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
`,
|
|
597
|
+
`, rn = ({
|
|
598
598
|
uniqueKey: e,
|
|
599
599
|
entityWithLocalizations: t,
|
|
600
|
-
entryTitle:
|
|
600
|
+
entryTitle: n,
|
|
601
601
|
selectedPromotions: r,
|
|
602
602
|
setSelectedPromotions: i,
|
|
603
603
|
onCheckItemChange: s,
|
|
@@ -605,37 +605,37 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
605
605
|
onRememberEntityGroup: c,
|
|
606
606
|
canExecute: d
|
|
607
607
|
}) => {
|
|
608
|
-
const { formatMessage: m } =
|
|
609
|
-
(
|
|
610
|
-
),
|
|
611
|
-
i((
|
|
612
|
-
const
|
|
613
|
-
(
|
|
614
|
-
),
|
|
615
|
-
(
|
|
608
|
+
const { formatMessage: m } = b(), p = t.filter(
|
|
609
|
+
(S) => Y(S.status, S.warning)
|
|
610
|
+
), y = (S) => {
|
|
611
|
+
i((G) => {
|
|
612
|
+
const Q = p.map(
|
|
613
|
+
(M) => se(M)
|
|
614
|
+
), K = (M) => t.some(
|
|
615
|
+
(R) => te(M, se(R))
|
|
616
616
|
);
|
|
617
|
-
return
|
|
617
|
+
return S ? (c?.(t), [...G.filter((R) => !K(R)), ...Q]) : G.filter((M) => !K(M));
|
|
618
618
|
});
|
|
619
619
|
}, g = t?.some(
|
|
620
|
-
(
|
|
621
|
-
),
|
|
622
|
-
(
|
|
623
|
-
),
|
|
620
|
+
(S) => ce(S, r)
|
|
621
|
+
), P = p.length > 0 && p.every(
|
|
622
|
+
(S) => ce(S, r)
|
|
623
|
+
), C = p.length === 0, T = rt(
|
|
624
624
|
d,
|
|
625
625
|
t
|
|
626
|
-
),
|
|
626
|
+
), $ = Zt(t), x = (() => {
|
|
627
627
|
switch (!0) {
|
|
628
|
-
case t?.some((
|
|
628
|
+
case t?.some((S) => S?.status === "new"):
|
|
629
629
|
return "new";
|
|
630
|
-
case t?.some((
|
|
630
|
+
case t?.some((S) => S?.status === "changed"):
|
|
631
631
|
return "changed";
|
|
632
632
|
default:
|
|
633
633
|
return "up_to_date";
|
|
634
634
|
}
|
|
635
|
-
})(),
|
|
636
|
-
return /* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
|
|
635
|
+
})(), O = g && !P;
|
|
636
|
+
return /* @__PURE__ */ o(q.Root, { style: { width: "100%" }, size: "M", children: /* @__PURE__ */ u(q.Item, { value: `${n}-${e}`, children: [
|
|
637
|
+
/* @__PURE__ */ o(q.Header, { children: /* @__PURE__ */ o(on, { caretPosition: "right", children: /* @__PURE__ */ o(
|
|
638
|
+
f,
|
|
639
639
|
{
|
|
640
640
|
direction: "row",
|
|
641
641
|
justifyContent: "space-between",
|
|
@@ -643,97 +643,97 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
643
643
|
style: { width: "100%" },
|
|
644
644
|
grow: 1,
|
|
645
645
|
gap: 4,
|
|
646
|
-
children: /* @__PURE__ */
|
|
647
|
-
|
|
646
|
+
children: /* @__PURE__ */ o(
|
|
647
|
+
at,
|
|
648
648
|
{
|
|
649
|
-
entryTitle:
|
|
649
|
+
entryTitle: n,
|
|
650
650
|
uniqueKey: e,
|
|
651
|
-
missingUniqueKeyScope:
|
|
652
|
-
checked:
|
|
653
|
-
onCheckedChange:
|
|
654
|
-
checkboxDisabled:
|
|
655
|
-
checkboxTooltipLabel:
|
|
656
|
-
status:
|
|
651
|
+
missingUniqueKeyScope: $,
|
|
652
|
+
checked: O ? "indeterminate" : P,
|
|
653
|
+
onCheckedChange: y,
|
|
654
|
+
checkboxDisabled: C || !d,
|
|
655
|
+
checkboxTooltipLabel: T ? m({ id: a(T) }) : void 0,
|
|
656
|
+
status: x
|
|
657
657
|
}
|
|
658
658
|
)
|
|
659
659
|
}
|
|
660
660
|
) }) }),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
|
|
661
|
+
/* @__PURE__ */ o(q.Content, { children: /* @__PURE__ */ o(
|
|
662
|
+
nn,
|
|
663
663
|
{
|
|
664
|
-
isAllCheckedInEntity:
|
|
665
|
-
onCheckAllInEntity:
|
|
664
|
+
isAllCheckedInEntity: P,
|
|
665
|
+
onCheckAllInEntity: y,
|
|
666
666
|
entityWithLocalizations: t,
|
|
667
667
|
selectedPromotions: r,
|
|
668
668
|
onCheckItemChange: s,
|
|
669
|
-
isIndeterminate:
|
|
669
|
+
isIndeterminate: O,
|
|
670
670
|
contentTypeMainField: l,
|
|
671
671
|
canExecute: d
|
|
672
672
|
}
|
|
673
673
|
) })
|
|
674
674
|
] }) });
|
|
675
|
-
},
|
|
675
|
+
}, an = ({
|
|
676
676
|
entities: e,
|
|
677
677
|
contentTypeMainField: t,
|
|
678
|
-
selectedPromotions:
|
|
678
|
+
selectedPromotions: n,
|
|
679
679
|
setSelectedPromotions: r,
|
|
680
680
|
onRememberEntityGroup: i,
|
|
681
681
|
canExecute: s
|
|
682
682
|
}) => {
|
|
683
683
|
const l = (d) => (m) => (p) => {
|
|
684
|
-
const
|
|
685
|
-
r((g) => p ? g.some((
|
|
684
|
+
const y = se(m);
|
|
685
|
+
r((g) => p ? g.some((P) => te(P, y)) ? g : (i?.(d), [...g, y]) : g.filter((P) => !te(P, y)));
|
|
686
686
|
}, c = (d, m) => {
|
|
687
|
-
const p = pe(d, t),
|
|
688
|
-
return m.length > 1 ? /* @__PURE__ */
|
|
689
|
-
|
|
687
|
+
const p = pe(d, t), y = d?.uniqueKeyValue || "";
|
|
688
|
+
return m.length > 1 ? /* @__PURE__ */ o(
|
|
689
|
+
rn,
|
|
690
690
|
{
|
|
691
|
-
uniqueKey:
|
|
691
|
+
uniqueKey: y,
|
|
692
692
|
contentTypeMainField: t,
|
|
693
693
|
entityWithLocalizations: m,
|
|
694
694
|
entryTitle: p || "",
|
|
695
|
-
selectedPromotions:
|
|
695
|
+
selectedPromotions: n,
|
|
696
696
|
setSelectedPromotions: r,
|
|
697
697
|
onCheckItemChange: l(m),
|
|
698
698
|
onRememberEntityGroup: i,
|
|
699
699
|
canExecute: s
|
|
700
700
|
}
|
|
701
|
-
) : /* @__PURE__ */
|
|
702
|
-
|
|
701
|
+
) : /* @__PURE__ */ o(
|
|
702
|
+
tn,
|
|
703
703
|
{
|
|
704
704
|
entryTitle: p || "",
|
|
705
|
-
uniqueKey:
|
|
705
|
+
uniqueKey: y,
|
|
706
706
|
status: d?.status,
|
|
707
707
|
warning: d?.warning,
|
|
708
708
|
locale: d?.locale,
|
|
709
|
-
isChecked: ce(d,
|
|
709
|
+
isChecked: ce(d, n),
|
|
710
710
|
onCheckItemChange: l(m)(d),
|
|
711
711
|
canExecute: s
|
|
712
712
|
}
|
|
713
713
|
);
|
|
714
714
|
};
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
const p =
|
|
717
|
-
return /* @__PURE__ */ u(
|
|
715
|
+
return /* @__PURE__ */ o("div", { children: e?.map((d, m) => {
|
|
716
|
+
const p = Ne(d);
|
|
717
|
+
return /* @__PURE__ */ u(Lt, { children: [
|
|
718
718
|
c(d, p),
|
|
719
|
-
e?.length - 1 > m && /* @__PURE__ */
|
|
719
|
+
e?.length - 1 > m && /* @__PURE__ */ o(xt, {})
|
|
720
720
|
] }, d?.documentId);
|
|
721
721
|
}) });
|
|
722
|
-
},
|
|
723
|
-
const { get: e } =
|
|
724
|
-
return
|
|
722
|
+
}, sn = () => {
|
|
723
|
+
const { get: e } = k();
|
|
724
|
+
return U({
|
|
725
725
|
queryKey: ["content-types"],
|
|
726
726
|
queryFn: async () => {
|
|
727
727
|
const { data: t } = await e("/content-type-builder/content-types");
|
|
728
728
|
return t.data;
|
|
729
729
|
}
|
|
730
730
|
});
|
|
731
|
-
},
|
|
732
|
-
const { get:
|
|
733
|
-
return
|
|
734
|
-
queryKey: [
|
|
731
|
+
}, cn = (e, t) => {
|
|
732
|
+
const { get: n } = k();
|
|
733
|
+
return U({
|
|
734
|
+
queryKey: [It, "related-content-types", e],
|
|
735
735
|
queryFn: async () => {
|
|
736
|
-
const { data: r } = await
|
|
736
|
+
const { data: r } = await n(
|
|
737
737
|
`/${_}/promotion/related-content-types`,
|
|
738
738
|
{
|
|
739
739
|
params: {
|
|
@@ -745,77 +745,77 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
745
745
|
},
|
|
746
746
|
enabled: !!e && t
|
|
747
747
|
});
|
|
748
|
-
},
|
|
749
|
-
const { post: e } =
|
|
748
|
+
}, ln = () => {
|
|
749
|
+
const { post: e } = k(), t = oe();
|
|
750
750
|
return ue({
|
|
751
|
-
mutationFn: async (
|
|
751
|
+
mutationFn: async (n) => {
|
|
752
752
|
const { data: r } = await e(
|
|
753
753
|
`/${_}/promotion`,
|
|
754
|
-
|
|
754
|
+
n
|
|
755
755
|
);
|
|
756
756
|
return r;
|
|
757
757
|
},
|
|
758
758
|
onSuccess: () => {
|
|
759
|
-
|
|
759
|
+
et(t);
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
|
-
},
|
|
762
|
+
}, dn = (e, t) => e.includes(t) ? [t, ...e.filter((n) => n !== t).sort()] : e.sort(), un = (e) => e.filter((t) => Y(t.status, t.warning)).map((t) => t.locale ?? "default"), mn = (e, t) => e.length > 0 && e.every((n) => t.includes(n)), gn = (e, t, n) => {
|
|
763
763
|
const r = /* @__PURE__ */ new Map();
|
|
764
764
|
for (const c of t ?? [])
|
|
765
765
|
r.set(c.documentId, c);
|
|
766
|
-
const i =
|
|
766
|
+
const i = nt(t), s = /* @__PURE__ */ new Map();
|
|
767
767
|
for (const c of e) {
|
|
768
768
|
const d = s.get(c.documentId) ?? [];
|
|
769
769
|
d.push(c), s.set(c.documentId, d);
|
|
770
770
|
}
|
|
771
771
|
return [...new Set(e.map((c) => c.documentId))].map((c) => {
|
|
772
|
-
const d = s.get(c) ?? [], m = r.get(c) ?? i.find((
|
|
773
|
-
(
|
|
774
|
-
(
|
|
775
|
-
documentId:
|
|
776
|
-
locale:
|
|
772
|
+
const d = s.get(c) ?? [], m = r.get(c) ?? i.find((C) => C.documentId === c), p = m?.locale ?? "default", y = m ?? i.find(
|
|
773
|
+
(C) => d.some(
|
|
774
|
+
(T) => te(T, {
|
|
775
|
+
documentId: C.documentId,
|
|
776
|
+
locale: C.locale ?? "default"
|
|
777
777
|
})
|
|
778
778
|
)
|
|
779
|
-
), g =
|
|
780
|
-
d.map((
|
|
779
|
+
), g = dn(
|
|
780
|
+
d.map((C) => C.locale),
|
|
781
781
|
p
|
|
782
|
-
),
|
|
783
|
-
|
|
782
|
+
), P = un(
|
|
783
|
+
Ht(c, t)
|
|
784
784
|
);
|
|
785
785
|
return {
|
|
786
786
|
documentId: c,
|
|
787
|
-
title:
|
|
787
|
+
title: y ? pe(y, n) ?? c : c,
|
|
788
788
|
locales: g,
|
|
789
|
-
allLocalesSelected:
|
|
790
|
-
uniqueKey:
|
|
789
|
+
allLocalesSelected: mn(P, g),
|
|
790
|
+
uniqueKey: y?.uniqueKeyValue ?? null
|
|
791
791
|
};
|
|
792
792
|
});
|
|
793
|
-
}, de = (e, t) => t?.find((
|
|
793
|
+
}, de = (e, t) => t?.find((n) => n.uid === e)?.schema.displayName ?? e, hn = (e) => {
|
|
794
794
|
const t = [
|
|
795
795
|
e.summary,
|
|
796
796
|
...e.dependencyResults.map((i) => i.summary)
|
|
797
|
-
],
|
|
798
|
-
return
|
|
799
|
-
},
|
|
800
|
-
for (const t of
|
|
801
|
-
const
|
|
802
|
-
if (
|
|
803
|
-
return
|
|
797
|
+
], n = t.reduce((i, s) => i + s.failed, 0), r = t.reduce((i, s) => i + s.total, 0);
|
|
798
|
+
return n === 0 ? "success" : n >= r ? "failure" : "partial";
|
|
799
|
+
}, pn = ["en", "default"], yn = (e) => {
|
|
800
|
+
for (const t of pn) {
|
|
801
|
+
const n = e.find((r) => r.locale === t);
|
|
802
|
+
if (n?.uniqueKey != null && n.uniqueKey.length > 0)
|
|
803
|
+
return n.uniqueKey;
|
|
804
804
|
}
|
|
805
805
|
return e.find((t) => t.uniqueKey != null && t.uniqueKey.length > 0)?.uniqueKey ?? null;
|
|
806
|
-
},
|
|
806
|
+
}, fn = (e, t, n) => {
|
|
807
807
|
if (e.uniqueKey != null && e.uniqueKey.length > 0)
|
|
808
808
|
return e.uniqueKey;
|
|
809
|
-
const r = e.documentId ?? e.documentKey, i =
|
|
809
|
+
const r = e.documentId ?? e.documentKey, i = nt(t).find(
|
|
810
810
|
(s) => s.documentId === r
|
|
811
811
|
);
|
|
812
812
|
if (i) {
|
|
813
|
-
const s = pe(i,
|
|
813
|
+
const s = pe(i, n);
|
|
814
814
|
if (s != null && String(s).length > 0)
|
|
815
815
|
return String(s);
|
|
816
816
|
}
|
|
817
817
|
return r;
|
|
818
|
-
},
|
|
818
|
+
}, Pn = (e) => {
|
|
819
819
|
if (e.documentId != null && e.documentId.length > 0)
|
|
820
820
|
return e.documentId;
|
|
821
821
|
const t = e.steps.find(
|
|
@@ -825,15 +825,15 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
825
825
|
return t;
|
|
826
826
|
if (e.uniqueKey != null && e.uniqueKey.length > 0)
|
|
827
827
|
return e.uniqueKey;
|
|
828
|
-
const
|
|
829
|
-
return
|
|
830
|
-
},
|
|
828
|
+
const n = e.groupKey.lastIndexOf("::");
|
|
829
|
+
return n === -1 ? e.groupKey : e.groupKey.slice(0, n);
|
|
830
|
+
}, Sn = {
|
|
831
831
|
create: "created",
|
|
832
832
|
update: "updated"
|
|
833
|
-
},
|
|
833
|
+
}, st = (e) => e.push.ok ? e.push.skipped || e.action === "skip" ? "skipped" : Sn[e.action] : "failed", Cn = (e) => {
|
|
834
834
|
const t = e[0];
|
|
835
|
-
return t ?
|
|
836
|
-
},
|
|
835
|
+
return t ? st(t) : "skipped";
|
|
836
|
+
}, bn = (e) => {
|
|
837
837
|
switch (e) {
|
|
838
838
|
case "failed":
|
|
839
839
|
return "danger";
|
|
@@ -846,77 +846,79 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
846
846
|
default:
|
|
847
847
|
return "success";
|
|
848
848
|
}
|
|
849
|
-
},
|
|
849
|
+
}, re = (e) => {
|
|
850
850
|
const t = /* @__PURE__ */ new Map();
|
|
851
|
-
for (const
|
|
852
|
-
const r =
|
|
853
|
-
i.push(
|
|
851
|
+
for (const n of e) {
|
|
852
|
+
const r = n.snapshotKey, i = t.get(r) ?? [];
|
|
853
|
+
i.push(n), t.set(r, i);
|
|
854
854
|
}
|
|
855
|
-
return Array.from(t.entries()).map(([
|
|
855
|
+
return Array.from(t.entries()).map(([n, r]) => {
|
|
856
856
|
const i = r.some((l) => !l.push.ok), s = r[r.length - 1];
|
|
857
857
|
return {
|
|
858
|
-
groupKey:
|
|
858
|
+
groupKey: n,
|
|
859
859
|
documentId: s.documentId,
|
|
860
860
|
locale: s.locale,
|
|
861
861
|
uniqueKey: s.uniqueKey,
|
|
862
|
-
outcome: i ? "failed" :
|
|
862
|
+
outcome: i ? "failed" : Cn(r),
|
|
863
863
|
steps: r,
|
|
864
864
|
hasFailure: i
|
|
865
865
|
};
|
|
866
866
|
});
|
|
867
|
-
},
|
|
868
|
-
const t =
|
|
867
|
+
}, ct = (e) => {
|
|
868
|
+
const t = re(e), n = /* @__PURE__ */ new Map();
|
|
869
869
|
for (const r of t) {
|
|
870
|
-
const i =
|
|
871
|
-
s.push(r),
|
|
870
|
+
const i = Pn(r), s = n.get(i) ?? [];
|
|
871
|
+
s.push(r), n.set(i, s);
|
|
872
872
|
}
|
|
873
|
-
return Array.from(
|
|
873
|
+
return Array.from(n.entries()).map(([r, i]) => {
|
|
874
874
|
const s = i.sort(
|
|
875
875
|
(l, c) => l.locale.localeCompare(c.locale)
|
|
876
876
|
);
|
|
877
877
|
return {
|
|
878
878
|
documentKey: r,
|
|
879
879
|
documentId: s[0]?.documentId,
|
|
880
|
-
uniqueKey:
|
|
880
|
+
uniqueKey: yn(s),
|
|
881
881
|
localeEntries: s
|
|
882
882
|
};
|
|
883
883
|
});
|
|
884
|
-
}, wn = (e, t) =>
|
|
885
|
-
id:
|
|
886
|
-
title:
|
|
887
|
-
|
|
884
|
+
}, wn = (e, t) => ct(e).map((n) => ({
|
|
885
|
+
id: n.documentKey,
|
|
886
|
+
title: fn(
|
|
887
|
+
n,
|
|
888
888
|
t?.comparedEntities,
|
|
889
889
|
t?.contentTypeMainField
|
|
890
890
|
),
|
|
891
|
-
entries:
|
|
892
|
-
})),
|
|
893
|
-
const t =
|
|
891
|
+
entries: n.localeEntries.flatMap((r) => r.steps)
|
|
892
|
+
})), je = (e) => {
|
|
893
|
+
const t = re(e);
|
|
894
894
|
return {
|
|
895
895
|
entityCount: t.length,
|
|
896
|
-
created: t.filter((
|
|
897
|
-
updated: t.filter((
|
|
898
|
-
skipped: t.filter((
|
|
899
|
-
failed: t.filter((
|
|
900
|
-
locales: [...new Set(t.map((
|
|
896
|
+
created: t.filter((n) => n.outcome === "created").length,
|
|
897
|
+
updated: t.filter((n) => n.outcome === "updated").length,
|
|
898
|
+
skipped: t.filter((n) => n.outcome === "skipped").length,
|
|
899
|
+
failed: t.filter((n) => n.outcome === "failed").length,
|
|
900
|
+
locales: [...new Set(t.map((n) => n.locale))].sort()
|
|
901
901
|
};
|
|
902
|
-
},
|
|
902
|
+
}, In = (e) => {
|
|
903
903
|
const t = {
|
|
904
904
|
total: 0,
|
|
905
905
|
created: 0,
|
|
906
906
|
updated: 0,
|
|
907
907
|
skipped: 0,
|
|
908
908
|
failed: 0
|
|
909
|
-
},
|
|
910
|
-
for (const r of
|
|
909
|
+
}, n = re(e);
|
|
910
|
+
for (const r of n) {
|
|
911
911
|
const i = r.steps[0];
|
|
912
|
-
i && (t.total += 1, t[
|
|
912
|
+
i && (t.total += 1, t[st(i)] += 1);
|
|
913
913
|
}
|
|
914
914
|
return t;
|
|
915
|
-
},
|
|
916
|
-
|
|
915
|
+
}, En = (e) => re(e).filter(
|
|
916
|
+
(t) => t.steps.some((n) => n.hasUnlinkedRelations)
|
|
917
|
+
).length, vn = (e, t) => {
|
|
918
|
+
const n = ct(e.entries), r = je(e.entries), i = [
|
|
917
919
|
...new Set(e.selections.map((d) => d.locale))
|
|
918
920
|
].sort(), s = e.dependencyResults.map((d) => {
|
|
919
|
-
const m =
|
|
921
|
+
const m = je(d.entries);
|
|
920
922
|
return {
|
|
921
923
|
contentTypeUid: d.contentTypeUid,
|
|
922
924
|
displayName: de(d.contentTypeUid, t),
|
|
@@ -924,9 +926,9 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
924
926
|
};
|
|
925
927
|
}), l = r.entityCount + s.reduce((d, m) => d + m.entityCount, 0), c = r.failed + s.reduce((d, m) => d + m.failed, 0);
|
|
926
928
|
return {
|
|
927
|
-
outcome:
|
|
929
|
+
outcome: hn(e),
|
|
928
930
|
primaryDisplayName: de(e.contentTypeUid, t),
|
|
929
|
-
primaryEntityCount:
|
|
931
|
+
primaryEntityCount: n.length,
|
|
930
932
|
dependencySummaries: s,
|
|
931
933
|
totalEntityCount: l,
|
|
932
934
|
totalFailed: c,
|
|
@@ -934,49 +936,49 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
934
936
|
dependencyContentTypeCount: e.dependencyResults.length,
|
|
935
937
|
mediaSummary: e.mediaSummary
|
|
936
938
|
};
|
|
937
|
-
},
|
|
938
|
-
const { formatMessage:
|
|
939
|
-
const i =
|
|
939
|
+
}, lt = ({ entries: e, showFailuresOnly: t = !1 }) => {
|
|
940
|
+
const { formatMessage: n } = b(), r = Je(() => {
|
|
941
|
+
const i = re(e);
|
|
940
942
|
return t ? i.filter((s) => s.hasFailure) : i;
|
|
941
943
|
}, [e, t]);
|
|
942
|
-
return r.length === 0 ? /* @__PURE__ */
|
|
944
|
+
return r.length === 0 ? /* @__PURE__ */ o(h, { variant: "omega", textColor: "neutral600", children: n({
|
|
943
945
|
id: a(
|
|
944
946
|
t ? "homePage.promotionResults.noFailures" : "homePage.promotionResults.noEntries"
|
|
945
947
|
)
|
|
946
|
-
}) }) : /* @__PURE__ */ u(
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
948
|
+
}) }) : /* @__PURE__ */ u(_e, { colCount: 3, rowCount: r.length, children: [
|
|
949
|
+
/* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ u(H, { children: [
|
|
950
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: n({ id: a("homePage.table.locale") }) }) }),
|
|
951
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: n({ id: a("homePage.table.key") }) }) }),
|
|
952
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: n({
|
|
951
953
|
id: a("homePage.promotionResults.table.outcome")
|
|
952
954
|
}) }) })
|
|
953
955
|
] }) }),
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ o(De, { children: r.map((i) => /* @__PURE__ */ u(H, { children: [
|
|
957
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(ye, { locale: i.locale }) }),
|
|
958
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(fe, { uniqueKey: i.uniqueKey, maxCharacters: 35 }) }),
|
|
959
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(z, { variant: bn(i.outcome), children: n({
|
|
958
960
|
id: a(`homePage.promotionResults.outcome.${i.outcome}`)
|
|
959
961
|
}) }) })
|
|
960
962
|
] }, i.groupKey)) })
|
|
961
963
|
] });
|
|
962
|
-
},
|
|
963
|
-
const { formatMessage:
|
|
964
|
+
}, Tn = ({ summary: e, unlinkedRelationCount: t = 0 }) => {
|
|
965
|
+
const { formatMessage: n } = b(), r = [
|
|
964
966
|
{
|
|
965
967
|
key: "created",
|
|
966
|
-
label:
|
|
968
|
+
label: n({ id: a("homePage.promotionResults.summary.created") }),
|
|
967
969
|
value: e.created,
|
|
968
970
|
variant: "success"
|
|
969
971
|
},
|
|
970
972
|
{
|
|
971
973
|
key: "updated",
|
|
972
|
-
label:
|
|
974
|
+
label: n({ id: a("homePage.promotionResults.summary.updated") }),
|
|
973
975
|
value: e.updated,
|
|
974
976
|
variant: "secondary"
|
|
975
977
|
},
|
|
976
978
|
...e.skipped > 0 ? [
|
|
977
979
|
{
|
|
978
980
|
key: "skipped",
|
|
979
|
-
label:
|
|
981
|
+
label: n({
|
|
980
982
|
id: a("homePage.promotionResults.summary.skipped")
|
|
981
983
|
}),
|
|
982
984
|
value: e.skipped,
|
|
@@ -986,20 +988,30 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
986
988
|
...e.failed > 0 ? [
|
|
987
989
|
{
|
|
988
990
|
key: "failed",
|
|
989
|
-
label:
|
|
991
|
+
label: n({
|
|
990
992
|
id: a("homePage.promotionResults.summary.failed")
|
|
991
993
|
}),
|
|
992
994
|
value: e.failed,
|
|
993
995
|
variant: "danger"
|
|
994
996
|
}
|
|
997
|
+
] : [],
|
|
998
|
+
...t > 0 ? [
|
|
999
|
+
{
|
|
1000
|
+
key: "unlinkedRelations",
|
|
1001
|
+
label: n({
|
|
1002
|
+
id: a("homePage.promotionResults.summary.unlinkedRelations")
|
|
1003
|
+
}),
|
|
1004
|
+
value: t,
|
|
1005
|
+
variant: "warning"
|
|
1006
|
+
}
|
|
995
1007
|
] : []
|
|
996
1008
|
];
|
|
997
|
-
return /* @__PURE__ */
|
|
998
|
-
|
|
1009
|
+
return /* @__PURE__ */ o(f, { gap: 2, wrap: "wrap", children: r.map((i) => /* @__PURE__ */ u(z, { variant: i.variant, children: [
|
|
1010
|
+
i.label,
|
|
999
1011
|
": ",
|
|
1000
|
-
|
|
1001
|
-
] },
|
|
1002
|
-
}, kn =
|
|
1012
|
+
i.value
|
|
1013
|
+
] }, i.key)) });
|
|
1014
|
+
}, kn = Be(q.Trigger)`
|
|
1003
1015
|
width: 100%;
|
|
1004
1016
|
font-weight: ${({ theme: e }) => e.fontWeights.regular};
|
|
1005
1017
|
|
|
@@ -1013,16 +1025,22 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1013
1025
|
font-weight: inherit;
|
|
1014
1026
|
}
|
|
1015
1027
|
}
|
|
1016
|
-
`,
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1028
|
+
`, Xe = ({ items: e }) => /* @__PURE__ */ o(q.Root, { style: { width: "100%" }, size: "S", children: e.map((t) => /* @__PURE__ */ u(q.Item, { value: t.id, children: [
|
|
1029
|
+
/* @__PURE__ */ o(q.Header, { children: /* @__PURE__ */ o(kn, { caretPosition: "right", children: /* @__PURE__ */ u(f, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
|
|
1030
|
+
/* @__PURE__ */ o(V, { maxCharacters: 40, text: t.title, fontWeight: "regular" }),
|
|
1031
|
+
/* @__PURE__ */ o(Mt, { style: { flexShrink: 0 }, children: /* @__PURE__ */ o(
|
|
1032
|
+
Tn,
|
|
1033
|
+
{
|
|
1034
|
+
summary: In(t.entries),
|
|
1035
|
+
unlinkedRelationCount: En(t.entries)
|
|
1036
|
+
}
|
|
1037
|
+
) })
|
|
1020
1038
|
] }) }) }),
|
|
1021
|
-
/* @__PURE__ */
|
|
1039
|
+
/* @__PURE__ */ o(q.Content, { children: /* @__PURE__ */ o(lt, { entries: t.entries }) })
|
|
1022
1040
|
] }, t.id)) }), xn = ({ overview: e }) => {
|
|
1023
|
-
const { formatMessage: t } =
|
|
1024
|
-
return /* @__PURE__ */ u(
|
|
1025
|
-
/* @__PURE__ */
|
|
1041
|
+
const { formatMessage: t } = b(), n = e.dependencySummaries.map((r) => r.displayName);
|
|
1042
|
+
return /* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
1043
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: t(
|
|
1026
1044
|
{ id: a("homePage.promotionResults.header.summary") },
|
|
1027
1045
|
{
|
|
1028
1046
|
primaryCount: e.primaryEntityCount,
|
|
@@ -1031,11 +1049,11 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1031
1049
|
failedCount: e.totalFailed
|
|
1032
1050
|
}
|
|
1033
1051
|
) }),
|
|
1034
|
-
|
|
1052
|
+
n.length > 0 && /* @__PURE__ */ o(h, { variant: "pi", textColor: "neutral600", children: t(
|
|
1035
1053
|
{ id: a("homePage.promotionResults.header.dependencies") },
|
|
1036
|
-
{ contentTypes:
|
|
1054
|
+
{ contentTypes: n.join(", ") }
|
|
1037
1055
|
) }),
|
|
1038
|
-
e.mediaSummary && /* @__PURE__ */
|
|
1056
|
+
e.mediaSummary && /* @__PURE__ */ o(h, { variant: "pi", textColor: "neutral600", children: t(
|
|
1039
1057
|
{ id: a("homePage.promotionResults.media.summary") },
|
|
1040
1058
|
{
|
|
1041
1059
|
uploaded: e.mediaSummary.uploaded,
|
|
@@ -1047,26 +1065,26 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1047
1065
|
}, Mn = ({
|
|
1048
1066
|
result: e,
|
|
1049
1067
|
contentTypes: t,
|
|
1050
|
-
comparedEntities:
|
|
1068
|
+
comparedEntities: n,
|
|
1051
1069
|
contentTypeMainField: r
|
|
1052
1070
|
}) => {
|
|
1053
|
-
const { formatMessage: i } =
|
|
1071
|
+
const { formatMessage: i } = b(), s = vn(e, t), l = s.outcome, c = [
|
|
1054
1072
|
...e.entries,
|
|
1055
|
-
...e.dependencyResults.flatMap((
|
|
1056
|
-
], d = de(e.contentTypeUid, t), m = s.totalFailed > 0, p = e.dependencyResults.length > 0,
|
|
1057
|
-
comparedEntities:
|
|
1073
|
+
...e.dependencyResults.flatMap((C) => C.entries)
|
|
1074
|
+
], d = de(e.contentTypeUid, t), m = s.totalFailed > 0, p = e.dependencyResults.length > 0, y = wn(e.entries, {
|
|
1075
|
+
comparedEntities: n,
|
|
1058
1076
|
contentTypeMainField: r
|
|
1059
|
-
}), g = e.dependencyResults.map((
|
|
1060
|
-
id:
|
|
1061
|
-
title: de(
|
|
1062
|
-
entries:
|
|
1077
|
+
}), g = e.dependencyResults.map((C) => ({
|
|
1078
|
+
id: C.contentTypeUid,
|
|
1079
|
+
title: de(C.contentTypeUid, t),
|
|
1080
|
+
entries: C.entries
|
|
1063
1081
|
}));
|
|
1064
|
-
return /* @__PURE__ */ u(
|
|
1082
|
+
return /* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
1065
1083
|
(() => {
|
|
1066
1084
|
switch (l) {
|
|
1067
1085
|
case "success":
|
|
1068
|
-
return /* @__PURE__ */
|
|
1069
|
-
|
|
1086
|
+
return /* @__PURE__ */ o(
|
|
1087
|
+
I,
|
|
1070
1088
|
{
|
|
1071
1089
|
variant: "success",
|
|
1072
1090
|
title: i({
|
|
@@ -1081,8 +1099,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1081
1099
|
}
|
|
1082
1100
|
);
|
|
1083
1101
|
case "partial":
|
|
1084
|
-
return /* @__PURE__ */
|
|
1085
|
-
|
|
1102
|
+
return /* @__PURE__ */ o(
|
|
1103
|
+
I,
|
|
1086
1104
|
{
|
|
1087
1105
|
variant: "warning",
|
|
1088
1106
|
title: i({
|
|
@@ -1094,8 +1112,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1094
1112
|
}
|
|
1095
1113
|
);
|
|
1096
1114
|
case "failure":
|
|
1097
|
-
return /* @__PURE__ */
|
|
1098
|
-
|
|
1115
|
+
return /* @__PURE__ */ o(
|
|
1116
|
+
I,
|
|
1099
1117
|
{
|
|
1100
1118
|
variant: "danger",
|
|
1101
1119
|
title: i({
|
|
@@ -1108,59 +1126,71 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1108
1126
|
);
|
|
1109
1127
|
}
|
|
1110
1128
|
})(),
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
|
|
1113
|
-
|
|
1129
|
+
e.hasUnlinkedRelations && /* @__PURE__ */ o(
|
|
1130
|
+
I,
|
|
1131
|
+
{
|
|
1132
|
+
variant: "warning",
|
|
1133
|
+
title: i({
|
|
1134
|
+
id: a("homePage.promotionResults.unlinkedRelations.title")
|
|
1135
|
+
}),
|
|
1136
|
+
description: i({
|
|
1137
|
+
id: a("homePage.promotionResults.unlinkedRelations.description")
|
|
1138
|
+
})
|
|
1139
|
+
}
|
|
1140
|
+
),
|
|
1141
|
+
/* @__PURE__ */ o(xn, { overview: s }),
|
|
1142
|
+
m && /* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
1143
|
+
/* @__PURE__ */ o(h, { variant: "delta", children: i({
|
|
1114
1144
|
id: a("homePage.promotionResults.failures.title")
|
|
1115
1145
|
}) }),
|
|
1116
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ o(lt, { entries: c, showFailuresOnly: !0 })
|
|
1117
1147
|
] }),
|
|
1118
|
-
/* @__PURE__ */ u(
|
|
1148
|
+
/* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
1119
1149
|
/* @__PURE__ */ u(h, { variant: "delta", children: [
|
|
1120
1150
|
d,
|
|
1121
1151
|
":"
|
|
1122
1152
|
] }),
|
|
1123
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ o(Xe, { items: y })
|
|
1124
1154
|
] }),
|
|
1125
|
-
p && /* @__PURE__ */ u(
|
|
1126
|
-
/* @__PURE__ */
|
|
1155
|
+
p && /* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
1156
|
+
/* @__PURE__ */ o(h, { variant: "delta", children: i({
|
|
1127
1157
|
id: a("homePage.promotionResults.dependencies.title")
|
|
1128
1158
|
}) }),
|
|
1129
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ o(Xe, { items: g })
|
|
1130
1160
|
] })
|
|
1131
1161
|
] });
|
|
1132
1162
|
}, Rn = ({
|
|
1133
1163
|
previews: e,
|
|
1134
1164
|
mediaDocumentIds: t,
|
|
1135
|
-
onToggleMediaDocument:
|
|
1165
|
+
onToggleMediaDocument: n
|
|
1136
1166
|
}) => {
|
|
1137
|
-
const { formatMessage: r } =
|
|
1138
|
-
return e.length === 0 ? null : /* @__PURE__ */ u(
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */ u(
|
|
1141
|
-
/* @__PURE__ */
|
|
1167
|
+
const { formatMessage: r } = b();
|
|
1168
|
+
return e.length === 0 ? null : /* @__PURE__ */ u(_e, { colCount: 4, rowCount: e.length, children: [
|
|
1169
|
+
/* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ u(H, { children: [
|
|
1170
|
+
/* @__PURE__ */ u(F, { children: [
|
|
1171
|
+
/* @__PURE__ */ o(h, { variant: "sigma", children: r({
|
|
1142
1172
|
id: a("homePage.modal.confirmPromotion.includeMedia")
|
|
1143
1173
|
}) }),
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
|
|
1174
|
+
/* @__PURE__ */ o(
|
|
1175
|
+
qe,
|
|
1146
1176
|
{
|
|
1147
1177
|
label: r({
|
|
1148
1178
|
id: a("homePage.modal.confirmPromotion.tooltip")
|
|
1149
1179
|
}),
|
|
1150
|
-
children: /* @__PURE__ */
|
|
1180
|
+
children: /* @__PURE__ */ o(qt, { style: { marginLeft: "4px" } })
|
|
1151
1181
|
}
|
|
1152
1182
|
)
|
|
1153
1183
|
] }),
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: r({ id: a("homePage.table.entryTitle") }) }) }),
|
|
1185
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: r({ id: a("homePage.table.locale") }) }) }),
|
|
1186
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(h, { variant: "sigma", children: r({ id: a("homePage.table.key") }) }) })
|
|
1157
1187
|
] }) }),
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
|
|
1188
|
+
/* @__PURE__ */ o(De, { children: e.map((i) => /* @__PURE__ */ u(H, { children: [
|
|
1189
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(
|
|
1190
|
+
Le,
|
|
1161
1191
|
{
|
|
1162
1192
|
checked: t.has(i.documentId),
|
|
1163
|
-
onCheckedChange: (s) =>
|
|
1193
|
+
onCheckedChange: (s) => n(i.documentId, s === !0),
|
|
1164
1194
|
"aria-label": r(
|
|
1165
1195
|
{
|
|
1166
1196
|
id: a("homePage.modal.confirmPromotion.includeMediaForDocument")
|
|
@@ -1169,82 +1199,82 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1169
1199
|
)
|
|
1170
1200
|
}
|
|
1171
1201
|
) }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(V, { maxCharacters: 50, text: i.title }) }),
|
|
1203
|
+
/* @__PURE__ */ o(v, { children: i.allLocalesSelected ? /* @__PURE__ */ o(h, { variant: "pi", children: r({
|
|
1174
1204
|
id: a("homePage.modal.confirmPromotion.allLocalesSelected")
|
|
1175
|
-
}) }) : /* @__PURE__ */
|
|
1176
|
-
/* @__PURE__ */
|
|
1205
|
+
}) }) : /* @__PURE__ */ o(f, { gap: 2, wrap: "wrap", children: i.locales.map((s) => /* @__PURE__ */ o(ye, { locale: s }, `${i.documentId}-${s}`)) }) }),
|
|
1206
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(fe, { uniqueKey: i.uniqueKey, maxCharacters: 35 }) })
|
|
1177
1207
|
] }, i.documentId)) })
|
|
1178
1208
|
] });
|
|
1179
1209
|
}, qn = ({
|
|
1180
1210
|
open: e,
|
|
1181
1211
|
onClose: t,
|
|
1182
|
-
selectedPromotions:
|
|
1212
|
+
selectedPromotions: n,
|
|
1183
1213
|
contentTypeUid: r,
|
|
1184
1214
|
contentTypeMainField: i,
|
|
1185
1215
|
comparedEntities: s,
|
|
1186
1216
|
onPromoteComplete: l
|
|
1187
1217
|
}) => {
|
|
1188
|
-
const { formatMessage: c } =
|
|
1218
|
+
const { formatMessage: c } = b(), { data: d } = sn(), { data: m } = cn(
|
|
1189
1219
|
r,
|
|
1190
1220
|
e
|
|
1191
|
-
), [p,
|
|
1192
|
-
mutate:
|
|
1193
|
-
isPending:
|
|
1194
|
-
error:
|
|
1195
|
-
reset:
|
|
1196
|
-
} =
|
|
1197
|
-
|
|
1221
|
+
), [p, y] = L(null), [g, P] = L(() => /* @__PURE__ */ new Set()), C = Yt(n), T = jt(C, g), $ = g.size > 0, {
|
|
1222
|
+
mutate: j,
|
|
1223
|
+
isPending: x,
|
|
1224
|
+
error: O,
|
|
1225
|
+
reset: S
|
|
1226
|
+
} = ln(), G = () => {
|
|
1227
|
+
y(null), P(/* @__PURE__ */ new Set()), S();
|
|
1198
1228
|
};
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1229
|
+
ne(() => {
|
|
1230
|
+
P((w) => Xt(w, C));
|
|
1231
|
+
}, [C]);
|
|
1232
|
+
const Q = m?.contentTypes.map((w) => w.displayName) ?? [], K = gn(
|
|
1233
|
+
n,
|
|
1204
1234
|
s,
|
|
1205
1235
|
i
|
|
1206
|
-
),
|
|
1207
|
-
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1210
|
-
},
|
|
1211
|
-
|
|
1212
|
-
const
|
|
1213
|
-
return Ce ?
|
|
1236
|
+
), M = () => {
|
|
1237
|
+
G(), t();
|
|
1238
|
+
}, R = (w) => {
|
|
1239
|
+
P(w ? new Set(C) : /* @__PURE__ */ new Set());
|
|
1240
|
+
}, Pe = (w, Ce) => {
|
|
1241
|
+
P((J) => {
|
|
1242
|
+
const D = new Set(J);
|
|
1243
|
+
return Ce ? D.add(w) : D.delete(w), D;
|
|
1214
1244
|
});
|
|
1215
1245
|
}, Se = () => {
|
|
1216
|
-
|
|
1246
|
+
j(
|
|
1217
1247
|
{
|
|
1218
|
-
selections:
|
|
1248
|
+
selections: n,
|
|
1219
1249
|
contentTypeUid: r,
|
|
1220
1250
|
mediaDocumentIds: [...g]
|
|
1221
1251
|
},
|
|
1222
1252
|
{
|
|
1223
1253
|
onSuccess: (w) => {
|
|
1224
|
-
|
|
1254
|
+
y(w), l?.(w);
|
|
1225
1255
|
}
|
|
1226
1256
|
}
|
|
1227
1257
|
);
|
|
1228
|
-
},
|
|
1229
|
-
return /* @__PURE__ */
|
|
1258
|
+
}, X = p != null;
|
|
1259
|
+
return /* @__PURE__ */ o(
|
|
1230
1260
|
me,
|
|
1231
1261
|
{
|
|
1232
1262
|
open: e,
|
|
1233
|
-
onClose:
|
|
1263
|
+
onClose: M,
|
|
1234
1264
|
onSubmit: Se,
|
|
1235
1265
|
title: c({
|
|
1236
1266
|
id: a(
|
|
1237
|
-
|
|
1267
|
+
X ? "homePage.modal.promotionResults.title" : "homePage.modal.confirmPromotion.title"
|
|
1238
1268
|
)
|
|
1239
1269
|
}),
|
|
1240
1270
|
confirmButtonText: c({
|
|
1241
1271
|
id: a("homePage.modal.confirmPromotion.confirmButtonText")
|
|
1242
1272
|
}),
|
|
1243
|
-
isConfirmButtonDisabled:
|
|
1244
|
-
isConfirmButtonLoading:
|
|
1245
|
-
showConfirmButton: !
|
|
1273
|
+
isConfirmButtonDisabled: x || !r || n.length === 0,
|
|
1274
|
+
isConfirmButtonLoading: x,
|
|
1275
|
+
showConfirmButton: !X,
|
|
1246
1276
|
fillMaxHeight: !0,
|
|
1247
|
-
children:
|
|
1277
|
+
children: X ? /* @__PURE__ */ o(
|
|
1248
1278
|
Mn,
|
|
1249
1279
|
{
|
|
1250
1280
|
result: p,
|
|
@@ -1252,33 +1282,33 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1252
1282
|
comparedEntities: s,
|
|
1253
1283
|
contentTypeMainField: i
|
|
1254
1284
|
}
|
|
1255
|
-
) : /* @__PURE__ */ u(
|
|
1256
|
-
/* @__PURE__ */
|
|
1285
|
+
) : /* @__PURE__ */ u(f, { direction: "column", gap: 4, alignItems: "stretch", children: [
|
|
1286
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: c(
|
|
1257
1287
|
{
|
|
1258
1288
|
id: a("homePage.modal.confirmPromotion.description")
|
|
1259
1289
|
},
|
|
1260
|
-
{ count:
|
|
1290
|
+
{ count: n.length }
|
|
1261
1291
|
) }),
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
|
|
1292
|
+
/* @__PURE__ */ o(
|
|
1293
|
+
Le,
|
|
1264
1294
|
{
|
|
1265
|
-
checked:
|
|
1266
|
-
onCheckedChange: (w) =>
|
|
1295
|
+
checked: T,
|
|
1296
|
+
onCheckedChange: (w) => R(w === !0),
|
|
1267
1297
|
children: c({
|
|
1268
1298
|
id: a("homePage.modal.confirmPromotion.includeMediaAll")
|
|
1269
1299
|
})
|
|
1270
1300
|
}
|
|
1271
1301
|
),
|
|
1272
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ o(
|
|
1273
1303
|
Rn,
|
|
1274
1304
|
{
|
|
1275
|
-
previews:
|
|
1305
|
+
previews: K,
|
|
1276
1306
|
mediaDocumentIds: g,
|
|
1277
|
-
onToggleMediaDocument:
|
|
1307
|
+
onToggleMediaDocument: Pe
|
|
1278
1308
|
}
|
|
1279
1309
|
),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
|
|
1310
|
+
/* @__PURE__ */ o(
|
|
1311
|
+
I,
|
|
1282
1312
|
{
|
|
1283
1313
|
variant: "default",
|
|
1284
1314
|
title: c({
|
|
@@ -1289,8 +1319,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1289
1319
|
})
|
|
1290
1320
|
}
|
|
1291
1321
|
),
|
|
1292
|
-
|
|
1293
|
-
|
|
1322
|
+
$ && /* @__PURE__ */ o(
|
|
1323
|
+
I,
|
|
1294
1324
|
{
|
|
1295
1325
|
variant: "default",
|
|
1296
1326
|
title: c({
|
|
@@ -1301,8 +1331,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1301
1331
|
})
|
|
1302
1332
|
}
|
|
1303
1333
|
),
|
|
1304
|
-
|
|
1305
|
-
|
|
1334
|
+
Q.length > 0 && /* @__PURE__ */ o(
|
|
1335
|
+
I,
|
|
1306
1336
|
{
|
|
1307
1337
|
variant: "warning",
|
|
1308
1338
|
title: c({
|
|
@@ -1312,19 +1342,19 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1312
1342
|
{
|
|
1313
1343
|
id: a("homePage.modal.confirmPromotion.relatedWarning.description")
|
|
1314
1344
|
},
|
|
1315
|
-
{ contentTypes:
|
|
1345
|
+
{ contentTypes: Q.join(", ") }
|
|
1316
1346
|
)
|
|
1317
1347
|
}
|
|
1318
1348
|
),
|
|
1319
|
-
|
|
1349
|
+
O && /* @__PURE__ */ o(h, { variant: "omega", textColor: "danger500", children: ge(O, c) })
|
|
1320
1350
|
] })
|
|
1321
1351
|
}
|
|
1322
1352
|
);
|
|
1323
|
-
}, Ln = 2500, _n = 5e3, Kn = (e) => e === "running" ? Ln : e === "queued" ? _n : !1,
|
|
1324
|
-
const { get:
|
|
1325
|
-
queryKey:
|
|
1353
|
+
}, Ln = 2500, _n = 5e3, Kn = (e) => e === "running" ? Ln : e === "queued" ? _n : !1, dt = (e, t = !0) => {
|
|
1354
|
+
const { get: n } = k(), r = oe(), i = Ze(void 0), s = U({
|
|
1355
|
+
queryKey: ee.list(e),
|
|
1326
1356
|
queryFn: async () => {
|
|
1327
|
-
const { data: l } = await
|
|
1357
|
+
const { data: l } = await n(
|
|
1328
1358
|
`/${_}/snapshot/sync/${e}/status`
|
|
1329
1359
|
);
|
|
1330
1360
|
return l;
|
|
@@ -1333,7 +1363,7 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1333
1363
|
refetchInterval: (l) => Kn(l.state.data?.status),
|
|
1334
1364
|
refetchOnWindowFocus: !0
|
|
1335
1365
|
});
|
|
1336
|
-
return
|
|
1366
|
+
return ne(() => {
|
|
1337
1367
|
if (!e)
|
|
1338
1368
|
return;
|
|
1339
1369
|
const l = i.current, c = s.data?.status;
|
|
@@ -1343,28 +1373,28 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1343
1373
|
syncStatus: e,
|
|
1344
1374
|
isSyncInProgressFromComparison: t
|
|
1345
1375
|
}) => {
|
|
1346
|
-
const
|
|
1376
|
+
const n = e?.status;
|
|
1347
1377
|
switch (!0) {
|
|
1348
|
-
case (
|
|
1378
|
+
case (n === "running" || t):
|
|
1349
1379
|
return "in_progress";
|
|
1350
|
-
case
|
|
1380
|
+
case n === "queued":
|
|
1351
1381
|
return "queued";
|
|
1352
|
-
case
|
|
1382
|
+
case n === "cancelled":
|
|
1353
1383
|
return "cancelled";
|
|
1354
|
-
case
|
|
1384
|
+
case n === "failed":
|
|
1355
1385
|
return "failed";
|
|
1356
1386
|
default:
|
|
1357
1387
|
return "none";
|
|
1358
1388
|
}
|
|
1359
|
-
}, An =
|
|
1389
|
+
}, An = Be(Rt)`
|
|
1360
1390
|
background-color: ${({ theme: e }) => e.colors.neutral600};
|
|
1361
1391
|
& > div {
|
|
1362
1392
|
background-color: ${({ theme: e }) => e.colors.neutral150};
|
|
1363
1393
|
}
|
|
1364
|
-
`,
|
|
1365
|
-
const { formatMessage:
|
|
1366
|
-
return /* @__PURE__ */ u(
|
|
1367
|
-
/* @__PURE__ */
|
|
1394
|
+
`, Te = ({ lastProcessedPage: e, totalPages: t }) => {
|
|
1395
|
+
const { formatMessage: n } = b(), r = (i, s) => Math.round(Number(i) / Number(s) * 100);
|
|
1396
|
+
return /* @__PURE__ */ u(f, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
1397
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: n(
|
|
1368
1398
|
{
|
|
1369
1399
|
id: a("homePage.alert.syncInProgress.progress")
|
|
1370
1400
|
},
|
|
@@ -1373,40 +1403,40 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1373
1403
|
totalPages: t
|
|
1374
1404
|
}
|
|
1375
1405
|
) }),
|
|
1376
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ o(An, { value: r(e, t) })
|
|
1377
1407
|
] });
|
|
1378
1408
|
}, Bn = ({
|
|
1379
1409
|
view: e,
|
|
1380
1410
|
syncStatus: t,
|
|
1381
|
-
onRefresh:
|
|
1411
|
+
onRefresh: n,
|
|
1382
1412
|
onCancel: r,
|
|
1383
1413
|
onResume: i,
|
|
1384
1414
|
canExecute: s
|
|
1385
1415
|
}) => {
|
|
1386
|
-
const { formatMessage: l } =
|
|
1416
|
+
const { formatMessage: l } = b();
|
|
1387
1417
|
if (e === "none")
|
|
1388
1418
|
return null;
|
|
1389
|
-
const c =
|
|
1419
|
+
const c = Nt(t?.error, l), m = (() => {
|
|
1390
1420
|
switch (e) {
|
|
1391
1421
|
case "queued":
|
|
1392
1422
|
return {
|
|
1393
1423
|
title: l({
|
|
1394
1424
|
id: a("homePage.alert.syncQueued.title")
|
|
1395
1425
|
}),
|
|
1396
|
-
description: /* @__PURE__ */ u(
|
|
1397
|
-
/* @__PURE__ */
|
|
1426
|
+
description: /* @__PURE__ */ u(f, { direction: "column", gap: 2, alignItems: "flex-start", children: [
|
|
1427
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: l({
|
|
1398
1428
|
id: a("homePage.alert.syncQueued.description")
|
|
1399
1429
|
}) }),
|
|
1400
|
-
t?.queuePosition != null ? /* @__PURE__ */
|
|
1430
|
+
t?.queuePosition != null ? /* @__PURE__ */ o(h, { variant: "omega", textColor: "neutral600", children: l(
|
|
1401
1431
|
{ id: a("homePage.alert.syncQueued.position") },
|
|
1402
1432
|
{ position: t.queuePosition }
|
|
1403
1433
|
) }) : null,
|
|
1404
|
-
t?.queuedAt ? /* @__PURE__ */
|
|
1434
|
+
t?.queuedAt ? /* @__PURE__ */ o(h, { variant: "omega", textColor: "neutral600", children: l(
|
|
1405
1435
|
{ id: a("homePage.alert.syncQueued.queuedAt") },
|
|
1406
1436
|
{ queuedAt: new Date(t.queuedAt).toLocaleString() }
|
|
1407
1437
|
) }) : null
|
|
1408
1438
|
] }),
|
|
1409
|
-
action: /* @__PURE__ */
|
|
1439
|
+
action: /* @__PURE__ */ o(E, { onClick: n, variant: "secondary", children: l({
|
|
1410
1440
|
id: a("homePage.alert.syncQueued.linkText")
|
|
1411
1441
|
}) }),
|
|
1412
1442
|
variant: "default"
|
|
@@ -1416,23 +1446,23 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1416
1446
|
title: l({
|
|
1417
1447
|
id: a("homePage.alert.syncInProgress.title")
|
|
1418
1448
|
}),
|
|
1419
|
-
description: /* @__PURE__ */ u(
|
|
1420
|
-
/* @__PURE__ */
|
|
1449
|
+
description: /* @__PURE__ */ u(f, { direction: "column", gap: 2, alignItems: "flex-start", children: [
|
|
1450
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: l({
|
|
1421
1451
|
id: a("homePage.alert.syncInProgress.description")
|
|
1422
1452
|
}) }),
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
|
|
1453
|
+
/* @__PURE__ */ o(
|
|
1454
|
+
Te,
|
|
1425
1455
|
{
|
|
1426
1456
|
lastProcessedPage: t?.lastProcessedPage ?? 0,
|
|
1427
1457
|
totalPages: t?.totalPages ?? 1
|
|
1428
1458
|
}
|
|
1429
1459
|
)
|
|
1430
1460
|
] }),
|
|
1431
|
-
action: /* @__PURE__ */ u(
|
|
1432
|
-
/* @__PURE__ */
|
|
1461
|
+
action: /* @__PURE__ */ u(f, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
1462
|
+
/* @__PURE__ */ o(E, { onClick: n, variant: "secondary", children: l({
|
|
1433
1463
|
id: a("homePage.alert.syncInProgress.linkText")
|
|
1434
1464
|
}) }),
|
|
1435
|
-
s ? /* @__PURE__ */
|
|
1465
|
+
s ? /* @__PURE__ */ o(E, { variant: "danger-light", onClick: r, children: l({
|
|
1436
1466
|
id: a("common.button.cancel")
|
|
1437
1467
|
}) }) : null
|
|
1438
1468
|
] }),
|
|
@@ -1443,19 +1473,19 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1443
1473
|
title: l({
|
|
1444
1474
|
id: a("homePage.alert.resumeSync.title")
|
|
1445
1475
|
}),
|
|
1446
|
-
description: /* @__PURE__ */ u(
|
|
1447
|
-
/* @__PURE__ */
|
|
1476
|
+
description: /* @__PURE__ */ u(f, { direction: "column", gap: 2, alignItems: "flex-start", children: [
|
|
1477
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: l({
|
|
1448
1478
|
id: a("homePage.alert.resumeSync.description")
|
|
1449
1479
|
}) }),
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
|
|
1480
|
+
/* @__PURE__ */ o(
|
|
1481
|
+
Te,
|
|
1452
1482
|
{
|
|
1453
1483
|
lastProcessedPage: t?.lastProcessedPage ?? 0,
|
|
1454
1484
|
totalPages: t?.totalPages ?? 1
|
|
1455
1485
|
}
|
|
1456
1486
|
)
|
|
1457
1487
|
] }),
|
|
1458
|
-
action: s ? /* @__PURE__ */
|
|
1488
|
+
action: s ? /* @__PURE__ */ o(E, { onClick: i, variant: "secondary", children: l({
|
|
1459
1489
|
id: a("homePage.alert.resumeSync.linkText")
|
|
1460
1490
|
}) }) : void 0,
|
|
1461
1491
|
variant: "warning"
|
|
@@ -1465,20 +1495,20 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1465
1495
|
title: l({
|
|
1466
1496
|
id: a("homePage.alert.syncFailed.title")
|
|
1467
1497
|
}),
|
|
1468
|
-
description: /* @__PURE__ */ u(
|
|
1469
|
-
/* @__PURE__ */
|
|
1498
|
+
description: /* @__PURE__ */ u(f, { direction: "column", gap: 2, alignItems: "flex-start", children: [
|
|
1499
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: l({
|
|
1470
1500
|
id: a("homePage.alert.syncFailed.description")
|
|
1471
1501
|
}) }),
|
|
1472
|
-
c ? /* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
|
|
1502
|
+
c ? /* @__PURE__ */ o(h, { variant: "omega", textColor: "danger500", children: c }) : null,
|
|
1503
|
+
/* @__PURE__ */ o(
|
|
1504
|
+
Te,
|
|
1475
1505
|
{
|
|
1476
1506
|
lastProcessedPage: t?.lastProcessedPage ?? 0,
|
|
1477
1507
|
totalPages: t?.totalPages ?? 1
|
|
1478
1508
|
}
|
|
1479
1509
|
)
|
|
1480
1510
|
] }),
|
|
1481
|
-
action: s ? /* @__PURE__ */
|
|
1511
|
+
action: s ? /* @__PURE__ */ o(E, { onClick: i, variant: "secondary", children: l({
|
|
1482
1512
|
id: a("homePage.alert.syncFailed.linkText")
|
|
1483
1513
|
}) }) : void 0,
|
|
1484
1514
|
variant: "danger"
|
|
@@ -1487,8 +1517,8 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1487
1517
|
return e;
|
|
1488
1518
|
}
|
|
1489
1519
|
})();
|
|
1490
|
-
return /* @__PURE__ */
|
|
1491
|
-
|
|
1520
|
+
return /* @__PURE__ */ o(
|
|
1521
|
+
I,
|
|
1492
1522
|
{
|
|
1493
1523
|
title: m?.title,
|
|
1494
1524
|
description: m?.description,
|
|
@@ -1497,7 +1527,7 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1497
1527
|
}
|
|
1498
1528
|
);
|
|
1499
1529
|
}, Nn = () => {
|
|
1500
|
-
const { post: e } =
|
|
1530
|
+
const { post: e } = k(), t = oe();
|
|
1501
1531
|
return ue({
|
|
1502
1532
|
mutationFn: async () => await e(`/${_}/snapshot/sync/cancel`),
|
|
1503
1533
|
onSuccess: () => {
|
|
@@ -1505,7 +1535,7 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1505
1535
|
}
|
|
1506
1536
|
});
|
|
1507
1537
|
}, Fn = ({ open: e, onClose: t }) => {
|
|
1508
|
-
const { formatMessage:
|
|
1538
|
+
const { formatMessage: n } = b(), {
|
|
1509
1539
|
mutate: r,
|
|
1510
1540
|
isPending: i,
|
|
1511
1541
|
error: s,
|
|
@@ -1513,40 +1543,40 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1513
1543
|
} = Nn(), c = () => {
|
|
1514
1544
|
t(), l();
|
|
1515
1545
|
};
|
|
1516
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ o(
|
|
1517
1547
|
me,
|
|
1518
1548
|
{
|
|
1519
1549
|
open: e,
|
|
1520
1550
|
onClose: c,
|
|
1521
1551
|
onSubmit: () => r(void 0, { onSuccess: c }),
|
|
1522
|
-
title: /* @__PURE__ */ u(
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
|
|
1552
|
+
title: /* @__PURE__ */ u(f, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
1553
|
+
/* @__PURE__ */ o(Ae, { fill: "danger500", width: 20, height: 20 }),
|
|
1554
|
+
n({
|
|
1525
1555
|
id: a("homePage.modal.cancelSync.title")
|
|
1526
1556
|
})
|
|
1527
1557
|
] }),
|
|
1528
|
-
confirmButtonText:
|
|
1558
|
+
confirmButtonText: n({
|
|
1529
1559
|
id: a("homePage.modal.cancelSync.confirmButtonText")
|
|
1530
1560
|
}),
|
|
1531
1561
|
isConfirmButtonLoading: i,
|
|
1532
|
-
children: /* @__PURE__ */ u(
|
|
1533
|
-
/* @__PURE__ */
|
|
1562
|
+
children: /* @__PURE__ */ u(f, { direction: "column", gap: 4, alignItems: "stretch", children: [
|
|
1563
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: n({
|
|
1534
1564
|
id: a("homePage.modal.cancelSync.description")
|
|
1535
1565
|
}) }),
|
|
1536
|
-
s && /* @__PURE__ */
|
|
1566
|
+
s && /* @__PURE__ */ o(h, { variant: "omega", textColor: "danger500", children: ge(s, n) })
|
|
1537
1567
|
] })
|
|
1538
1568
|
}
|
|
1539
1569
|
);
|
|
1540
1570
|
}, On = () => {
|
|
1541
|
-
const { post: e } =
|
|
1571
|
+
const { post: e } = k(), t = oe();
|
|
1542
1572
|
return ue({
|
|
1543
|
-
mutationFn: async (
|
|
1573
|
+
mutationFn: async (n) => await e(`/${_}/snapshot/sync/${n}/resume`),
|
|
1544
1574
|
onSuccess: () => {
|
|
1545
1575
|
he(t);
|
|
1546
1576
|
}
|
|
1547
1577
|
});
|
|
1548
|
-
}, Un = ({ open: e, onClose: t, jobDocumentId:
|
|
1549
|
-
const { formatMessage: r } =
|
|
1578
|
+
}, Un = ({ open: e, onClose: t, jobDocumentId: n }) => {
|
|
1579
|
+
const { formatMessage: r } = b(), {
|
|
1550
1580
|
mutate: i,
|
|
1551
1581
|
isPending: s,
|
|
1552
1582
|
error: l,
|
|
@@ -1554,183 +1584,183 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1554
1584
|
} = On(), d = () => {
|
|
1555
1585
|
t(), c();
|
|
1556
1586
|
};
|
|
1557
|
-
return /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ o(
|
|
1558
1588
|
me,
|
|
1559
1589
|
{
|
|
1560
1590
|
open: e,
|
|
1561
1591
|
onClose: d,
|
|
1562
|
-
onSubmit: () => i(
|
|
1592
|
+
onSubmit: () => i(n, { onSuccess: d }),
|
|
1563
1593
|
title: r({
|
|
1564
1594
|
id: a("homePage.modal.resumeSync.title")
|
|
1565
1595
|
}),
|
|
1566
1596
|
confirmButtonText: r({
|
|
1567
1597
|
id: a("homePage.modal.resumeSync.confirmButtonText")
|
|
1568
1598
|
}),
|
|
1569
|
-
isConfirmButtonDisabled: !
|
|
1599
|
+
isConfirmButtonDisabled: !n,
|
|
1570
1600
|
isConfirmButtonLoading: s,
|
|
1571
|
-
children: /* @__PURE__ */ u(
|
|
1572
|
-
/* @__PURE__ */
|
|
1601
|
+
children: /* @__PURE__ */ u(f, { direction: "column", gap: 4, alignItems: "stretch", children: [
|
|
1602
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: r({
|
|
1573
1603
|
id: a("homePage.modal.resumeSync.description")
|
|
1574
1604
|
}) }),
|
|
1575
|
-
l && /* @__PURE__ */
|
|
1605
|
+
l && /* @__PURE__ */ o(h, { variant: "omega", textColor: "danger500", children: ge(l, r) })
|
|
1576
1606
|
] })
|
|
1577
1607
|
}
|
|
1578
1608
|
);
|
|
1579
1609
|
}, $n = ({
|
|
1580
1610
|
contentTypeUid: e,
|
|
1581
1611
|
isSyncInProgressFromComparison: t,
|
|
1582
|
-
canExecute:
|
|
1612
|
+
canExecute: n,
|
|
1613
|
+
enabled: r = !0
|
|
1583
1614
|
}) => {
|
|
1584
|
-
const [
|
|
1585
|
-
|
|
1615
|
+
const [i, s] = L(!1), [l, c] = L(!1), { data: d, refetch: m } = dt(
|
|
1616
|
+
e,
|
|
1617
|
+
r
|
|
1618
|
+
), p = Dn({
|
|
1619
|
+
syncStatus: d,
|
|
1586
1620
|
isSyncInProgressFromComparison: t
|
|
1587
|
-
}),
|
|
1588
|
-
return /* @__PURE__ */ u(
|
|
1589
|
-
/* @__PURE__ */
|
|
1621
|
+
}), y = d?.jobDocumentId ?? "";
|
|
1622
|
+
return /* @__PURE__ */ u(A, { children: [
|
|
1623
|
+
/* @__PURE__ */ o(
|
|
1590
1624
|
Bn,
|
|
1591
1625
|
{
|
|
1592
|
-
view:
|
|
1593
|
-
syncStatus:
|
|
1594
|
-
onRefresh: () =>
|
|
1595
|
-
onCancel: () =>
|
|
1596
|
-
onResume: () =>
|
|
1597
|
-
canExecute:
|
|
1626
|
+
view: p,
|
|
1627
|
+
syncStatus: d,
|
|
1628
|
+
onRefresh: () => m(),
|
|
1629
|
+
onCancel: () => s(!0),
|
|
1630
|
+
onResume: () => c(!0),
|
|
1631
|
+
canExecute: n
|
|
1598
1632
|
}
|
|
1599
1633
|
),
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1634
|
+
n ? /* @__PURE__ */ u(A, { children: [
|
|
1635
|
+
/* @__PURE__ */ o(Fn, { open: i, onClose: () => s(!1) }),
|
|
1636
|
+
/* @__PURE__ */ o(
|
|
1603
1637
|
Un,
|
|
1604
1638
|
{
|
|
1605
|
-
open:
|
|
1606
|
-
onClose: () =>
|
|
1607
|
-
jobDocumentId:
|
|
1639
|
+
open: l,
|
|
1640
|
+
onClose: () => c(!1),
|
|
1641
|
+
jobDocumentId: y
|
|
1608
1642
|
}
|
|
1609
1643
|
)
|
|
1610
1644
|
] }) : null
|
|
1611
1645
|
] });
|
|
1612
1646
|
}, Gn = (e) => {
|
|
1613
|
-
const { get: t } =
|
|
1614
|
-
return
|
|
1647
|
+
const { get: t } = k();
|
|
1648
|
+
return U({
|
|
1615
1649
|
queryKey: ["compare-schemas"],
|
|
1616
1650
|
queryFn: async () => {
|
|
1617
|
-
const { data:
|
|
1618
|
-
return
|
|
1651
|
+
const { data: n } = await t(`/${_}/compare-schemas`);
|
|
1652
|
+
return n;
|
|
1619
1653
|
},
|
|
1620
1654
|
enabled: e
|
|
1621
1655
|
});
|
|
1622
1656
|
}, Qn = (e = !0) => {
|
|
1623
|
-
const { get: t } =
|
|
1624
|
-
return
|
|
1625
|
-
queryKey: [
|
|
1657
|
+
const { get: t } = k();
|
|
1658
|
+
return U({
|
|
1659
|
+
queryKey: [Et],
|
|
1626
1660
|
enabled: e,
|
|
1627
1661
|
queryFn: async () => {
|
|
1628
|
-
const { data:
|
|
1662
|
+
const { data: n } = await t(
|
|
1629
1663
|
`/${_}/promotion/promotable-content-types`
|
|
1630
1664
|
);
|
|
1631
|
-
return
|
|
1665
|
+
return n.contentTypes;
|
|
1632
1666
|
}
|
|
1633
1667
|
});
|
|
1634
1668
|
}, Hn = (e, t) => {
|
|
1635
|
-
const
|
|
1669
|
+
const n = new Set((e ?? []).map((i) => i.documentId)), r = [...t.entries()].filter(([i]) => !n.has(i)).map(([, i]) => Vt(i)).filter((i) => i != null);
|
|
1636
1670
|
return [...e ?? [], ...r];
|
|
1637
1671
|
}, Vn = (e, t) => {
|
|
1638
|
-
const
|
|
1672
|
+
const n = new Set(t.map((i) => i.documentId)), r = /* @__PURE__ */ new Map();
|
|
1639
1673
|
for (const [i, s] of e)
|
|
1640
|
-
|
|
1674
|
+
n.has(i) && r.set(i, s);
|
|
1641
1675
|
return r;
|
|
1642
1676
|
}, Yn = (e, t) => {
|
|
1643
|
-
const
|
|
1644
|
-
if (!
|
|
1677
|
+
const n = t[0]?.documentId;
|
|
1678
|
+
if (!n)
|
|
1645
1679
|
return e;
|
|
1646
1680
|
const r = new Map(e);
|
|
1647
|
-
return r.set(
|
|
1681
|
+
return r.set(n, t), r;
|
|
1648
1682
|
}, jn = (e) => {
|
|
1649
|
-
const [t,
|
|
1650
|
-
|
|
1683
|
+
const [t, n] = L([]), [r, i] = L(() => /* @__PURE__ */ new Map()), s = Ve(() => {
|
|
1684
|
+
n([]), i(/* @__PURE__ */ new Map());
|
|
1651
1685
|
}, []);
|
|
1652
|
-
|
|
1686
|
+
ne(() => {
|
|
1653
1687
|
i(
|
|
1654
1688
|
(d) => Vn(d, t)
|
|
1655
1689
|
);
|
|
1656
1690
|
}, [t]);
|
|
1657
|
-
const l =
|
|
1691
|
+
const l = Ve((d) => {
|
|
1658
1692
|
i(
|
|
1659
1693
|
(m) => Yn(m, d)
|
|
1660
1694
|
);
|
|
1661
|
-
}, []), c =
|
|
1695
|
+
}, []), c = Je(
|
|
1662
1696
|
() => Hn(e, r),
|
|
1663
1697
|
[e, r]
|
|
1664
1698
|
);
|
|
1665
1699
|
return {
|
|
1666
1700
|
selectedPromotions: t,
|
|
1667
|
-
setSelectedPromotions:
|
|
1701
|
+
setSelectedPromotions: n,
|
|
1668
1702
|
clear: s,
|
|
1669
1703
|
rememberEntityGroup: l,
|
|
1670
1704
|
entitiesForPreview: c
|
|
1671
1705
|
};
|
|
1672
1706
|
}, Xn = () => {
|
|
1673
|
-
const { formatMessage: e } =
|
|
1707
|
+
const { formatMessage: e } = b(), {
|
|
1674
1708
|
isLoading: t,
|
|
1675
|
-
allowedActions: { canExecute:
|
|
1676
|
-
} =
|
|
1709
|
+
allowedActions: { canExecute: n = !1, canRead: r = !1 }
|
|
1710
|
+
} = St([...ke.promotionExecute, ...ke.settingsRead]), [{ query: i }, s] = Ct(), l = Ze(!1), c = ae.object({
|
|
1677
1711
|
page: ae.coerce.number().optional().default(1),
|
|
1678
1712
|
pageSize: ae.coerce.number().optional().default(10),
|
|
1679
1713
|
uid: ae.string().optional()
|
|
1680
|
-
}).parse(i), [d, m] = L(!1), {
|
|
1681
|
-
data:
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
} =
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
} = Qn(C), x = X && (D?.length ?? 0) > 0, I = D?.map((A) => ({
|
|
1689
|
-
key: A.uid,
|
|
1690
|
-
value: A.uid,
|
|
1691
|
-
label: A.displayName
|
|
1714
|
+
}).parse(i), [d, m] = L(!1), { data: p, isLoading: y } = Kt(), g = p?.active === !0, P = !y && p?.active === !1, { data: C } = dt(c.uid ?? "", g), {
|
|
1715
|
+
data: T,
|
|
1716
|
+
isSuccess: $,
|
|
1717
|
+
isLoading: j
|
|
1718
|
+
} = Qn(g), x = $ && (T?.length ?? 0) > 0, O = T?.map((B) => ({
|
|
1719
|
+
key: B.uid,
|
|
1720
|
+
value: B.uid,
|
|
1721
|
+
label: B.displayName
|
|
1692
1722
|
})) ?? [], {
|
|
1693
|
-
data:
|
|
1723
|
+
data: S,
|
|
1694
1724
|
isLoading: G,
|
|
1695
1725
|
error: Q
|
|
1696
|
-
} =
|
|
1726
|
+
} = Ft({
|
|
1697
1727
|
uid: c.uid,
|
|
1698
1728
|
page: c.page,
|
|
1699
1729
|
pageSize: c.pageSize,
|
|
1700
|
-
enabled:
|
|
1730
|
+
enabled: g
|
|
1701
1731
|
}), {
|
|
1702
|
-
selectedPromotions:
|
|
1703
|
-
setSelectedPromotions:
|
|
1704
|
-
clear:
|
|
1705
|
-
rememberEntityGroup:
|
|
1706
|
-
entitiesForPreview:
|
|
1707
|
-
} = jn(
|
|
1732
|
+
selectedPromotions: K,
|
|
1733
|
+
setSelectedPromotions: M,
|
|
1734
|
+
clear: R,
|
|
1735
|
+
rememberEntityGroup: Pe,
|
|
1736
|
+
entitiesForPreview: Se
|
|
1737
|
+
} = jn(S?.results), X = (B) => {
|
|
1708
1738
|
l.current = !1, s({
|
|
1709
1739
|
...i,
|
|
1710
1740
|
page: 1,
|
|
1711
1741
|
pageSize: 10,
|
|
1712
|
-
uid:
|
|
1713
|
-
}),
|
|
1714
|
-
},
|
|
1742
|
+
uid: B
|
|
1743
|
+
}), R();
|
|
1744
|
+
}, w = () => {
|
|
1715
1745
|
l.current = !0, s({
|
|
1716
1746
|
...i,
|
|
1717
1747
|
page: 1,
|
|
1718
1748
|
pageSize: 10,
|
|
1719
1749
|
uid: void 0
|
|
1720
|
-
}),
|
|
1721
|
-
},
|
|
1722
|
-
m(!1),
|
|
1750
|
+
}), R();
|
|
1751
|
+
}, Ce = () => {
|
|
1752
|
+
m(!1), R();
|
|
1723
1753
|
}, {
|
|
1724
|
-
data:
|
|
1725
|
-
isLoading:
|
|
1726
|
-
error:
|
|
1727
|
-
} = Gn(
|
|
1754
|
+
data: J,
|
|
1755
|
+
isLoading: D,
|
|
1756
|
+
error: Fe
|
|
1757
|
+
} = Gn(g && x), Oe = S?.mainField, ut = S?.maxDepthReached, be = S?.errors, mt = be?.type === "unconfigured_relations" ? be : void 0, we = be?.type === "sync_in_progress", Ie = we || C?.status === "running", ie = !P && !D && (!!Fe || !!J && !J?.isMatch), Ue = !n || y || P || D || ie || we || C?.status === "running" || C?.status === "queued", gt = !!c.uid && G, ht = () => {
|
|
1728
1758
|
switch (!0) {
|
|
1729
|
-
case (
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
case (
|
|
1732
|
-
return /* @__PURE__ */
|
|
1733
|
-
|
|
1759
|
+
case (j || gt):
|
|
1760
|
+
return /* @__PURE__ */ o(ve, {});
|
|
1761
|
+
case ($ && !x):
|
|
1762
|
+
return /* @__PURE__ */ o(
|
|
1763
|
+
I,
|
|
1734
1764
|
{
|
|
1735
1765
|
title: e({
|
|
1736
1766
|
id: a("homePage.alert.configurationNeeded.title")
|
|
@@ -1740,25 +1770,25 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1740
1770
|
r ? "homePage.alert.configurationNeeded.description" : "homePage.alert.configurationNeeded.readOnlyDescription"
|
|
1741
1771
|
)
|
|
1742
1772
|
}),
|
|
1743
|
-
action: r ? /* @__PURE__ */
|
|
1773
|
+
action: r ? /* @__PURE__ */ o(Re, { tag: Me, to: "/settings/xecp/configuration", children: e({
|
|
1744
1774
|
id: a("homePage.alert.configurationNeeded.linkText")
|
|
1745
1775
|
}) }) : void 0,
|
|
1746
1776
|
variant: "danger"
|
|
1747
1777
|
}
|
|
1748
1778
|
);
|
|
1749
|
-
case
|
|
1750
|
-
return /* @__PURE__ */
|
|
1751
|
-
|
|
1779
|
+
case Ie:
|
|
1780
|
+
return /* @__PURE__ */ o(
|
|
1781
|
+
W,
|
|
1752
1782
|
{
|
|
1753
1783
|
content: e({
|
|
1754
1784
|
id: a("homePage.alert.syncInProgress.contentUnavailable")
|
|
1755
1785
|
})
|
|
1756
1786
|
}
|
|
1757
1787
|
);
|
|
1758
|
-
case (
|
|
1759
|
-
return /* @__PURE__ */ u(
|
|
1760
|
-
|
|
1761
|
-
|
|
1788
|
+
case (S?.results && S?.results?.length > 0):
|
|
1789
|
+
return /* @__PURE__ */ u(A, { children: [
|
|
1790
|
+
ut && /* @__PURE__ */ o(
|
|
1791
|
+
I,
|
|
1762
1792
|
{
|
|
1763
1793
|
title: e({
|
|
1764
1794
|
id: a("homePage.alert.maxDepthExceeded.title")
|
|
@@ -1769,41 +1799,41 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1769
1799
|
})
|
|
1770
1800
|
}
|
|
1771
1801
|
),
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
|
|
1802
|
+
/* @__PURE__ */ o(
|
|
1803
|
+
an,
|
|
1774
1804
|
{
|
|
1775
|
-
entities:
|
|
1776
|
-
contentTypeMainField:
|
|
1777
|
-
selectedPromotions:
|
|
1778
|
-
setSelectedPromotions:
|
|
1779
|
-
onRememberEntityGroup:
|
|
1780
|
-
canExecute:
|
|
1805
|
+
entities: S?.results,
|
|
1806
|
+
contentTypeMainField: Oe,
|
|
1807
|
+
selectedPromotions: K,
|
|
1808
|
+
setSelectedPromotions: M,
|
|
1809
|
+
onRememberEntityGroup: Pe,
|
|
1810
|
+
canExecute: n && !P
|
|
1781
1811
|
}
|
|
1782
1812
|
)
|
|
1783
1813
|
] });
|
|
1784
1814
|
case !!Q:
|
|
1785
|
-
return /* @__PURE__ */
|
|
1786
|
-
|
|
1815
|
+
return /* @__PURE__ */ o(
|
|
1816
|
+
W,
|
|
1787
1817
|
{
|
|
1788
|
-
icon: /* @__PURE__ */
|
|
1818
|
+
icon: /* @__PURE__ */ o(Ae, { width: 24, height: 24 }),
|
|
1789
1819
|
content: e({ id: a("homePage.errorLoadingEntities") })
|
|
1790
1820
|
}
|
|
1791
1821
|
);
|
|
1792
|
-
case (
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
|
|
1822
|
+
case (S?.results && S?.results?.length === 0):
|
|
1823
|
+
return /* @__PURE__ */ o(
|
|
1824
|
+
Qt,
|
|
1795
1825
|
{
|
|
1796
1826
|
contentTypeUid: c.uid ?? "",
|
|
1797
|
-
hasExistingSnapshot:
|
|
1798
|
-
unconfiguredRelationsError:
|
|
1799
|
-
isGetSnapshotDisabled:
|
|
1800
|
-
canExecute:
|
|
1827
|
+
hasExistingSnapshot: S?.snapshot?.exists ?? !1,
|
|
1828
|
+
unconfiguredRelationsError: mt,
|
|
1829
|
+
isGetSnapshotDisabled: Ue,
|
|
1830
|
+
canExecute: n && !P,
|
|
1801
1831
|
canReadSettings: r
|
|
1802
1832
|
}
|
|
1803
1833
|
);
|
|
1804
1834
|
default:
|
|
1805
|
-
return /* @__PURE__ */
|
|
1806
|
-
|
|
1835
|
+
return /* @__PURE__ */ o(
|
|
1836
|
+
W,
|
|
1807
1837
|
{
|
|
1808
1838
|
content: e({
|
|
1809
1839
|
id: a("homePage.youNeedToSelectAContentTypeToSeeTheEntities")
|
|
@@ -1811,116 +1841,117 @@ const Kt = 120 * 1e3, Dt = () => {
|
|
|
1811
1841
|
}
|
|
1812
1842
|
);
|
|
1813
1843
|
}
|
|
1814
|
-
},
|
|
1844
|
+
}, $e = S?.snapshot?.exists ?? !1, pt = !Ie && $e && S?.pagination && S?.pagination?.pageCount > 0, yt = !n || y || P || D || !x || ie || !c.uid || K.length === 0 || Ie, ft = j || y || D || P || ie || !x, Pt = () => {
|
|
1815
1845
|
switch (!0) {
|
|
1816
|
-
case f:
|
|
1817
|
-
return /* @__PURE__ */ u(P, { gap: 2, alignItems: "center", children: [
|
|
1818
|
-
/* @__PURE__ */ n(ve, { small: !0 }),
|
|
1819
|
-
/* @__PURE__ */ n(h, { variant: "omega", children: e({ id: a("homePage.verifyingLicense") }) })
|
|
1820
|
-
] });
|
|
1821
1846
|
case y:
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1847
|
+
return /* @__PURE__ */ u(f, { gap: 2, alignItems: "center", children: [
|
|
1848
|
+
/* @__PURE__ */ o(ve, { small: !0 }),
|
|
1849
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: e({ id: a("homePage.verifyingLicense") }) })
|
|
1850
|
+
] });
|
|
1851
|
+
case P:
|
|
1852
|
+
return /* @__PURE__ */ o($t, { canReadSettings: r });
|
|
1853
|
+
case D:
|
|
1854
|
+
return /* @__PURE__ */ u(f, { gap: 2, alignItems: "center", children: [
|
|
1855
|
+
/* @__PURE__ */ o(ve, { small: !0 }),
|
|
1856
|
+
/* @__PURE__ */ o(h, { variant: "omega", children: e({ id: a("homePage.verifyingSchemas") }) })
|
|
1827
1857
|
] });
|
|
1828
1858
|
case ie:
|
|
1829
|
-
return /* @__PURE__ */
|
|
1830
|
-
|
|
1859
|
+
return /* @__PURE__ */ o(
|
|
1860
|
+
Gt,
|
|
1831
1861
|
{
|
|
1832
|
-
compareSchemasData:
|
|
1833
|
-
errorCompareSchemas:
|
|
1862
|
+
compareSchemasData: J,
|
|
1863
|
+
errorCompareSchemas: Fe?.message
|
|
1834
1864
|
}
|
|
1835
1865
|
);
|
|
1836
1866
|
default:
|
|
1837
1867
|
return null;
|
|
1838
1868
|
}
|
|
1839
|
-
},
|
|
1840
|
-
return
|
|
1841
|
-
if (
|
|
1842
|
-
const
|
|
1843
|
-
|
|
1869
|
+
}, Ge = l.current || !!c.uid || !x;
|
|
1870
|
+
return ne(() => {
|
|
1871
|
+
if (Ge) return;
|
|
1872
|
+
const B = T?.[0]?.uid;
|
|
1873
|
+
B && s({
|
|
1844
1874
|
...i,
|
|
1845
|
-
uid:
|
|
1875
|
+
uid: B,
|
|
1846
1876
|
page: 1,
|
|
1847
1877
|
pageSize: 10
|
|
1848
1878
|
});
|
|
1849
|
-
}, [
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */ u(
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
|
|
1879
|
+
}, [Ge, T, i, s]), t ? /* @__PURE__ */ o(Z.Loading, {}) : /* @__PURE__ */ u(A, { children: [
|
|
1880
|
+
/* @__PURE__ */ o(Z.Title, { children: e({ id: a("homePage.title") }) }),
|
|
1881
|
+
/* @__PURE__ */ u(Z.Main, { children: [
|
|
1882
|
+
/* @__PURE__ */ o(
|
|
1883
|
+
Qe.Header,
|
|
1854
1884
|
{
|
|
1855
1885
|
title: e({ id: a("homePage.title") }),
|
|
1856
|
-
primaryAction:
|
|
1886
|
+
primaryAction: n ? /* @__PURE__ */ o(E, { disabled: yt, onClick: () => m(!0), children: e({ id: a("homePage.promoteContent") }) }) : null
|
|
1857
1887
|
}
|
|
1858
1888
|
),
|
|
1859
|
-
/* @__PURE__ */
|
|
1860
|
-
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
|
|
1889
|
+
/* @__PURE__ */ o(Qe.Content, { children: /* @__PURE__ */ u(f, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
1890
|
+
Pt(),
|
|
1891
|
+
/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
|
|
1892
|
+
Dt,
|
|
1863
1893
|
{
|
|
1864
1894
|
name: "contentType",
|
|
1865
1895
|
placeholder: e({ id: a("homePage.selectContentType") }),
|
|
1866
|
-
onClear:
|
|
1867
|
-
onChange:
|
|
1868
|
-
options:
|
|
1896
|
+
onClear: w,
|
|
1897
|
+
onChange: X,
|
|
1898
|
+
options: O,
|
|
1869
1899
|
value: c.uid,
|
|
1870
|
-
disabled:
|
|
1900
|
+
disabled: ft
|
|
1871
1901
|
}
|
|
1872
1902
|
) }),
|
|
1873
|
-
c?.uid && !
|
|
1874
|
-
/* @__PURE__ */
|
|
1903
|
+
c?.uid && !P ? /* @__PURE__ */ u(A, { children: [
|
|
1904
|
+
/* @__PURE__ */ o(
|
|
1875
1905
|
$n,
|
|
1876
1906
|
{
|
|
1877
1907
|
contentTypeUid: c.uid,
|
|
1878
1908
|
isSyncInProgressFromComparison: we,
|
|
1879
|
-
canExecute:
|
|
1909
|
+
canExecute: n && !P,
|
|
1910
|
+
enabled: g
|
|
1880
1911
|
}
|
|
1881
1912
|
),
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
|
|
1913
|
+
/* @__PURE__ */ o(
|
|
1914
|
+
Ut,
|
|
1884
1915
|
{
|
|
1885
1916
|
contentTypeUid: c.uid,
|
|
1886
|
-
selectedPromotionsLength:
|
|
1887
|
-
syncedAt:
|
|
1888
|
-
isGetSnapshotDisabled:
|
|
1889
|
-
hasSnapshot:
|
|
1890
|
-
clearSelectedPromotions:
|
|
1891
|
-
canExecute:
|
|
1917
|
+
selectedPromotionsLength: K.length,
|
|
1918
|
+
syncedAt: S?.snapshot?.syncedAt ?? null,
|
|
1919
|
+
isGetSnapshotDisabled: Ue,
|
|
1920
|
+
hasSnapshot: $e,
|
|
1921
|
+
clearSelectedPromotions: R,
|
|
1922
|
+
canExecute: n && !P
|
|
1892
1923
|
}
|
|
1893
1924
|
)
|
|
1894
1925
|
] }) : null,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1926
|
+
P ? null : ht(),
|
|
1927
|
+
pt && !P ? /* @__PURE__ */ u(
|
|
1928
|
+
Ee.Root,
|
|
1898
1929
|
{
|
|
1899
|
-
total:
|
|
1900
|
-
pageCount:
|
|
1930
|
+
total: S?.pagination?.total || 0,
|
|
1931
|
+
pageCount: S?.pagination?.pageCount || 0,
|
|
1901
1932
|
children: [
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ o(Ee.PageSize, {}),
|
|
1934
|
+
/* @__PURE__ */ o(Ee.Links, {})
|
|
1904
1935
|
]
|
|
1905
1936
|
}
|
|
1906
1937
|
) : null
|
|
1907
1938
|
] }) })
|
|
1908
1939
|
] }),
|
|
1909
|
-
|
|
1940
|
+
n && !P && d ? /* @__PURE__ */ o(
|
|
1910
1941
|
qn,
|
|
1911
1942
|
{
|
|
1912
1943
|
open: d,
|
|
1913
|
-
onClose:
|
|
1914
|
-
selectedPromotions:
|
|
1944
|
+
onClose: Ce,
|
|
1945
|
+
selectedPromotions: K,
|
|
1915
1946
|
contentTypeUid: c.uid ?? "",
|
|
1916
|
-
contentTypeMainField:
|
|
1917
|
-
comparedEntities:
|
|
1947
|
+
contentTypeMainField: Oe,
|
|
1948
|
+
comparedEntities: Se
|
|
1918
1949
|
}
|
|
1919
1950
|
) : null
|
|
1920
1951
|
] });
|
|
1921
|
-
}, Jn = () => /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1952
|
+
}, Jn = () => /* @__PURE__ */ o(Z.Protect, { permissions: [...ke.promotionRead], children: /* @__PURE__ */ o(Xn, {}) }), uo = () => /* @__PURE__ */ o(vt, { children: /* @__PURE__ */ u(bt, { children: [
|
|
1953
|
+
/* @__PURE__ */ o(He, { index: !0, element: /* @__PURE__ */ o(Jn, {}) }),
|
|
1954
|
+
/* @__PURE__ */ o(He, { path: "*", element: /* @__PURE__ */ o(Z.Error, {}) })
|
|
1924
1955
|
] }) });
|
|
1925
1956
|
export {
|
|
1926
1957
|
uo as default
|