@leverege/imaginarium-ui 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{PluginSetup-DxxEPoTy.js → PluginSetup-B-KjdUGN.js} +1164 -1028
- package/lib/PluginSetup-B-KjdUGN.js.map +1 -0
- package/lib/PluginSetup-CioXRjWx.cjs +116 -0
- package/lib/PluginSetup-CioXRjWx.cjs.map +1 -0
- package/lib/imp/release/DuplicateReleaseModal.d.ts +10 -0
- package/lib/imp/release/DuplicateReleaseModal.d.ts.map +1 -0
- package/lib/imp/release/ReleaseList.d.ts.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/release.cjs +1 -1
- package/lib/release.js +1 -1
- package/package.json +7 -7
- package/src/imp/release/DuplicateReleaseModal.tsx +157 -0
- package/src/imp/release/ReleaseList.tsx +54 -4
- package/lib/PluginSetup-DxxEPoTy.js.map +0 -1
- package/lib/PluginSetup-u6GoSd6c.cjs +0 -116
- package/lib/PluginSetup-u6GoSd6c.cjs.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { P as Mt, N as
|
|
2
|
-
import { M as
|
|
3
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
4
|
-
import { useState as R, useMemo as
|
|
5
|
-
import { u as
|
|
6
|
-
import { useQueryClient as
|
|
7
|
-
import { X as
|
|
8
|
-
import { Config as
|
|
1
|
+
import { P as Mt, N as Ft } from "./PluginTypes-D14LkV6u.js";
|
|
2
|
+
import { M as qt, u as fe, P as zt } from "./MarkdownPageDoc-IGkRhxWs.js";
|
|
3
|
+
import { jsx as e, jsxs as n, Fragment as Pe } from "react/jsx-runtime";
|
|
4
|
+
import { useState as R, useMemo as J, useEffect as Ue, Fragment as bt } from "react";
|
|
5
|
+
import { u as se, B as $, C as De, e as Me, c as ce } from "./Card-DbOhP3-w.js";
|
|
6
|
+
import { useQueryClient as ae, useMutation as H, useQuery as le } from "@tanstack/react-query";
|
|
7
|
+
import { X as ge, Loader2 as ze, Save as Nt, Copy as vt, Plus as Je, Trash2 as He, ArrowRight as jt, Ban as Le, RotateCcw as Bt, AlertTriangle as Se, Check as wt, ChevronDown as he, ChevronRight as pe, Send as Jt, Circle as Lt, ArrowLeft as Qe, RefreshCw as Ct, ListChecks as Qt, BarChart2 as Vt, Pencil as Ut, Bot as Ht } from "lucide-react";
|
|
8
|
+
import { Config as je } from "@leverege/plugin";
|
|
9
9
|
import { u as te } from "./ImaginariumApiContext-BScpog6-.js";
|
|
10
|
-
import { D as
|
|
11
|
-
import { T as
|
|
12
|
-
const
|
|
10
|
+
import { D as xe, a as ye, b as be, c as Ne, d as ve, L as ne, I as ue, e as we } from "./Label-DAcriHxc.js";
|
|
11
|
+
import { T as _t, a as Yt, c as Wt, b as Gt } from "./Tooltip-B1T4_ZuM.js";
|
|
12
|
+
const Xt = qt.create({
|
|
13
13
|
path: "/imp",
|
|
14
14
|
markdown: `# imp
|
|
15
15
|
|
|
@@ -124,144 +124,243 @@ Lists all permanently-ignored items for the selected origin cluster. Removing a
|
|
|
124
124
|
After removing an ignore, refreshing an existing release draft will bring the item back.
|
|
125
125
|
`
|
|
126
126
|
});
|
|
127
|
-
function
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
() =>
|
|
132
|
-
[
|
|
133
|
-
),
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
(
|
|
127
|
+
function Zt({ open: t, onOpenChange: s, onCreated: a }) {
|
|
128
|
+
const i = je.get("Release", "apiPath", "/releases"), { toast: r } = se(), { fetchJson: d } = te(), l = ae(), { configs: c } = fe(), [h, N] = R(""), [y, m] = R(""), [p, S] = R(""), [q, M] = R([]), B = ["imaginarium", "releases", i], b = () => {
|
|
129
|
+
N(""), m(""), S(""), M([]);
|
|
130
|
+
}, P = J(
|
|
131
|
+
() => c.filter((x) => x.id !== p),
|
|
132
|
+
[c, p]
|
|
133
|
+
), L = (x) => {
|
|
134
|
+
S(x), M((k) => k.filter((_) => _ !== x));
|
|
135
|
+
}, z = (x) => {
|
|
136
|
+
M(
|
|
137
|
+
(k) => k.includes(x) ? k.filter((_) => _ !== x) : [...k, x]
|
|
138
138
|
);
|
|
139
|
-
},
|
|
139
|
+
}, f = H({
|
|
140
140
|
mutationFn: async () => {
|
|
141
|
-
const
|
|
141
|
+
const x = await d(i, {
|
|
142
142
|
method: "POST",
|
|
143
143
|
body: JSON.stringify({
|
|
144
144
|
name: h.trim(),
|
|
145
|
-
description:
|
|
145
|
+
description: y.trim() || null,
|
|
146
146
|
originConfigId: p,
|
|
147
|
-
targetConfigIds:
|
|
147
|
+
targetConfigIds: q
|
|
148
148
|
})
|
|
149
149
|
});
|
|
150
|
-
return await d(`${
|
|
150
|
+
return await d(`${i}/${x.id}/snapshot-from-compare`, {
|
|
151
151
|
method: "POST",
|
|
152
152
|
body: JSON.stringify({})
|
|
153
|
-
}),
|
|
153
|
+
}), x;
|
|
154
154
|
},
|
|
155
|
-
onSuccess: (
|
|
156
|
-
l.invalidateQueries({ queryKey:
|
|
155
|
+
onSuccess: (x) => {
|
|
156
|
+
l.invalidateQueries({ queryKey: B }), r({ title: "Success", description: "Release created and snapshotted" }), s(!1), b(), a(x.id);
|
|
157
157
|
},
|
|
158
|
-
onError: (
|
|
159
|
-
r({ title: "Error", description:
|
|
158
|
+
onError: (x) => {
|
|
159
|
+
r({ title: "Error", description: x.message, variant: "destructive" });
|
|
160
160
|
},
|
|
161
161
|
// Refetch regardless of outcome: if create succeeds but snapshot fails, the
|
|
162
162
|
// new release would otherwise be orphaned and missing from the list.
|
|
163
163
|
onSettled: () => {
|
|
164
|
-
l.invalidateQueries({ queryKey:
|
|
164
|
+
l.invalidateQueries({ queryKey: B });
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
return /* @__PURE__ */ e(
|
|
170
|
-
/* @__PURE__ */ n(
|
|
171
|
-
/* @__PURE__ */ e(
|
|
172
|
-
/* @__PURE__ */ e(
|
|
166
|
+
}), T = (x) => {
|
|
167
|
+
x || b(), s(x);
|
|
168
|
+
}, I = !!(h.trim() && p && q.length > 0);
|
|
169
|
+
return /* @__PURE__ */ e(xe, { open: t, onOpenChange: T, children: /* @__PURE__ */ n(ye, { children: [
|
|
170
|
+
/* @__PURE__ */ n(be, { children: [
|
|
171
|
+
/* @__PURE__ */ e(Ne, { children: "New Release" }),
|
|
172
|
+
/* @__PURE__ */ e(ve, { children: "Create a release from an origin cluster and snapshot the diff against its targets." })
|
|
173
173
|
] }),
|
|
174
174
|
/* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
|
|
175
175
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
176
|
-
/* @__PURE__ */ e(
|
|
176
|
+
/* @__PURE__ */ e(ne, { htmlFor: "release-name", children: "Name" }),
|
|
177
177
|
/* @__PURE__ */ e(
|
|
178
|
-
|
|
178
|
+
ue,
|
|
179
179
|
{
|
|
180
180
|
id: "release-name",
|
|
181
181
|
value: h,
|
|
182
|
-
onChange: (
|
|
182
|
+
onChange: (x) => N(x.target.value),
|
|
183
183
|
placeholder: "2026.05 Release"
|
|
184
184
|
}
|
|
185
185
|
)
|
|
186
186
|
] }),
|
|
187
187
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
188
|
-
/* @__PURE__ */ e(
|
|
188
|
+
/* @__PURE__ */ e(ne, { htmlFor: "release-description", children: "Description (Optional)" }),
|
|
189
189
|
/* @__PURE__ */ e(
|
|
190
|
-
|
|
190
|
+
ue,
|
|
191
191
|
{
|
|
192
192
|
id: "release-description",
|
|
193
|
-
value:
|
|
194
|
-
onChange: (
|
|
193
|
+
value: y,
|
|
194
|
+
onChange: (x) => m(x.target.value),
|
|
195
195
|
placeholder: "What this release contains"
|
|
196
196
|
}
|
|
197
197
|
)
|
|
198
198
|
] }),
|
|
199
199
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
200
|
-
/* @__PURE__ */ e(
|
|
200
|
+
/* @__PURE__ */ e(ne, { htmlFor: "release-origin", children: "Origin Cluster" }),
|
|
201
201
|
/* @__PURE__ */ n(
|
|
202
202
|
"select",
|
|
203
203
|
{
|
|
204
204
|
id: "release-origin",
|
|
205
205
|
value: p,
|
|
206
|
-
onChange: (
|
|
206
|
+
onChange: (x) => L(x.target.value),
|
|
207
207
|
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ e("option", { value: "", children: "Select origin…" }),
|
|
210
|
-
|
|
210
|
+
c.map((x) => /* @__PURE__ */ e("option", { value: x.id, children: x.displayName }, x.id))
|
|
211
211
|
]
|
|
212
212
|
}
|
|
213
213
|
)
|
|
214
214
|
] }),
|
|
215
215
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
216
|
-
/* @__PURE__ */ e(
|
|
217
|
-
|
|
216
|
+
/* @__PURE__ */ e(ne, { children: "Target Clusters" }),
|
|
217
|
+
P.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 rounded-md border border-input p-2 max-h-48 overflow-y-auto", children: P.map((x) => /* @__PURE__ */ n("label", { className: "flex items-center gap-2 text-sm cursor-pointer", children: [
|
|
218
218
|
/* @__PURE__ */ e(
|
|
219
219
|
"input",
|
|
220
220
|
{
|
|
221
221
|
type: "checkbox",
|
|
222
|
-
checked:
|
|
223
|
-
onChange: () =>
|
|
222
|
+
checked: q.includes(x.id),
|
|
223
|
+
onChange: () => z(x.id)
|
|
224
224
|
}
|
|
225
225
|
),
|
|
226
|
-
|
|
227
|
-
] },
|
|
226
|
+
x.displayName
|
|
227
|
+
] }, x.id)) }) : /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: p ? "No other clusters available as targets." : "Select an origin first." })
|
|
228
228
|
] })
|
|
229
229
|
] }),
|
|
230
|
-
/* @__PURE__ */ n(
|
|
231
|
-
/* @__PURE__ */ n(
|
|
232
|
-
/* @__PURE__ */ e(
|
|
230
|
+
/* @__PURE__ */ n(we, { children: [
|
|
231
|
+
/* @__PURE__ */ n($, { variant: "outline", onClick: () => T(!1), disabled: f.isPending, children: [
|
|
232
|
+
/* @__PURE__ */ e(ge, { className: "w-4 h-4 mr-2" }),
|
|
233
233
|
"Cancel"
|
|
234
234
|
] }),
|
|
235
|
-
/* @__PURE__ */ e(
|
|
236
|
-
/* @__PURE__ */ e(
|
|
235
|
+
/* @__PURE__ */ e($, { onClick: () => f.mutate(), disabled: !I || f.isPending, children: f.isPending ? /* @__PURE__ */ n(Pe, { children: [
|
|
236
|
+
/* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
237
237
|
"Snapshotting…"
|
|
238
|
-
] }) : /* @__PURE__ */ n(
|
|
239
|
-
/* @__PURE__ */ e(
|
|
238
|
+
] }) : /* @__PURE__ */ n(Pe, { children: [
|
|
239
|
+
/* @__PURE__ */ e(Nt, { className: "w-4 h-4 mr-2" }),
|
|
240
240
|
"Create & snapshot"
|
|
241
241
|
] }) })
|
|
242
242
|
] })
|
|
243
243
|
] }) });
|
|
244
244
|
}
|
|
245
|
+
function en({ open: t, onOpenChange: s, release: a, onDuplicated: i }) {
|
|
246
|
+
const r = je.get("Release", "apiPath", "/releases"), { toast: d } = se(), { fetchJson: l } = te(), c = ae(), { configs: h } = fe(), N = ["imaginarium", "releases", r], [y, m] = R(`Copy of ${a.name}`), [p, S] = R([]), q = new Set(
|
|
247
|
+
(a.targetConfigIds ?? []).filter((f) => f !== a.originConfigId)
|
|
248
|
+
), M = h.filter((f) => f.id !== a.originConfigId), B = (f) => {
|
|
249
|
+
S(
|
|
250
|
+
(T) => T.includes(f) ? T.filter((I) => I !== f) : [...T, f]
|
|
251
|
+
);
|
|
252
|
+
}, b = () => {
|
|
253
|
+
m(`Copy of ${a.name}`), S([]);
|
|
254
|
+
}, P = H({
|
|
255
|
+
mutationFn: async () => {
|
|
256
|
+
const f = await l(`${r}/${a.id}/duplicate`, {
|
|
257
|
+
method: "POST",
|
|
258
|
+
body: JSON.stringify({
|
|
259
|
+
name: y.trim(),
|
|
260
|
+
targetConfigIds: p
|
|
261
|
+
})
|
|
262
|
+
});
|
|
263
|
+
return await l(`${r}/${f.id}/snapshot-from-compare`, {
|
|
264
|
+
method: "POST",
|
|
265
|
+
body: JSON.stringify({})
|
|
266
|
+
}), f;
|
|
267
|
+
},
|
|
268
|
+
onSuccess: (f) => {
|
|
269
|
+
c.invalidateQueries({ queryKey: N }), d({ title: "Success", description: "Release duplicated and snapshotted" }), s(!1), b(), i(f.id);
|
|
270
|
+
},
|
|
271
|
+
onError: (f) => {
|
|
272
|
+
d({ title: "Error", description: f.message, variant: "destructive" });
|
|
273
|
+
},
|
|
274
|
+
// Refetch regardless of outcome: if duplicate succeeds but snapshot fails, the
|
|
275
|
+
// new release would otherwise be orphaned and missing from the list.
|
|
276
|
+
onSettled: () => {
|
|
277
|
+
c.invalidateQueries({ queryKey: N });
|
|
278
|
+
}
|
|
279
|
+
}), L = (f) => {
|
|
280
|
+
f || b(), s(f);
|
|
281
|
+
}, z = !!(y.trim() && p.length > 0);
|
|
282
|
+
return /* @__PURE__ */ e(xe, { open: t, onOpenChange: L, children: /* @__PURE__ */ n(ye, { children: [
|
|
283
|
+
/* @__PURE__ */ n(be, { children: [
|
|
284
|
+
/* @__PURE__ */ e(Ne, { children: "Duplicate Release" }),
|
|
285
|
+
/* @__PURE__ */ n(ve, { children: [
|
|
286
|
+
'Copy all include/exclude decisions from "',
|
|
287
|
+
a.name,
|
|
288
|
+
'" into a new release.'
|
|
289
|
+
] })
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
|
|
292
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
293
|
+
/* @__PURE__ */ e(ne, { htmlFor: "dup-release-name", children: "Name" }),
|
|
294
|
+
/* @__PURE__ */ e(
|
|
295
|
+
ue,
|
|
296
|
+
{
|
|
297
|
+
id: "dup-release-name",
|
|
298
|
+
value: y,
|
|
299
|
+
onChange: (f) => m(f.target.value)
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] }),
|
|
303
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
304
|
+
/* @__PURE__ */ e(ne, { children: "Target Clusters" }),
|
|
305
|
+
M.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 rounded-md border border-input p-2 max-h-48 overflow-y-auto", children: M.map((f) => /* @__PURE__ */ n("label", { className: "flex items-center gap-2 text-sm cursor-pointer", children: [
|
|
306
|
+
/* @__PURE__ */ e(
|
|
307
|
+
"input",
|
|
308
|
+
{
|
|
309
|
+
type: "checkbox",
|
|
310
|
+
checked: p.includes(f.id),
|
|
311
|
+
onChange: () => B(f.id)
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
f.displayName,
|
|
315
|
+
q.has(f.id) ? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: " (original destination)" }) : null
|
|
316
|
+
] }, f.id)) }) : /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "No other clusters available." })
|
|
317
|
+
] })
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ n(we, { children: [
|
|
320
|
+
/* @__PURE__ */ n($, { variant: "outline", onClick: () => L(!1), disabled: P.isPending, children: [
|
|
321
|
+
/* @__PURE__ */ e(ge, { className: "w-4 h-4 mr-2" }),
|
|
322
|
+
"Cancel"
|
|
323
|
+
] }),
|
|
324
|
+
/* @__PURE__ */ e($, { onClick: () => P.mutate(), disabled: !z || P.isPending, children: P.isPending ? /* @__PURE__ */ n(Pe, { children: [
|
|
325
|
+
/* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
326
|
+
"Duplicating…"
|
|
327
|
+
] }) : /* @__PURE__ */ n(Pe, { children: [
|
|
328
|
+
/* @__PURE__ */ e(vt, { className: "w-4 h-4 mr-2" }),
|
|
329
|
+
"Duplicate & snapshot"
|
|
330
|
+
] }) })
|
|
331
|
+
] })
|
|
332
|
+
] }) });
|
|
333
|
+
}
|
|
245
334
|
function kt({ status: t }) {
|
|
246
335
|
return /* @__PURE__ */ e("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border ${t === "pushed" ? "bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border-emerald-500/30" : "bg-muted text-muted-foreground border-border"}`, children: t });
|
|
247
336
|
}
|
|
248
|
-
function
|
|
249
|
-
const s =
|
|
250
|
-
queryKey:
|
|
337
|
+
function tn({ onOpen: t }) {
|
|
338
|
+
const s = je.get("Release", "apiPath", "/releases"), { toast: a } = se(), { fetchJson: i } = te(), { configs: r } = fe(), d = ae(), [l, c] = R(!1), [h, N] = R(null), y = ["imaginarium", "releases", s], { data: m, isLoading: p } = le({
|
|
339
|
+
queryKey: y,
|
|
251
340
|
queryFn: async () => {
|
|
252
|
-
const
|
|
253
|
-
return [...Array.isArray(
|
|
341
|
+
const b = await i(s);
|
|
342
|
+
return [...Array.isArray(b) ? b : (b == null ? void 0 : b.items) ?? []].sort((L, z) => (z.createdAt ?? "").localeCompare(L.createdAt ?? ""));
|
|
254
343
|
}
|
|
255
|
-
}),
|
|
256
|
-
const
|
|
257
|
-
return
|
|
258
|
-
}, [
|
|
344
|
+
}), S = J(() => {
|
|
345
|
+
const b = /* @__PURE__ */ new Map();
|
|
346
|
+
return r.forEach((P) => b.set(String(P.id), P.displayName)), b;
|
|
347
|
+
}, [r]), q = (b) => S.get(b) ?? b, M = H({
|
|
348
|
+
mutationFn: (b) => i(`${s}/${b}`, { method: "DELETE" }),
|
|
349
|
+
onSuccess: () => {
|
|
350
|
+
d.invalidateQueries({ queryKey: y }), a({ title: "Release deleted" });
|
|
351
|
+
},
|
|
352
|
+
onError: (b) => {
|
|
353
|
+
a({ title: "Error", description: b.message, variant: "destructive" });
|
|
354
|
+
}
|
|
355
|
+
}), B = (b, P) => {
|
|
356
|
+
b.stopPropagation(), window.confirm(`Delete "${P.name}"? This cannot be undone.`) && M.mutate(P.id);
|
|
357
|
+
};
|
|
259
358
|
return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
260
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ n(
|
|
261
|
-
/* @__PURE__ */ e(
|
|
359
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ n($, { onClick: () => c(!0), children: [
|
|
360
|
+
/* @__PURE__ */ e(Je, { className: "w-4 h-4 mr-2" }),
|
|
262
361
|
"New Release"
|
|
263
362
|
] }) }),
|
|
264
|
-
|
|
363
|
+
p ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground", children: "Loading…" }) : m && m.length > 0 ? /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
|
|
265
364
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b text-left text-muted-foreground", children: [
|
|
266
365
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Name" }),
|
|
267
366
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Origin" }),
|
|
@@ -271,67 +370,104 @@ function Xt({ onOpen: t }) {
|
|
|
271
370
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Pushed" }),
|
|
272
371
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium" })
|
|
273
372
|
] }) }),
|
|
274
|
-
/* @__PURE__ */ e("tbody", { children: m.map((
|
|
373
|
+
/* @__PURE__ */ e("tbody", { children: m.map((b) => /* @__PURE__ */ n(
|
|
275
374
|
"tr",
|
|
276
375
|
{
|
|
277
376
|
className: "border-b last:border-0 cursor-pointer hover:bg-muted/50",
|
|
278
|
-
onClick: () => t(
|
|
377
|
+
onClick: () => t(b.id),
|
|
279
378
|
children: [
|
|
280
379
|
/* @__PURE__ */ n("td", { className: "p-3", children: [
|
|
281
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children:
|
|
282
|
-
|
|
380
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: b.name }),
|
|
381
|
+
b.description ? /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: b.description }) : null
|
|
283
382
|
] }),
|
|
284
|
-
/* @__PURE__ */ e("td", { className: "p-3", children:
|
|
285
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: (
|
|
383
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: q(b.originConfigId) }),
|
|
384
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: (b.targetConfigIds ?? []).map((P) => /* @__PURE__ */ e(
|
|
286
385
|
"span",
|
|
287
386
|
{
|
|
288
387
|
className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs",
|
|
289
|
-
children:
|
|
388
|
+
children: q(P)
|
|
290
389
|
},
|
|
291
|
-
|
|
390
|
+
P
|
|
292
391
|
)) }) }),
|
|
293
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(kt, { status:
|
|
294
|
-
/* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children:
|
|
295
|
-
/* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children:
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
392
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(kt, { status: b.status }) }),
|
|
393
|
+
/* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: b.snapshotAt ? new Date(b.snapshotAt).toLocaleString() : "—" }),
|
|
394
|
+
/* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: b.pushedAt ? new Date(b.pushedAt).toLocaleString() : "—" }),
|
|
395
|
+
/* @__PURE__ */ n("td", { className: "p-3 text-right whitespace-nowrap", children: [
|
|
396
|
+
b.status === "draft" ? /* @__PURE__ */ e(
|
|
397
|
+
$,
|
|
398
|
+
{
|
|
399
|
+
variant: "ghost",
|
|
400
|
+
size: "sm",
|
|
401
|
+
onClick: (P) => B(P, b),
|
|
402
|
+
title: "Delete draft",
|
|
403
|
+
disabled: M.isPending,
|
|
404
|
+
children: /* @__PURE__ */ e(He, { className: "w-4 h-4 text-destructive" })
|
|
405
|
+
}
|
|
406
|
+
) : null,
|
|
407
|
+
/* @__PURE__ */ e(
|
|
408
|
+
$,
|
|
409
|
+
{
|
|
410
|
+
variant: "ghost",
|
|
411
|
+
size: "sm",
|
|
412
|
+
onClick: (P) => {
|
|
413
|
+
P.stopPropagation(), N(b);
|
|
414
|
+
},
|
|
415
|
+
title: "Duplicate",
|
|
416
|
+
children: /* @__PURE__ */ e(vt, { className: "w-4 h-4" })
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
/* @__PURE__ */ e(
|
|
420
|
+
$,
|
|
421
|
+
{
|
|
422
|
+
variant: "ghost",
|
|
423
|
+
size: "sm",
|
|
424
|
+
onClick: (P) => {
|
|
425
|
+
P.stopPropagation(), t(b.id);
|
|
426
|
+
},
|
|
427
|
+
title: "Open",
|
|
428
|
+
children: /* @__PURE__ */ e(jt, { className: "w-4 h-4" })
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] })
|
|
307
432
|
]
|
|
308
433
|
},
|
|
309
|
-
|
|
434
|
+
b.id
|
|
310
435
|
)) })
|
|
311
|
-
] }) }) }) : /* @__PURE__ */ e(
|
|
436
|
+
] }) }) }) : /* @__PURE__ */ e(De, { children: /* @__PURE__ */ n(Me, { className: "py-12 text-center", children: [
|
|
312
437
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-4", children: "No releases yet" }),
|
|
313
|
-
/* @__PURE__ */ n(
|
|
314
|
-
/* @__PURE__ */ e(
|
|
438
|
+
/* @__PURE__ */ n($, { onClick: () => c(!0), children: [
|
|
439
|
+
/* @__PURE__ */ e(Je, { className: "w-4 h-4 mr-2" }),
|
|
315
440
|
"Create Your First Release"
|
|
316
441
|
] })
|
|
317
442
|
] }) }),
|
|
318
443
|
/* @__PURE__ */ e(
|
|
319
|
-
|
|
444
|
+
Zt,
|
|
320
445
|
{
|
|
321
|
-
open:
|
|
322
|
-
onOpenChange:
|
|
446
|
+
open: l,
|
|
447
|
+
onOpenChange: c,
|
|
323
448
|
onCreated: t
|
|
324
449
|
}
|
|
325
|
-
)
|
|
450
|
+
),
|
|
451
|
+
h ? /* @__PURE__ */ e(
|
|
452
|
+
en,
|
|
453
|
+
{
|
|
454
|
+
open: !!h,
|
|
455
|
+
onOpenChange: (b) => {
|
|
456
|
+
b || N(null);
|
|
457
|
+
},
|
|
458
|
+
release: h,
|
|
459
|
+
onDuplicated: t
|
|
460
|
+
}
|
|
461
|
+
) : null
|
|
326
462
|
] });
|
|
327
463
|
}
|
|
328
|
-
function
|
|
464
|
+
function nn({
|
|
329
465
|
originName: t,
|
|
330
466
|
className: s
|
|
331
467
|
}) {
|
|
332
|
-
const
|
|
333
|
-
return /* @__PURE__ */ e(
|
|
334
|
-
/* @__PURE__ */ e(
|
|
468
|
+
const a = t ? `Skipped in your last release from ${t}.` : "Skipped in your last release.";
|
|
469
|
+
return /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ n(Yt, { children: [
|
|
470
|
+
/* @__PURE__ */ e(Wt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
335
471
|
"span",
|
|
336
472
|
{
|
|
337
473
|
className: ce(
|
|
@@ -342,10 +478,10 @@ function Zt({
|
|
|
342
478
|
children: "previously skipped"
|
|
343
479
|
}
|
|
344
480
|
) }),
|
|
345
|
-
/* @__PURE__ */ e(
|
|
481
|
+
/* @__PURE__ */ e(Gt, { side: "top", children: a })
|
|
346
482
|
] }) });
|
|
347
483
|
}
|
|
348
|
-
function
|
|
484
|
+
function sn({ className: t }) {
|
|
349
485
|
return /* @__PURE__ */ e(
|
|
350
486
|
"span",
|
|
351
487
|
{
|
|
@@ -358,75 +494,75 @@ function en({ className: t }) {
|
|
|
358
494
|
}
|
|
359
495
|
);
|
|
360
496
|
}
|
|
361
|
-
function
|
|
497
|
+
function an({
|
|
362
498
|
ignoreRule: t,
|
|
363
499
|
createPayload: s,
|
|
364
|
-
apiPath:
|
|
365
|
-
onChange:
|
|
500
|
+
apiPath: a = "/release-ignores",
|
|
501
|
+
onChange: i,
|
|
366
502
|
className: r
|
|
367
503
|
}) {
|
|
368
|
-
const { toast: d } =
|
|
369
|
-
|
|
370
|
-
}, p =
|
|
371
|
-
mutationFn: () => l(
|
|
504
|
+
const { toast: d } = se(), { fetchJson: l } = te(), c = ae(), [h, N] = R(!1), y = !!t, m = () => {
|
|
505
|
+
c.invalidateQueries({ queryKey: ["imaginarium", "release-ignores"] }), i == null || i();
|
|
506
|
+
}, p = H({
|
|
507
|
+
mutationFn: () => l(a, {
|
|
372
508
|
method: "POST",
|
|
373
509
|
body: JSON.stringify(s)
|
|
374
510
|
}),
|
|
375
511
|
onSuccess: () => {
|
|
376
|
-
d({ title: "Item ignored", description: "Will be excluded from all future snapshots." }),
|
|
512
|
+
d({ title: "Item ignored", description: "Will be excluded from all future snapshots." }), N(!1), m();
|
|
377
513
|
},
|
|
378
|
-
onError: (
|
|
379
|
-
d({ title: "Error", description:
|
|
514
|
+
onError: (M) => {
|
|
515
|
+
d({ title: "Error", description: M.message, variant: "destructive" });
|
|
380
516
|
}
|
|
381
|
-
}),
|
|
382
|
-
mutationFn: () => l(`${
|
|
517
|
+
}), S = H({
|
|
518
|
+
mutationFn: () => l(`${a}/${t.id}`, { method: "DELETE" }),
|
|
383
519
|
onSuccess: () => {
|
|
384
|
-
d({ title: "Item un-ignored", description: "Will appear normally in future snapshots." }),
|
|
520
|
+
d({ title: "Item un-ignored", description: "Will appear normally in future snapshots." }), m();
|
|
385
521
|
},
|
|
386
|
-
onError: (
|
|
387
|
-
d({ title: "Error", description:
|
|
522
|
+
onError: (M) => {
|
|
523
|
+
d({ title: "Error", description: M.message, variant: "destructive" });
|
|
388
524
|
}
|
|
389
|
-
}),
|
|
390
|
-
return /* @__PURE__ */ n(
|
|
525
|
+
}), q = p.isPending || S.isPending;
|
|
526
|
+
return /* @__PURE__ */ n(Pe, { children: [
|
|
391
527
|
/* @__PURE__ */ e(
|
|
392
|
-
|
|
528
|
+
$,
|
|
393
529
|
{
|
|
394
530
|
variant: "ghost",
|
|
395
531
|
size: "icon",
|
|
396
|
-
title:
|
|
397
|
-
disabled:
|
|
398
|
-
onClick: () =>
|
|
399
|
-
className: ce(
|
|
400
|
-
children: /* @__PURE__ */ e(
|
|
532
|
+
title: y ? "Remove from ignore list" : "Ignore this item",
|
|
533
|
+
disabled: q,
|
|
534
|
+
onClick: () => y ? S.mutate() : N(!0),
|
|
535
|
+
className: ce(y && "text-red-500 hover:text-red-500 dark:text-red-400 dark:hover:text-red-400", r),
|
|
536
|
+
children: /* @__PURE__ */ e(Le, {})
|
|
401
537
|
}
|
|
402
538
|
),
|
|
403
|
-
/* @__PURE__ */ e(
|
|
404
|
-
/* @__PURE__ */ n(
|
|
405
|
-
/* @__PURE__ */ e(
|
|
406
|
-
/* @__PURE__ */ n(
|
|
539
|
+
/* @__PURE__ */ e(xe, { open: h, onOpenChange: N, children: /* @__PURE__ */ n(ye, { children: [
|
|
540
|
+
/* @__PURE__ */ n(be, { children: [
|
|
541
|
+
/* @__PURE__ */ e(Ne, { children: "Ignore this item?" }),
|
|
542
|
+
/* @__PURE__ */ n(ve, { children: [
|
|
407
543
|
"Ignoring excludes this item from ",
|
|
408
544
|
/* @__PURE__ */ e("strong", { children: "this and all future releases" }),
|
|
409
545
|
" for this origin cluster — it will never be pushed to any destination. You can un-ignore it later from the Ignored tab."
|
|
410
546
|
] })
|
|
411
547
|
] }),
|
|
412
|
-
/* @__PURE__ */ n(
|
|
548
|
+
/* @__PURE__ */ n(we, { children: [
|
|
413
549
|
/* @__PURE__ */ e(
|
|
414
|
-
|
|
550
|
+
$,
|
|
415
551
|
{
|
|
416
552
|
variant: "outline",
|
|
417
|
-
onClick: () =>
|
|
553
|
+
onClick: () => N(!1),
|
|
418
554
|
disabled: p.isPending,
|
|
419
555
|
children: "Cancel"
|
|
420
556
|
}
|
|
421
557
|
),
|
|
422
558
|
/* @__PURE__ */ n(
|
|
423
|
-
|
|
559
|
+
$,
|
|
424
560
|
{
|
|
425
561
|
variant: "destructive",
|
|
426
562
|
onClick: () => p.mutate(),
|
|
427
563
|
disabled: p.isPending,
|
|
428
564
|
children: [
|
|
429
|
-
/* @__PURE__ */ e(
|
|
565
|
+
/* @__PURE__ */ e(Le, { className: "w-4 h-4 mr-2" }),
|
|
430
566
|
"Ignore item"
|
|
431
567
|
]
|
|
432
568
|
}
|
|
@@ -435,109 +571,109 @@ function tn({
|
|
|
435
571
|
] }) })
|
|
436
572
|
] });
|
|
437
573
|
}
|
|
438
|
-
function
|
|
574
|
+
function rn({
|
|
439
575
|
releaseId: t,
|
|
440
576
|
apiPath: s = "/releases",
|
|
441
|
-
onReset:
|
|
577
|
+
onReset: a
|
|
442
578
|
}) {
|
|
443
|
-
const { toast:
|
|
579
|
+
const { toast: i } = se(), { fetchJson: r } = te(), d = ae(), l = H({
|
|
444
580
|
mutationFn: () => r(`${s}/${t}/reset-exclusions`, {
|
|
445
581
|
method: "POST"
|
|
446
582
|
}),
|
|
447
|
-
onSuccess: (
|
|
448
|
-
d.invalidateQueries({ queryKey: ["imaginarium", "release-items", t] }),
|
|
583
|
+
onSuccess: (c) => {
|
|
584
|
+
d.invalidateQueries({ queryKey: ["imaginarium", "release-items", t] }), i({
|
|
449
585
|
title: "Exclusions reset",
|
|
450
|
-
description: `${
|
|
451
|
-
}),
|
|
586
|
+
description: `${c.reset} item${c.reset === 1 ? "" : "s"} re-enabled.`
|
|
587
|
+
}), a == null || a(c.reset);
|
|
452
588
|
},
|
|
453
|
-
onError: (
|
|
454
|
-
|
|
589
|
+
onError: (c) => {
|
|
590
|
+
i({ title: "Error", description: c.message, variant: "destructive" });
|
|
455
591
|
}
|
|
456
592
|
});
|
|
457
593
|
return /* @__PURE__ */ n(
|
|
458
|
-
|
|
594
|
+
$,
|
|
459
595
|
{
|
|
460
596
|
variant: "outline",
|
|
461
597
|
size: "sm",
|
|
462
598
|
onClick: () => l.mutate(),
|
|
463
599
|
disabled: l.isPending,
|
|
464
600
|
children: [
|
|
465
|
-
/* @__PURE__ */ e(
|
|
601
|
+
/* @__PURE__ */ e(Bt, {}),
|
|
466
602
|
l.isPending ? "Resetting…" : "Reset exclusions"
|
|
467
603
|
]
|
|
468
604
|
}
|
|
469
605
|
);
|
|
470
606
|
}
|
|
471
|
-
function
|
|
607
|
+
function Fe({ label: t, value: s, highlightLines: a }) {
|
|
472
608
|
return /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
473
609
|
/* @__PURE__ */ e("div", { className: "mb-1 text-xs font-medium text-muted-foreground", children: t }),
|
|
474
|
-
/* @__PURE__ */ e("pre", { className: "flex-1 overflow-auto rounded border bg-muted/30 p-3 text-xs", children:
|
|
475
|
-
`).map((
|
|
610
|
+
/* @__PURE__ */ e("pre", { className: "flex-1 overflow-auto rounded border bg-muted/30 p-3 text-xs", children: a === void 0 ? s === void 0 ? "null" : JSON.stringify(s, null, 2) : (s === void 0 ? "null" : JSON.stringify(s, null, 2)).split(`
|
|
611
|
+
`).map((i, r) => (
|
|
476
612
|
// eslint-disable-next-line react/no-array-index-key
|
|
477
613
|
/* @__PURE__ */ e(
|
|
478
614
|
"div",
|
|
479
615
|
{
|
|
480
|
-
className:
|
|
481
|
-
children:
|
|
616
|
+
className: a[r] ? "bg-yellow-200/70 text-yellow-950 dark:bg-yellow-400/20 dark:text-yellow-100" : void 0,
|
|
617
|
+
children: i === "" ? " " : i
|
|
482
618
|
},
|
|
483
619
|
r
|
|
484
620
|
)
|
|
485
621
|
)) })
|
|
486
622
|
] });
|
|
487
623
|
}
|
|
488
|
-
function
|
|
624
|
+
function at(t) {
|
|
489
625
|
return t === void 0 ? "null" : JSON.stringify(t, null, 2);
|
|
490
626
|
}
|
|
491
|
-
function
|
|
492
|
-
let
|
|
493
|
-
if (
|
|
494
|
-
for (const { replace: p, with:
|
|
495
|
-
p && (
|
|
496
|
-
const r =
|
|
497
|
-
`), d =
|
|
498
|
-
`), l = r.length,
|
|
627
|
+
function Tt(t, s, a) {
|
|
628
|
+
let i = at(t);
|
|
629
|
+
if (a && a.length > 0)
|
|
630
|
+
for (const { replace: p, with: S } of a)
|
|
631
|
+
p && (i = i.split(p).join(S));
|
|
632
|
+
const r = i.split(`
|
|
633
|
+
`), d = at(s).split(`
|
|
634
|
+
`), l = r.length, c = d.length, h = Array.from({ length: l + 1 }, () => new Array(c + 1).fill(0));
|
|
499
635
|
for (let p = l - 1; p >= 0; p -= 1)
|
|
500
|
-
for (let
|
|
501
|
-
h[p][
|
|
502
|
-
const
|
|
503
|
-
let
|
|
504
|
-
for (;
|
|
505
|
-
r[
|
|
506
|
-
return
|
|
636
|
+
for (let S = c - 1; S >= 0; S -= 1)
|
|
637
|
+
h[p][S] = r[p] === d[S] ? h[p + 1][S + 1] + 1 : Math.max(h[p + 1][S], h[p][S + 1]);
|
|
638
|
+
const N = new Array(l).fill(!0);
|
|
639
|
+
let y = 0, m = 0;
|
|
640
|
+
for (; y < l && m < c; )
|
|
641
|
+
r[y] === d[m] ? (N[y] = !1, y += 1, m += 1) : h[y + 1][m] >= h[y][m + 1] ? y += 1 : m += 1;
|
|
642
|
+
return N;
|
|
507
643
|
}
|
|
508
|
-
function
|
|
644
|
+
function Ie({
|
|
509
645
|
title: t,
|
|
510
646
|
values: s,
|
|
511
|
-
excluded:
|
|
512
|
-
editable:
|
|
647
|
+
excluded: a,
|
|
648
|
+
editable: i,
|
|
513
649
|
onToggle: r,
|
|
514
650
|
formatLabel: d
|
|
515
651
|
}) {
|
|
516
|
-
const [l,
|
|
517
|
-
return
|
|
518
|
-
|
|
519
|
-
}, [
|
|
652
|
+
const [l, c] = R(a.length > 0);
|
|
653
|
+
return Ue(() => {
|
|
654
|
+
a.length > 0 && c(!0);
|
|
655
|
+
}, [a.length]), /* @__PURE__ */ n("div", { className: "border-b p-2", children: [
|
|
520
656
|
/* @__PURE__ */ n(
|
|
521
657
|
"button",
|
|
522
658
|
{
|
|
523
659
|
type: "button",
|
|
524
660
|
className: "flex w-full items-center justify-between gap-2",
|
|
525
|
-
onClick: () =>
|
|
661
|
+
onClick: () => c((h) => !h),
|
|
526
662
|
"aria-expanded": l,
|
|
527
663
|
children: [
|
|
528
664
|
/* @__PURE__ */ n("span", { className: "flex items-center gap-1 text-xs font-medium text-muted-foreground", children: [
|
|
529
|
-
l ? /* @__PURE__ */ e(
|
|
665
|
+
l ? /* @__PURE__ */ e(he, { size: 12 }) : /* @__PURE__ */ e(pe, { size: 12 }),
|
|
530
666
|
t,
|
|
531
667
|
" (",
|
|
532
|
-
|
|
668
|
+
a.length,
|
|
533
669
|
")"
|
|
534
670
|
] }),
|
|
535
|
-
|
|
671
|
+
i ? null : /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: "read-only" })
|
|
536
672
|
]
|
|
537
673
|
}
|
|
538
674
|
),
|
|
539
675
|
l ? /* @__PURE__ */ e("div", { className: "mt-1 flex flex-col gap-1", children: s.map((h) => {
|
|
540
|
-
const
|
|
676
|
+
const N = !a.includes(h);
|
|
541
677
|
return /* @__PURE__ */ n(
|
|
542
678
|
"label",
|
|
543
679
|
{
|
|
@@ -548,12 +684,12 @@ function Oe({
|
|
|
548
684
|
{
|
|
549
685
|
type: "checkbox",
|
|
550
686
|
className: "mt-0.5 shrink-0",
|
|
551
|
-
checked:
|
|
552
|
-
disabled: !
|
|
553
|
-
onChange: (
|
|
687
|
+
checked: N,
|
|
688
|
+
disabled: !i,
|
|
689
|
+
onChange: (y) => r == null ? void 0 : r(h, y.target.checked)
|
|
554
690
|
}
|
|
555
691
|
),
|
|
556
|
-
/* @__PURE__ */ e("span", { className: `min-w-0 break-all font-mono ${
|
|
692
|
+
/* @__PURE__ */ e("span", { className: `min-w-0 break-all font-mono ${N ? "" : "text-muted-foreground line-through"}`, children: d ? d(h) : h })
|
|
557
693
|
]
|
|
558
694
|
},
|
|
559
695
|
h
|
|
@@ -561,39 +697,39 @@ function Oe({
|
|
|
561
697
|
}) }) : null
|
|
562
698
|
] });
|
|
563
699
|
}
|
|
564
|
-
function
|
|
700
|
+
function ln({
|
|
565
701
|
item: t,
|
|
566
702
|
targets: s,
|
|
567
|
-
onClose:
|
|
568
|
-
unmetDependencyNames:
|
|
703
|
+
onClose: a,
|
|
704
|
+
unmetDependencyNames: i = [],
|
|
569
705
|
tags: r = [],
|
|
570
706
|
excludedTags: d = [],
|
|
571
707
|
editable: l = !0,
|
|
572
|
-
onToggleTag:
|
|
708
|
+
onToggleTag: c,
|
|
573
709
|
metadataKeys: h = [],
|
|
574
|
-
excludedMetadataKeys:
|
|
575
|
-
onToggleMetadataKey:
|
|
576
|
-
i18nPaths:
|
|
710
|
+
excludedMetadataKeys: N = [],
|
|
711
|
+
onToggleMetadataKey: y,
|
|
712
|
+
i18nPaths: m = [],
|
|
577
713
|
excludedI18nPaths: p = [],
|
|
578
|
-
onToggleI18nPath:
|
|
579
|
-
permissionKeys:
|
|
580
|
-
excludedPermissions:
|
|
581
|
-
onTogglePermission:
|
|
582
|
-
formatPermissionLabel:
|
|
583
|
-
replacementMaps:
|
|
714
|
+
onToggleI18nPath: S,
|
|
715
|
+
permissionKeys: q = [],
|
|
716
|
+
excludedPermissions: M = [],
|
|
717
|
+
onTogglePermission: B,
|
|
718
|
+
formatPermissionLabel: b,
|
|
719
|
+
replacementMaps: P
|
|
584
720
|
}) {
|
|
585
|
-
var X,
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
var
|
|
589
|
-
|
|
721
|
+
var X, g, j, U;
|
|
722
|
+
const L = ((X = s[0]) == null ? void 0 : X.id) ?? null, [z, f] = R(L);
|
|
723
|
+
Ue(() => {
|
|
724
|
+
var F;
|
|
725
|
+
f(((F = s[0]) == null ? void 0 : F.id) ?? null);
|
|
590
726
|
}, [t == null ? void 0 : t.id]);
|
|
591
|
-
const
|
|
727
|
+
const T = s.find((F) => F.id === z) ?? s[0] ?? null, I = (g = t == null ? void 0 : t.diff) == null ? void 0 : g.byTarget, x = I != null, k = x ? I[(T == null ? void 0 : T.id) ?? ""] : (j = t == null ? void 0 : t.diff) == null ? void 0 : j.target, _ = x && T != null && !(T.id in I), V = J(
|
|
592
728
|
() => {
|
|
593
|
-
var
|
|
594
|
-
return
|
|
729
|
+
var F;
|
|
730
|
+
return _ ? void 0 : Tt((F = t == null ? void 0 : t.diff) == null ? void 0 : F.origin, k, P == null ? void 0 : P[(T == null ? void 0 : T.id) ?? ""]);
|
|
595
731
|
},
|
|
596
|
-
[t,
|
|
732
|
+
[t, k, _, P, T == null ? void 0 : T.id]
|
|
597
733
|
);
|
|
598
734
|
return t ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col rounded-md border bg-background", children: [
|
|
599
735
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-3", children: [
|
|
@@ -601,84 +737,84 @@ function sn({
|
|
|
601
737
|
/* @__PURE__ */ e("div", { className: "truncate font-medium", children: t.itemName }),
|
|
602
738
|
/* @__PURE__ */ e("div", { className: "font-mono text-xs text-muted-foreground", children: t.itemType })
|
|
603
739
|
] }),
|
|
604
|
-
/* @__PURE__ */ e(
|
|
740
|
+
/* @__PURE__ */ e($, { variant: "ghost", size: "icon", title: "Close", onClick: a, children: /* @__PURE__ */ e(ge, {}) })
|
|
605
741
|
] }),
|
|
606
|
-
|
|
607
|
-
/* @__PURE__ */ e(
|
|
742
|
+
i.length > 0 ? /* @__PURE__ */ n("div", { className: "flex items-start gap-2 border-b bg-amber-50 p-2 text-xs text-amber-700 dark:bg-amber-500/10 dark:text-amber-300", children: [
|
|
743
|
+
/* @__PURE__ */ e(Se, { size: 14, className: "mt-0.5 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
608
744
|
/* @__PURE__ */ n("span", { children: [
|
|
609
745
|
"Depends on excluded items: ",
|
|
610
|
-
|
|
746
|
+
i.join(", "),
|
|
611
747
|
". Push will fail for this item until they're included."
|
|
612
748
|
] })
|
|
613
749
|
] }) : null,
|
|
614
750
|
r.length > 0 ? /* @__PURE__ */ e(
|
|
615
|
-
|
|
751
|
+
Ie,
|
|
616
752
|
{
|
|
617
753
|
title: "Tag Overrides",
|
|
618
754
|
values: r,
|
|
619
755
|
excluded: d,
|
|
620
756
|
editable: l,
|
|
621
|
-
onToggle:
|
|
757
|
+
onToggle: c
|
|
622
758
|
}
|
|
623
759
|
) : null,
|
|
624
760
|
h.length > 0 ? /* @__PURE__ */ e(
|
|
625
|
-
|
|
761
|
+
Ie,
|
|
626
762
|
{
|
|
627
763
|
title: "Metadata Overrides",
|
|
628
764
|
values: h,
|
|
629
|
-
excluded:
|
|
765
|
+
excluded: N,
|
|
630
766
|
editable: l,
|
|
631
|
-
onToggle:
|
|
767
|
+
onToggle: y
|
|
632
768
|
}
|
|
633
769
|
) : null,
|
|
634
|
-
|
|
635
|
-
|
|
770
|
+
m.length > 0 ? /* @__PURE__ */ e(
|
|
771
|
+
Ie,
|
|
636
772
|
{
|
|
637
773
|
title: "Translation Overrides",
|
|
638
|
-
values:
|
|
774
|
+
values: m,
|
|
639
775
|
excluded: p,
|
|
640
776
|
editable: l,
|
|
641
|
-
onToggle:
|
|
777
|
+
onToggle: S
|
|
642
778
|
}
|
|
643
779
|
) : null,
|
|
644
|
-
|
|
645
|
-
|
|
780
|
+
q.length > 0 ? /* @__PURE__ */ e(
|
|
781
|
+
Ie,
|
|
646
782
|
{
|
|
647
783
|
title: "Permission Overrides",
|
|
648
|
-
values:
|
|
649
|
-
excluded:
|
|
784
|
+
values: q,
|
|
785
|
+
excluded: M,
|
|
650
786
|
editable: l,
|
|
651
|
-
onToggle:
|
|
652
|
-
formatLabel:
|
|
787
|
+
onToggle: B,
|
|
788
|
+
formatLabel: b
|
|
653
789
|
}
|
|
654
790
|
) : null,
|
|
655
|
-
s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-b p-2", children: s.map((
|
|
656
|
-
const
|
|
791
|
+
s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-b p-2", children: s.map((F) => {
|
|
792
|
+
const Y = x && !(F.id in I);
|
|
657
793
|
return /* @__PURE__ */ n(
|
|
658
794
|
"button",
|
|
659
795
|
{
|
|
660
796
|
type: "button",
|
|
661
|
-
onClick: () =>
|
|
662
|
-
className: `inline-flex items-center gap-1 rounded px-2 py-1 text-xs ${
|
|
797
|
+
onClick: () => f(F.id),
|
|
798
|
+
className: `inline-flex items-center gap-1 rounded px-2 py-1 text-xs ${F.id === (T == null ? void 0 : T.id) ? "bg-muted font-medium" : "hover:bg-muted/50"}`,
|
|
663
799
|
children: [
|
|
664
|
-
|
|
665
|
-
|
|
800
|
+
Y ? /* @__PURE__ */ e(wt, { size: 12, className: "text-green-600" }) : /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-500", "aria-hidden": !0 }),
|
|
801
|
+
F.name
|
|
666
802
|
]
|
|
667
803
|
},
|
|
668
|
-
|
|
804
|
+
F.id
|
|
669
805
|
);
|
|
670
806
|
}) }) : null,
|
|
671
807
|
/* @__PURE__ */ n("div", { className: "flex flex-1 gap-3 overflow-auto p-3", children: [
|
|
672
|
-
/* @__PURE__ */ e(
|
|
673
|
-
|
|
808
|
+
/* @__PURE__ */ e(Fe, { label: "Origin", value: (U = t.diff) == null ? void 0 : U.origin, highlightLines: V }),
|
|
809
|
+
_ ? /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center justify-center rounded border bg-muted/30 p-3 text-xs text-muted-foreground", children: [
|
|
674
810
|
"Matches ",
|
|
675
|
-
|
|
811
|
+
T == null ? void 0 : T.name,
|
|
676
812
|
" — no differences."
|
|
677
|
-
] }) : /* @__PURE__ */ e(
|
|
813
|
+
] }) : /* @__PURE__ */ e(Fe, { label: (T == null ? void 0 : T.name) ?? "Target", value: k })
|
|
678
814
|
] })
|
|
679
815
|
] }) : null;
|
|
680
816
|
}
|
|
681
|
-
const
|
|
817
|
+
const it = [
|
|
682
818
|
"blueprint",
|
|
683
819
|
"system",
|
|
684
820
|
"network",
|
|
@@ -700,83 +836,83 @@ const at = [
|
|
|
700
836
|
"script"
|
|
701
837
|
// Project
|
|
702
838
|
];
|
|
703
|
-
function
|
|
704
|
-
const s =
|
|
705
|
-
return s === -1 ?
|
|
839
|
+
function qe(t) {
|
|
840
|
+
const s = it.indexOf(t);
|
|
841
|
+
return s === -1 ? it.length : s;
|
|
706
842
|
}
|
|
707
|
-
function
|
|
708
|
-
const
|
|
709
|
-
return
|
|
843
|
+
function Ve(t, s) {
|
|
844
|
+
const a = qe(t) - qe(s);
|
|
845
|
+
return a !== 0 ? a : t.localeCompare(s);
|
|
710
846
|
}
|
|
711
|
-
const
|
|
847
|
+
const Ae = {
|
|
712
848
|
create: "text-emerald-600",
|
|
713
849
|
update: "text-amber-600",
|
|
714
850
|
remove: "text-destructive"
|
|
715
851
|
};
|
|
716
|
-
function
|
|
852
|
+
function rt(t) {
|
|
717
853
|
const s = t.indexOf(":");
|
|
718
854
|
return s >= 0 ? { type: t.slice(0, s), name: t.slice(s + 1) } : { type: "", name: t };
|
|
719
855
|
}
|
|
720
|
-
function
|
|
721
|
-
const s = /* @__PURE__ */ new Map(),
|
|
722
|
-
let l = s.get(
|
|
723
|
-
return l || (l = { key:
|
|
856
|
+
function on(t) {
|
|
857
|
+
const s = /* @__PURE__ */ new Map(), a = (i, r, d) => {
|
|
858
|
+
let l = s.get(i);
|
|
859
|
+
return l || (l = { key: i, type: r, name: d, children: [] }, s.set(i, l)), l;
|
|
724
860
|
};
|
|
725
|
-
for (const
|
|
726
|
-
if (
|
|
727
|
-
const r =
|
|
728
|
-
i
|
|
861
|
+
for (const i of t)
|
|
862
|
+
if (i.parentKey) {
|
|
863
|
+
const r = rt(i.parentKey);
|
|
864
|
+
a(i.parentKey, r.type, r.name).children.push(i);
|
|
729
865
|
} else {
|
|
730
|
-
const r = i
|
|
731
|
-
r.type =
|
|
866
|
+
const r = a(i.itemKey, i.itemType, i.itemName || rt(i.itemKey).name);
|
|
867
|
+
r.type = i.itemType, r.name = i.itemName || r.name, r.self = i;
|
|
732
868
|
}
|
|
733
869
|
return [...s.values()].sort(
|
|
734
|
-
(
|
|
870
|
+
(i, r) => qe(i.type) - qe(r.type) || i.name.localeCompare(r.name)
|
|
735
871
|
);
|
|
736
872
|
}
|
|
737
|
-
function
|
|
873
|
+
function dn(t, s, a, i) {
|
|
738
874
|
const { fetchJson: r } = te();
|
|
739
|
-
return
|
|
875
|
+
return le({
|
|
740
876
|
queryKey: ["imaginarium", "release-push-preview", t, s],
|
|
741
|
-
queryFn: () => r(`${
|
|
877
|
+
queryFn: () => r(`${a}/${t}/push-preview`, {
|
|
742
878
|
method: "POST",
|
|
743
879
|
body: JSON.stringify({ destConfigIds: s })
|
|
744
880
|
}),
|
|
745
|
-
enabled:
|
|
881
|
+
enabled: i,
|
|
746
882
|
// The dialog recomputes on every open (see refetch-on-open), so don't also
|
|
747
883
|
// auto-refetch on enable — that would double the (slow) compare.
|
|
748
884
|
staleTime: 1 / 0,
|
|
749
885
|
gcTime: 0
|
|
750
886
|
});
|
|
751
887
|
}
|
|
752
|
-
function
|
|
888
|
+
function cn({ summary: t }) {
|
|
753
889
|
return /* @__PURE__ */ n("span", { className: "text-xs", children: [
|
|
754
|
-
/* @__PURE__ */ n("span", { className:
|
|
890
|
+
/* @__PURE__ */ n("span", { className: Ae.create, children: [
|
|
755
891
|
t.create,
|
|
756
892
|
" create"
|
|
757
893
|
] }),
|
|
758
894
|
" · ",
|
|
759
|
-
/* @__PURE__ */ n("span", { className:
|
|
895
|
+
/* @__PURE__ */ n("span", { className: Ae.update, children: [
|
|
760
896
|
t.update,
|
|
761
897
|
" update"
|
|
762
898
|
] }),
|
|
763
899
|
" · ",
|
|
764
|
-
/* @__PURE__ */ n("span", { className:
|
|
900
|
+
/* @__PURE__ */ n("span", { className: Ae.remove, children: [
|
|
765
901
|
t.remove,
|
|
766
902
|
" remove"
|
|
767
903
|
] })
|
|
768
904
|
] });
|
|
769
905
|
}
|
|
770
|
-
function
|
|
771
|
-
return /* @__PURE__ */ e("span", { className: `font-mono text-xs uppercase ${
|
|
906
|
+
function lt({ action: t }) {
|
|
907
|
+
return /* @__PURE__ */ e("span", { className: `font-mono text-xs uppercase ${Ae[t] ?? ""}`, children: t });
|
|
772
908
|
}
|
|
773
|
-
function
|
|
909
|
+
function mn() {
|
|
774
910
|
return /* @__PURE__ */ e("span", { className: "font-mono text-xs uppercase text-muted-foreground", children: "no_update" });
|
|
775
911
|
}
|
|
776
|
-
function
|
|
912
|
+
function un({ preview: t, loading: s, error: a, onSelectItem: i }) {
|
|
777
913
|
if (s)
|
|
778
914
|
return /* @__PURE__ */ n("p", { className: "mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
779
|
-
/* @__PURE__ */ e(
|
|
915
|
+
/* @__PURE__ */ e(ze, { className: "h-3 w-3 animate-spin" }),
|
|
780
916
|
" Computing changes…"
|
|
781
917
|
] });
|
|
782
918
|
if (t != null && t.error)
|
|
@@ -784,54 +920,54 @@ function dn({ preview: t, loading: s, error: i, onSelectItem: a }) {
|
|
|
784
920
|
"Couldn’t compute changes: ",
|
|
785
921
|
t.error
|
|
786
922
|
] });
|
|
787
|
-
if (
|
|
923
|
+
if (a && !t)
|
|
788
924
|
return /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-destructive", children: "Couldn’t compute changes for this target." });
|
|
789
925
|
if (!t || !t.summary)
|
|
790
926
|
return null;
|
|
791
927
|
if (t.summary.total === 0)
|
|
792
928
|
return /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted-foreground", children: "No changes — already up to date." });
|
|
793
|
-
const r =
|
|
929
|
+
const r = on(t.items ?? []);
|
|
794
930
|
return /* @__PURE__ */ n("div", { className: "mt-1", children: [
|
|
795
|
-
/* @__PURE__ */ e(
|
|
931
|
+
/* @__PURE__ */ e(cn, { summary: t.summary }),
|
|
796
932
|
/* @__PURE__ */ e("div", { className: "mt-2 max-h-[55vh] space-y-3 overflow-auto border-t pt-2", children: r.map((d) => /* @__PURE__ */ n("div", { children: [
|
|
797
933
|
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
798
|
-
d.self ? /* @__PURE__ */ e(
|
|
799
|
-
d.self &&
|
|
934
|
+
d.self ? /* @__PURE__ */ e(lt, { action: d.self.action }) : /* @__PURE__ */ e(mn, {}),
|
|
935
|
+
d.self && i ? /* @__PURE__ */ e(
|
|
800
936
|
"button",
|
|
801
937
|
{
|
|
802
938
|
type: "button",
|
|
803
939
|
className: "text-sm font-medium hover:underline",
|
|
804
|
-
onClick: () =>
|
|
940
|
+
onClick: () => i(d.self),
|
|
805
941
|
children: d.name
|
|
806
942
|
}
|
|
807
943
|
) : /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: d.name }),
|
|
808
944
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: d.type })
|
|
809
945
|
] }),
|
|
810
|
-
d.children.length > 0 ? /* @__PURE__ */ e("ul", { className: "ml-4 mt-0.5 space-y-0.5 border-l pl-3", children: d.children.map((l,
|
|
811
|
-
/* @__PURE__ */ e(
|
|
946
|
+
d.children.length > 0 ? /* @__PURE__ */ e("ul", { className: "ml-4 mt-0.5 space-y-0.5 border-l pl-3", children: d.children.map((l, c) => /* @__PURE__ */ n("li", { className: "text-xs", children: [
|
|
947
|
+
/* @__PURE__ */ e(lt, { action: l.action }),
|
|
812
948
|
" ",
|
|
813
|
-
|
|
949
|
+
i ? /* @__PURE__ */ e("button", { type: "button", className: "hover:underline", onClick: () => i(l), children: l.itemName || l.itemKey }) : /* @__PURE__ */ e("span", { children: l.itemName || l.itemKey }),
|
|
814
950
|
l.itemType !== "attribute" ? /* @__PURE__ */ n("span", { className: "text-muted-foreground", children: [
|
|
815
951
|
" (",
|
|
816
952
|
l.itemType,
|
|
817
953
|
")"
|
|
818
954
|
] }) : null
|
|
819
|
-
] }, `${l.itemKey}-${
|
|
955
|
+
] }, `${l.itemKey}-${c}`)) }) : null
|
|
820
956
|
] }, d.key)) })
|
|
821
957
|
] });
|
|
822
958
|
}
|
|
823
|
-
function
|
|
959
|
+
function Pt({
|
|
824
960
|
releaseId: t,
|
|
825
961
|
destConfigId: s,
|
|
826
|
-
name:
|
|
827
|
-
apiPath:
|
|
962
|
+
name: a,
|
|
963
|
+
apiPath: i = "/releases",
|
|
828
964
|
onSelectItem: r,
|
|
829
965
|
headerRight: d,
|
|
830
966
|
footer: l,
|
|
831
|
-
defaultOpen:
|
|
967
|
+
defaultOpen: c = !1
|
|
832
968
|
}) {
|
|
833
|
-
var
|
|
834
|
-
const [h,
|
|
969
|
+
var S, q, M, B;
|
|
970
|
+
const [h, N] = R(c), y = J(() => [s], [s]), m = dn(t, y, i, h), p = ((q = (S = m.data) == null ? void 0 : S.previews) == null ? void 0 : q.find((b) => b.destConfigId === s)) ?? ((B = (M = m.data) == null ? void 0 : M.previews) == null ? void 0 : B[0]);
|
|
835
971
|
return /* @__PURE__ */ n("div", { className: "rounded border", children: [
|
|
836
972
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
837
973
|
/* @__PURE__ */ n(
|
|
@@ -839,10 +975,10 @@ function Tt({
|
|
|
839
975
|
{
|
|
840
976
|
type: "button",
|
|
841
977
|
className: "flex min-w-0 items-center gap-1 text-sm font-medium",
|
|
842
|
-
onClick: () =>
|
|
978
|
+
onClick: () => N((b) => !b),
|
|
843
979
|
children: [
|
|
844
|
-
h ? /* @__PURE__ */ e(
|
|
845
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
980
|
+
h ? /* @__PURE__ */ e(he, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ e(pe, { className: "h-4 w-4 shrink-0" }),
|
|
981
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: a })
|
|
846
982
|
]
|
|
847
983
|
}
|
|
848
984
|
),
|
|
@@ -850,11 +986,11 @@ function Tt({
|
|
|
850
986
|
] }),
|
|
851
987
|
h ? /* @__PURE__ */ n("div", { className: "border-t px-3 py-2", children: [
|
|
852
988
|
/* @__PURE__ */ e(
|
|
853
|
-
|
|
989
|
+
un,
|
|
854
990
|
{
|
|
855
991
|
preview: p,
|
|
856
|
-
loading:
|
|
857
|
-
error:
|
|
992
|
+
loading: m.isFetching,
|
|
993
|
+
error: m.isError,
|
|
858
994
|
onSelectItem: r
|
|
859
995
|
}
|
|
860
996
|
),
|
|
@@ -862,21 +998,21 @@ function Tt({
|
|
|
862
998
|
] }) : null
|
|
863
999
|
] });
|
|
864
1000
|
}
|
|
865
|
-
function
|
|
1001
|
+
function hn({ state: t }) {
|
|
866
1002
|
switch (t.status) {
|
|
867
1003
|
case "pushing":
|
|
868
1004
|
return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
869
|
-
/* @__PURE__ */ e(
|
|
1005
|
+
/* @__PURE__ */ e(ze, { className: "h-4 w-4 animate-spin" }),
|
|
870
1006
|
"Pushing…"
|
|
871
1007
|
] });
|
|
872
1008
|
case "success":
|
|
873
1009
|
return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-emerald-600", children: [
|
|
874
|
-
/* @__PURE__ */ e(
|
|
1010
|
+
/* @__PURE__ */ e(wt, { className: "h-4 w-4" }),
|
|
875
1011
|
"Success"
|
|
876
1012
|
] });
|
|
877
1013
|
case "partial":
|
|
878
1014
|
return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-amber-600", children: [
|
|
879
|
-
/* @__PURE__ */ e(
|
|
1015
|
+
/* @__PURE__ */ e(Se, { className: "h-4 w-4" }),
|
|
880
1016
|
"Partial — ",
|
|
881
1017
|
t.failed ?? 0,
|
|
882
1018
|
" failed"
|
|
@@ -888,120 +1024,120 @@ function cn({ state: t }) {
|
|
|
888
1024
|
className: "inline-flex items-center gap-1 text-sm text-destructive",
|
|
889
1025
|
title: t.error,
|
|
890
1026
|
children: [
|
|
891
|
-
/* @__PURE__ */ e(
|
|
1027
|
+
/* @__PURE__ */ e(ge, { className: "h-4 w-4" }),
|
|
892
1028
|
"Failed"
|
|
893
1029
|
]
|
|
894
1030
|
}
|
|
895
1031
|
);
|
|
896
1032
|
default:
|
|
897
1033
|
return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
898
|
-
/* @__PURE__ */ e(
|
|
1034
|
+
/* @__PURE__ */ e(Lt, { className: "h-3 w-3" }),
|
|
899
1035
|
"Pending"
|
|
900
1036
|
] });
|
|
901
1037
|
}
|
|
902
1038
|
}
|
|
903
|
-
function
|
|
1039
|
+
function pn({
|
|
904
1040
|
open: t,
|
|
905
1041
|
onOpenChange: s,
|
|
906
|
-
releaseId:
|
|
907
|
-
targetConfigIds:
|
|
1042
|
+
releaseId: a,
|
|
1043
|
+
targetConfigIds: i,
|
|
908
1044
|
targetNames: r,
|
|
909
1045
|
apiPath: d = "/releases",
|
|
910
1046
|
onComplete: l,
|
|
911
|
-
dependencyWarnings:
|
|
1047
|
+
dependencyWarnings: c = []
|
|
912
1048
|
}) {
|
|
913
|
-
const { toast: h } =
|
|
914
|
-
p(!0),
|
|
915
|
-
let
|
|
916
|
-
for (const
|
|
917
|
-
|
|
1049
|
+
const { toast: h } = se(), { fetchJson: N } = te(), y = ae(), [m, p] = R(!1), [S, q] = R({}), [M, B] = R(!1), b = (f) => (r == null ? void 0 : r[f]) ?? f, P = (f, T) => q((I) => ({ ...I, [f]: T })), L = async () => {
|
|
1050
|
+
p(!0), B(!1), q(Object.fromEntries(i.map((I) => [I, { status: "idle" }])));
|
|
1051
|
+
let f = 0, T = 0;
|
|
1052
|
+
for (const I of i) {
|
|
1053
|
+
P(I, { status: "pushing" });
|
|
918
1054
|
try {
|
|
919
|
-
const
|
|
1055
|
+
const x = await N(`${d}/${a}/push`, {
|
|
920
1056
|
method: "POST",
|
|
921
|
-
body: JSON.stringify({ destConfigId:
|
|
922
|
-
}),
|
|
923
|
-
|
|
924
|
-
} catch (
|
|
925
|
-
|
|
926
|
-
const
|
|
927
|
-
|
|
1057
|
+
body: JSON.stringify({ destConfigId: I })
|
|
1058
|
+
}), k = (x.results ?? []).filter((_) => !_.ok);
|
|
1059
|
+
x.status === "success" ? (f += 1, P(I, { status: "success" })) : x.status === "partial" ? (T += 1, P(I, { status: "partial", failed: k.length, failures: k })) : (T += 1, P(I, { status: "failed", failures: k }));
|
|
1060
|
+
} catch (x) {
|
|
1061
|
+
T += 1;
|
|
1062
|
+
const k = x instanceof Error ? x.message : String(x);
|
|
1063
|
+
P(I, { status: "failed", error: k });
|
|
928
1064
|
}
|
|
929
1065
|
}
|
|
930
|
-
|
|
1066
|
+
y.invalidateQueries({ queryKey: ["imaginarium", "releases"] }), y.invalidateQueries({ queryKey: ["imaginarium", "release", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-items", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-pushes", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-push-preview", a] }), h(T === 0 ? { title: "Push complete", description: `Pushed to ${f} target${f === 1 ? "" : "s"}.` } : {
|
|
931
1067
|
title: "Push finished with errors",
|
|
932
|
-
description: `${
|
|
1068
|
+
description: `${T} target${T === 1 ? "" : "s"} did not fully succeed.`,
|
|
933
1069
|
variant: "destructive"
|
|
934
|
-
}), p(!1),
|
|
935
|
-
},
|
|
936
|
-
|
|
1070
|
+
}), p(!1), B(!0), l == null || l();
|
|
1071
|
+
}, z = (f) => {
|
|
1072
|
+
m || (f || (q({}), B(!1)), s(f));
|
|
937
1073
|
};
|
|
938
|
-
return /* @__PURE__ */ e(
|
|
939
|
-
/* @__PURE__ */ n(
|
|
940
|
-
/* @__PURE__ */ e(
|
|
941
|
-
/* @__PURE__ */ e(
|
|
1074
|
+
return /* @__PURE__ */ e(xe, { open: t, onOpenChange: z, children: /* @__PURE__ */ n(ye, { className: "max-w-2xl", children: [
|
|
1075
|
+
/* @__PURE__ */ n(be, { children: [
|
|
1076
|
+
/* @__PURE__ */ e(Ne, { children: "Push release" }),
|
|
1077
|
+
/* @__PURE__ */ e(ve, { children: "Pushes the included items to each target cluster, one at a time. Each target re-compares against the latest origin before applying." })
|
|
942
1078
|
] }),
|
|
943
|
-
|
|
1079
|
+
c.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-1 rounded border border-amber-200 bg-amber-50 p-3 text-xs text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300", children: [
|
|
944
1080
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
945
|
-
/* @__PURE__ */ e(
|
|
946
|
-
|
|
1081
|
+
/* @__PURE__ */ e(Se, { className: "h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
1082
|
+
c.length,
|
|
947
1083
|
" item",
|
|
948
|
-
|
|
1084
|
+
c.length === 1 ? "" : "s",
|
|
949
1085
|
" reference excluded dependencies"
|
|
950
1086
|
] }),
|
|
951
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-0.5 pl-8", children:
|
|
952
|
-
|
|
1087
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-0.5 pl-8", children: c.map((f) => /* @__PURE__ */ n("li", { children: [
|
|
1088
|
+
f.itemName,
|
|
953
1089
|
" → ",
|
|
954
|
-
|
|
955
|
-
] },
|
|
1090
|
+
f.missing.join(", ")
|
|
1091
|
+
] }, f.itemName)) }),
|
|
956
1092
|
/* @__PURE__ */ e("p", { className: "pl-8 text-amber-600", children: "Push may fail for these items. You can proceed anyway." })
|
|
957
1093
|
] }) : null,
|
|
958
|
-
/* @__PURE__ */ e("div", { className: "max-h-[60vh] space-y-2 overflow-y-auto py-2", children:
|
|
959
|
-
const
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "max-h-[60vh] space-y-2 overflow-y-auto py-2", children: i.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : i.map((f) => {
|
|
1095
|
+
const T = S[f] ?? { status: "idle" }, I = T.failures ?? [];
|
|
960
1096
|
return /* @__PURE__ */ e(
|
|
961
|
-
|
|
1097
|
+
Pt,
|
|
962
1098
|
{
|
|
963
|
-
releaseId:
|
|
964
|
-
destConfigId:
|
|
965
|
-
name:
|
|
1099
|
+
releaseId: a,
|
|
1100
|
+
destConfigId: f,
|
|
1101
|
+
name: b(f),
|
|
966
1102
|
apiPath: d,
|
|
967
|
-
headerRight: /* @__PURE__ */ e(
|
|
968
|
-
footer:
|
|
1103
|
+
headerRight: /* @__PURE__ */ e(hn, { state: T }),
|
|
1104
|
+
footer: I.length > 0 ? /* @__PURE__ */ e("ul", { className: "mt-2 max-h-48 space-y-1 overflow-auto border-t pt-2 text-xs", children: I.map((x, k) => /* @__PURE__ */ n("li", { className: "text-destructive", children: [
|
|
969
1105
|
/* @__PURE__ */ n("span", { className: "font-mono", children: [
|
|
970
|
-
|
|
971
|
-
|
|
1106
|
+
x.action ? `${x.action} ` : "",
|
|
1107
|
+
x.itemKey ?? "item"
|
|
972
1108
|
] }),
|
|
973
|
-
|
|
1109
|
+
x.error ? /* @__PURE__ */ n("span", { className: "text-muted-foreground", children: [
|
|
974
1110
|
" — ",
|
|
975
|
-
|
|
1111
|
+
x.error
|
|
976
1112
|
] }) : null
|
|
977
|
-
] }, `${
|
|
1113
|
+
] }, `${x.itemKey ?? "item"}-${k}`)) }) : null
|
|
978
1114
|
},
|
|
979
|
-
|
|
1115
|
+
f
|
|
980
1116
|
);
|
|
981
1117
|
}) }),
|
|
982
|
-
/* @__PURE__ */ n(
|
|
983
|
-
/* @__PURE__ */ e(
|
|
1118
|
+
/* @__PURE__ */ n(we, { children: [
|
|
1119
|
+
/* @__PURE__ */ e($, { variant: "outline", onClick: () => z(!1), disabled: m, children: "Close" }),
|
|
984
1120
|
/* @__PURE__ */ n(
|
|
985
|
-
|
|
1121
|
+
$,
|
|
986
1122
|
{
|
|
987
1123
|
variant: "destructive",
|
|
988
|
-
onClick:
|
|
989
|
-
disabled:
|
|
1124
|
+
onClick: L,
|
|
1125
|
+
disabled: m || M || i.length === 0,
|
|
990
1126
|
children: [
|
|
991
|
-
/* @__PURE__ */ e(
|
|
992
|
-
|
|
1127
|
+
/* @__PURE__ */ e(Jt, { className: "w-4 h-4 mr-2" }),
|
|
1128
|
+
m ? "Pushing…" : "Confirm push"
|
|
993
1129
|
]
|
|
994
1130
|
}
|
|
995
1131
|
)
|
|
996
1132
|
] })
|
|
997
1133
|
] }) });
|
|
998
1134
|
}
|
|
999
|
-
function
|
|
1000
|
-
var
|
|
1001
|
-
const
|
|
1135
|
+
function St({ item: t, onClose: s }) {
|
|
1136
|
+
var i, r;
|
|
1137
|
+
const a = J(
|
|
1002
1138
|
() => {
|
|
1003
1139
|
var d, l;
|
|
1004
|
-
return
|
|
1140
|
+
return Tt((d = t == null ? void 0 : t.diff) == null ? void 0 : d.origin, (l = t == null ? void 0 : t.diff) == null ? void 0 : l.target);
|
|
1005
1141
|
},
|
|
1006
1142
|
[t]
|
|
1007
1143
|
);
|
|
@@ -1011,85 +1147,85 @@ function Pt({ item: t, onClose: s }) {
|
|
|
1011
1147
|
/* @__PURE__ */ e("div", { className: "truncate font-medium", children: t.itemName }),
|
|
1012
1148
|
/* @__PURE__ */ e("div", { className: "font-mono text-xs text-muted-foreground", children: t.itemType })
|
|
1013
1149
|
] }),
|
|
1014
|
-
/* @__PURE__ */ e(
|
|
1150
|
+
/* @__PURE__ */ e($, { variant: "ghost", size: "icon", title: "Close", onClick: s, children: /* @__PURE__ */ e(ge, {}) })
|
|
1015
1151
|
] }),
|
|
1016
1152
|
/* @__PURE__ */ n("div", { className: "flex flex-1 gap-3 overflow-auto p-3", children: [
|
|
1017
|
-
/* @__PURE__ */ e(
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1153
|
+
/* @__PURE__ */ e(Fe, { label: "Origin", value: (i = t.diff) == null ? void 0 : i.origin, highlightLines: a }),
|
|
1154
|
+
/* @__PURE__ */ e(Fe, { label: "Target", value: (r = t.diff) == null ? void 0 : r.target })
|
|
1019
1155
|
] })
|
|
1020
1156
|
] }) : null;
|
|
1021
1157
|
}
|
|
1022
|
-
function
|
|
1158
|
+
function fn(t) {
|
|
1023
1159
|
return {
|
|
1024
1160
|
itemName: t.itemName,
|
|
1025
1161
|
itemType: t.itemType,
|
|
1026
1162
|
diff: { origin: t.origin, target: t.target }
|
|
1027
1163
|
};
|
|
1028
1164
|
}
|
|
1029
|
-
function
|
|
1165
|
+
function gn({
|
|
1030
1166
|
open: t,
|
|
1031
1167
|
onOpenChange: s,
|
|
1032
|
-
releaseId:
|
|
1033
|
-
targetConfigIds:
|
|
1168
|
+
releaseId: a,
|
|
1169
|
+
targetConfigIds: i,
|
|
1034
1170
|
targetNames: r,
|
|
1035
1171
|
apiPath: d = "/releases"
|
|
1036
1172
|
}) {
|
|
1037
|
-
const [l,
|
|
1038
|
-
|
|
1173
|
+
const [l, c] = R(null), h = (y) => (r == null ? void 0 : r[y]) ?? y, N = (y) => {
|
|
1174
|
+
y || c(null), s(y);
|
|
1039
1175
|
};
|
|
1040
|
-
return /* @__PURE__ */ e(
|
|
1041
|
-
/* @__PURE__ */ n(
|
|
1042
|
-
/* @__PURE__ */ e(
|
|
1043
|
-
/* @__PURE__ */ e(
|
|
1176
|
+
return /* @__PURE__ */ e(xe, { open: t, onOpenChange: N, children: /* @__PURE__ */ n(ye, { className: "max-w-4xl", children: [
|
|
1177
|
+
/* @__PURE__ */ n(be, { children: [
|
|
1178
|
+
/* @__PURE__ */ e(Ne, { children: "Changes to push" }),
|
|
1179
|
+
/* @__PURE__ */ e(ve, { children: "Expand a target to compute and see exactly what it would receive, from a dry run of the push. Nothing is applied." })
|
|
1044
1180
|
] }),
|
|
1045
|
-
/* @__PURE__ */ e("div", { className: l ? "hidden" : "min-w-0 max-h-[70vh] space-y-2 overflow-y-auto py-2", children:
|
|
1046
|
-
|
|
1181
|
+
/* @__PURE__ */ e("div", { className: l ? "hidden" : "min-w-0 max-h-[70vh] space-y-2 overflow-y-auto py-2", children: i.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : i.map((y) => /* @__PURE__ */ e(
|
|
1182
|
+
Pt,
|
|
1047
1183
|
{
|
|
1048
|
-
releaseId:
|
|
1049
|
-
destConfigId:
|
|
1050
|
-
name: h(
|
|
1184
|
+
releaseId: a,
|
|
1185
|
+
destConfigId: y,
|
|
1186
|
+
name: h(y),
|
|
1051
1187
|
apiPath: d,
|
|
1052
|
-
onSelectItem:
|
|
1188
|
+
onSelectItem: c
|
|
1053
1189
|
},
|
|
1054
|
-
|
|
1190
|
+
y
|
|
1055
1191
|
)) }),
|
|
1056
1192
|
l ? /* @__PURE__ */ n("div", { className: "min-w-0 space-y-2", children: [
|
|
1057
|
-
/* @__PURE__ */ n(
|
|
1058
|
-
/* @__PURE__ */ e(
|
|
1193
|
+
/* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: () => c(null), children: [
|
|
1194
|
+
/* @__PURE__ */ e(Qe, {}),
|
|
1059
1195
|
" Back to changes"
|
|
1060
1196
|
] }),
|
|
1061
|
-
/* @__PURE__ */ e("div", { className: "h-[60vh] min-w-0", children: /* @__PURE__ */ e(
|
|
1197
|
+
/* @__PURE__ */ e("div", { className: "h-[60vh] min-w-0", children: /* @__PURE__ */ e(St, { item: fn(l), onClose: () => c(null) }) })
|
|
1062
1198
|
] }) : null,
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
1199
|
+
/* @__PURE__ */ e(we, { children: /* @__PURE__ */ e($, { variant: "outline", onClick: () => N(!1), children: "Close" }) })
|
|
1064
1200
|
] }) });
|
|
1065
1201
|
}
|
|
1066
|
-
function
|
|
1202
|
+
function xn(t) {
|
|
1067
1203
|
var s;
|
|
1068
|
-
return (((s = t.diff) == null ? void 0 : s.versions) ?? []).filter((
|
|
1204
|
+
return (((s = t.diff) == null ? void 0 : s.versions) ?? []).filter((a) => !a.existsOnTarget);
|
|
1069
1205
|
}
|
|
1070
|
-
function
|
|
1206
|
+
function yn({ item: t, disabled: s, onChange: a }) {
|
|
1071
1207
|
var r;
|
|
1072
|
-
const
|
|
1208
|
+
const i = ((r = t.diff) == null ? void 0 : r.versions) ?? [];
|
|
1073
1209
|
return /* @__PURE__ */ n(
|
|
1074
1210
|
"select",
|
|
1075
1211
|
{
|
|
1076
1212
|
value: t.selectedVersion ?? "",
|
|
1077
1213
|
disabled: s,
|
|
1078
1214
|
onClick: (d) => d.stopPropagation(),
|
|
1079
|
-
onChange: (d) =>
|
|
1215
|
+
onChange: (d) => a(d.target.value),
|
|
1080
1216
|
className: "h-7 rounded-md border border-input bg-background px-2 py-0.5 text-xs disabled:cursor-not-allowed disabled:opacity-50",
|
|
1081
1217
|
"aria-label": "Rule version",
|
|
1082
1218
|
children: [
|
|
1083
1219
|
/* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Select a version" }),
|
|
1084
|
-
|
|
1085
|
-
const l = String(d.version),
|
|
1086
|
-
return /* @__PURE__ */ e("option", { value: l, disabled: d.existsOnTarget, children:
|
|
1220
|
+
i.map((d) => {
|
|
1221
|
+
const l = String(d.version), c = d.existsOnTarget ? `v${d.version} — already on target` : `v${d.version}${d.isPublished ? " (published)" : ""}`;
|
|
1222
|
+
return /* @__PURE__ */ e("option", { value: l, disabled: d.existsOnTarget, children: c }, l);
|
|
1087
1223
|
})
|
|
1088
1224
|
]
|
|
1089
1225
|
}
|
|
1090
1226
|
);
|
|
1091
1227
|
}
|
|
1092
|
-
const
|
|
1228
|
+
const bn = {
|
|
1093
1229
|
blueprint: "bg-blue-100 text-blue-700 dark:bg-blue-500/15 dark:text-blue-300",
|
|
1094
1230
|
rule: "bg-orange-100 text-orange-700 dark:bg-orange-500/15 dark:text-orange-300",
|
|
1095
1231
|
messageRoute: "bg-teal-100 text-teal-700 dark:bg-teal-500/15 dark:text-teal-300",
|
|
@@ -1108,15 +1244,15 @@ const gn = {
|
|
|
1108
1244
|
enumValue: "bg-violet-100 text-violet-700 dark:bg-violet-500/15 dark:text-violet-300",
|
|
1109
1245
|
project: "bg-fuchsia-50 text-fuchsia-800 dark:bg-fuchsia-500/15 dark:text-fuchsia-300"
|
|
1110
1246
|
};
|
|
1111
|
-
function
|
|
1112
|
-
const s =
|
|
1247
|
+
function Te({ type: t }) {
|
|
1248
|
+
const s = bn[t] ?? "bg-muted text-muted-foreground";
|
|
1113
1249
|
return /* @__PURE__ */ e("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs font-semibold ${s}`, children: t });
|
|
1114
1250
|
}
|
|
1115
|
-
function
|
|
1251
|
+
function ot({ checked: t, onChange: s, disabled: a = !1 }) {
|
|
1116
1252
|
return /* @__PURE__ */ n(
|
|
1117
1253
|
"label",
|
|
1118
1254
|
{
|
|
1119
|
-
className: `relative inline-block h-[18px] w-8 shrink-0 ${
|
|
1255
|
+
className: `relative inline-block h-[18px] w-8 shrink-0 ${a ? "cursor-not-allowed opacity-40" : "cursor-pointer"}`,
|
|
1120
1256
|
children: [
|
|
1121
1257
|
/* @__PURE__ */ e(
|
|
1122
1258
|
"input",
|
|
@@ -1124,8 +1260,8 @@ function lt({ checked: t, onChange: s, disabled: i = !1 }) {
|
|
|
1124
1260
|
type: "checkbox",
|
|
1125
1261
|
className: "peer sr-only",
|
|
1126
1262
|
checked: t,
|
|
1127
|
-
disabled:
|
|
1128
|
-
onChange: (
|
|
1263
|
+
disabled: a,
|
|
1264
|
+
onChange: (i) => s(i.target.checked)
|
|
1129
1265
|
}
|
|
1130
1266
|
),
|
|
1131
1267
|
/* @__PURE__ */ e("span", { className: "absolute inset-0 rounded-full bg-input transition-colors peer-checked:bg-primary" }),
|
|
@@ -1134,43 +1270,43 @@ function lt({ checked: t, onChange: s, disabled: i = !1 }) {
|
|
|
1134
1270
|
}
|
|
1135
1271
|
);
|
|
1136
1272
|
}
|
|
1137
|
-
function
|
|
1273
|
+
function Nn(t) {
|
|
1138
1274
|
const s = /* @__PURE__ */ new Map();
|
|
1139
|
-
for (const
|
|
1140
|
-
const r = s.get(
|
|
1141
|
-
(!r ||
|
|
1275
|
+
for (const i of t) {
|
|
1276
|
+
const r = s.get(i.destConfigId);
|
|
1277
|
+
(!r || i.createdAt > r.createdAt) && s.set(i.destConfigId, i);
|
|
1142
1278
|
}
|
|
1143
|
-
const
|
|
1144
|
-
for (const
|
|
1145
|
-
for (const r of
|
|
1279
|
+
const a = /* @__PURE__ */ new Map();
|
|
1280
|
+
for (const i of s.values())
|
|
1281
|
+
for (const r of i.results ?? []) {
|
|
1146
1282
|
if (!r.itemKey)
|
|
1147
1283
|
continue;
|
|
1148
|
-
let d =
|
|
1149
|
-
d || (d = /* @__PURE__ */ new Map(),
|
|
1284
|
+
let d = a.get(r.itemKey);
|
|
1285
|
+
d || (d = /* @__PURE__ */ new Map(), a.set(r.itemKey, d)), d.set(i.destConfigId, { ok: r.ok, error: r.error });
|
|
1150
1286
|
}
|
|
1151
|
-
return
|
|
1287
|
+
return a;
|
|
1152
1288
|
}
|
|
1153
|
-
function
|
|
1154
|
-
var
|
|
1155
|
-
return (
|
|
1289
|
+
function vn(t, s, a) {
|
|
1290
|
+
var i;
|
|
1291
|
+
return (i = t.get(s)) == null ? void 0 : i.get(a);
|
|
1156
1292
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return t.filter((
|
|
1293
|
+
function ts(t, s) {
|
|
1294
|
+
return t.filter((a) => !(s.type !== "all" && a.itemType !== s.type || s.included === "enabled" && (!a.included || a.ignored) || s.included === "disabled" && a.included && !a.ignored));
|
|
1159
1295
|
}
|
|
1160
|
-
function
|
|
1296
|
+
function wn(t) {
|
|
1161
1297
|
const s = {};
|
|
1162
|
-
for (const
|
|
1163
|
-
s[
|
|
1298
|
+
for (const a of t)
|
|
1299
|
+
s[a.itemType] = (s[a.itemType] ?? 0) + 1;
|
|
1164
1300
|
return s;
|
|
1165
1301
|
}
|
|
1166
|
-
function
|
|
1167
|
-
const s = t.indexOf(":"),
|
|
1302
|
+
function Cn(t) {
|
|
1303
|
+
const s = t.indexOf(":"), a = s >= 0 ? t.slice(0, s) : t, i = s >= 0 ? t.slice(s + 1) : t;
|
|
1168
1304
|
return {
|
|
1169
1305
|
id: "",
|
|
1170
1306
|
releaseId: "",
|
|
1171
1307
|
itemKey: t,
|
|
1172
|
-
itemType:
|
|
1173
|
-
itemName:
|
|
1308
|
+
itemType: a,
|
|
1309
|
+
itemName: i,
|
|
1174
1310
|
parentKey: null,
|
|
1175
1311
|
selectedVersion: null,
|
|
1176
1312
|
status: "updated",
|
|
@@ -1182,112 +1318,112 @@ function Nn(t) {
|
|
|
1182
1318
|
updatedAt: ""
|
|
1183
1319
|
};
|
|
1184
1320
|
}
|
|
1185
|
-
function
|
|
1321
|
+
function kn(t) {
|
|
1186
1322
|
var d;
|
|
1187
1323
|
const s = new Set(
|
|
1188
1324
|
t.filter((l) => !l.parentKey).map((l) => l.itemKey)
|
|
1189
|
-
),
|
|
1325
|
+
), a = [], i = /* @__PURE__ */ new Map();
|
|
1190
1326
|
for (const l of t) {
|
|
1191
1327
|
if (l.parentKey)
|
|
1192
1328
|
continue;
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1329
|
+
const c = { item: l, children: [] };
|
|
1330
|
+
a.push(c), i.set(l.itemKey, c);
|
|
1195
1331
|
}
|
|
1196
1332
|
const r = /* @__PURE__ */ new Map();
|
|
1197
1333
|
for (const l of t) {
|
|
1198
1334
|
if (!l.parentKey)
|
|
1199
1335
|
continue;
|
|
1200
1336
|
if (s.has(l.parentKey)) {
|
|
1201
|
-
(d =
|
|
1337
|
+
(d = i.get(l.parentKey)) == null || d.children.push(l);
|
|
1202
1338
|
continue;
|
|
1203
1339
|
}
|
|
1204
|
-
let
|
|
1205
|
-
|
|
1340
|
+
let c = r.get(l.parentKey);
|
|
1341
|
+
c || (c = { item: Cn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, c), a.push(c)), c.children.push(l);
|
|
1206
1342
|
}
|
|
1207
|
-
return
|
|
1343
|
+
return a;
|
|
1208
1344
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const s = t.indexOf(":"),
|
|
1211
|
-
return { itemKey: t, itemType:
|
|
1345
|
+
function Tn(t) {
|
|
1346
|
+
const s = t.indexOf(":"), a = s >= 0 ? t.slice(0, s) : t, i = s >= 0 ? t.slice(s + 1) : t;
|
|
1347
|
+
return { itemKey: t, itemType: a, itemName: i, parentKey: null, cells: {} };
|
|
1212
1348
|
}
|
|
1213
|
-
function
|
|
1349
|
+
function Pn(t) {
|
|
1214
1350
|
var d;
|
|
1215
1351
|
const s = new Set(
|
|
1216
1352
|
t.filter((l) => !l.parentKey).map((l) => l.itemKey)
|
|
1217
|
-
),
|
|
1353
|
+
), a = [], i = /* @__PURE__ */ new Map();
|
|
1218
1354
|
for (const l of t) {
|
|
1219
1355
|
if (l.parentKey)
|
|
1220
1356
|
continue;
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1357
|
+
const c = { row: l, children: [] };
|
|
1358
|
+
a.push(c), i.set(l.itemKey, c);
|
|
1223
1359
|
}
|
|
1224
1360
|
const r = /* @__PURE__ */ new Map();
|
|
1225
1361
|
for (const l of t) {
|
|
1226
1362
|
if (!l.parentKey)
|
|
1227
1363
|
continue;
|
|
1228
1364
|
if (s.has(l.parentKey)) {
|
|
1229
|
-
(d =
|
|
1365
|
+
(d = i.get(l.parentKey)) == null || d.children.push(l);
|
|
1230
1366
|
continue;
|
|
1231
1367
|
}
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1368
|
+
let c = r.get(l.parentKey);
|
|
1369
|
+
c || (c = { row: Tn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, c), a.push(c)), c.children.push(l);
|
|
1234
1370
|
}
|
|
1235
|
-
return
|
|
1371
|
+
return a;
|
|
1236
1372
|
}
|
|
1237
|
-
function
|
|
1373
|
+
function Sn(t) {
|
|
1238
1374
|
let s = 0;
|
|
1239
|
-
for (const
|
|
1240
|
-
|
|
1375
|
+
for (const a of t.children)
|
|
1376
|
+
a.included && !a.ignored && (s += 1);
|
|
1241
1377
|
return { included: s, total: t.children.length };
|
|
1242
1378
|
}
|
|
1243
|
-
function
|
|
1244
|
-
var
|
|
1379
|
+
function En(t) {
|
|
1380
|
+
var i, r;
|
|
1245
1381
|
const s = [];
|
|
1246
1382
|
for (const d of t) {
|
|
1247
1383
|
if (d.status !== "new")
|
|
1248
1384
|
continue;
|
|
1249
|
-
const l = (
|
|
1250
|
-
if (typeof
|
|
1385
|
+
const l = (i = d.diff) == null ? void 0 : i.origin, c = l == null ? void 0 : l.id;
|
|
1386
|
+
if (typeof c == "string" && c && s.push({ token: c, depKey: d.itemKey }), d.itemType === "enum") {
|
|
1251
1387
|
const h = l == null ? void 0 : l.type;
|
|
1252
1388
|
typeof h == "string" && h && s.push({ token: h, depKey: d.itemKey });
|
|
1253
1389
|
}
|
|
1254
1390
|
}
|
|
1255
|
-
const
|
|
1391
|
+
const a = /* @__PURE__ */ new Map();
|
|
1256
1392
|
for (const d of t) {
|
|
1257
|
-
const l = /* @__PURE__ */ new Set(),
|
|
1258
|
-
for (const { token: h, depKey:
|
|
1259
|
-
|
|
1260
|
-
|
|
1393
|
+
const l = /* @__PURE__ */ new Set(), c = JSON.stringify(((r = d.diff) == null ? void 0 : r.origin) ?? null);
|
|
1394
|
+
for (const { token: h, depKey: N } of s)
|
|
1395
|
+
N !== d.itemKey && c.includes(h) && l.add(N);
|
|
1396
|
+
a.set(d.itemKey, l);
|
|
1261
1397
|
}
|
|
1262
|
-
return
|
|
1398
|
+
return a;
|
|
1263
1399
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const
|
|
1266
|
-
if (!
|
|
1400
|
+
function Re(t, s, a) {
|
|
1401
|
+
const i = s.get(t.itemKey);
|
|
1402
|
+
if (!i || i.size === 0)
|
|
1267
1403
|
return [];
|
|
1268
1404
|
const r = [];
|
|
1269
|
-
for (const d of
|
|
1270
|
-
const l =
|
|
1405
|
+
for (const d of i) {
|
|
1406
|
+
const l = a.get(d);
|
|
1271
1407
|
l && l.status === "new" && (!l.included || l.ignored) && r.push(l);
|
|
1272
1408
|
}
|
|
1273
1409
|
return r;
|
|
1274
1410
|
}
|
|
1275
|
-
function
|
|
1411
|
+
function $n(t) {
|
|
1276
1412
|
return t.tags + t.metadataKeys + t.i18nPaths + t.permissions;
|
|
1277
1413
|
}
|
|
1278
|
-
function
|
|
1414
|
+
function Kn(t) {
|
|
1279
1415
|
const s = [];
|
|
1280
1416
|
return t.tags > 0 && s.push(`${t.tags} tag${t.tags === 1 ? "" : "s"}`), t.metadataKeys > 0 && s.push(`${t.metadataKeys} metadata key${t.metadataKeys === 1 ? "" : "s"}`), t.i18nPaths > 0 && s.push(`${t.i18nPaths} translation${t.i18nPaths === 1 ? "" : "s"}`), t.permissions > 0 && s.push(`${t.permissions} permission${t.permissions === 1 ? "" : "s"}`), s.length === 0 ? "" : `${s.join(", ")} excluded from push`;
|
|
1281
1417
|
}
|
|
1282
|
-
const
|
|
1418
|
+
const On = [
|
|
1283
1419
|
{ value: "all", label: "All" },
|
|
1284
1420
|
{ value: "enabled", label: "Enabled" },
|
|
1285
1421
|
{ value: "disabled", label: "Disabled" }
|
|
1286
1422
|
];
|
|
1287
|
-
function
|
|
1423
|
+
function dt(t, s) {
|
|
1288
1424
|
return s === "all" ? !0 : s === "enabled" ? t.included && !t.ignored : !t.included || t.ignored;
|
|
1289
1425
|
}
|
|
1290
|
-
function
|
|
1426
|
+
function ct({ status: t }) {
|
|
1291
1427
|
return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border bg-muted text-muted-foreground border-border", children: t });
|
|
1292
1428
|
}
|
|
1293
1429
|
function Z(t) {
|
|
@@ -1296,285 +1432,285 @@ function Z(t) {
|
|
|
1296
1432
|
if (typeof t == "string" && t.length > 0)
|
|
1297
1433
|
try {
|
|
1298
1434
|
const s = JSON.parse(t);
|
|
1299
|
-
return Array.isArray(s) ? s.filter((
|
|
1435
|
+
return Array.isArray(s) ? s.filter((a) => typeof a == "string") : [];
|
|
1300
1436
|
} catch {
|
|
1301
1437
|
return [];
|
|
1302
1438
|
}
|
|
1303
1439
|
return [];
|
|
1304
1440
|
}
|
|
1305
|
-
function
|
|
1441
|
+
function mt({ item: t }) {
|
|
1306
1442
|
const s = {
|
|
1307
1443
|
tags: Z(t.excludedTags).length,
|
|
1308
1444
|
metadataKeys: Z(t.excludedMetadataKeys).length,
|
|
1309
1445
|
i18nPaths: Z(t.excludedI18nPaths).length,
|
|
1310
1446
|
permissions: Z(t.excludedPermissions).length
|
|
1311
|
-
},
|
|
1312
|
-
return
|
|
1447
|
+
}, a = $n(s);
|
|
1448
|
+
return a <= 0 ? null : /* @__PURE__ */ n(
|
|
1313
1449
|
"span",
|
|
1314
1450
|
{
|
|
1315
|
-
title:
|
|
1451
|
+
title: Kn(s),
|
|
1316
1452
|
className: "inline-flex items-center rounded px-1.5 py-0.5 text-xs bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300",
|
|
1317
1453
|
children: [
|
|
1318
|
-
|
|
1454
|
+
a,
|
|
1319
1455
|
" manual override",
|
|
1320
|
-
|
|
1456
|
+
a === 1 ? "" : "s"
|
|
1321
1457
|
]
|
|
1322
1458
|
}
|
|
1323
1459
|
);
|
|
1324
1460
|
}
|
|
1325
|
-
function
|
|
1461
|
+
function ut({
|
|
1326
1462
|
item: t,
|
|
1327
1463
|
targetConfigIds: s,
|
|
1328
|
-
results:
|
|
1329
|
-
pushedDests:
|
|
1464
|
+
results: a,
|
|
1465
|
+
pushedDests: i,
|
|
1330
1466
|
displayName: r
|
|
1331
1467
|
}) {
|
|
1332
|
-
const d = t.included && !t.ignored, l = s.filter((
|
|
1333
|
-
return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-1", children: l.map(({ id:
|
|
1334
|
-
const
|
|
1468
|
+
const d = t.included && !t.ignored, l = s.filter((c) => i.has(c)).map((c) => ({ id: c, result: vn(a, t.itemKey, c) })).filter((c) => c.result != null || d);
|
|
1469
|
+
return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-1", children: l.map(({ id: c, result: h }) => {
|
|
1470
|
+
const N = h ? h.ok ? "bg-green-100 text-green-700 dark:bg-green-500/15 dark:text-green-300" : "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300" : "bg-muted text-muted-foreground", y = h ? h.ok ? "✓" : "✗" : "=", m = h ? h.ok ? void 0 : h.error : "No change — already in sync";
|
|
1335
1471
|
return /* @__PURE__ */ n(
|
|
1336
1472
|
"span",
|
|
1337
1473
|
{
|
|
1338
|
-
title:
|
|
1339
|
-
className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-semibold ${
|
|
1474
|
+
title: m,
|
|
1475
|
+
className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-semibold ${N}`,
|
|
1340
1476
|
children: [
|
|
1341
|
-
r(
|
|
1477
|
+
r(c),
|
|
1342
1478
|
" ",
|
|
1343
|
-
|
|
1479
|
+
y
|
|
1344
1480
|
]
|
|
1345
1481
|
},
|
|
1346
|
-
|
|
1482
|
+
c
|
|
1347
1483
|
);
|
|
1348
1484
|
}) });
|
|
1349
1485
|
}
|
|
1350
|
-
function
|
|
1351
|
-
var
|
|
1352
|
-
const
|
|
1353
|
-
const u = new Set(
|
|
1486
|
+
function In({ releaseId: t, onBack: s }) {
|
|
1487
|
+
var We, Ge, Xe;
|
|
1488
|
+
const a = je.get("Release", "apiPath", "/releases"), { toast: i } = se(), { fetchJson: r } = te(), { configs: d } = fe(), l = ae(), [c, h] = R("all"), [N, y] = R("all"), [m, p] = R(null), [S, q] = R(!1), [M, B] = R(!1), [b, P] = R(() => /* @__PURE__ */ new Set()), L = (o) => P((C) => {
|
|
1489
|
+
const u = new Set(C);
|
|
1354
1490
|
return u.has(o) ? u.delete(o) : u.add(o), u;
|
|
1355
|
-
}),
|
|
1356
|
-
l.invalidateQueries({ queryKey:
|
|
1357
|
-
}, { data:
|
|
1358
|
-
queryKey:
|
|
1359
|
-
queryFn: () => r(`${
|
|
1360
|
-
}), { data:
|
|
1361
|
-
queryKey:
|
|
1491
|
+
}), z = ["imaginarium", "release", t], f = ["imaginarium", "release-items", t], T = ["imaginarium", "release-pushes", t], I = ["imaginarium", "release-push-preview", t], x = () => {
|
|
1492
|
+
l.invalidateQueries({ queryKey: f }), l.invalidateQueries({ queryKey: I });
|
|
1493
|
+
}, { data: k, isLoading: _ } = le({
|
|
1494
|
+
queryKey: z,
|
|
1495
|
+
queryFn: () => r(`${a}/${t}`)
|
|
1496
|
+
}), { data: V, isLoading: X } = le({
|
|
1497
|
+
queryKey: f,
|
|
1362
1498
|
queryFn: async () => {
|
|
1363
|
-
const o = await r(`${
|
|
1499
|
+
const o = await r(`${a}/${t}/items`);
|
|
1364
1500
|
return Array.isArray(o) ? o : (o == null ? void 0 : o.items) ?? [];
|
|
1365
1501
|
}
|
|
1366
|
-
}), { data:
|
|
1367
|
-
queryKey:
|
|
1502
|
+
}), { data: g } = le({
|
|
1503
|
+
queryKey: T,
|
|
1368
1504
|
queryFn: async () => {
|
|
1369
|
-
const o = await r(`${
|
|
1505
|
+
const o = await r(`${a}/${t}/pushes`);
|
|
1370
1506
|
return Array.isArray(o) ? o : (o == null ? void 0 : o.items) ?? [];
|
|
1371
1507
|
}
|
|
1372
|
-
}),
|
|
1373
|
-
() => new Set((
|
|
1374
|
-
[
|
|
1375
|
-
),
|
|
1508
|
+
}), j = J(() => Nn(g ?? []), [g]), U = J(
|
|
1509
|
+
() => new Set((g ?? []).map((o) => o.destConfigId)),
|
|
1510
|
+
[g]
|
|
1511
|
+
), F = (g ?? []).length > 0, Y = J(() => (k == null ? void 0 : k.targetConfigIds) ?? [], [k]), Q = J(() => {
|
|
1376
1512
|
const o = /* @__PURE__ */ new Map();
|
|
1377
|
-
return d.forEach((
|
|
1378
|
-
}, [d]),
|
|
1379
|
-
() => new Map((
|
|
1380
|
-
[
|
|
1381
|
-
),
|
|
1513
|
+
return d.forEach((C) => o.set(String(C.id), C.displayName)), o;
|
|
1514
|
+
}, [d]), v = (o) => Q.get(o) ?? o, A = J(() => kn(V ?? []), [V]), E = J(() => A.map((o) => o.item), [A]), ee = J(() => En(V ?? []), [V]), ie = J(
|
|
1515
|
+
() => new Map((V ?? []).map((o) => [o.itemKey, o])),
|
|
1516
|
+
[V]
|
|
1517
|
+
), Ce = (o) => {
|
|
1382
1518
|
var u;
|
|
1383
|
-
let
|
|
1519
|
+
let C;
|
|
1384
1520
|
if (o.parentKey) {
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1521
|
+
const D = (u = ie.get(o.parentKey)) == null ? void 0 : u.itemName, K = o.parentKey.indexOf(":");
|
|
1522
|
+
C = D ?? (K >= 0 ? o.parentKey.slice(K + 1) : void 0);
|
|
1387
1523
|
}
|
|
1388
|
-
return `${
|
|
1389
|
-
}, G =
|
|
1390
|
-
var
|
|
1524
|
+
return `${C ? C + " " : ""}${o.itemType} "${o.itemName}"`;
|
|
1525
|
+
}, G = J(() => {
|
|
1526
|
+
var C, u;
|
|
1391
1527
|
const o = /* @__PURE__ */ new Map();
|
|
1392
|
-
for (const
|
|
1393
|
-
const
|
|
1394
|
-
typeof
|
|
1528
|
+
for (const D of V ?? []) {
|
|
1529
|
+
const K = (u = (C = D.diff) == null ? void 0 : C.origin) == null ? void 0 : u.id;
|
|
1530
|
+
typeof K == "string" && K && o.set(K, D.itemName);
|
|
1395
1531
|
}
|
|
1396
1532
|
return o;
|
|
1397
|
-
}, [
|
|
1398
|
-
() => (
|
|
1533
|
+
}, [V]), me = J(
|
|
1534
|
+
() => (V ?? []).filter((o) => o.included && !o.ignored).map((o) => ({
|
|
1399
1535
|
itemName: o.itemName,
|
|
1400
|
-
missing:
|
|
1536
|
+
missing: Re(o, ee, ie).map(Ce)
|
|
1401
1537
|
})).filter((o) => o.missing.length > 0),
|
|
1402
1538
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1403
|
-
[
|
|
1404
|
-
),
|
|
1405
|
-
const
|
|
1406
|
-
return { node: o, renderChildren:
|
|
1539
|
+
[V, ee, ie]
|
|
1540
|
+
), Be = J(() => wn(E), [E]), Et = J(() => Object.keys(Be).sort(Ve), [Be]), _e = J(() => A.filter((o) => c === "all" || o.item.itemType === c).map((o) => {
|
|
1541
|
+
const C = N === "all" ? o.children : o.children.filter((u) => dt(u, N));
|
|
1542
|
+
return { node: o, renderChildren: C };
|
|
1407
1543
|
}).filter(
|
|
1408
|
-
({ node: o, renderChildren:
|
|
1409
|
-
).sort((o,
|
|
1410
|
-
const u =
|
|
1411
|
-
return u !== 0 ? u : o.node.item.itemName.localeCompare(
|
|
1412
|
-
}), [
|
|
1413
|
-
mutationFn: () => r(`${
|
|
1544
|
+
({ node: o, renderChildren: C }) => N === "all" || dt(o.item, N) || C.length > 0
|
|
1545
|
+
).sort((o, C) => {
|
|
1546
|
+
const u = Ve(o.node.item.itemType, C.node.item.itemType);
|
|
1547
|
+
return u !== 0 ? u : o.node.item.itemName.localeCompare(C.node.item.itemName);
|
|
1548
|
+
}), [A, c, N]), Ee = H({
|
|
1549
|
+
mutationFn: () => r(`${a}/${t}/refresh`, { method: "POST" }),
|
|
1414
1550
|
onSuccess: () => {
|
|
1415
|
-
|
|
1551
|
+
x(), i({ title: "Snapshot refreshed", description: "Items re-computed from origin." });
|
|
1416
1552
|
},
|
|
1417
1553
|
onError: (o) => {
|
|
1418
|
-
|
|
1554
|
+
i({ title: "Error", description: o.message, variant: "destructive" });
|
|
1419
1555
|
}
|
|
1420
|
-
}),
|
|
1421
|
-
mutationFn: ({ itemId: o, included:
|
|
1556
|
+
}), $e = H({
|
|
1557
|
+
mutationFn: ({ itemId: o, included: C }) => r(`${a}/${t}/items/${o}`, {
|
|
1422
1558
|
method: "PATCH",
|
|
1423
|
-
body: JSON.stringify({ included:
|
|
1559
|
+
body: JSON.stringify({ included: C })
|
|
1424
1560
|
}),
|
|
1425
1561
|
onSuccess: () => {
|
|
1426
|
-
|
|
1562
|
+
x();
|
|
1427
1563
|
},
|
|
1428
1564
|
onError: (o) => {
|
|
1429
|
-
|
|
1565
|
+
i({ title: "Error", description: o.message, variant: "destructive" });
|
|
1430
1566
|
}
|
|
1431
|
-
}),
|
|
1432
|
-
mutationFn: ({ itemId: o, selectedVersion:
|
|
1567
|
+
}), Ye = H({
|
|
1568
|
+
mutationFn: ({ itemId: o, selectedVersion: C }) => r(`${a}/${t}/items/${o}`, {
|
|
1433
1569
|
method: "PATCH",
|
|
1434
|
-
body: JSON.stringify({ selectedVersion:
|
|
1570
|
+
body: JSON.stringify({ selectedVersion: C })
|
|
1435
1571
|
}),
|
|
1436
1572
|
onSuccess: () => {
|
|
1437
|
-
|
|
1573
|
+
x();
|
|
1438
1574
|
},
|
|
1439
1575
|
onError: (o) => {
|
|
1440
|
-
|
|
1576
|
+
i({ title: "Error", description: o.message, variant: "destructive" });
|
|
1441
1577
|
}
|
|
1442
|
-
}),
|
|
1443
|
-
mutationFn: ({ itemId:
|
|
1578
|
+
}), Ke = (o) => ({
|
|
1579
|
+
mutationFn: ({ itemId: C, value: u }) => r(`${a}/${t}/items/${C}`, {
|
|
1444
1580
|
method: "PATCH",
|
|
1445
1581
|
body: JSON.stringify({ [o]: u })
|
|
1446
1582
|
}),
|
|
1447
|
-
onMutate: async ({ itemId:
|
|
1448
|
-
await l.cancelQueries({ queryKey:
|
|
1449
|
-
const
|
|
1583
|
+
onMutate: async ({ itemId: C, value: u }) => {
|
|
1584
|
+
await l.cancelQueries({ queryKey: f });
|
|
1585
|
+
const D = l.getQueryData(f);
|
|
1450
1586
|
return l.setQueryData(
|
|
1451
|
-
|
|
1452
|
-
(
|
|
1453
|
-
), { prev:
|
|
1587
|
+
f,
|
|
1588
|
+
(K) => (K ?? []).map((oe) => oe.id === C ? { ...oe, [o]: u } : oe)
|
|
1589
|
+
), { prev: D };
|
|
1454
1590
|
},
|
|
1455
|
-
onError: (
|
|
1456
|
-
|
|
1591
|
+
onError: (C, u, D) => {
|
|
1592
|
+
D != null && D.prev && l.setQueryData(f, D.prev), i({ title: "Error", description: C.message, variant: "destructive" });
|
|
1457
1593
|
},
|
|
1458
1594
|
onSettled: () => {
|
|
1459
|
-
|
|
1595
|
+
x();
|
|
1460
1596
|
}
|
|
1461
|
-
}),
|
|
1462
|
-
return
|
|
1463
|
-
|
|
1597
|
+
}), $t = H(Ke("excludedTags")), Kt = H(Ke("excludedMetadataKeys")), Ot = H(Ke("excludedI18nPaths")), It = H(Ke("excludedPermissions")), re = (k == null ? void 0 : k.status) === "pushed", w = m ? ie.get(m.itemKey) ?? m : null;
|
|
1598
|
+
return _ ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }) : k ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
1599
|
+
re && /* @__PURE__ */ e("div", { className: "bg-muted text-muted-foreground rounded-md px-3 py-2 text-sm", children: "This release was pushed and is read-only." }),
|
|
1464
1600
|
/* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
1465
1601
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
1466
1602
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
1467
|
-
/* @__PURE__ */ n(
|
|
1468
|
-
/* @__PURE__ */ e(
|
|
1603
|
+
/* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: s, children: [
|
|
1604
|
+
/* @__PURE__ */ e(Qe, {}),
|
|
1469
1605
|
"Back"
|
|
1470
1606
|
] }),
|
|
1471
|
-
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children:
|
|
1472
|
-
/* @__PURE__ */ e(kt, { status:
|
|
1607
|
+
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: k.name }),
|
|
1608
|
+
/* @__PURE__ */ e(kt, { status: k.status })
|
|
1473
1609
|
] }),
|
|
1474
1610
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1475
|
-
!
|
|
1476
|
-
|
|
1611
|
+
!re && /* @__PURE__ */ e(
|
|
1612
|
+
rn,
|
|
1477
1613
|
{
|
|
1478
1614
|
releaseId: t,
|
|
1479
|
-
apiPath:
|
|
1480
|
-
onReset:
|
|
1615
|
+
apiPath: a,
|
|
1616
|
+
onReset: x
|
|
1481
1617
|
}
|
|
1482
1618
|
),
|
|
1483
1619
|
/* @__PURE__ */ n(
|
|
1484
|
-
|
|
1620
|
+
$,
|
|
1485
1621
|
{
|
|
1486
1622
|
variant: "outline",
|
|
1487
1623
|
size: "sm",
|
|
1488
|
-
onClick: () =>
|
|
1489
|
-
disabled:
|
|
1624
|
+
onClick: () => Ee.mutate(),
|
|
1625
|
+
disabled: re || Ee.isPending,
|
|
1490
1626
|
children: [
|
|
1491
|
-
/* @__PURE__ */ e(
|
|
1492
|
-
|
|
1627
|
+
/* @__PURE__ */ e(Ct, {}),
|
|
1628
|
+
Ee.isPending ? "Refreshing…" : "Refresh"
|
|
1493
1629
|
]
|
|
1494
1630
|
}
|
|
1495
1631
|
),
|
|
1496
1632
|
/* @__PURE__ */ n(
|
|
1497
|
-
|
|
1633
|
+
$,
|
|
1498
1634
|
{
|
|
1499
1635
|
variant: "outline",
|
|
1500
1636
|
size: "sm",
|
|
1501
|
-
onClick: () =>
|
|
1502
|
-
disabled: (
|
|
1637
|
+
onClick: () => B(!0),
|
|
1638
|
+
disabled: (k.targetConfigIds ?? []).length === 0,
|
|
1503
1639
|
children: [
|
|
1504
|
-
/* @__PURE__ */ e(
|
|
1640
|
+
/* @__PURE__ */ e(Qt, {}),
|
|
1505
1641
|
"Preview changes"
|
|
1506
1642
|
]
|
|
1507
1643
|
}
|
|
1508
1644
|
),
|
|
1509
|
-
|
|
1510
|
-
|
|
1645
|
+
re ? /* @__PURE__ */ e($, { size: "sm", disabled: !0, children: "Pushed ✓" }) : /* @__PURE__ */ e(
|
|
1646
|
+
$,
|
|
1511
1647
|
{
|
|
1512
1648
|
size: "sm",
|
|
1513
|
-
onClick: () =>
|
|
1514
|
-
disabled: (
|
|
1649
|
+
onClick: () => q(!0),
|
|
1650
|
+
disabled: (k.targetConfigIds ?? []).length === 0,
|
|
1515
1651
|
children: "Push"
|
|
1516
1652
|
}
|
|
1517
1653
|
)
|
|
1518
1654
|
] })
|
|
1519
1655
|
] }),
|
|
1520
1656
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1521
|
-
/* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children:
|
|
1657
|
+
/* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: v(k.originConfigId) }),
|
|
1522
1658
|
/* @__PURE__ */ e("span", { children: "→" }),
|
|
1523
|
-
(
|
|
1659
|
+
(k.targetConfigIds ?? []).map((o) => /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: v(o) }, o)),
|
|
1524
1660
|
/* @__PURE__ */ n("span", { className: "ml-2", children: [
|
|
1525
1661
|
"Snapshot: ",
|
|
1526
|
-
|
|
1662
|
+
k.snapshotAt ? new Date(k.snapshotAt).toLocaleString() : "—"
|
|
1527
1663
|
] }),
|
|
1528
1664
|
/* @__PURE__ */ n("span", { children: [
|
|
1529
1665
|
"Pushed: ",
|
|
1530
|
-
|
|
1666
|
+
k.pushedAt ? new Date(k.pushedAt).toLocaleString() : "—"
|
|
1531
1667
|
] })
|
|
1532
1668
|
] })
|
|
1533
1669
|
] }),
|
|
1534
1670
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
1535
1671
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1536
1672
|
/* @__PURE__ */ n(
|
|
1537
|
-
|
|
1673
|
+
$,
|
|
1538
1674
|
{
|
|
1539
|
-
variant:
|
|
1675
|
+
variant: c === "all" ? "secondary" : "ghost",
|
|
1540
1676
|
size: "sm",
|
|
1541
1677
|
onClick: () => h("all"),
|
|
1542
1678
|
children: [
|
|
1543
1679
|
"All types (",
|
|
1544
|
-
|
|
1680
|
+
E.length,
|
|
1545
1681
|
")"
|
|
1546
1682
|
]
|
|
1547
1683
|
}
|
|
1548
1684
|
),
|
|
1549
|
-
|
|
1550
|
-
|
|
1685
|
+
Et.map((o) => /* @__PURE__ */ n(
|
|
1686
|
+
$,
|
|
1551
1687
|
{
|
|
1552
|
-
variant:
|
|
1688
|
+
variant: c === o ? "secondary" : "ghost",
|
|
1553
1689
|
size: "sm",
|
|
1554
1690
|
onClick: () => h(o),
|
|
1555
1691
|
children: [
|
|
1556
1692
|
o,
|
|
1557
1693
|
" (",
|
|
1558
|
-
|
|
1694
|
+
Be[o],
|
|
1559
1695
|
")"
|
|
1560
1696
|
]
|
|
1561
1697
|
},
|
|
1562
1698
|
o
|
|
1563
1699
|
))
|
|
1564
1700
|
] }),
|
|
1565
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1", children:
|
|
1566
|
-
|
|
1701
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1", children: On.map((o) => /* @__PURE__ */ e(
|
|
1702
|
+
$,
|
|
1567
1703
|
{
|
|
1568
|
-
variant:
|
|
1704
|
+
variant: N === o.value ? "secondary" : "outline",
|
|
1569
1705
|
size: "sm",
|
|
1570
|
-
onClick: () =>
|
|
1706
|
+
onClick: () => y(o.value),
|
|
1571
1707
|
children: o.label
|
|
1572
1708
|
},
|
|
1573
1709
|
o.value
|
|
1574
1710
|
)) })
|
|
1575
1711
|
] }),
|
|
1576
1712
|
/* @__PURE__ */ n("div", { className: "flex gap-4", children: [
|
|
1577
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: X ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading items…" }) :
|
|
1713
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: X ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading items…" }) : _e.length === 0 ? /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "py-12 text-center text-muted-foreground", children: E.length === 0 ? "No items in this release yet." : "No items match the current filters." }) }) : /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
|
|
1578
1714
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b text-left text-muted-foreground", children: [
|
|
1579
1715
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium w-10", children: "Inc." }),
|
|
1580
1716
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Type" }),
|
|
@@ -1582,36 +1718,36 @@ function En({ releaseId: t, onBack: s }) {
|
|
|
1582
1718
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Status" }),
|
|
1583
1719
|
/* @__PURE__ */ e("th", { className: "p-3 font-medium" })
|
|
1584
1720
|
] }) }),
|
|
1585
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
1586
|
-
var
|
|
1587
|
-
const u = o.item,
|
|
1588
|
-
return /* @__PURE__ */ n(
|
|
1721
|
+
/* @__PURE__ */ e("tbody", { children: _e.map(({ node: o, renderChildren: C }) => {
|
|
1722
|
+
var st;
|
|
1723
|
+
const u = o.item, D = C.length > 0, K = b.has(u.itemKey) || N !== "all", oe = b.has(u.itemKey), de = Sn(o), Ze = ((st = u.diff) == null ? void 0 : st.versions) ?? [], ke = u.itemType === "rule" && Ze.length > 0, et = Ze.some((O) => O.isPublished), Rt = ke ? xn(u) : [], tt = ke && !et, nt = ke && et && Rt.length === 0, Oe = tt || nt, At = ke && !Oe && u.selectedVersion == null;
|
|
1724
|
+
return /* @__PURE__ */ n(bt, { children: [
|
|
1589
1725
|
o.synthetic ? /* @__PURE__ */ n(
|
|
1590
1726
|
"tr",
|
|
1591
1727
|
{
|
|
1592
1728
|
className: "border-b last:border-0 cursor-pointer hover:bg-muted/50",
|
|
1593
|
-
onClick: () =>
|
|
1729
|
+
onClick: () => L(u.itemKey),
|
|
1594
1730
|
children: [
|
|
1595
1731
|
/* @__PURE__ */ e("td", { className: "p-3" }),
|
|
1596
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
|
|
1732
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(Te, { type: u.itemType }) }),
|
|
1597
1733
|
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1598
1734
|
/* @__PURE__ */ e(
|
|
1599
1735
|
"button",
|
|
1600
1736
|
{
|
|
1601
1737
|
type: "button",
|
|
1602
1738
|
className: "text-muted-foreground hover:text-foreground",
|
|
1603
|
-
onClick: (
|
|
1604
|
-
|
|
1739
|
+
onClick: (O) => {
|
|
1740
|
+
O.stopPropagation(), L(u.itemKey);
|
|
1605
1741
|
},
|
|
1606
|
-
"aria-label":
|
|
1607
|
-
children:
|
|
1742
|
+
"aria-label": oe ? "Collapse" : "Expand",
|
|
1743
|
+
children: oe ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
|
|
1608
1744
|
}
|
|
1609
1745
|
),
|
|
1610
1746
|
/* @__PURE__ */ e("span", { className: "font-medium", children: u.itemName }),
|
|
1611
|
-
/* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${
|
|
1612
|
-
|
|
1747
|
+
/* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${de.included < de.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
|
|
1748
|
+
de.included,
|
|
1613
1749
|
"/",
|
|
1614
|
-
|
|
1750
|
+
de.total,
|
|
1615
1751
|
" changes included"
|
|
1616
1752
|
] })
|
|
1617
1753
|
] }) }),
|
|
@@ -1622,85 +1758,85 @@ function En({ releaseId: t, onBack: s }) {
|
|
|
1622
1758
|
) : /* @__PURE__ */ n(
|
|
1623
1759
|
"tr",
|
|
1624
1760
|
{
|
|
1625
|
-
className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(
|
|
1761
|
+
className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(m == null ? void 0 : m.id) === u.id ? "bg-muted/50" : ""} ${Oe ? "opacity-60" : ""}`,
|
|
1626
1762
|
onClick: () => p(u),
|
|
1627
1763
|
children: [
|
|
1628
|
-
/* @__PURE__ */ e("td", { className: "p-3", onClick: (
|
|
1629
|
-
|
|
1764
|
+
/* @__PURE__ */ e("td", { className: "p-3", onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1765
|
+
ot,
|
|
1630
1766
|
{
|
|
1631
1767
|
checked: u.included,
|
|
1632
|
-
disabled: u.ignored ||
|
|
1633
|
-
onChange: (
|
|
1768
|
+
disabled: u.ignored || $e.isPending || re || Oe,
|
|
1769
|
+
onChange: (O) => $e.mutate({ itemId: u.id, included: O })
|
|
1634
1770
|
}
|
|
1635
1771
|
) }),
|
|
1636
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
|
|
1772
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(Te, { type: u.itemType }) }),
|
|
1637
1773
|
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1638
|
-
|
|
1774
|
+
D ? /* @__PURE__ */ e(
|
|
1639
1775
|
"button",
|
|
1640
1776
|
{
|
|
1641
1777
|
type: "button",
|
|
1642
1778
|
className: "text-muted-foreground hover:text-foreground",
|
|
1643
|
-
onClick: (
|
|
1644
|
-
|
|
1779
|
+
onClick: (O) => {
|
|
1780
|
+
O.stopPropagation(), L(u.itemKey);
|
|
1645
1781
|
},
|
|
1646
|
-
"aria-label":
|
|
1647
|
-
children:
|
|
1782
|
+
"aria-label": oe ? "Collapse" : "Expand",
|
|
1783
|
+
children: oe ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
|
|
1648
1784
|
}
|
|
1649
1785
|
) : null,
|
|
1650
1786
|
/* @__PURE__ */ e("span", { className: "font-medium", children: u.itemName }),
|
|
1651
1787
|
(() => {
|
|
1652
1788
|
if (!u.included || u.ignored)
|
|
1653
1789
|
return null;
|
|
1654
|
-
const
|
|
1655
|
-
return
|
|
1790
|
+
const O = Re(u, ee, ie);
|
|
1791
|
+
return O.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${O.map((W) => W.itemName).join(", ")}`, children: /* @__PURE__ */ e(Se, { size: 14, className: "shrink-0 text-amber-600" }) });
|
|
1656
1792
|
})(),
|
|
1657
|
-
/* @__PURE__ */ e(
|
|
1658
|
-
|
|
1659
|
-
|
|
1793
|
+
/* @__PURE__ */ e(mt, { item: u }),
|
|
1794
|
+
D ? /* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${de.included < de.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
|
|
1795
|
+
de.included,
|
|
1660
1796
|
"/",
|
|
1661
|
-
|
|
1797
|
+
de.total,
|
|
1662
1798
|
" changes included"
|
|
1663
1799
|
] }) : null,
|
|
1664
|
-
u.carriedOver ? /* @__PURE__ */ e(
|
|
1665
|
-
u.ignored ? /* @__PURE__ */ e(
|
|
1666
|
-
|
|
1667
|
-
|
|
1800
|
+
u.carriedOver ? /* @__PURE__ */ e(nn, { originName: v(k.originConfigId) }) : null,
|
|
1801
|
+
u.ignored ? /* @__PURE__ */ e(sn, {}) : null,
|
|
1802
|
+
ke && !Oe ? /* @__PURE__ */ e("span", { onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1803
|
+
yn,
|
|
1668
1804
|
{
|
|
1669
1805
|
item: u,
|
|
1670
|
-
disabled:
|
|
1671
|
-
onChange: (
|
|
1806
|
+
disabled: re || Ye.isPending,
|
|
1807
|
+
onChange: (O) => Ye.mutate({ itemId: u.id, selectedVersion: O })
|
|
1672
1808
|
}
|
|
1673
1809
|
) }) : null,
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1810
|
+
tt ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Rules without a published version cannot be pushed" }) : null,
|
|
1811
|
+
nt ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Nothing to push — all versions exist on target" }) : null,
|
|
1812
|
+
At ? /* @__PURE__ */ e("span", { className: "text-xs text-amber-600", children: "Pushable version not selected" }) : null
|
|
1677
1813
|
] }) }),
|
|
1678
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
|
|
1679
|
-
/* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (
|
|
1680
|
-
|
|
1681
|
-
|
|
1814
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(ct, { status: u.status }) }),
|
|
1815
|
+
/* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2", children: [
|
|
1816
|
+
F ? /* @__PURE__ */ e(
|
|
1817
|
+
ut,
|
|
1682
1818
|
{
|
|
1683
1819
|
item: u,
|
|
1684
|
-
targetConfigIds:
|
|
1685
|
-
results:
|
|
1686
|
-
pushedDests:
|
|
1687
|
-
displayName:
|
|
1820
|
+
targetConfigIds: Y,
|
|
1821
|
+
results: j,
|
|
1822
|
+
pushedDests: U,
|
|
1823
|
+
displayName: v
|
|
1688
1824
|
}
|
|
1689
1825
|
) : null,
|
|
1690
|
-
!u.ignored && !
|
|
1691
|
-
|
|
1826
|
+
!u.ignored && !re && /* @__PURE__ */ e(
|
|
1827
|
+
an,
|
|
1692
1828
|
{
|
|
1693
1829
|
createPayload: {
|
|
1694
|
-
originConfigId:
|
|
1830
|
+
originConfigId: k.originConfigId,
|
|
1695
1831
|
itemKey: u.itemKey,
|
|
1696
1832
|
itemType: u.itemType,
|
|
1697
1833
|
itemName: u.itemName
|
|
1698
1834
|
},
|
|
1699
1835
|
onChange: () => {
|
|
1700
1836
|
l.setQueryData(
|
|
1701
|
-
|
|
1702
|
-
(
|
|
1703
|
-
),
|
|
1837
|
+
f,
|
|
1838
|
+
(O) => (O ?? []).map((W) => W.id === u.id ? { ...W, ignored: !0, included: !1 } : W)
|
|
1839
|
+
), Ee.mutate();
|
|
1704
1840
|
}
|
|
1705
1841
|
}
|
|
1706
1842
|
)
|
|
@@ -1708,156 +1844,156 @@ function En({ releaseId: t, onBack: s }) {
|
|
|
1708
1844
|
]
|
|
1709
1845
|
}
|
|
1710
1846
|
),
|
|
1711
|
-
|
|
1847
|
+
D && K ? C.map((O) => /* @__PURE__ */ n(
|
|
1712
1848
|
"tr",
|
|
1713
1849
|
{
|
|
1714
|
-
className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(
|
|
1715
|
-
onClick: () => p(
|
|
1850
|
+
className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(m == null ? void 0 : m.id) === O.id ? "bg-muted/50" : ""}`,
|
|
1851
|
+
onClick: () => p(O),
|
|
1716
1852
|
children: [
|
|
1717
1853
|
/* @__PURE__ */ e("td", { className: "p-3 pl-8", onClick: (W) => W.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1718
|
-
|
|
1854
|
+
ot,
|
|
1719
1855
|
{
|
|
1720
|
-
checked:
|
|
1721
|
-
disabled:
|
|
1722
|
-
onChange: (W) =>
|
|
1856
|
+
checked: O.included,
|
|
1857
|
+
disabled: O.ignored || $e.isPending || re,
|
|
1858
|
+
onChange: (W) => $e.mutate({ itemId: O.id, included: W })
|
|
1723
1859
|
}
|
|
1724
1860
|
) }),
|
|
1725
|
-
/* @__PURE__ */ e("td", { className: "p-3 pl-8", children: /* @__PURE__ */ e(
|
|
1861
|
+
/* @__PURE__ */ e("td", { className: "p-3 pl-8", children: /* @__PURE__ */ e(Te, { type: O.itemType }) }),
|
|
1726
1862
|
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1727
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
1863
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: O.itemName }),
|
|
1728
1864
|
(() => {
|
|
1729
|
-
if (!
|
|
1865
|
+
if (!O.included || O.ignored)
|
|
1730
1866
|
return null;
|
|
1731
|
-
const W =
|
|
1732
|
-
return W.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${W.map((
|
|
1867
|
+
const W = Re(O, ee, ie);
|
|
1868
|
+
return W.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${W.map((Dt) => Dt.itemName).join(", ")}`, children: /* @__PURE__ */ e(Se, { size: 14, className: "shrink-0 text-amber-600" }) });
|
|
1733
1869
|
})(),
|
|
1734
|
-
/* @__PURE__ */ e(
|
|
1870
|
+
/* @__PURE__ */ e(mt, { item: O })
|
|
1735
1871
|
] }) }),
|
|
1736
|
-
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
|
|
1737
|
-
/* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (W) => W.stopPropagation(), children:
|
|
1738
|
-
|
|
1872
|
+
/* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(ct, { status: O.status }) }),
|
|
1873
|
+
/* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (W) => W.stopPropagation(), children: F ? /* @__PURE__ */ e(
|
|
1874
|
+
ut,
|
|
1739
1875
|
{
|
|
1740
|
-
item:
|
|
1741
|
-
targetConfigIds:
|
|
1742
|
-
results:
|
|
1743
|
-
pushedDests:
|
|
1744
|
-
displayName:
|
|
1876
|
+
item: O,
|
|
1877
|
+
targetConfigIds: Y,
|
|
1878
|
+
results: j,
|
|
1879
|
+
pushedDests: U,
|
|
1880
|
+
displayName: v
|
|
1745
1881
|
}
|
|
1746
1882
|
) : null })
|
|
1747
1883
|
]
|
|
1748
1884
|
},
|
|
1749
|
-
|
|
1885
|
+
O.id
|
|
1750
1886
|
)) : null
|
|
1751
1887
|
] }, o.synthetic ? u.itemKey : u.id);
|
|
1752
1888
|
}) })
|
|
1753
1889
|
] }) }) }) }),
|
|
1754
|
-
|
|
1755
|
-
|
|
1890
|
+
m ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: /* @__PURE__ */ e(
|
|
1891
|
+
ln,
|
|
1756
1892
|
{
|
|
1757
|
-
item:
|
|
1758
|
-
targets: (
|
|
1893
|
+
item: w,
|
|
1894
|
+
targets: (k.targetConfigIds ?? []).map((o) => ({ id: o, name: v(o) })),
|
|
1759
1895
|
onClose: () => p(null),
|
|
1760
|
-
unmetDependencyNames:
|
|
1761
|
-
tags: Array.isArray((
|
|
1762
|
-
excludedTags: Z(
|
|
1896
|
+
unmetDependencyNames: w && w.included && !w.ignored ? Re(w, ee, ie).map(Ce) : [],
|
|
1897
|
+
tags: Array.isArray((Ge = (We = w == null ? void 0 : w.diff) == null ? void 0 : We.origin) == null ? void 0 : Ge.tags) ? ((Xe = w == null ? void 0 : w.diff) == null ? void 0 : Xe.origin).tags ?? [] : [],
|
|
1898
|
+
excludedTags: Z(w == null ? void 0 : w.excludedTags),
|
|
1763
1899
|
metadataKeys: (() => {
|
|
1764
|
-
var
|
|
1765
|
-
const o = (u = (
|
|
1900
|
+
var C, u;
|
|
1901
|
+
const o = (u = (C = w == null ? void 0 : w.diff) == null ? void 0 : C.origin) == null ? void 0 : u.metadata;
|
|
1766
1902
|
return o != null && typeof o == "object" && !Array.isArray(o) ? Object.keys(o) : [];
|
|
1767
1903
|
})(),
|
|
1768
|
-
excludedMetadataKeys: Z(
|
|
1904
|
+
excludedMetadataKeys: Z(w == null ? void 0 : w.excludedMetadataKeys),
|
|
1769
1905
|
i18nPaths: (() => {
|
|
1770
|
-
var u,
|
|
1771
|
-
const o = (
|
|
1906
|
+
var u, D;
|
|
1907
|
+
const o = (D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.origin) == null ? void 0 : D.i18n;
|
|
1772
1908
|
if (!Array.isArray(o))
|
|
1773
1909
|
return [];
|
|
1774
|
-
const
|
|
1775
|
-
return Array.from(new Set(
|
|
1910
|
+
const C = o.map((K) => K == null ? void 0 : K.path).filter((K) => typeof K == "string");
|
|
1911
|
+
return Array.from(new Set(C));
|
|
1776
1912
|
})(),
|
|
1777
|
-
excludedI18nPaths: Z(
|
|
1913
|
+
excludedI18nPaths: Z(w == null ? void 0 : w.excludedI18nPaths),
|
|
1778
1914
|
permissionKeys: (() => {
|
|
1779
|
-
var u,
|
|
1780
|
-
if ((
|
|
1915
|
+
var u, D;
|
|
1916
|
+
if ((w == null ? void 0 : w.itemType) !== "role")
|
|
1781
1917
|
return [];
|
|
1782
|
-
const o = (
|
|
1918
|
+
const o = (D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.origin) == null ? void 0 : D.permissions;
|
|
1783
1919
|
if (!Array.isArray(o))
|
|
1784
1920
|
return [];
|
|
1785
|
-
const
|
|
1786
|
-
return Array.from(new Set(
|
|
1921
|
+
const C = o.map((K) => `${(K == null ? void 0 : K.module) ?? ""}/${(K == null ? void 0 : K.name) ?? (K == null ? void 0 : K.id) ?? ""}`).filter((K) => K !== "/");
|
|
1922
|
+
return Array.from(new Set(C));
|
|
1787
1923
|
})(),
|
|
1788
|
-
excludedPermissions: Z(
|
|
1789
|
-
formatPermissionLabel: (o) => o.split(/([/.])/).map((
|
|
1790
|
-
var u,
|
|
1791
|
-
return ((
|
|
1924
|
+
excludedPermissions: Z(w == null ? void 0 : w.excludedPermissions),
|
|
1925
|
+
formatPermissionLabel: (o) => o.split(/([/.])/).map((C) => {
|
|
1926
|
+
var u, D;
|
|
1927
|
+
return ((D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.nameMap) == null ? void 0 : D[C]) ?? G.get(C) ?? C;
|
|
1792
1928
|
}).join(""),
|
|
1793
|
-
replacementMaps:
|
|
1794
|
-
editable: !
|
|
1795
|
-
onToggleTag: (o,
|
|
1796
|
-
if (!
|
|
1929
|
+
replacementMaps: k.replacementMaps ?? void 0,
|
|
1930
|
+
editable: !re,
|
|
1931
|
+
onToggleTag: (o, C) => {
|
|
1932
|
+
if (!w)
|
|
1797
1933
|
return;
|
|
1798
|
-
const u = Z(
|
|
1799
|
-
|
|
1934
|
+
const u = Z(w.excludedTags), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
|
|
1935
|
+
$t.mutate({ itemId: w.id, value: D });
|
|
1800
1936
|
},
|
|
1801
|
-
onToggleMetadataKey: (o,
|
|
1802
|
-
if (!
|
|
1937
|
+
onToggleMetadataKey: (o, C) => {
|
|
1938
|
+
if (!w)
|
|
1803
1939
|
return;
|
|
1804
|
-
const u = Z(
|
|
1805
|
-
|
|
1940
|
+
const u = Z(w.excludedMetadataKeys), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
|
|
1941
|
+
Kt.mutate({ itemId: w.id, value: D });
|
|
1806
1942
|
},
|
|
1807
|
-
onToggleI18nPath: (o,
|
|
1808
|
-
if (!
|
|
1943
|
+
onToggleI18nPath: (o, C) => {
|
|
1944
|
+
if (!w)
|
|
1809
1945
|
return;
|
|
1810
|
-
const u = Z(
|
|
1811
|
-
|
|
1946
|
+
const u = Z(w.excludedI18nPaths), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
|
|
1947
|
+
Ot.mutate({ itemId: w.id, value: D });
|
|
1812
1948
|
},
|
|
1813
|
-
onTogglePermission: (o,
|
|
1814
|
-
if (!
|
|
1949
|
+
onTogglePermission: (o, C) => {
|
|
1950
|
+
if (!w)
|
|
1815
1951
|
return;
|
|
1816
|
-
const u = Z(
|
|
1817
|
-
|
|
1952
|
+
const u = Z(w.excludedPermissions), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
|
|
1953
|
+
It.mutate({ itemId: w.id, value: D });
|
|
1818
1954
|
}
|
|
1819
1955
|
}
|
|
1820
1956
|
) }) : null
|
|
1821
1957
|
] }),
|
|
1822
1958
|
/* @__PURE__ */ e(
|
|
1823
|
-
|
|
1959
|
+
pn,
|
|
1824
1960
|
{
|
|
1825
|
-
open:
|
|
1826
|
-
onOpenChange:
|
|
1961
|
+
open: S,
|
|
1962
|
+
onOpenChange: q,
|
|
1827
1963
|
releaseId: t,
|
|
1828
|
-
apiPath:
|
|
1829
|
-
targetConfigIds:
|
|
1964
|
+
apiPath: a,
|
|
1965
|
+
targetConfigIds: Y,
|
|
1830
1966
|
targetNames: Object.fromEntries(
|
|
1831
|
-
(
|
|
1967
|
+
(k.targetConfigIds ?? []).map((o) => [o, v(o)])
|
|
1832
1968
|
),
|
|
1833
1969
|
dependencyWarnings: me
|
|
1834
1970
|
}
|
|
1835
1971
|
),
|
|
1836
1972
|
/* @__PURE__ */ e(
|
|
1837
|
-
|
|
1973
|
+
gn,
|
|
1838
1974
|
{
|
|
1839
|
-
open:
|
|
1840
|
-
onOpenChange:
|
|
1975
|
+
open: M,
|
|
1976
|
+
onOpenChange: B,
|
|
1841
1977
|
releaseId: t,
|
|
1842
|
-
apiPath:
|
|
1843
|
-
targetConfigIds:
|
|
1978
|
+
apiPath: a,
|
|
1979
|
+
targetConfigIds: Y,
|
|
1844
1980
|
targetNames: Object.fromEntries(
|
|
1845
|
-
(
|
|
1981
|
+
(k.targetConfigIds ?? []).map((o) => [o, v(o)])
|
|
1846
1982
|
)
|
|
1847
1983
|
}
|
|
1848
1984
|
)
|
|
1849
1985
|
] }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
1850
|
-
/* @__PURE__ */ n(
|
|
1851
|
-
/* @__PURE__ */ e(
|
|
1986
|
+
/* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: s, children: [
|
|
1987
|
+
/* @__PURE__ */ e(Qe, {}),
|
|
1852
1988
|
"Back"
|
|
1853
1989
|
] }),
|
|
1854
1990
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "Release not found." })
|
|
1855
1991
|
] });
|
|
1856
1992
|
}
|
|
1857
|
-
function
|
|
1858
|
-
const r = `cluster-select-${
|
|
1993
|
+
function ht({ value: t, onChange: s, configs: a, label: i }) {
|
|
1994
|
+
const r = `cluster-select-${i.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1859
1995
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
1860
|
-
/* @__PURE__ */ e(
|
|
1996
|
+
/* @__PURE__ */ e(ne, { htmlFor: r, children: i }),
|
|
1861
1997
|
/* @__PURE__ */ n(
|
|
1862
1998
|
"select",
|
|
1863
1999
|
{
|
|
@@ -1867,13 +2003,13 @@ function ut({ value: t, onChange: s, configs: i, label: a }) {
|
|
|
1867
2003
|
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
1868
2004
|
children: [
|
|
1869
2005
|
/* @__PURE__ */ e("option", { value: "", children: "Select cluster…" }),
|
|
1870
|
-
|
|
2006
|
+
a.map((d) => /* @__PURE__ */ e("option", { value: d.id, children: d.displayName }, d.id))
|
|
1871
2007
|
]
|
|
1872
2008
|
}
|
|
1873
2009
|
)
|
|
1874
2010
|
] });
|
|
1875
2011
|
}
|
|
1876
|
-
const
|
|
2012
|
+
const pt = {
|
|
1877
2013
|
match: { symbol: "✓", className: "text-muted-foreground", label: "Match" },
|
|
1878
2014
|
diff: { symbol: "≠", className: "text-red-500 dark:text-red-400 font-semibold", label: "Diff" },
|
|
1879
2015
|
translated: { symbol: "≈", className: "text-blue-600 dark:text-blue-400 font-semibold", label: "Translated" },
|
|
@@ -1881,124 +2017,124 @@ const ht = {
|
|
|
1881
2017
|
extra: { symbol: "+", className: "text-amber-600 font-semibold", label: "Extra" },
|
|
1882
2018
|
skip: { symbol: "—", className: "text-muted-foreground/50", label: "Ignored" }
|
|
1883
2019
|
};
|
|
1884
|
-
function
|
|
2020
|
+
function ft({
|
|
1885
2021
|
state: t,
|
|
1886
2022
|
onClick: s,
|
|
1887
|
-
active:
|
|
2023
|
+
active: a
|
|
1888
2024
|
}) {
|
|
1889
|
-
const
|
|
2025
|
+
const i = pt[t] ?? pt.match, r = t !== "match" && t !== "skip" && !!s;
|
|
1890
2026
|
return /* @__PURE__ */ e(
|
|
1891
2027
|
"button",
|
|
1892
2028
|
{
|
|
1893
2029
|
type: "button",
|
|
1894
2030
|
onClick: r ? s : void 0,
|
|
1895
2031
|
disabled: !r,
|
|
1896
|
-
title:
|
|
2032
|
+
title: i.label,
|
|
1897
2033
|
className: ce(
|
|
1898
2034
|
"w-full text-center text-sm py-1 rounded",
|
|
1899
|
-
|
|
2035
|
+
i.className,
|
|
1900
2036
|
r && "hover:bg-muted cursor-pointer",
|
|
1901
2037
|
!r && "cursor-default",
|
|
1902
|
-
|
|
2038
|
+
a && "bg-muted ring-1 ring-ring"
|
|
1903
2039
|
),
|
|
1904
|
-
children:
|
|
2040
|
+
children: i.symbol
|
|
1905
2041
|
}
|
|
1906
2042
|
);
|
|
1907
2043
|
}
|
|
1908
|
-
function
|
|
1909
|
-
return /* @__PURE__ */ e("div", { className: "flex gap-6 text-xs text-muted-foreground py-2 px-1", children: s.map((
|
|
1910
|
-
const
|
|
1911
|
-
if (!
|
|
2044
|
+
function Rn({ stats: t, destConfigIds: s }) {
|
|
2045
|
+
return /* @__PURE__ */ e("div", { className: "flex gap-6 text-xs text-muted-foreground py-2 px-1", children: s.map((a) => {
|
|
2046
|
+
const i = t[a];
|
|
2047
|
+
if (!i)
|
|
1912
2048
|
return null;
|
|
1913
|
-
const r =
|
|
2049
|
+
const r = i.match + i.diff + i.missing + i.extra;
|
|
1914
2050
|
return /* @__PURE__ */ n("span", { children: [
|
|
1915
2051
|
/* @__PURE__ */ n("span", { className: "font-mono font-medium", children: [
|
|
1916
|
-
|
|
2052
|
+
i.match,
|
|
1917
2053
|
"/",
|
|
1918
2054
|
r
|
|
1919
2055
|
] }),
|
|
1920
2056
|
" match",
|
|
1921
|
-
|
|
1922
|
-
|
|
2057
|
+
i.diff > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
|
|
2058
|
+
i.diff,
|
|
1923
2059
|
" diff"
|
|
1924
2060
|
] }),
|
|
1925
|
-
|
|
1926
|
-
|
|
2061
|
+
i.missing > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
|
|
2062
|
+
i.missing,
|
|
1927
2063
|
" missing"
|
|
1928
2064
|
] }),
|
|
1929
|
-
|
|
1930
|
-
|
|
2065
|
+
i.extra > 0 && /* @__PURE__ */ n("span", { className: "text-amber-600 ml-2", children: [
|
|
2066
|
+
i.extra,
|
|
1931
2067
|
" extra"
|
|
1932
2068
|
] })
|
|
1933
|
-
] },
|
|
2069
|
+
] }, a);
|
|
1934
2070
|
}) });
|
|
1935
2071
|
}
|
|
1936
|
-
function
|
|
2072
|
+
function gt(t) {
|
|
1937
2073
|
return Object.values(t.cells).some((s) => s === "diff" || s === "missing" || s === "extra");
|
|
1938
2074
|
}
|
|
1939
|
-
function
|
|
2075
|
+
function An({
|
|
1940
2076
|
originConfigId: t,
|
|
1941
2077
|
destConfigIds: s,
|
|
1942
|
-
apiPath:
|
|
2078
|
+
apiPath: a = "/release-status"
|
|
1943
2079
|
}) {
|
|
1944
|
-
const { toast:
|
|
1945
|
-
const
|
|
1946
|
-
return
|
|
1947
|
-
}),
|
|
1948
|
-
const
|
|
1949
|
-
return d.forEach((
|
|
1950
|
-
}, [d]),
|
|
1951
|
-
|
|
1952
|
-
const
|
|
1953
|
-
queryKey:
|
|
1954
|
-
queryFn: () => r(`${
|
|
1955
|
-
enabled:
|
|
1956
|
-
}),
|
|
1957
|
-
mutationFn: () => r(`${
|
|
2080
|
+
const { toast: i } = se(), { fetchJson: r } = te(), { configs: d } = fe(), l = ae(), [c, h] = R("issues"), [N, y] = R(!1), [m, p] = R(null), [S, q] = R(/* @__PURE__ */ new Set()), [M, B] = R(() => /* @__PURE__ */ new Set()), b = (v) => B((A) => {
|
|
2081
|
+
const E = new Set(A);
|
|
2082
|
+
return E.has(v) ? E.delete(v) : E.add(v), E;
|
|
2083
|
+
}), P = J(() => {
|
|
2084
|
+
const v = /* @__PURE__ */ new Map();
|
|
2085
|
+
return d.forEach((A) => v.set(A.id, A.displayName)), v;
|
|
2086
|
+
}, [d]), L = (v) => P.get(v) ?? v, z = s.filter((v) => !S.has(v)), f = new URLSearchParams();
|
|
2087
|
+
f.set("originConfigId", t), z.forEach((v) => f.append("destConfigIds[]", v));
|
|
2088
|
+
const T = ["imaginarium", "release-status", t, z], { data: I, isLoading: x, isError: k } = le({
|
|
2089
|
+
queryKey: T,
|
|
2090
|
+
queryFn: () => r(`${a}?${f.toString()}`),
|
|
2091
|
+
enabled: z.length > 0
|
|
2092
|
+
}), _ = H({
|
|
2093
|
+
mutationFn: () => r(`${a}/refresh`, {
|
|
1958
2094
|
method: "POST",
|
|
1959
|
-
body: JSON.stringify({ originConfigId: t, destConfigIds:
|
|
2095
|
+
body: JSON.stringify({ originConfigId: t, destConfigIds: z })
|
|
1960
2096
|
}),
|
|
1961
2097
|
onSuccess: () => {
|
|
1962
|
-
l.invalidateQueries({ queryKey:
|
|
2098
|
+
l.invalidateQueries({ queryKey: T }), i({ title: "Cache cleared", description: "Refreshing comparison data…" });
|
|
1963
2099
|
},
|
|
1964
|
-
onError: (
|
|
1965
|
-
|
|
2100
|
+
onError: (v) => {
|
|
2101
|
+
i({ title: "Error", description: v.message, variant: "destructive" });
|
|
1966
2102
|
}
|
|
1967
2103
|
}), {
|
|
1968
|
-
data:
|
|
2104
|
+
data: V,
|
|
1969
2105
|
isLoading: X,
|
|
1970
|
-
isError:
|
|
1971
|
-
} =
|
|
1972
|
-
queryKey: ["imaginarium", "release-status-diff", t,
|
|
2106
|
+
isError: g
|
|
2107
|
+
} = le({
|
|
2108
|
+
queryKey: ["imaginarium", "release-status-diff", t, m == null ? void 0 : m.destConfigId, m == null ? void 0 : m.itemKey],
|
|
1973
2109
|
queryFn: () => r(
|
|
1974
|
-
`${
|
|
2110
|
+
`${a}/diff?originConfigId=${encodeURIComponent(t)}&destConfigId=${encodeURIComponent(m.destConfigId)}&itemKey=${encodeURIComponent(m.itemKey)}`
|
|
1975
2111
|
),
|
|
1976
|
-
enabled: !!
|
|
1977
|
-
}),
|
|
1978
|
-
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
2112
|
+
enabled: !!m
|
|
2113
|
+
}), j = (v) => {
|
|
2114
|
+
q((A) => {
|
|
2115
|
+
const E = new Set(A);
|
|
2116
|
+
return E.has(v) ? E.delete(v) : E.add(v), E;
|
|
1981
2117
|
});
|
|
1982
|
-
},
|
|
2118
|
+
}, U = (v, A) => {
|
|
1983
2119
|
p(
|
|
1984
|
-
(
|
|
2120
|
+
(E) => (E == null ? void 0 : E.itemKey) === v && E.destConfigId === A ? null : { itemKey: v, destConfigId: A }
|
|
1985
2121
|
);
|
|
1986
|
-
},
|
|
1987
|
-
const
|
|
1988
|
-
return { node:
|
|
2122
|
+
}, F = (I == null ? void 0 : I.rows) ?? [], Y = (I == null ? void 0 : I.stats) ?? {}, Q = J(() => Pn(F).map((A) => {
|
|
2123
|
+
const E = c === "issues" ? A.children.filter(gt) : A.children;
|
|
2124
|
+
return { node: A, renderChildren: E };
|
|
1989
2125
|
}).filter(
|
|
1990
|
-
({ node:
|
|
1991
|
-
).sort((
|
|
1992
|
-
const ee =
|
|
1993
|
-
return ee !== 0 ? ee :
|
|
1994
|
-
}), [
|
|
2126
|
+
({ node: A, renderChildren: E }) => c === "all" || gt(A.row) || E.length > 0
|
|
2127
|
+
).sort((A, E) => {
|
|
2128
|
+
const ee = Ve(A.node.row.itemType, E.node.row.itemType);
|
|
2129
|
+
return ee !== 0 ? ee : A.node.row.itemName.localeCompare(E.node.row.itemName);
|
|
2130
|
+
}), [F, c]);
|
|
1995
2131
|
return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
1996
2132
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
1997
2133
|
/* @__PURE__ */ n("div", { className: "flex rounded-md border text-sm overflow-hidden", children: [
|
|
1998
2134
|
/* @__PURE__ */ e(
|
|
1999
2135
|
"button",
|
|
2000
2136
|
{
|
|
2001
|
-
className: ce("px-3 py-1.5",
|
|
2137
|
+
className: ce("px-3 py-1.5", c === "issues" ? "bg-muted font-medium" : "hover:bg-muted/50"),
|
|
2002
2138
|
onClick: () => h("issues"),
|
|
2003
2139
|
children: "Issues only"
|
|
2004
2140
|
}
|
|
@@ -2006,65 +2142,65 @@ function On({
|
|
|
2006
2142
|
/* @__PURE__ */ e(
|
|
2007
2143
|
"button",
|
|
2008
2144
|
{
|
|
2009
|
-
className: ce("px-3 py-1.5 border-l",
|
|
2145
|
+
className: ce("px-3 py-1.5 border-l", c === "all" ? "bg-muted font-medium" : "hover:bg-muted/50"),
|
|
2010
2146
|
onClick: () => h("all"),
|
|
2011
2147
|
children: "All"
|
|
2012
2148
|
}
|
|
2013
2149
|
)
|
|
2014
2150
|
] }),
|
|
2015
|
-
/* @__PURE__ */ n(
|
|
2016
|
-
/* @__PURE__ */ e(
|
|
2151
|
+
/* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: () => y((v) => !v), children: [
|
|
2152
|
+
/* @__PURE__ */ e(Vt, {}),
|
|
2017
2153
|
"Stats"
|
|
2018
2154
|
] }),
|
|
2019
2155
|
/* @__PURE__ */ n(
|
|
2020
|
-
|
|
2156
|
+
$,
|
|
2021
2157
|
{
|
|
2022
2158
|
variant: "ghost",
|
|
2023
2159
|
size: "sm",
|
|
2024
|
-
onClick: () =>
|
|
2025
|
-
disabled:
|
|
2160
|
+
onClick: () => _.mutate(),
|
|
2161
|
+
disabled: _.isPending,
|
|
2026
2162
|
children: [
|
|
2027
|
-
/* @__PURE__ */ e(
|
|
2163
|
+
/* @__PURE__ */ e(Ct, { className: ce(_.isPending && "animate-spin") }),
|
|
2028
2164
|
"Refresh"
|
|
2029
2165
|
]
|
|
2030
2166
|
}
|
|
2031
2167
|
),
|
|
2032
|
-
[...
|
|
2168
|
+
[...S].map((v) => /* @__PURE__ */ n(
|
|
2033
2169
|
"button",
|
|
2034
2170
|
{
|
|
2035
|
-
onClick: () =>
|
|
2171
|
+
onClick: () => j(v),
|
|
2036
2172
|
className: "text-xs border rounded px-2 py-1 text-muted-foreground hover:bg-muted",
|
|
2037
2173
|
children: [
|
|
2038
2174
|
"+ ",
|
|
2039
|
-
|
|
2175
|
+
L(v)
|
|
2040
2176
|
]
|
|
2041
2177
|
},
|
|
2042
|
-
|
|
2178
|
+
v
|
|
2043
2179
|
))
|
|
2044
2180
|
] }),
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
!
|
|
2181
|
+
N && I && /* @__PURE__ */ e(Rn, { stats: Y, destConfigIds: z }),
|
|
2182
|
+
x && /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }),
|
|
2183
|
+
k && /* @__PURE__ */ e("div", { className: "text-center text-destructive py-8", children: "Failed to load comparison data." }),
|
|
2184
|
+
!x && !k && /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
|
|
2049
2185
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1 rounded-md border overflow-auto max-h-[70vh]", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
|
|
2050
2186
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b bg-muted/50", children: [
|
|
2051
2187
|
/* @__PURE__ */ e("th", { className: "sticky top-0 z-10 bg-muted px-4 py-2 text-left font-medium min-w-[200px]", children: "Item" }),
|
|
2052
|
-
|
|
2053
|
-
/* @__PURE__ */ e("span", { className: "truncate max-w-[120px]", title:
|
|
2188
|
+
z.map((v) => /* @__PURE__ */ e("th", { className: "sticky top-0 z-10 bg-muted px-2 py-2 text-center font-medium min-w-[80px]", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-center gap-1", children: [
|
|
2189
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-[120px]", title: L(v), children: L(v) }),
|
|
2054
2190
|
/* @__PURE__ */ e(
|
|
2055
2191
|
"button",
|
|
2056
2192
|
{
|
|
2057
2193
|
className: "text-muted-foreground hover:text-foreground",
|
|
2058
|
-
onClick: () =>
|
|
2194
|
+
onClick: () => j(v),
|
|
2059
2195
|
title: "Hide column",
|
|
2060
2196
|
children: "×"
|
|
2061
2197
|
}
|
|
2062
2198
|
)
|
|
2063
|
-
] }) },
|
|
2199
|
+
] }) }, v))
|
|
2064
2200
|
] }) }),
|
|
2065
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
2066
|
-
const
|
|
2067
|
-
return /* @__PURE__ */ n(
|
|
2201
|
+
/* @__PURE__ */ e("tbody", { children: Q.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: z.length + 1, className: "text-center text-muted-foreground py-8", children: c === "issues" ? "No issues found — all clusters in sync." : "No items." }) }) : Q.map(({ node: v, renderChildren: A }) => {
|
|
2202
|
+
const E = v.row, ee = A.length > 0, ie = M.has(E.itemKey) || c === "issues", Ce = M.has(E.itemKey);
|
|
2203
|
+
return /* @__PURE__ */ n(bt, { children: [
|
|
2068
2204
|
/* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
|
|
2069
2205
|
/* @__PURE__ */ e("td", { className: "px-4 py-1.5", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2070
2206
|
ee ? /* @__PURE__ */ e(
|
|
@@ -2072,47 +2208,47 @@ function On({
|
|
|
2072
2208
|
{
|
|
2073
2209
|
type: "button",
|
|
2074
2210
|
className: "text-muted-foreground hover:text-foreground",
|
|
2075
|
-
onClick: () =>
|
|
2076
|
-
"aria-label":
|
|
2077
|
-
children:
|
|
2211
|
+
onClick: () => b(E.itemKey),
|
|
2212
|
+
"aria-label": Ce ? "Collapse" : "Expand",
|
|
2213
|
+
children: Ce ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
|
|
2078
2214
|
}
|
|
2079
2215
|
) : null,
|
|
2080
|
-
/* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(
|
|
2081
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
2216
|
+
/* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(Te, { type: E.itemType }) }),
|
|
2217
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: E.itemName })
|
|
2082
2218
|
] }) }),
|
|
2083
|
-
|
|
2084
|
-
|
|
2219
|
+
z.map((G) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
|
|
2220
|
+
ft,
|
|
2085
2221
|
{
|
|
2086
|
-
state:
|
|
2087
|
-
active: (
|
|
2088
|
-
onClick: () =>
|
|
2222
|
+
state: E.cells[G] ?? "match",
|
|
2223
|
+
active: (m == null ? void 0 : m.itemKey) === E.itemKey && m.destConfigId === G,
|
|
2224
|
+
onClick: () => U(E.itemKey, G)
|
|
2089
2225
|
}
|
|
2090
2226
|
) }, G))
|
|
2091
2227
|
] }),
|
|
2092
|
-
ee &&
|
|
2228
|
+
ee && ie ? A.map((G) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
|
|
2093
2229
|
/* @__PURE__ */ e("td", { className: "px-4 py-1.5 pl-8", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2094
|
-
/* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(
|
|
2230
|
+
/* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(Te, { type: G.itemType }) }),
|
|
2095
2231
|
/* @__PURE__ */ e("span", { className: "font-medium", children: G.itemName })
|
|
2096
2232
|
] }) }),
|
|
2097
|
-
|
|
2098
|
-
|
|
2233
|
+
z.map((me) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
|
|
2234
|
+
ft,
|
|
2099
2235
|
{
|
|
2100
2236
|
state: G.cells[me] ?? "match",
|
|
2101
|
-
active: (
|
|
2102
|
-
onClick: () =>
|
|
2237
|
+
active: (m == null ? void 0 : m.itemKey) === G.itemKey && m.destConfigId === me,
|
|
2238
|
+
onClick: () => U(G.itemKey, me)
|
|
2103
2239
|
}
|
|
2104
2240
|
) }, me))
|
|
2105
2241
|
] }, G.itemKey)) : null
|
|
2106
|
-
] },
|
|
2242
|
+
] }, E.itemKey);
|
|
2107
2243
|
}) })
|
|
2108
2244
|
] }) }),
|
|
2109
|
-
|
|
2110
|
-
|
|
2245
|
+
m ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: X ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "Loading diff…" }) : g || !V ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "No diff available." }) : /* @__PURE__ */ e(
|
|
2246
|
+
St,
|
|
2111
2247
|
{
|
|
2112
2248
|
item: {
|
|
2113
|
-
itemName:
|
|
2114
|
-
itemType:
|
|
2115
|
-
diff: { origin:
|
|
2249
|
+
itemName: V.itemName,
|
|
2250
|
+
itemType: V.itemType,
|
|
2251
|
+
diff: { origin: V.origin, target: V.target }
|
|
2116
2252
|
},
|
|
2117
2253
|
onClose: () => p(null)
|
|
2118
2254
|
}
|
|
@@ -2120,122 +2256,122 @@ function On({
|
|
|
2120
2256
|
] })
|
|
2121
2257
|
] });
|
|
2122
2258
|
}
|
|
2123
|
-
const
|
|
2259
|
+
const xt = (t) => ({
|
|
2124
2260
|
name: "",
|
|
2125
2261
|
description: "",
|
|
2126
2262
|
values: Object.fromEntries(t.map((s) => [s, ""]))
|
|
2127
2263
|
});
|
|
2128
|
-
function
|
|
2264
|
+
function Dn({
|
|
2129
2265
|
configIds: t,
|
|
2130
2266
|
clusterNames: s = {},
|
|
2131
|
-
apiPath:
|
|
2267
|
+
apiPath: a = "/release-translations"
|
|
2132
2268
|
}) {
|
|
2133
|
-
const { toast:
|
|
2134
|
-
|
|
2135
|
-
const
|
|
2136
|
-
return
|
|
2269
|
+
const { toast: i } = se(), { fetchJson: r } = te(), d = ae(), [l, c] = R(!1), [h, N] = R(null), [y, m] = R(xt(t)), [p, S] = R(() => /* @__PURE__ */ new Set()), q = (g) => {
|
|
2270
|
+
S((j) => {
|
|
2271
|
+
const U = new Set(j);
|
|
2272
|
+
return U.has(g) ? U.delete(g) : U.add(g), U;
|
|
2137
2273
|
});
|
|
2138
|
-
},
|
|
2139
|
-
queryKey:
|
|
2274
|
+
}, M = ["imaginarium", "release-translations"], { data: B, isLoading: b } = le({
|
|
2275
|
+
queryKey: M,
|
|
2140
2276
|
queryFn: async () => {
|
|
2141
|
-
const
|
|
2142
|
-
return (
|
|
2277
|
+
const g = await r(a);
|
|
2278
|
+
return (g == null ? void 0 : g.items) ?? [];
|
|
2143
2279
|
}
|
|
2144
|
-
}),
|
|
2145
|
-
mutationFn: async (
|
|
2146
|
-
const
|
|
2280
|
+
}), P = H({
|
|
2281
|
+
mutationFn: async (g) => {
|
|
2282
|
+
const j = await r(a, {
|
|
2147
2283
|
method: "POST",
|
|
2148
|
-
body: JSON.stringify({ name:
|
|
2284
|
+
body: JSON.stringify({ name: g.name.trim(), description: g.description.trim() || null })
|
|
2149
2285
|
});
|
|
2150
|
-
await
|
|
2286
|
+
await f(j.id, g.values);
|
|
2151
2287
|
},
|
|
2152
2288
|
onSuccess: () => {
|
|
2153
|
-
d.invalidateQueries({ queryKey:
|
|
2289
|
+
d.invalidateQueries({ queryKey: M }), i({ title: "Translation created" }), x();
|
|
2154
2290
|
},
|
|
2155
|
-
onError: (
|
|
2156
|
-
}),
|
|
2157
|
-
mutationFn: async (
|
|
2158
|
-
await r(`${
|
|
2291
|
+
onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
|
|
2292
|
+
}), L = H({
|
|
2293
|
+
mutationFn: async (g) => {
|
|
2294
|
+
await r(`${a}/${h.id}`, {
|
|
2159
2295
|
method: "PATCH",
|
|
2160
|
-
body: JSON.stringify({ name:
|
|
2161
|
-
}), await
|
|
2296
|
+
body: JSON.stringify({ name: g.name.trim(), description: g.description.trim() || null })
|
|
2297
|
+
}), await f(h.id, g.values);
|
|
2162
2298
|
},
|
|
2163
2299
|
onSuccess: () => {
|
|
2164
|
-
d.invalidateQueries({ queryKey:
|
|
2300
|
+
d.invalidateQueries({ queryKey: M }), i({ title: "Translation updated" }), x();
|
|
2165
2301
|
},
|
|
2166
|
-
onError: (
|
|
2167
|
-
}),
|
|
2168
|
-
mutationFn: (
|
|
2302
|
+
onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
|
|
2303
|
+
}), z = H({
|
|
2304
|
+
mutationFn: (g) => r(`${a}/${g}`, { method: "DELETE" }),
|
|
2169
2305
|
onSuccess: () => {
|
|
2170
|
-
d.invalidateQueries({ queryKey:
|
|
2306
|
+
d.invalidateQueries({ queryKey: M }), i({ title: "Translation deleted" });
|
|
2171
2307
|
},
|
|
2172
|
-
onError: (
|
|
2308
|
+
onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
|
|
2173
2309
|
});
|
|
2174
|
-
async function
|
|
2175
|
-
var
|
|
2176
|
-
const
|
|
2177
|
-
for (const
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2310
|
+
async function f(g, j) {
|
|
2311
|
+
var F;
|
|
2312
|
+
const U = (h == null ? void 0 : h.values) ?? [];
|
|
2313
|
+
for (const Y of t) {
|
|
2314
|
+
const Q = (F = j[Y]) == null ? void 0 : F.trim(), v = U.find((E) => E.configId === Y), A = `${a}/${g}/values`;
|
|
2315
|
+
v && Q ? await r(`${A}/${v.id}`, {
|
|
2180
2316
|
method: "PATCH",
|
|
2181
|
-
body: JSON.stringify({ value:
|
|
2182
|
-
}) :
|
|
2317
|
+
body: JSON.stringify({ value: Q })
|
|
2318
|
+
}) : v && !Q ? await r(`${A}/${v.id}`, { method: "DELETE" }) : !v && Q && await r(A, {
|
|
2183
2319
|
method: "POST",
|
|
2184
|
-
body: JSON.stringify({ translationId:
|
|
2320
|
+
body: JSON.stringify({ translationId: g, configId: Y, value: Q })
|
|
2185
2321
|
});
|
|
2186
2322
|
}
|
|
2187
2323
|
}
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2190
|
-
},
|
|
2191
|
-
|
|
2192
|
-
const
|
|
2193
|
-
t.map((
|
|
2194
|
-
var
|
|
2195
|
-
return [
|
|
2324
|
+
const T = () => {
|
|
2325
|
+
N(null), m(xt(t)), c(!0);
|
|
2326
|
+
}, I = (g) => {
|
|
2327
|
+
N(g);
|
|
2328
|
+
const j = g.values ?? [], U = Object.fromEntries(
|
|
2329
|
+
t.map((F) => {
|
|
2330
|
+
var Y;
|
|
2331
|
+
return [F, ((Y = j.find((Q) => Q.configId === F)) == null ? void 0 : Y.value) ?? ""];
|
|
2196
2332
|
})
|
|
2197
2333
|
);
|
|
2198
|
-
|
|
2199
|
-
},
|
|
2200
|
-
|
|
2201
|
-
},
|
|
2202
|
-
h ?
|
|
2203
|
-
},
|
|
2204
|
-
if (
|
|
2334
|
+
m({ name: g.name, description: g.description ?? "", values: U }), c(!0);
|
|
2335
|
+
}, x = () => {
|
|
2336
|
+
c(!1), N(null);
|
|
2337
|
+
}, k = () => {
|
|
2338
|
+
h ? L.mutate(y) : P.mutate(y);
|
|
2339
|
+
}, _ = P.isPending || L.isPending, V = !!y.name.trim();
|
|
2340
|
+
if (b)
|
|
2205
2341
|
return /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" });
|
|
2206
|
-
const X = [...
|
|
2207
|
-
(
|
|
2342
|
+
const X = [...B ?? []].sort(
|
|
2343
|
+
(g, j) => g.name.localeCompare(j.name, void 0, { sensitivity: "base" })
|
|
2208
2344
|
);
|
|
2209
2345
|
return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
2210
2346
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2211
2347
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: X.length === 0 ? "No translation rules yet." : `${X.length} translation rule${X.length === 1 ? "" : "s"}.` }),
|
|
2212
|
-
/* @__PURE__ */ n(
|
|
2213
|
-
/* @__PURE__ */ e(
|
|
2348
|
+
/* @__PURE__ */ n($, { size: "sm", onClick: T, children: [
|
|
2349
|
+
/* @__PURE__ */ e(Je, {}),
|
|
2214
2350
|
"Add translation"
|
|
2215
2351
|
] })
|
|
2216
2352
|
] }),
|
|
2217
|
-
X.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border divide-y text-sm", children: X.map((
|
|
2218
|
-
const
|
|
2219
|
-
var
|
|
2220
|
-
return ((
|
|
2221
|
-
},
|
|
2353
|
+
X.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border divide-y text-sm", children: X.map((g) => {
|
|
2354
|
+
const j = p.has(g.id), U = g.values ?? [], F = (Q) => {
|
|
2355
|
+
var v;
|
|
2356
|
+
return ((v = U.find((A) => A.configId === Q)) == null ? void 0 : v.value) ?? "";
|
|
2357
|
+
}, Y = t.filter((Q) => F(Q)).length;
|
|
2222
2358
|
return /* @__PURE__ */ n("div", { children: [
|
|
2223
2359
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3 px-4 py-2 hover:bg-muted/25", children: [
|
|
2224
2360
|
/* @__PURE__ */ n(
|
|
2225
2361
|
"button",
|
|
2226
2362
|
{
|
|
2227
2363
|
type: "button",
|
|
2228
|
-
onClick: () =>
|
|
2229
|
-
"aria-expanded":
|
|
2364
|
+
onClick: () => q(g.id),
|
|
2365
|
+
"aria-expanded": j,
|
|
2230
2366
|
className: "flex flex-1 min-w-0 items-center gap-3 text-left",
|
|
2231
2367
|
children: [
|
|
2232
|
-
|
|
2368
|
+
j ? /* @__PURE__ */ e(he, { className: "size-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ e(pe, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
2233
2369
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
2234
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children:
|
|
2235
|
-
|
|
2370
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: g.name }),
|
|
2371
|
+
g.description && /* @__PURE__ */ e("div", { className: "truncate text-xs text-muted-foreground", children: g.description })
|
|
2236
2372
|
] }),
|
|
2237
2373
|
/* @__PURE__ */ n("div", { className: "shrink-0 whitespace-nowrap text-xs text-muted-foreground", children: [
|
|
2238
|
-
|
|
2374
|
+
Y,
|
|
2239
2375
|
" of ",
|
|
2240
2376
|
t.length,
|
|
2241
2377
|
" set"
|
|
@@ -2244,223 +2380,223 @@ function In({
|
|
|
2244
2380
|
}
|
|
2245
2381
|
),
|
|
2246
2382
|
/* @__PURE__ */ n("div", { className: "flex shrink-0 gap-1", children: [
|
|
2247
|
-
/* @__PURE__ */ e(
|
|
2383
|
+
/* @__PURE__ */ e($, { variant: "ghost", size: "icon", onClick: () => I(g), children: /* @__PURE__ */ e(Ut, {}) }),
|
|
2248
2384
|
/* @__PURE__ */ e(
|
|
2249
|
-
|
|
2385
|
+
$,
|
|
2250
2386
|
{
|
|
2251
2387
|
variant: "ghost",
|
|
2252
2388
|
size: "icon",
|
|
2253
2389
|
onClick: () => {
|
|
2254
|
-
window.confirm(`Delete translation "${
|
|
2390
|
+
window.confirm(`Delete translation "${g.name}"?`) && z.mutate(g.id);
|
|
2255
2391
|
},
|
|
2256
|
-
children: /* @__PURE__ */ e(
|
|
2392
|
+
children: /* @__PURE__ */ e(He, {})
|
|
2257
2393
|
}
|
|
2258
2394
|
)
|
|
2259
2395
|
] })
|
|
2260
2396
|
] }),
|
|
2261
|
-
|
|
2262
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s[
|
|
2263
|
-
/* @__PURE__ */ e("span", { className: "break-all font-mono", children:
|
|
2264
|
-
] },
|
|
2265
|
-
] },
|
|
2397
|
+
j && /* @__PURE__ */ e("div", { className: "space-y-1 px-4 pb-3 pl-11", children: t.map((Q) => /* @__PURE__ */ n("div", { className: "grid grid-cols-[10rem_1fr] gap-2 text-xs", children: [
|
|
2398
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s[Q] ?? Q }),
|
|
2399
|
+
/* @__PURE__ */ e("span", { className: "break-all font-mono", children: F(Q) || /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "—" }) })
|
|
2400
|
+
] }, Q)) })
|
|
2401
|
+
] }, g.id);
|
|
2266
2402
|
}) }),
|
|
2267
|
-
/* @__PURE__ */ e(
|
|
2268
|
-
/* @__PURE__ */ n(
|
|
2269
|
-
/* @__PURE__ */ e(
|
|
2270
|
-
/* @__PURE__ */ e(
|
|
2403
|
+
/* @__PURE__ */ e(xe, { open: l, onOpenChange: c, children: /* @__PURE__ */ n(ye, { className: "max-w-lg", children: [
|
|
2404
|
+
/* @__PURE__ */ n(be, { children: [
|
|
2405
|
+
/* @__PURE__ */ e(Ne, { children: h ? `Edit ${h.name}` : "New Translation Rule" }),
|
|
2406
|
+
/* @__PURE__ */ e(ve, { children: "Set the equivalent values for each cluster. Rules with values on only one side of a pair are silently skipped for that comparison." })
|
|
2271
2407
|
] }),
|
|
2272
2408
|
/* @__PURE__ */ n("div", { className: "space-y-4 py-2", children: [
|
|
2273
2409
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
2274
|
-
/* @__PURE__ */ e(
|
|
2410
|
+
/* @__PURE__ */ e(ne, { htmlFor: "tr-name", children: "Name" }),
|
|
2275
2411
|
/* @__PURE__ */ e(
|
|
2276
|
-
|
|
2412
|
+
ue,
|
|
2277
2413
|
{
|
|
2278
2414
|
id: "tr-name",
|
|
2279
|
-
value:
|
|
2280
|
-
onChange: (
|
|
2415
|
+
value: y.name,
|
|
2416
|
+
onChange: (g) => m({ ...y, name: g.target.value }),
|
|
2281
2417
|
placeholder: "key (ex. molten-url)"
|
|
2282
2418
|
}
|
|
2283
2419
|
)
|
|
2284
2420
|
] }),
|
|
2285
2421
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
2286
|
-
/* @__PURE__ */ e(
|
|
2422
|
+
/* @__PURE__ */ e(ne, { htmlFor: "tr-desc", children: "Description (optional)" }),
|
|
2287
2423
|
/* @__PURE__ */ e(
|
|
2288
|
-
|
|
2424
|
+
ue,
|
|
2289
2425
|
{
|
|
2290
2426
|
id: "tr-desc",
|
|
2291
|
-
value:
|
|
2292
|
-
onChange: (
|
|
2427
|
+
value: y.description,
|
|
2428
|
+
onChange: (g) => m({ ...y, description: g.target.value }),
|
|
2293
2429
|
placeholder: "Explain what this value represents"
|
|
2294
2430
|
}
|
|
2295
2431
|
)
|
|
2296
2432
|
] }),
|
|
2297
2433
|
/* @__PURE__ */ n("div", { className: "space-y-3 pt-1", children: [
|
|
2298
2434
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "Values per cluster" }),
|
|
2299
|
-
t.map((
|
|
2300
|
-
/* @__PURE__ */ e(
|
|
2435
|
+
t.map((g) => /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
2436
|
+
/* @__PURE__ */ e(ne, { htmlFor: `tr-val-${g}`, className: "text-xs text-muted-foreground", children: s[g] ?? g }),
|
|
2301
2437
|
/* @__PURE__ */ e(
|
|
2302
|
-
|
|
2438
|
+
ue,
|
|
2303
2439
|
{
|
|
2304
|
-
id: `tr-val-${
|
|
2305
|
-
value:
|
|
2306
|
-
onChange: (
|
|
2307
|
-
...
|
|
2308
|
-
values: { ...
|
|
2440
|
+
id: `tr-val-${g}`,
|
|
2441
|
+
value: y.values[g] ?? "",
|
|
2442
|
+
onChange: (j) => m({
|
|
2443
|
+
...y,
|
|
2444
|
+
values: { ...y.values, [g]: j.target.value }
|
|
2309
2445
|
}),
|
|
2310
2446
|
placeholder: "Leave blank to remove",
|
|
2311
2447
|
className: "font-mono text-xs"
|
|
2312
2448
|
}
|
|
2313
2449
|
)
|
|
2314
|
-
] },
|
|
2450
|
+
] }, g))
|
|
2315
2451
|
] })
|
|
2316
2452
|
] }),
|
|
2317
|
-
/* @__PURE__ */ n(
|
|
2318
|
-
/* @__PURE__ */ n(
|
|
2319
|
-
/* @__PURE__ */ e(
|
|
2453
|
+
/* @__PURE__ */ n(we, { children: [
|
|
2454
|
+
/* @__PURE__ */ n($, { variant: "outline", onClick: x, children: [
|
|
2455
|
+
/* @__PURE__ */ e(ge, {}),
|
|
2320
2456
|
"Cancel"
|
|
2321
2457
|
] }),
|
|
2322
|
-
/* @__PURE__ */ n(
|
|
2323
|
-
/* @__PURE__ */ e(
|
|
2324
|
-
|
|
2458
|
+
/* @__PURE__ */ n($, { onClick: k, disabled: !V || _, children: [
|
|
2459
|
+
/* @__PURE__ */ e(Nt, {}),
|
|
2460
|
+
_ ? "Saving…" : "Save"
|
|
2325
2461
|
] })
|
|
2326
2462
|
] })
|
|
2327
2463
|
] }) })
|
|
2328
2464
|
] });
|
|
2329
2465
|
}
|
|
2330
|
-
function
|
|
2466
|
+
function Mn({
|
|
2331
2467
|
originConfigId: t,
|
|
2332
2468
|
apiPath: s = "/release-ignores"
|
|
2333
2469
|
}) {
|
|
2334
|
-
const { toast:
|
|
2470
|
+
const { toast: a } = se(), { fetchJson: i } = te(), r = ae(), d = ["imaginarium", "release-ignores", t], { data: l, isLoading: c } = le({
|
|
2335
2471
|
queryKey: d,
|
|
2336
2472
|
queryFn: async () => {
|
|
2337
|
-
const p = await
|
|
2473
|
+
const p = await i(
|
|
2338
2474
|
`${s}?where[originConfigId]=${encodeURIComponent(t)}`
|
|
2339
2475
|
);
|
|
2340
2476
|
return (p == null ? void 0 : p.items) ?? [];
|
|
2341
2477
|
}
|
|
2342
|
-
}), h =
|
|
2343
|
-
mutationFn: (p) =>
|
|
2478
|
+
}), h = H({
|
|
2479
|
+
mutationFn: (p) => i(`${s}/${p}`, { method: "DELETE" }),
|
|
2344
2480
|
onSuccess: () => {
|
|
2345
|
-
r.invalidateQueries({ queryKey: d }),
|
|
2481
|
+
r.invalidateQueries({ queryKey: d }), a({ title: "Item removed from ignore list" });
|
|
2346
2482
|
},
|
|
2347
2483
|
onError: (p) => {
|
|
2348
|
-
|
|
2484
|
+
a({ title: "Error", description: p.message, variant: "destructive" });
|
|
2349
2485
|
}
|
|
2350
|
-
}),
|
|
2351
|
-
mutationFn: () =>
|
|
2486
|
+
}), N = H({
|
|
2487
|
+
mutationFn: () => i(`${s}?originConfigId=${encodeURIComponent(t)}`, {
|
|
2352
2488
|
method: "DELETE"
|
|
2353
2489
|
}),
|
|
2354
2490
|
onSuccess: () => {
|
|
2355
|
-
r.invalidateQueries({ queryKey: d }),
|
|
2491
|
+
r.invalidateQueries({ queryKey: d }), a({ title: "All ignore rules cleared" });
|
|
2356
2492
|
},
|
|
2357
2493
|
onError: (p) => {
|
|
2358
|
-
|
|
2494
|
+
a({ title: "Error", description: p.message, variant: "destructive" });
|
|
2359
2495
|
}
|
|
2360
|
-
}),
|
|
2361
|
-
window.confirm("Remove all ignore rules for this cluster? Items will appear normally in future snapshots.") &&
|
|
2496
|
+
}), y = () => {
|
|
2497
|
+
window.confirm("Remove all ignore rules for this cluster? Items will appear normally in future snapshots.") && N.mutate();
|
|
2362
2498
|
};
|
|
2363
|
-
if (
|
|
2499
|
+
if (c)
|
|
2364
2500
|
return /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" });
|
|
2365
|
-
const
|
|
2501
|
+
const m = l ?? [];
|
|
2366
2502
|
return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
2367
2503
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2368
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children:
|
|
2369
|
-
|
|
2370
|
-
|
|
2504
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: m.length === 0 ? "No items are permanently ignored." : `${m.length} item${m.length === 1 ? "" : "s"} permanently ignored for this cluster.` }),
|
|
2505
|
+
m.length > 0 && /* @__PURE__ */ n(
|
|
2506
|
+
$,
|
|
2371
2507
|
{
|
|
2372
2508
|
variant: "outline",
|
|
2373
2509
|
size: "sm",
|
|
2374
|
-
onClick:
|
|
2375
|
-
disabled:
|
|
2510
|
+
onClick: y,
|
|
2511
|
+
disabled: N.isPending,
|
|
2376
2512
|
children: [
|
|
2377
|
-
/* @__PURE__ */ e(
|
|
2378
|
-
|
|
2513
|
+
/* @__PURE__ */ e(Le, {}),
|
|
2514
|
+
N.isPending ? "Clearing…" : "Clear all"
|
|
2379
2515
|
]
|
|
2380
2516
|
}
|
|
2381
2517
|
)
|
|
2382
2518
|
] }),
|
|
2383
|
-
|
|
2519
|
+
m.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
|
|
2384
2520
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b bg-muted/50", children: [
|
|
2385
2521
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Type" }),
|
|
2386
2522
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Name" }),
|
|
2387
2523
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Reason" }),
|
|
2388
2524
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 text-right font-medium" })
|
|
2389
2525
|
] }) }),
|
|
2390
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
2526
|
+
/* @__PURE__ */ e("tbody", { children: m.map((p) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
|
|
2391
2527
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 text-muted-foreground font-mono text-xs", children: p.itemType }),
|
|
2392
2528
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 font-medium", children: p.itemName }),
|
|
2393
2529
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 text-muted-foreground", children: p.reason ?? /* @__PURE__ */ e("span", { className: "italic text-xs", children: "—" }) }),
|
|
2394
2530
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 text-right", children: /* @__PURE__ */ e(
|
|
2395
|
-
|
|
2531
|
+
$,
|
|
2396
2532
|
{
|
|
2397
2533
|
variant: "ghost",
|
|
2398
2534
|
size: "icon",
|
|
2399
2535
|
title: "Remove from ignore list",
|
|
2400
2536
|
onClick: () => h.mutate(p.id),
|
|
2401
2537
|
disabled: h.isPending,
|
|
2402
|
-
children: /* @__PURE__ */ e(
|
|
2538
|
+
children: /* @__PURE__ */ e(He, {})
|
|
2403
2539
|
}
|
|
2404
2540
|
) })
|
|
2405
2541
|
] }, p.id)) })
|
|
2406
2542
|
] }) })
|
|
2407
2543
|
] });
|
|
2408
2544
|
}
|
|
2409
|
-
function
|
|
2545
|
+
function Fn(t, s) {
|
|
2410
2546
|
return [...t].sort(
|
|
2411
|
-
(
|
|
2547
|
+
(a, i) => (s[a] ?? a).localeCompare(s[i] ?? i, void 0, { sensitivity: "base" })
|
|
2412
2548
|
);
|
|
2413
2549
|
}
|
|
2414
|
-
const
|
|
2415
|
-
function
|
|
2416
|
-
const s = (t.tags ?? []).map((
|
|
2417
|
-
return
|
|
2550
|
+
const yt = ["dev", "stg", "prd"];
|
|
2551
|
+
function qn(t) {
|
|
2552
|
+
const s = (t.tags ?? []).map((i) => i.toLowerCase()), a = yt.findIndex((i) => s.includes(i));
|
|
2553
|
+
return a === -1 ? yt.length : a;
|
|
2418
2554
|
}
|
|
2419
|
-
function
|
|
2420
|
-
const s = Object.fromEntries(t.map((r) => [r.id, r.displayName])),
|
|
2555
|
+
function zn(t) {
|
|
2556
|
+
const s = Object.fromEntries(t.map((r) => [r.id, r.displayName])), a = /* @__PURE__ */ new Map();
|
|
2421
2557
|
for (const r of t) {
|
|
2422
|
-
const d =
|
|
2423
|
-
|
|
2558
|
+
const d = qn(r);
|
|
2559
|
+
a.has(d) || a.set(d, []), a.get(d).push(r.id);
|
|
2424
2560
|
}
|
|
2425
|
-
return [...
|
|
2561
|
+
return [...a.keys()].sort((r, d) => r - d).flatMap((r) => Fn(a.get(r), s));
|
|
2426
2562
|
}
|
|
2427
|
-
const
|
|
2563
|
+
const jn = [
|
|
2428
2564
|
{ id: "releases", label: "Releases" },
|
|
2429
2565
|
{ id: "status", label: "Status" },
|
|
2430
2566
|
{ id: "translations", label: "Translations" },
|
|
2431
2567
|
{ id: "ignored", label: "Ignored" }
|
|
2432
2568
|
];
|
|
2433
|
-
function
|
|
2434
|
-
var
|
|
2435
|
-
const [t, s] = R("releases"), [
|
|
2436
|
-
|
|
2569
|
+
function Bn() {
|
|
2570
|
+
var m;
|
|
2571
|
+
const [t, s] = R("releases"), [a, i] = R(null), { configs: r } = fe(), [d, l] = R("");
|
|
2572
|
+
Ue(() => {
|
|
2437
2573
|
!d && r.length > 0 && l(r[0].id);
|
|
2438
2574
|
}, [d, r]);
|
|
2439
|
-
const
|
|
2575
|
+
const c = J(() => {
|
|
2440
2576
|
const p = {};
|
|
2441
|
-
return r.forEach((
|
|
2442
|
-
p[
|
|
2577
|
+
return r.forEach((S) => {
|
|
2578
|
+
p[S.id] = S.displayName;
|
|
2443
2579
|
}), p;
|
|
2444
|
-
}, [r]), h = d || ((
|
|
2580
|
+
}, [r]), h = d || ((m = r[0]) == null ? void 0 : m.id) || "", N = J(() => zn(r), [r]), y = N.filter((p) => p !== h);
|
|
2445
2581
|
return /* @__PURE__ */ n("div", { className: "space-y-6", children: [
|
|
2446
2582
|
/* @__PURE__ */ n("div", { children: [
|
|
2447
2583
|
/* @__PURE__ */ e("h2", { className: "text-2xl font-semibold", children: "imp" }),
|
|
2448
2584
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Manage releases across clusters" })
|
|
2449
2585
|
] }),
|
|
2450
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b pb-2", children:
|
|
2451
|
-
|
|
2586
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b pb-2", children: jn.map(({ id: p, label: S }) => /* @__PURE__ */ e(
|
|
2587
|
+
$,
|
|
2452
2588
|
{
|
|
2453
2589
|
variant: t === p ? "secondary" : "ghost",
|
|
2454
2590
|
size: "sm",
|
|
2455
2591
|
onClick: () => s(p),
|
|
2456
|
-
children:
|
|
2592
|
+
children: S
|
|
2457
2593
|
},
|
|
2458
2594
|
p
|
|
2459
2595
|
)) }),
|
|
2460
|
-
t === "releases" && (
|
|
2596
|
+
t === "releases" && (a == null ? /* @__PURE__ */ e(tn, { onOpen: i }) : /* @__PURE__ */ e(In, { releaseId: a, onBack: () => i(null) })),
|
|
2461
2597
|
t === "status" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
2462
2598
|
/* @__PURE__ */ e("div", { className: "max-w-xs", children: /* @__PURE__ */ e(
|
|
2463
|
-
|
|
2599
|
+
ht,
|
|
2464
2600
|
{
|
|
2465
2601
|
label: "Reference",
|
|
2466
2602
|
value: h,
|
|
@@ -2468,12 +2604,12 @@ function qn() {
|
|
|
2468
2604
|
configs: r
|
|
2469
2605
|
}
|
|
2470
2606
|
) }),
|
|
2471
|
-
h ? /* @__PURE__ */ e(
|
|
2607
|
+
h ? /* @__PURE__ */ e(An, { originConfigId: h, destConfigIds: y }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a reference cluster." })
|
|
2472
2608
|
] })),
|
|
2473
|
-
t === "translations" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ e(
|
|
2609
|
+
t === "translations" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ e(Dn, { configIds: N, clusterNames: c })),
|
|
2474
2610
|
t === "ignored" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
2475
2611
|
/* @__PURE__ */ e("div", { className: "max-w-xs", children: /* @__PURE__ */ e(
|
|
2476
|
-
|
|
2612
|
+
ht,
|
|
2477
2613
|
{
|
|
2478
2614
|
label: "Cluster",
|
|
2479
2615
|
value: h,
|
|
@@ -2481,53 +2617,53 @@ function qn() {
|
|
|
2481
2617
|
configs: r
|
|
2482
2618
|
}
|
|
2483
2619
|
) }),
|
|
2484
|
-
h ? /* @__PURE__ */ e(
|
|
2620
|
+
h ? /* @__PURE__ */ e(Mn, { originConfigId: h }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a cluster." })
|
|
2485
2621
|
] }))
|
|
2486
2622
|
] });
|
|
2487
2623
|
}
|
|
2488
|
-
const
|
|
2624
|
+
const Jn = {
|
|
2489
2625
|
id: "imaginarium.ui.ImpPage",
|
|
2490
2626
|
path: "/imp",
|
|
2491
|
-
element:
|
|
2492
|
-
},
|
|
2627
|
+
element: Bn
|
|
2628
|
+
}, Ln = {
|
|
2493
2629
|
id: "imaginarium.ui.ImpNavItem",
|
|
2494
2630
|
path: "/imp",
|
|
2495
2631
|
label: "imp",
|
|
2496
|
-
icon:
|
|
2632
|
+
icon: Ht,
|
|
2497
2633
|
sort: 150
|
|
2498
|
-
},
|
|
2634
|
+
}, ns = {
|
|
2499
2635
|
install(t) {
|
|
2500
|
-
t.addPlugin(Mt,
|
|
2636
|
+
t.addPlugin(Mt, Jn), t.addPlugin(Ft, Ln), zt.register(t, Xt);
|
|
2501
2637
|
}
|
|
2502
2638
|
};
|
|
2503
2639
|
export {
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2640
|
+
ht as C,
|
|
2641
|
+
St as D,
|
|
2642
|
+
Te as E,
|
|
2643
|
+
an as I,
|
|
2644
|
+
nn as P,
|
|
2645
|
+
In as R,
|
|
2646
|
+
An as S,
|
|
2647
|
+
ot as T,
|
|
2648
|
+
Zt as a,
|
|
2649
|
+
sn as b,
|
|
2650
|
+
Mn as c,
|
|
2651
|
+
pn as d,
|
|
2652
|
+
ln as e,
|
|
2653
|
+
tn as f,
|
|
2654
|
+
ns as g,
|
|
2519
2655
|
kt as h,
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2656
|
+
Bn as i,
|
|
2657
|
+
rn as j,
|
|
2658
|
+
Dn as k,
|
|
2659
|
+
kn as l,
|
|
2660
|
+
Nn as m,
|
|
2661
|
+
En as n,
|
|
2662
|
+
ts as o,
|
|
2663
|
+
Pn as p,
|
|
2664
|
+
Sn as q,
|
|
2665
|
+
vn as r,
|
|
2666
|
+
wn as t,
|
|
2667
|
+
Re as u
|
|
2532
2668
|
};
|
|
2533
|
-
//# sourceMappingURL=PluginSetup-
|
|
2669
|
+
//# sourceMappingURL=PluginSetup-B-KjdUGN.js.map
|