@meirblachman/azure-pipelines-visualizer 0.2.2 → 0.2.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/dist/index.min.js +25 -25
- package/dist/web/assets/{index-CUWgfzhx.css → index-CR6Yqjeq.css} +1 -1
- package/dist/web/assets/{index-C-vxesL2.js → index-DOVhmxvL.js} +169 -169
- package/dist/web/assets/react-vendor-DNJ8iqd0.js +1 -0
- package/dist/web/assets/{reactflow-BBgD8bXw.js → reactflow-BEXr8p1i.js} +5 -5
- package/dist/web/assets/{yaml-DGeXk3xG.js → yaml-DEoQNyYi.js} +1 -1
- package/dist/web/index.html +3 -3
- package/dist/web/lib/index.js +1479 -1000
- package/dist/web/lib/style.css +1 -1
- package/package.json +1 -1
- package/dist/web/assets/react-vendor-Bdswto6F.js +0 -1
package/dist/web/lib/index.js
CHANGED
|
@@ -1,124 +1,658 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { parseYaml as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsx as s, jsxs as l, Fragment as Je } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Ze, useMemo as ve, useEffect as ee, useCallback as ne, useState as L, useRef as Q, Component as yt, createContext as wt, useContext as Pt, createElement as Et } from "react";
|
|
3
|
+
import { collapsePath as Rt, parseAdoCommitUrl as xt, parseYaml as ue, extractTaskReferences as kt, resolveTaskDocUrl as Tt, extractVariableValues as Pe, detectTemplateReferences as Oe, extractParameterDefaults as ze, buildAdoFileUrl as rt, getEffectiveRepoAlias as ie, extractDeclaredParameterNames as Qe, pathHasExpressions as me, resolveExpressionPath as Te, resolveTemplateRefPaths as it, evaluateExpression as $t, resolveTemplateSource as lt, parseTemplatePath as St, resolveAllExpressions as Ct, parseAdoUrl as Dt } from "@meirblachman/azure-pipelines-visualizer-core";
|
|
4
|
+
import $e from "@dagrejs/dagre";
|
|
5
|
+
import { Handle as Se, Position as Ce, useNodesState as ct, useEdgesState as dt, ReactFlow as pt, Background as ut, Controls as mt, getBezierPath as At, BaseEdge as It, EdgeLabelRenderer as Lt, MarkerType as De, BackgroundVariant as Ft } from "@xyflow/react";
|
|
6
|
+
import Bt from "@monaco-editor/react";
|
|
7
|
+
import { create as Ut } from "zustand";
|
|
8
|
+
import Mt from "react-dom";
|
|
9
|
+
const Le = "7.1";
|
|
10
|
+
function Fe(e, t) {
|
|
11
|
+
return `https://dev.azure.com/${encodeURIComponent(e)}/${encodeURIComponent(t)}/_apis`;
|
|
12
|
+
}
|
|
13
|
+
function Vt(e) {
|
|
14
|
+
return e.startsWith("refs/heads/") ? { version: e.slice(11), versionType: "branch" } : e.startsWith("refs/tags/") ? { version: e.slice(10), versionType: "tag" } : /^[0-9a-f]{40}$/i.test(e) ? { version: e, versionType: "commit" } : { version: e, versionType: "branch" };
|
|
15
|
+
}
|
|
16
|
+
async function Be(e) {
|
|
17
|
+
const t = await fetch(e, { credentials: "include" });
|
|
18
|
+
if (!t.ok) {
|
|
19
|
+
const a = await t.text();
|
|
20
|
+
throw new Error(`ADO API error (${t.status}): ${a}`);
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
async function ht(e, t, a, o, r) {
|
|
25
|
+
const n = o.startsWith("/") ? o : `/${o}`, c = Rt(n);
|
|
26
|
+
let d = `${Fe(e, t)}/git/repositories/${encodeURIComponent(a)}/items?path=${encodeURIComponent(c)}&api-version=${Le}&includeContent=true&$format=text`;
|
|
27
|
+
if (r) {
|
|
28
|
+
const h = Vt(r);
|
|
29
|
+
d += `&versionDescriptor.version=${encodeURIComponent(h.version)}&versionDescriptor.versionType=${h.versionType}`;
|
|
30
|
+
}
|
|
31
|
+
return (await Be(d)).text();
|
|
32
|
+
}
|
|
33
|
+
async function Ot(e, t) {
|
|
34
|
+
const a = `${Fe(e, t)}/pipelines?api-version=${Le}`;
|
|
35
|
+
return (await (await Be(a)).json()).value;
|
|
36
|
+
}
|
|
37
|
+
async function zt(e, t, a) {
|
|
38
|
+
var u, h, i, m, f;
|
|
39
|
+
const o = `${Fe(e, t)}/build/definitions/${a}?api-version=${Le}`, n = await (await Be(o)).json(), c = {
|
|
40
|
+
id: n.id,
|
|
41
|
+
name: n.name,
|
|
42
|
+
path: ((u = n.process) == null ? void 0 : u.yamlFilename) ?? n.path,
|
|
43
|
+
repository: {
|
|
44
|
+
id: (h = n.repository) == null ? void 0 : h.id,
|
|
45
|
+
name: (i = n.repository) == null ? void 0 : i.name,
|
|
46
|
+
type: (m = n.repository) == null ? void 0 : m.type,
|
|
47
|
+
defaultBranch: (f = n.repository) == null ? void 0 : f.defaultBranch
|
|
48
|
+
}
|
|
49
|
+
}, d = await ht(
|
|
50
|
+
e,
|
|
51
|
+
t,
|
|
52
|
+
c.repository.id,
|
|
53
|
+
c.path,
|
|
54
|
+
c.repository.defaultBranch
|
|
55
|
+
);
|
|
56
|
+
return { definition: c, yaml: d };
|
|
57
|
+
}
|
|
58
|
+
async function jt(e, t, a, o, r) {
|
|
59
|
+
return { content: await ht(e, t, a, o, r), path: o, repoId: a, repoName: a, branch: r || "" };
|
|
60
|
+
}
|
|
61
|
+
async function Wt() {
|
|
62
|
+
return { customTaskDocs: {} };
|
|
63
|
+
}
|
|
64
|
+
async function Ht(e) {
|
|
65
|
+
return { tasks: [], cached: !1 };
|
|
66
|
+
}
|
|
67
|
+
async function Kt(e, t, a, o) {
|
|
68
|
+
const r = new URLSearchParams({
|
|
69
|
+
"api-version": Le,
|
|
70
|
+
repositoryId: a,
|
|
71
|
+
repositoryType: "TfsGit",
|
|
72
|
+
sourceVersion: o,
|
|
73
|
+
queryOrder: "queueTimeAscending",
|
|
74
|
+
maxBuildsPerDefinition: "50"
|
|
75
|
+
}), n = `${Fe(e, t)}/build/builds?${r}`;
|
|
76
|
+
return (await (await Be(n)).json()).value ?? [];
|
|
77
|
+
}
|
|
78
|
+
const ft = "/api";
|
|
79
|
+
var ot;
|
|
80
|
+
const he = typeof window < "u" && ((ot = window.location) == null ? void 0 : ot.protocol) === "chrome-extension:";
|
|
81
|
+
async function Ne(e) {
|
|
82
|
+
const t = await fetch(`${ft}${e}`);
|
|
83
|
+
if (!t.ok) {
|
|
84
|
+
const a = await t.text();
|
|
85
|
+
throw new Error(`API error (${t.status}): ${a}`);
|
|
86
|
+
}
|
|
87
|
+
return t.json();
|
|
88
|
+
}
|
|
89
|
+
function Ka(e, t) {
|
|
90
|
+
return he ? Ot(e, t) : Ne(`/${e}/${t}/pipelines`);
|
|
91
|
+
}
|
|
92
|
+
function Gt(e, t, a) {
|
|
93
|
+
return he ? zt(e, t, a) : Ne(`/${e}/${t}/pipelines/${a}/yaml`);
|
|
94
|
+
}
|
|
95
|
+
function gt(e, t, a, o, r) {
|
|
96
|
+
if (he)
|
|
97
|
+
return jt(e, t, a, o, r);
|
|
98
|
+
const n = new URLSearchParams({ repo: a, path: o });
|
|
99
|
+
return r && n.set("branch", r), Ne(`/${e}/${t}/file-by-repo-name?${n}`);
|
|
100
|
+
}
|
|
101
|
+
function qt() {
|
|
102
|
+
return he ? Wt() : Ne("/config/task-docs");
|
|
103
|
+
}
|
|
104
|
+
function Yt(e) {
|
|
105
|
+
return he ? Ht() : Ne(`/${e}/schema/tasks`);
|
|
106
|
+
}
|
|
107
|
+
function Jt(e, t, a, o, r, n, c) {
|
|
108
|
+
const d = new AbortController();
|
|
109
|
+
if (he)
|
|
110
|
+
return Kt(e, t, a, o).then((m) => {
|
|
111
|
+
r(m), n();
|
|
112
|
+
}).catch(
|
|
113
|
+
(m) => c(m instanceof Error ? m.message : String(m))
|
|
114
|
+
), d;
|
|
115
|
+
const u = new URLSearchParams({ repoName: a, commitSha: o }), h = `${ft}/${e}/${t}/commit-flow/stream?${u}`, i = new EventSource(h);
|
|
116
|
+
return d.signal.addEventListener("abort", () => i.close()), i.addEventListener("builds", (m) => {
|
|
117
|
+
try {
|
|
118
|
+
const f = JSON.parse(m.data);
|
|
119
|
+
r(f);
|
|
120
|
+
} catch {
|
|
121
|
+
}
|
|
122
|
+
}), i.addEventListener("done", () => {
|
|
123
|
+
i.close(), n();
|
|
124
|
+
}), i.addEventListener("error", (m) => {
|
|
125
|
+
i.close();
|
|
126
|
+
const f = m instanceof MessageEvent && m.data ? JSON.parse(m.data).error : "Connection lost";
|
|
127
|
+
c(f);
|
|
128
|
+
}), d;
|
|
129
|
+
}
|
|
130
|
+
function je(e) {
|
|
131
|
+
return e ? new Date(e).toLocaleString() : "—";
|
|
132
|
+
}
|
|
133
|
+
function Xt(e, t) {
|
|
134
|
+
if (!e || !t) return null;
|
|
135
|
+
const a = new Date(t).getTime() - new Date(e).getTime();
|
|
136
|
+
if (a < 0) return null;
|
|
137
|
+
const o = Math.floor(a / 1e3);
|
|
138
|
+
if (o < 60) return `${o}s`;
|
|
139
|
+
const r = Math.floor(o / 60), n = o % 60;
|
|
140
|
+
if (r < 60) return `${r}m ${n}s`;
|
|
141
|
+
const c = Math.floor(r / 60), d = r % 60;
|
|
142
|
+
return `${c}h ${d}m`;
|
|
143
|
+
}
|
|
144
|
+
function Zt(e, t) {
|
|
145
|
+
return e === "inProgress" ? { label: "In Progress", className: "badge--in-progress" } : e === "notStarted" ? { label: "Not Started", className: "badge--pending" } : t === "succeeded" ? { label: "Succeeded", className: "badge--succeeded" } : t === "partiallySucceeded" ? { label: "Partial Success", className: "badge--partial" } : t === "failed" ? { label: "Failed", className: "badge--failed" } : t === "canceled" ? { label: "Canceled", className: "badge--canceled" } : { label: e, className: "" };
|
|
146
|
+
}
|
|
147
|
+
function Qt({
|
|
148
|
+
build: e,
|
|
149
|
+
onClose: t
|
|
150
|
+
}) {
|
|
151
|
+
var n, c;
|
|
152
|
+
const a = Zt(e.status, e.result), o = Xt(e.startTime, e.finishTime), r = (c = (n = e._links) == null ? void 0 : n.web) == null ? void 0 : c.href;
|
|
153
|
+
return /* @__PURE__ */ s(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
className: "build-popup-overlay",
|
|
157
|
+
onClick: t,
|
|
158
|
+
onKeyDown: (d) => {
|
|
159
|
+
d.key === "Escape" && t();
|
|
160
|
+
},
|
|
161
|
+
role: "dialog",
|
|
162
|
+
"aria-modal": "true",
|
|
163
|
+
children: /* @__PURE__ */ l(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: "build-popup",
|
|
167
|
+
onClick: (d) => d.stopPropagation(),
|
|
168
|
+
onKeyDown: (d) => d.stopPropagation(),
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ l("div", { className: "build-popup__header", children: [
|
|
171
|
+
/* @__PURE__ */ s("h2", { children: e.definition.name }),
|
|
172
|
+
/* @__PURE__ */ s(
|
|
173
|
+
"button",
|
|
174
|
+
{
|
|
175
|
+
className: "build-popup__close",
|
|
176
|
+
onClick: t,
|
|
177
|
+
type: "button",
|
|
178
|
+
children: "✕"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ l("div", { className: "build-popup__body", children: [
|
|
183
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
184
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Build Number" }),
|
|
185
|
+
/* @__PURE__ */ l("span", { children: [
|
|
186
|
+
"#",
|
|
187
|
+
e.buildNumber
|
|
188
|
+
] })
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
191
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Status" }),
|
|
192
|
+
/* @__PURE__ */ s("span", { className: `build-popup__badge ${a.className}`, children: a.label })
|
|
193
|
+
] }),
|
|
194
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
195
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Queued" }),
|
|
196
|
+
/* @__PURE__ */ s("span", { children: je(e.queueTime) })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
199
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Started" }),
|
|
200
|
+
/* @__PURE__ */ s("span", { children: je(e.startTime) })
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
203
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Finished" }),
|
|
204
|
+
/* @__PURE__ */ s("span", { children: je(e.finishTime) })
|
|
205
|
+
] }),
|
|
206
|
+
o && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
207
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Duration" }),
|
|
208
|
+
/* @__PURE__ */ s("span", { children: o })
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
211
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Branch" }),
|
|
212
|
+
/* @__PURE__ */ s("span", { children: e.sourceBranch.replace("refs/heads/", "") })
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
215
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Commit" }),
|
|
216
|
+
/* @__PURE__ */ s("span", { className: "build-popup__mono", children: e.sourceVersion.slice(0, 8) })
|
|
217
|
+
] }),
|
|
218
|
+
e.requestedFor && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
219
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Requested For" }),
|
|
220
|
+
/* @__PURE__ */ s("span", { children: e.requestedFor.displayName })
|
|
221
|
+
] }),
|
|
222
|
+
e.triggeredByBuild && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
223
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Triggered By" }),
|
|
224
|
+
/* @__PURE__ */ l("span", { children: [
|
|
225
|
+
e.triggeredByBuild.definition.name,
|
|
226
|
+
" #",
|
|
227
|
+
e.triggeredByBuild.buildNumber
|
|
228
|
+
] })
|
|
229
|
+
] }),
|
|
230
|
+
Object.keys(e.triggerInfo).length > 0 && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
231
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Trigger Info" }),
|
|
232
|
+
/* @__PURE__ */ s("span", { className: "build-popup__mono", children: Object.entries(e.triggerInfo).map(([d, u]) => `${d}: ${u}`).join(", ") })
|
|
233
|
+
] }),
|
|
234
|
+
e.tags.length > 0 && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
|
|
235
|
+
/* @__PURE__ */ s("span", { className: "build-popup__label", children: "Tags" }),
|
|
236
|
+
/* @__PURE__ */ s("span", { className: "build-popup__tags", children: e.tags.map((d) => /* @__PURE__ */ s("span", { className: "build-popup__tag", children: d }, d)) })
|
|
237
|
+
] }),
|
|
238
|
+
r && /* @__PURE__ */ s("div", { className: "build-popup__row", children: /* @__PURE__ */ s(
|
|
239
|
+
"a",
|
|
240
|
+
{
|
|
241
|
+
href: r,
|
|
242
|
+
target: "_blank",
|
|
243
|
+
rel: "noopener noreferrer",
|
|
244
|
+
className: "build-popup__link",
|
|
245
|
+
children: "Open in Azure DevOps ↗"
|
|
246
|
+
}
|
|
247
|
+
) })
|
|
248
|
+
] })
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function ea(e) {
|
|
256
|
+
return e ? new Date(e).toLocaleString(void 0, {
|
|
257
|
+
month: "short",
|
|
258
|
+
day: "numeric",
|
|
259
|
+
hour: "2-digit",
|
|
260
|
+
minute: "2-digit",
|
|
261
|
+
second: "2-digit"
|
|
262
|
+
}) : "—";
|
|
263
|
+
}
|
|
264
|
+
function ta(e, t) {
|
|
265
|
+
if (!e || !t) return null;
|
|
266
|
+
const a = new Date(t).getTime() - new Date(e).getTime();
|
|
267
|
+
if (a < 0) return null;
|
|
268
|
+
const o = Math.floor(a / 1e3);
|
|
269
|
+
if (o < 60) return `${o}s`;
|
|
270
|
+
const r = Math.floor(o / 60), n = o % 60;
|
|
271
|
+
if (r < 60) return `${r}m ${n}s`;
|
|
272
|
+
const c = Math.floor(r / 60), d = r % 60;
|
|
273
|
+
return `${c}h ${d}m`;
|
|
274
|
+
}
|
|
275
|
+
function aa(e, t) {
|
|
276
|
+
return e === "inProgress" ? "⏳" : e === "notStarted" ? "⏸️" : t === "succeeded" ? "✅" : t === "partiallySucceeded" ? "⚠️" : t === "failed" ? "❌" : t === "canceled" ? "🚫" : "❓";
|
|
277
|
+
}
|
|
278
|
+
function na(e, t) {
|
|
279
|
+
return e === "inProgress" ? "build-node--in-progress" : t === "succeeded" ? "build-node--succeeded" : t === "partiallySucceeded" ? "build-node--partial" : t === "failed" ? "build-node--failed" : t === "canceled" ? "build-node--canceled" : "";
|
|
280
|
+
}
|
|
281
|
+
function sa({ data: e }) {
|
|
282
|
+
const t = e, a = ta(t.startTime, t.finishTime);
|
|
283
|
+
return /* @__PURE__ */ l("div", { className: `build-node ${na(t.status, t.result)}`, children: [
|
|
284
|
+
!t.isRoot && /* @__PURE__ */ s(Se, { type: "target", position: Ce.Left }),
|
|
285
|
+
/* @__PURE__ */ l("div", { className: "build-node__header", children: [
|
|
286
|
+
/* @__PURE__ */ s("span", { className: "build-node__status", children: aa(t.status, t.result) }),
|
|
287
|
+
/* @__PURE__ */ s("span", { className: "build-node__name", title: t.pipelineName, children: t.pipelineName })
|
|
288
|
+
] }),
|
|
289
|
+
/* @__PURE__ */ l("div", { className: "build-node__number", children: [
|
|
290
|
+
"#",
|
|
291
|
+
t.buildNumber
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ l("div", { className: "build-node__times", children: [
|
|
294
|
+
/* @__PURE__ */ l("span", { title: "Start time", children: [
|
|
295
|
+
"🕐 ",
|
|
296
|
+
ea(t.startTime)
|
|
297
|
+
] }),
|
|
298
|
+
a && /* @__PURE__ */ l("span", { title: "Duration", children: [
|
|
299
|
+
"⏱️ ",
|
|
300
|
+
a
|
|
301
|
+
] })
|
|
302
|
+
] }),
|
|
303
|
+
/* @__PURE__ */ l("div", { className: "build-node__branch", title: t.sourceBranch, children: [
|
|
304
|
+
"🌿 ",
|
|
305
|
+
t.sourceBranch.replace("refs/heads/", "")
|
|
306
|
+
] }),
|
|
307
|
+
/* @__PURE__ */ s(Se, { type: "source", position: Ce.Right })
|
|
308
|
+
] });
|
|
309
|
+
}
|
|
310
|
+
const oa = Ze(sa), We = 280, _e = 130, He = 20, ra = { build: oa };
|
|
311
|
+
function ia(e, t) {
|
|
312
|
+
if (e.length === 0) return { nodes: e, edges: t };
|
|
313
|
+
const a = /* @__PURE__ */ new Set();
|
|
314
|
+
for (const c of t)
|
|
315
|
+
a.add(c.source), a.add(c.target);
|
|
316
|
+
const o = e.filter((c) => !a.has(c.id)), r = e.filter((c) => a.has(c.id));
|
|
317
|
+
let n = [];
|
|
318
|
+
if (r.length > 0) {
|
|
319
|
+
const c = new $e.graphlib.Graph();
|
|
320
|
+
c.setDefaultEdgeLabel(() => ({})), c.setGraph({ rankdir: "LR", ranksep: 80, nodesep: 30 });
|
|
321
|
+
for (const d of r)
|
|
322
|
+
c.setNode(d.id, { width: We, height: _e });
|
|
323
|
+
for (const d of t)
|
|
324
|
+
c.setEdge(d.source, d.target);
|
|
325
|
+
$e.layout(c), n = r.map((d) => {
|
|
326
|
+
const u = c.node(d.id);
|
|
327
|
+
return {
|
|
328
|
+
...d,
|
|
329
|
+
position: { x: u.x - We / 2, y: u.y - _e / 2 }
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
if (o.length > 0) {
|
|
334
|
+
let c = 0;
|
|
335
|
+
for (const i of n) c = Math.max(c, i.position.y + _e);
|
|
336
|
+
const d = n.length > 0 ? c + 60 : 0, u = [...o].sort((i, m) => {
|
|
337
|
+
const f = i.data.startTime ?? "", p = m.data.startTime ?? "";
|
|
338
|
+
return f < p ? -1 : f > p ? 1 : 0;
|
|
339
|
+
}), h = u.map((i) => {
|
|
340
|
+
const m = i.data.startTime;
|
|
341
|
+
return m ? new Date(m).getTime() : null;
|
|
342
|
+
}).filter((i) => i !== null);
|
|
343
|
+
if (h.length > 0) {
|
|
344
|
+
const i = Math.min(...h), f = Math.max(...h) - i || 1, p = Math.max(u.length * (We + He), 1200);
|
|
345
|
+
let w = 0;
|
|
346
|
+
for (const E of u) {
|
|
347
|
+
const _ = E.data.startTime, y = ((_ ? new Date(_).getTime() : i) - i) / f * p;
|
|
348
|
+
E.position = {
|
|
349
|
+
x: y,
|
|
350
|
+
y: d + w * (_e + He)
|
|
351
|
+
}, w++;
|
|
352
|
+
}
|
|
353
|
+
} else
|
|
354
|
+
u.forEach((i, m) => {
|
|
355
|
+
i.position = { x: 0, y: d + m * (_e + He) };
|
|
356
|
+
});
|
|
357
|
+
n = [...n, ...u];
|
|
358
|
+
}
|
|
359
|
+
return { nodes: n, edges: t };
|
|
360
|
+
}
|
|
361
|
+
function la(e) {
|
|
362
|
+
const t = /* @__PURE__ */ new Map();
|
|
363
|
+
for (const n of e)
|
|
364
|
+
t.set(n.id, n);
|
|
365
|
+
const a = /* @__PURE__ */ new Set();
|
|
366
|
+
for (const n of e)
|
|
367
|
+
n.upstreamBuildId && t.has(n.upstreamBuildId) && a.add(n.id);
|
|
368
|
+
const o = e.map((n) => {
|
|
369
|
+
var c, d;
|
|
370
|
+
return {
|
|
371
|
+
id: String(n.id),
|
|
372
|
+
type: "build",
|
|
373
|
+
position: { x: 0, y: 0 },
|
|
374
|
+
data: {
|
|
375
|
+
buildId: n.id,
|
|
376
|
+
pipelineName: n.definition.name,
|
|
377
|
+
buildNumber: n.buildNumber,
|
|
378
|
+
status: n.status,
|
|
379
|
+
result: n.result,
|
|
380
|
+
startTime: n.startTime,
|
|
381
|
+
finishTime: n.finishTime,
|
|
382
|
+
sourceBranch: n.sourceBranch,
|
|
383
|
+
webUrl: ((d = (c = n._links) == null ? void 0 : c.web) == null ? void 0 : d.href) ?? null,
|
|
384
|
+
isRoot: !a.has(n.id)
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}), r = [];
|
|
388
|
+
for (const n of e)
|
|
389
|
+
n.upstreamBuildId && t.has(n.upstreamBuildId) && r.push({
|
|
390
|
+
id: `e-${n.upstreamBuildId}-${n.id}`,
|
|
391
|
+
source: String(n.upstreamBuildId),
|
|
392
|
+
target: String(n.id),
|
|
393
|
+
animated: n.status === "inProgress",
|
|
394
|
+
style: { stroke: "#89b4fa", strokeWidth: 2 }
|
|
395
|
+
});
|
|
396
|
+
return ia(o, r);
|
|
397
|
+
}
|
|
398
|
+
function ca({
|
|
399
|
+
builds: e,
|
|
400
|
+
onNodeClick: t
|
|
401
|
+
}) {
|
|
402
|
+
const { nodes: a, edges: o } = ve(
|
|
403
|
+
() => la(e),
|
|
404
|
+
[e]
|
|
405
|
+
), [r, n, c] = ct(a), [d, u, h] = dt(o);
|
|
406
|
+
ee(() => {
|
|
407
|
+
n(a), u(o);
|
|
408
|
+
}, [a, o, n, u]);
|
|
409
|
+
const i = ve(() => {
|
|
410
|
+
const f = /* @__PURE__ */ new Map();
|
|
411
|
+
for (const p of e) f.set(p.id, p);
|
|
412
|
+
return f;
|
|
413
|
+
}, [e]), m = ne(
|
|
414
|
+
(f, p) => {
|
|
415
|
+
const w = i.get(Number(p.id));
|
|
416
|
+
w && t(w);
|
|
417
|
+
},
|
|
418
|
+
[i, t]
|
|
419
|
+
);
|
|
420
|
+
return /* @__PURE__ */ s("div", { className: "commit-flow-diagram", children: /* @__PURE__ */ l(
|
|
421
|
+
pt,
|
|
422
|
+
{
|
|
423
|
+
nodes: r,
|
|
424
|
+
edges: d,
|
|
425
|
+
nodeTypes: ra,
|
|
426
|
+
onNodesChange: c,
|
|
427
|
+
onEdgesChange: h,
|
|
428
|
+
onNodeClick: m,
|
|
429
|
+
fitView: !0,
|
|
430
|
+
minZoom: 0.2,
|
|
431
|
+
maxZoom: 2,
|
|
432
|
+
proOptions: { hideAttribution: !0 },
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ s(ut, {}),
|
|
435
|
+
/* @__PURE__ */ s(mt, {})
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
) });
|
|
439
|
+
}
|
|
440
|
+
function da({
|
|
441
|
+
onLoad: e,
|
|
442
|
+
loading: t
|
|
443
|
+
}) {
|
|
444
|
+
const [a, o] = L(""), [r, n] = L(null), c = () => {
|
|
445
|
+
const u = a.trim();
|
|
446
|
+
if (!u) return;
|
|
447
|
+
n(null);
|
|
448
|
+
const h = xt(u);
|
|
449
|
+
if (!h) {
|
|
450
|
+
n(
|
|
451
|
+
"Invalid URL. Expected: https://dev.azure.com/{org}/{project}/_git/{repo}/commit/{sha}"
|
|
452
|
+
);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
e({
|
|
456
|
+
org: h.org,
|
|
457
|
+
project: h.project,
|
|
458
|
+
repoName: h.repoName,
|
|
459
|
+
commitSha: h.commitSha
|
|
460
|
+
});
|
|
461
|
+
};
|
|
462
|
+
return /* @__PURE__ */ l("div", { className: "commit-flow-selector", children: [
|
|
463
|
+
/* @__PURE__ */ s(
|
|
464
|
+
"input",
|
|
465
|
+
{
|
|
466
|
+
type: "text",
|
|
467
|
+
placeholder: "https://dev.azure.com/{org}/{project}/_git/{repo}/commit/{sha}",
|
|
468
|
+
value: a,
|
|
469
|
+
onChange: (u) => o(u.target.value),
|
|
470
|
+
onKeyDown: (u) => {
|
|
471
|
+
u.key === "Enter" && (u.preventDefault(), c());
|
|
472
|
+
},
|
|
473
|
+
className: "commit-flow-selector__input commit-flow-selector__input--url"
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
/* @__PURE__ */ s(
|
|
477
|
+
"button",
|
|
478
|
+
{
|
|
479
|
+
className: "commit-flow-selector__btn",
|
|
480
|
+
onClick: c,
|
|
481
|
+
disabled: !a.trim() || t,
|
|
482
|
+
type: "button",
|
|
483
|
+
children: t ? "⏳ Loading..." : "Load Builds"
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
r && /* @__PURE__ */ s("div", { className: "commit-flow-selector__error", children: r })
|
|
487
|
+
] });
|
|
488
|
+
}
|
|
489
|
+
function pa() {
|
|
490
|
+
const [e, t] = L([]), [a, o] = L(!1), [r, n] = L(null), [c, d] = L(null), [u, h] = L(null), i = Q(null), m = ne((p) => {
|
|
491
|
+
var w;
|
|
492
|
+
(w = i.current) == null || w.abort(), o(!0), n(null), t([]), d(null), h(p), i.current = Jt(
|
|
493
|
+
p.org,
|
|
494
|
+
p.project,
|
|
495
|
+
p.repoName,
|
|
496
|
+
p.commitSha,
|
|
497
|
+
(E) => {
|
|
498
|
+
t((_) => [..._, ...E]);
|
|
499
|
+
},
|
|
500
|
+
() => {
|
|
501
|
+
o(!1), t((E) => (E.length === 0 && n("No builds found for this commit."), E));
|
|
502
|
+
},
|
|
503
|
+
(E) => {
|
|
504
|
+
o(!1), n(E);
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
}, []), f = ne(() => {
|
|
508
|
+
u && m(u);
|
|
509
|
+
}, [u, m]);
|
|
510
|
+
return /* @__PURE__ */ l("div", { className: "commit-flow-page", children: [
|
|
511
|
+
/* @__PURE__ */ l("div", { className: "commit-flow-page__selector", children: [
|
|
512
|
+
/* @__PURE__ */ s(da, { onLoad: m, loading: a }),
|
|
513
|
+
u && !a && /* @__PURE__ */ s(
|
|
514
|
+
"button",
|
|
515
|
+
{
|
|
516
|
+
className: "commit-flow-page__refresh",
|
|
517
|
+
onClick: f,
|
|
518
|
+
type: "button",
|
|
519
|
+
children: "🔄 Refresh"
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
] }),
|
|
523
|
+
r && /* @__PURE__ */ s("div", { className: "commit-flow-page__error", children: r }),
|
|
524
|
+
e.length > 0 && /* @__PURE__ */ l("div", { className: "commit-flow-page__diagram", children: [
|
|
525
|
+
/* @__PURE__ */ l("div", { className: "commit-flow-page__summary", children: [
|
|
526
|
+
e.length,
|
|
527
|
+
" build",
|
|
528
|
+
e.length !== 1 ? "s" : "",
|
|
529
|
+
" found",
|
|
530
|
+
a && " (loading…)"
|
|
531
|
+
] }),
|
|
532
|
+
/* @__PURE__ */ s(ca, { builds: e, onNodeClick: d })
|
|
533
|
+
] }),
|
|
534
|
+
c && /* @__PURE__ */ s(
|
|
535
|
+
Qt,
|
|
536
|
+
{
|
|
537
|
+
build: c,
|
|
538
|
+
onClose: () => d(null)
|
|
539
|
+
}
|
|
540
|
+
)
|
|
541
|
+
] });
|
|
542
|
+
}
|
|
543
|
+
const Ue = Ut((e) => ({
|
|
10
544
|
org: "",
|
|
11
545
|
project: "",
|
|
12
|
-
setConnection: (
|
|
546
|
+
setConnection: (t, a) => e({ org: t, project: a }),
|
|
13
547
|
selectedPipeline: null,
|
|
14
548
|
selectedPipelineLoading: !1,
|
|
15
549
|
selectedPipelineError: null,
|
|
16
|
-
setSelectedPipeline: (
|
|
17
|
-
selectedPipeline:
|
|
550
|
+
setSelectedPipeline: (t) => e({
|
|
551
|
+
selectedPipeline: t,
|
|
18
552
|
selectedPipelineError: null,
|
|
19
553
|
expandedNodes: /* @__PURE__ */ new Set()
|
|
20
554
|
}),
|
|
21
|
-
setSelectedPipelineLoading: (
|
|
22
|
-
setSelectedPipelineError: (
|
|
23
|
-
expandedTemplates: new Map(
|
|
24
|
-
setExpandedTemplate: (
|
|
25
|
-
const
|
|
26
|
-
return
|
|
555
|
+
setSelectedPipelineLoading: (t) => e({ selectedPipelineLoading: t }),
|
|
556
|
+
setSelectedPipelineError: (t) => e({ selectedPipelineError: t }),
|
|
557
|
+
expandedTemplates: new Map(ua()),
|
|
558
|
+
setExpandedTemplate: (t, a) => e((o) => {
|
|
559
|
+
const r = new Map(o.expandedTemplates);
|
|
560
|
+
return r.set(t, a), ma(r), { expandedTemplates: r };
|
|
27
561
|
}),
|
|
28
562
|
expandedNodes: /* @__PURE__ */ new Set(),
|
|
29
|
-
toggleNode: (
|
|
30
|
-
const
|
|
31
|
-
return
|
|
563
|
+
toggleNode: (t) => e((a) => {
|
|
564
|
+
const o = new Set(a.expandedNodes);
|
|
565
|
+
return o.has(t) ? o.delete(t) : o.add(t), { expandedNodes: o };
|
|
32
566
|
}),
|
|
33
567
|
selectedNodeDetail: null,
|
|
34
|
-
setSelectedNodeDetail: (
|
|
568
|
+
setSelectedNodeDetail: (t) => e({ selectedNodeDetail: t }),
|
|
35
569
|
customTaskDocs: {},
|
|
36
|
-
setCustomTaskDocs: (
|
|
570
|
+
setCustomTaskDocs: (t) => e({ customTaskDocs: t }),
|
|
37
571
|
taskSchema: /* @__PURE__ */ new Map(),
|
|
38
|
-
setTaskSchema: (
|
|
572
|
+
setTaskSchema: (t) => e(() => {
|
|
39
573
|
const a = /* @__PURE__ */ new Map();
|
|
40
|
-
for (const
|
|
41
|
-
a.set(`${
|
|
574
|
+
for (const o of t)
|
|
575
|
+
a.set(`${o.name}@${o.version}`, o);
|
|
42
576
|
return { taskSchema: a };
|
|
43
577
|
})
|
|
44
|
-
})),
|
|
45
|
-
function
|
|
578
|
+
})), _t = "apv-template-cache";
|
|
579
|
+
function ua() {
|
|
46
580
|
try {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
return JSON.parse(
|
|
581
|
+
const e = localStorage.getItem(_t);
|
|
582
|
+
if (e)
|
|
583
|
+
return JSON.parse(e);
|
|
50
584
|
} catch {
|
|
51
585
|
}
|
|
52
586
|
return [];
|
|
53
587
|
}
|
|
54
|
-
function
|
|
588
|
+
function ma(e) {
|
|
55
589
|
try {
|
|
56
|
-
const a = Array.from(
|
|
57
|
-
localStorage.setItem(
|
|
590
|
+
const a = Array.from(e.entries()).slice(-100);
|
|
591
|
+
localStorage.setItem(_t, JSON.stringify(a));
|
|
58
592
|
} catch {
|
|
59
593
|
}
|
|
60
594
|
}
|
|
61
|
-
function
|
|
595
|
+
function ha() {
|
|
62
596
|
const {
|
|
63
|
-
selectedNodeDetail:
|
|
64
|
-
customTaskDocs:
|
|
597
|
+
selectedNodeDetail: e,
|
|
598
|
+
customTaskDocs: t,
|
|
65
599
|
taskSchema: a,
|
|
66
|
-
setSelectedNodeDetail:
|
|
67
|
-
} =
|
|
68
|
-
if (!(
|
|
600
|
+
setSelectedNodeDetail: o
|
|
601
|
+
} = Ue(), r = ve(() => {
|
|
602
|
+
if (!(e != null && e.yaml)) return [];
|
|
69
603
|
try {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
604
|
+
const n = ue(e.yaml);
|
|
605
|
+
return kt(n ?? {});
|
|
72
606
|
} catch {
|
|
73
607
|
return [];
|
|
74
608
|
}
|
|
75
|
-
}, [
|
|
76
|
-
return
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */ s("h3", { className: "detail-panel__title", children:
|
|
609
|
+
}, [e == null ? void 0 : e.yaml]);
|
|
610
|
+
return e ? /* @__PURE__ */ l("div", { className: "detail-panel", children: [
|
|
611
|
+
/* @__PURE__ */ l("div", { className: "detail-panel__header", children: [
|
|
612
|
+
/* @__PURE__ */ l("div", { className: "detail-panel__header-row", children: [
|
|
613
|
+
/* @__PURE__ */ s("h3", { className: "detail-panel__title", children: e.label }),
|
|
80
614
|
/* @__PURE__ */ s(
|
|
81
615
|
"button",
|
|
82
616
|
{
|
|
83
617
|
className: "detail-panel__close",
|
|
84
|
-
onClick: () =>
|
|
618
|
+
onClick: () => o(null),
|
|
85
619
|
"aria-label": "Close detail panel",
|
|
86
620
|
title: "Close",
|
|
87
621
|
children: "✕"
|
|
88
622
|
}
|
|
89
623
|
)
|
|
90
624
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
625
|
+
/* @__PURE__ */ l("div", { className: "detail-panel__path", children: [
|
|
626
|
+
e.filePath,
|
|
627
|
+
e.repoAlias && /* @__PURE__ */ l("span", { className: "detail-panel__repo", children: [
|
|
94
628
|
" ",
|
|
95
629
|
"@",
|
|
96
|
-
|
|
630
|
+
e.repoAlias
|
|
97
631
|
] })
|
|
98
632
|
] })
|
|
99
633
|
] }),
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
634
|
+
r.length > 0 && /* @__PURE__ */ l("div", { className: "detail-panel__tasks", children: [
|
|
635
|
+
/* @__PURE__ */ l("h4", { className: "detail-panel__section-title", children: [
|
|
102
636
|
"Tasks (",
|
|
103
|
-
|
|
637
|
+
r.length,
|
|
104
638
|
")"
|
|
105
639
|
] }),
|
|
106
|
-
/* @__PURE__ */ s("ul", { className: "task-list", children:
|
|
107
|
-
|
|
640
|
+
/* @__PURE__ */ s("ul", { className: "task-list", children: r.map((n) => /* @__PURE__ */ s(
|
|
641
|
+
fa,
|
|
108
642
|
{
|
|
109
|
-
ref_:
|
|
110
|
-
customDocs:
|
|
111
|
-
schemaEntry: a.get(
|
|
643
|
+
ref_: n,
|
|
644
|
+
customDocs: t,
|
|
645
|
+
schemaEntry: a.get(n.raw) ?? a.get(`${n.name}@${n.version}`)
|
|
112
646
|
},
|
|
113
|
-
|
|
647
|
+
n.raw
|
|
114
648
|
)) })
|
|
115
649
|
] }),
|
|
116
650
|
/* @__PURE__ */ s("div", { className: "detail-panel__editor", children: /* @__PURE__ */ s(
|
|
117
|
-
|
|
651
|
+
Bt,
|
|
118
652
|
{
|
|
119
653
|
height: "100%",
|
|
120
654
|
language: "yaml",
|
|
121
|
-
value:
|
|
655
|
+
value: e.yaml,
|
|
122
656
|
theme: "vs-dark",
|
|
123
657
|
options: {
|
|
124
658
|
readOnly: !0,
|
|
@@ -134,58 +668,58 @@ function Lt() {
|
|
|
134
668
|
) })
|
|
135
669
|
] }) : /* @__PURE__ */ s("div", { className: "detail-panel detail-panel--empty", children: /* @__PURE__ */ s("p", { children: "Click a node to view its contents" }) });
|
|
136
670
|
}
|
|
137
|
-
function
|
|
138
|
-
ref_:
|
|
139
|
-
customDocs:
|
|
671
|
+
function fa({
|
|
672
|
+
ref_: e,
|
|
673
|
+
customDocs: t,
|
|
140
674
|
schemaEntry: a
|
|
141
675
|
}) {
|
|
142
|
-
const
|
|
143
|
-
return /* @__PURE__ */
|
|
676
|
+
const o = Tt(e, t);
|
|
677
|
+
return /* @__PURE__ */ l("li", { className: "task-item", children: [
|
|
144
678
|
/* @__PURE__ */ s("span", { className: "task-item__icon", children: "⚙️" }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
679
|
+
/* @__PURE__ */ l("div", { className: "task-item__content", children: [
|
|
680
|
+
o ? /* @__PURE__ */ l(
|
|
147
681
|
"a",
|
|
148
682
|
{
|
|
149
|
-
href:
|
|
683
|
+
href: o,
|
|
150
684
|
target: "_blank",
|
|
151
685
|
rel: "noopener noreferrer",
|
|
152
686
|
className: "task-item__link",
|
|
153
|
-
title: (a == null ? void 0 : a.description) || `Open docs for ${
|
|
687
|
+
title: (a == null ? void 0 : a.description) || `Open docs for ${e.name}`,
|
|
154
688
|
children: [
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */
|
|
689
|
+
e.name,
|
|
690
|
+
/* @__PURE__ */ l("span", { className: "task-item__version", children: [
|
|
157
691
|
"@",
|
|
158
|
-
|
|
692
|
+
e.version
|
|
159
693
|
] }),
|
|
160
694
|
/* @__PURE__ */ s("span", { className: "task-item__external", children: "↗" })
|
|
161
695
|
]
|
|
162
696
|
}
|
|
163
|
-
) : /* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */
|
|
697
|
+
) : /* @__PURE__ */ l("span", { className: "task-item__name", children: [
|
|
698
|
+
e.name,
|
|
699
|
+
/* @__PURE__ */ l("span", { className: "task-item__version", children: [
|
|
166
700
|
"@",
|
|
167
|
-
|
|
701
|
+
e.version
|
|
168
702
|
] })
|
|
169
703
|
] }),
|
|
170
704
|
(a == null ? void 0 : a.description) && /* @__PURE__ */ s("div", { className: "task-item__description", children: a.description })
|
|
171
705
|
] })
|
|
172
706
|
] });
|
|
173
707
|
}
|
|
174
|
-
class
|
|
175
|
-
constructor(
|
|
176
|
-
super(
|
|
708
|
+
class Ee extends yt {
|
|
709
|
+
constructor(t) {
|
|
710
|
+
super(t), this.state = { hasError: !1, error: null };
|
|
177
711
|
}
|
|
178
|
-
static getDerivedStateFromError(
|
|
179
|
-
return { hasError: !0, error:
|
|
712
|
+
static getDerivedStateFromError(t) {
|
|
713
|
+
return { hasError: !0, error: t };
|
|
180
714
|
}
|
|
181
|
-
componentDidCatch(
|
|
182
|
-
console.error("ErrorBoundary caught:",
|
|
715
|
+
componentDidCatch(t, a) {
|
|
716
|
+
console.error("ErrorBoundary caught:", t, a);
|
|
183
717
|
}
|
|
184
718
|
render() {
|
|
185
|
-
var
|
|
186
|
-
return this.state.hasError ? this.props.fallback || /* @__PURE__ */
|
|
719
|
+
var t;
|
|
720
|
+
return this.state.hasError ? this.props.fallback || /* @__PURE__ */ l("div", { className: "error", children: [
|
|
187
721
|
/* @__PURE__ */ s("h3", { children: "Something went wrong" }),
|
|
188
|
-
/* @__PURE__ */ s("p", { children: (
|
|
722
|
+
/* @__PURE__ */ s("p", { children: (t = this.state.error) == null ? void 0 : t.message }),
|
|
189
723
|
/* @__PURE__ */ s(
|
|
190
724
|
"button",
|
|
191
725
|
{
|
|
@@ -197,104 +731,104 @@ class Ie extends pt {
|
|
|
197
731
|
] }) : this.props.children;
|
|
198
732
|
}
|
|
199
733
|
}
|
|
200
|
-
const
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
if (!
|
|
734
|
+
const vt = wt(null), ga = vt.Provider;
|
|
735
|
+
function _a() {
|
|
736
|
+
const e = Pt(vt);
|
|
737
|
+
if (!e)
|
|
204
738
|
throw new Error(
|
|
205
739
|
"useFileFetch must be used within a FileFetchProvider. Wrap your component tree with <FileFetchProvider value={...}>."
|
|
206
740
|
);
|
|
207
|
-
return
|
|
741
|
+
return e;
|
|
208
742
|
}
|
|
209
|
-
const
|
|
210
|
-
function
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
for (const
|
|
214
|
-
|
|
215
|
-
for (const
|
|
216
|
-
|
|
217
|
-
return
|
|
218
|
-
const
|
|
743
|
+
const et = 300, tt = 100;
|
|
744
|
+
function Ke(e, t, a = "TB") {
|
|
745
|
+
const o = new $e.graphlib.Graph();
|
|
746
|
+
o.setDefaultEdgeLabel(() => ({})), o.setGraph({ rankdir: a, ranksep: 80, nodesep: 40 });
|
|
747
|
+
for (const n of e)
|
|
748
|
+
o.setNode(n.id, { width: et, height: tt });
|
|
749
|
+
for (const n of t)
|
|
750
|
+
o.setEdge(n.source, n.target);
|
|
751
|
+
return $e.layout(o), { nodes: e.map((n) => {
|
|
752
|
+
const c = o.node(n.id);
|
|
219
753
|
return {
|
|
220
|
-
...
|
|
754
|
+
...n,
|
|
221
755
|
position: {
|
|
222
|
-
x:
|
|
223
|
-
y:
|
|
756
|
+
x: c.x - et / 2,
|
|
757
|
+
y: c.y - tt / 2
|
|
224
758
|
}
|
|
225
759
|
};
|
|
226
|
-
}), edges:
|
|
760
|
+
}), edges: t };
|
|
227
761
|
}
|
|
228
|
-
function
|
|
229
|
-
var
|
|
230
|
-
const
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
!
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */ s("span", { className: "file-node__icon", children:
|
|
235
|
-
/* @__PURE__ */ s("span", { className: "file-node__label", title:
|
|
236
|
-
/* @__PURE__ */ s("span", { className: "file-node__actions", children:
|
|
762
|
+
function va({ data: e }) {
|
|
763
|
+
var c;
|
|
764
|
+
const t = e, [a, o] = L(!1), r = t.status === "root" ? "file-node--root" : t.status === "expanded" ? "file-node--expanded" : t.status === "loading" ? "file-node--loading" : t.status === "error" ? "file-node--error" : "file-node--collapsed", n = t.repoAlias ? "file-node--cross-repo" : "";
|
|
765
|
+
return /* @__PURE__ */ l("div", { className: `file-node ${r} ${n}`, children: [
|
|
766
|
+
!t.isRoot && /* @__PURE__ */ s(Se, { type: "target", position: Ce.Top }),
|
|
767
|
+
/* @__PURE__ */ l("div", { className: "file-node__header", children: [
|
|
768
|
+
/* @__PURE__ */ s("span", { className: "file-node__icon", children: t.isRoot ? "📄" : t.status === "expanded" ? "📋" : t.repoAlias ? "🔗" : "📁" }),
|
|
769
|
+
/* @__PURE__ */ s("span", { className: "file-node__label", title: t.filePath, children: t.label }),
|
|
770
|
+
/* @__PURE__ */ s("span", { className: "file-node__actions", children: t.adoUrl && /* @__PURE__ */ s(
|
|
237
771
|
"a",
|
|
238
772
|
{
|
|
239
|
-
href:
|
|
773
|
+
href: t.adoUrl,
|
|
240
774
|
target: "_blank",
|
|
241
775
|
rel: "noopener noreferrer",
|
|
242
776
|
className: "file-node__action-btn",
|
|
243
777
|
title: "Open in Azure DevOps",
|
|
244
|
-
onClick: (
|
|
245
|
-
children: /* @__PURE__ */ s(
|
|
778
|
+
onClick: (d) => d.stopPropagation(),
|
|
779
|
+
children: /* @__PURE__ */ s(Na, {})
|
|
246
780
|
}
|
|
247
781
|
) })
|
|
248
782
|
] }),
|
|
249
|
-
|
|
783
|
+
t.repoAlias && /* @__PURE__ */ l(
|
|
250
784
|
"div",
|
|
251
785
|
{
|
|
252
786
|
className: "file-node__repo-row",
|
|
253
|
-
onMouseEnter: () =>
|
|
254
|
-
onMouseLeave: () =>
|
|
787
|
+
onMouseEnter: () => o(!0),
|
|
788
|
+
onMouseLeave: () => o(!1),
|
|
255
789
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ l("span", { className: "file-node__repo", children: [
|
|
257
791
|
"@",
|
|
258
|
-
|
|
792
|
+
t.repoAlias
|
|
259
793
|
] }),
|
|
260
|
-
|
|
261
|
-
/* @__PURE__ */
|
|
794
|
+
t.repoInfo && a && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip", children: [
|
|
795
|
+
/* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
|
|
262
796
|
/* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Repo" }),
|
|
263
|
-
/* @__PURE__ */ s("span", { children:
|
|
797
|
+
/* @__PURE__ */ s("span", { children: t.repoInfo.fullName })
|
|
264
798
|
] }),
|
|
265
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
|
|
266
800
|
/* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Type" }),
|
|
267
|
-
/* @__PURE__ */ s("span", { children:
|
|
801
|
+
/* @__PURE__ */ s("span", { children: t.repoInfo.type })
|
|
268
802
|
] }),
|
|
269
|
-
|
|
803
|
+
t.repoInfo.ref && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
|
|
270
804
|
/* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Ref" }),
|
|
271
|
-
/* @__PURE__ */ s("span", { children:
|
|
805
|
+
/* @__PURE__ */ s("span", { children: t.repoInfo.ref })
|
|
272
806
|
] }),
|
|
273
|
-
|
|
807
|
+
t.repoInfo.project && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
|
|
274
808
|
/* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Project" }),
|
|
275
|
-
/* @__PURE__ */ s("span", { children:
|
|
809
|
+
/* @__PURE__ */ s("span", { children: t.repoInfo.project })
|
|
276
810
|
] })
|
|
277
811
|
] })
|
|
278
812
|
]
|
|
279
813
|
}
|
|
280
814
|
),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
|
|
815
|
+
/* @__PURE__ */ l("div", { className: "file-node__meta", children: [
|
|
816
|
+
t.status === "loading" && /* @__PURE__ */ s("span", { className: "file-node__spinner", children: "⏳ Loading..." }),
|
|
817
|
+
t.status === "error" && /* @__PURE__ */ l("span", { className: "file-node__error", title: t.errorMessage, children: [
|
|
284
818
|
"❌ ",
|
|
285
|
-
(
|
|
819
|
+
(c = t.errorMessage) == null ? void 0 : c.slice(0, 80)
|
|
286
820
|
] }),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
(
|
|
290
|
-
|
|
821
|
+
t.status === "collapsed" && /* @__PURE__ */ s("span", { className: "file-node__hint", children: "Click to expand" }),
|
|
822
|
+
t.status === "expanded" && t.templateCount === 0 && !t.isRoot && /* @__PURE__ */ s("span", { className: "file-node__leaf", children: "✓ no nested templates" }),
|
|
823
|
+
(t.status === "root" || t.status === "expanded") && t.templateCount > 0 && /* @__PURE__ */ l("span", { className: "file-node__count", children: [
|
|
824
|
+
t.templateCount,
|
|
291
825
|
" template ref(s)"
|
|
292
826
|
] })
|
|
293
827
|
] }),
|
|
294
|
-
/* @__PURE__ */ s(
|
|
828
|
+
/* @__PURE__ */ s(Se, { type: "source", position: Ce.Bottom })
|
|
295
829
|
] });
|
|
296
830
|
}
|
|
297
|
-
function
|
|
831
|
+
function Na() {
|
|
298
832
|
return /* @__PURE__ */ s(
|
|
299
833
|
"svg",
|
|
300
834
|
{
|
|
@@ -313,132 +847,132 @@ function Mt() {
|
|
|
313
847
|
}
|
|
314
848
|
);
|
|
315
849
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
318
|
-
className:
|
|
319
|
-
label:
|
|
850
|
+
const ba = Ze(va);
|
|
851
|
+
function Ge({
|
|
852
|
+
className: e,
|
|
853
|
+
label: t,
|
|
320
854
|
children: a
|
|
321
855
|
}) {
|
|
322
|
-
const [
|
|
323
|
-
return /* @__PURE__ */
|
|
856
|
+
const [o, r] = L(!1);
|
|
857
|
+
return /* @__PURE__ */ l(
|
|
324
858
|
"span",
|
|
325
859
|
{
|
|
326
|
-
className:
|
|
327
|
-
onMouseEnter: () =>
|
|
328
|
-
onMouseLeave: () =>
|
|
860
|
+
className: e,
|
|
861
|
+
onMouseEnter: () => r(!0),
|
|
862
|
+
onMouseLeave: () => r(!1),
|
|
329
863
|
children: [
|
|
330
|
-
|
|
331
|
-
|
|
864
|
+
t,
|
|
865
|
+
o && /* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip", children: a })
|
|
332
866
|
]
|
|
333
867
|
}
|
|
334
868
|
);
|
|
335
869
|
}
|
|
336
|
-
function
|
|
337
|
-
id:
|
|
338
|
-
sourceX:
|
|
870
|
+
function ya({
|
|
871
|
+
id: e,
|
|
872
|
+
sourceX: t,
|
|
339
873
|
sourceY: a,
|
|
340
|
-
targetX:
|
|
341
|
-
targetY:
|
|
342
|
-
sourcePosition:
|
|
343
|
-
targetPosition:
|
|
344
|
-
data:
|
|
345
|
-
markerEnd:
|
|
346
|
-
style:
|
|
874
|
+
targetX: o,
|
|
875
|
+
targetY: r,
|
|
876
|
+
sourcePosition: n,
|
|
877
|
+
targetPosition: c,
|
|
878
|
+
data: d,
|
|
879
|
+
markerEnd: u,
|
|
880
|
+
style: h
|
|
347
881
|
}) {
|
|
348
|
-
var
|
|
349
|
-
const
|
|
350
|
-
sourceX:
|
|
882
|
+
var P;
|
|
883
|
+
const i = d, [m, f] = L(!1), [p, w, E] = At({
|
|
884
|
+
sourceX: t,
|
|
351
885
|
sourceY: a,
|
|
352
|
-
sourcePosition:
|
|
353
|
-
targetX:
|
|
354
|
-
targetY:
|
|
355
|
-
targetPosition:
|
|
356
|
-
}),
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */ s(
|
|
359
|
-
/* @__PURE__ */ s(
|
|
886
|
+
sourcePosition: n,
|
|
887
|
+
targetX: o,
|
|
888
|
+
targetY: r,
|
|
889
|
+
targetPosition: c
|
|
890
|
+
}), _ = ne(() => f(!0), []), b = ne(() => f(!1), []), y = ((P = i == null ? void 0 : i.parameterNames) == null ? void 0 : P.length) ?? 0;
|
|
891
|
+
return /* @__PURE__ */ l(Je, { children: [
|
|
892
|
+
/* @__PURE__ */ s(It, { id: e, path: p, markerEnd: u, style: h }),
|
|
893
|
+
/* @__PURE__ */ s(Lt, { children: /* @__PURE__ */ l(
|
|
360
894
|
"div",
|
|
361
895
|
{
|
|
362
896
|
className: "template-edge__label-container",
|
|
363
897
|
style: {
|
|
364
898
|
position: "absolute",
|
|
365
|
-
transform: `translate(-50%, -50%) translate(${
|
|
899
|
+
transform: `translate(-50%, -50%) translate(${w}px,${E}px)`,
|
|
366
900
|
pointerEvents: "all"
|
|
367
901
|
},
|
|
368
902
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */ s("span", { className: "template-edge__category", children:
|
|
371
|
-
(
|
|
372
|
-
|
|
903
|
+
/* @__PURE__ */ l("div", { className: "template-edge__top-row", children: [
|
|
904
|
+
/* @__PURE__ */ s("span", { className: "template-edge__category", children: i == null ? void 0 : i.edgeLabel }),
|
|
905
|
+
(i == null ? void 0 : i.conditional) && /* @__PURE__ */ l(
|
|
906
|
+
Ge,
|
|
373
907
|
{
|
|
374
|
-
className: `template-edge__badge template-edge__badge--conditional${
|
|
375
|
-
label:
|
|
908
|
+
className: `template-edge__badge template-edge__badge--conditional${i.conditionResult === !1 ? " template-edge__badge--condition-false" : i.conditionResult === !0 ? " template-edge__badge--condition-true" : ""}`,
|
|
909
|
+
label: i.conditionResult === !1 ? "⊘ false" : i.conditionResult === !0 ? "✓ conditional" : "conditional",
|
|
376
910
|
children: [
|
|
377
911
|
/* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "⚡ Conditional Reference" }),
|
|
378
|
-
/* @__PURE__ */ s("p", { children:
|
|
379
|
-
|
|
912
|
+
/* @__PURE__ */ s("p", { children: i.conditionResult === !0 ? "Condition evaluated to true — this template will be included." : i.conditionResult === !1 ? "Condition evaluated to false — this template will NOT be included in this pipeline run." : "This template is inside a conditional block. The condition could not be fully evaluated." }),
|
|
913
|
+
i.conditionExpression && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
380
914
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Condition" }),
|
|
381
|
-
/* @__PURE__ */ s("code", { children:
|
|
915
|
+
/* @__PURE__ */ s("code", { children: i.conditionExpression })
|
|
382
916
|
] }),
|
|
383
|
-
|
|
917
|
+
i.conditionResult != null && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
384
918
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Result" }),
|
|
385
|
-
/* @__PURE__ */ s("code", { children: String(
|
|
919
|
+
/* @__PURE__ */ s("code", { children: String(i.conditionResult) })
|
|
386
920
|
] })
|
|
387
921
|
]
|
|
388
922
|
}
|
|
389
923
|
),
|
|
390
|
-
(
|
|
391
|
-
|
|
924
|
+
(i == null ? void 0 : i.dynamicPath) && i.expressionResolved && /* @__PURE__ */ l(
|
|
925
|
+
Ge,
|
|
392
926
|
{
|
|
393
927
|
className: "template-edge__badge template-edge__badge--resolved",
|
|
394
928
|
label: "🔮 resolved",
|
|
395
929
|
children: [
|
|
396
930
|
/* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "🔮 Expression Resolved" }),
|
|
397
931
|
/* @__PURE__ */ s("p", { children: "The template path contained expressions that were successfully evaluated." }),
|
|
398
|
-
/* @__PURE__ */
|
|
932
|
+
/* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
399
933
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
|
|
400
|
-
/* @__PURE__ */ s("code", { children:
|
|
934
|
+
/* @__PURE__ */ s("code", { children: i.originalPath })
|
|
401
935
|
] }),
|
|
402
|
-
|
|
936
|
+
i.resolvedPath && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
403
937
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Resolved" }),
|
|
404
|
-
/* @__PURE__ */ s("code", { children:
|
|
938
|
+
/* @__PURE__ */ s("code", { children: i.resolvedPath })
|
|
405
939
|
] })
|
|
406
940
|
]
|
|
407
941
|
}
|
|
408
942
|
),
|
|
409
|
-
(
|
|
410
|
-
|
|
943
|
+
(i == null ? void 0 : i.dynamicPath) && !i.expressionResolved && /* @__PURE__ */ l(
|
|
944
|
+
Ge,
|
|
411
945
|
{
|
|
412
946
|
className: "template-edge__badge template-edge__badge--unresolved",
|
|
413
947
|
label: "⚠️ dynamic",
|
|
414
948
|
children: [
|
|
415
949
|
/* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "⚠️ Unresolved Expressions" }),
|
|
416
950
|
/* @__PURE__ */ s("p", { children: "The template path contains expressions that could not be evaluated at analysis time." }),
|
|
417
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
418
952
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
|
|
419
|
-
/* @__PURE__ */ s("code", { children:
|
|
953
|
+
/* @__PURE__ */ s("code", { children: i.originalPath })
|
|
420
954
|
] }),
|
|
421
|
-
|
|
955
|
+
i.resolvedPath && i.resolvedPath !== i.originalPath && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
422
956
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Partial" }),
|
|
423
|
-
/* @__PURE__ */ s("code", { children:
|
|
957
|
+
/* @__PURE__ */ s("code", { children: i.resolvedPath })
|
|
424
958
|
] }),
|
|
425
|
-
|
|
959
|
+
i.unresolvedExpressions && i.unresolvedExpressions.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
|
|
426
960
|
/* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Unresolved" }),
|
|
427
|
-
/* @__PURE__ */ s("span", { children:
|
|
961
|
+
/* @__PURE__ */ s("span", { children: i.unresolvedExpressions.join(", ") })
|
|
428
962
|
] })
|
|
429
963
|
]
|
|
430
964
|
}
|
|
431
965
|
)
|
|
432
966
|
] }),
|
|
433
|
-
|
|
967
|
+
y > 0 && /* @__PURE__ */ l(
|
|
434
968
|
"span",
|
|
435
969
|
{
|
|
436
970
|
className: "template-edge__params-badge",
|
|
437
|
-
onMouseEnter:
|
|
438
|
-
onMouseLeave:
|
|
971
|
+
onMouseEnter: _,
|
|
972
|
+
onMouseLeave: b,
|
|
439
973
|
children: [
|
|
440
|
-
|
|
441
|
-
|
|
974
|
+
wa(i),
|
|
975
|
+
m && /* @__PURE__ */ s(Pa, { data: i })
|
|
442
976
|
]
|
|
443
977
|
}
|
|
444
978
|
)
|
|
@@ -447,539 +981,539 @@ function Wt({
|
|
|
447
981
|
) })
|
|
448
982
|
] });
|
|
449
983
|
}
|
|
450
|
-
function
|
|
984
|
+
function wa(e) {
|
|
451
985
|
var a;
|
|
452
|
-
const
|
|
453
|
-
return
|
|
986
|
+
const t = ((a = e.parameterNames) == null ? void 0 : a.length) ?? 0;
|
|
987
|
+
return e.totalParameterCount != null ? `${t}/${e.totalParameterCount} params` : `${t} params`;
|
|
454
988
|
}
|
|
455
|
-
function
|
|
456
|
-
var a,
|
|
457
|
-
const
|
|
458
|
-
(
|
|
459
|
-
var
|
|
460
|
-
return !((
|
|
989
|
+
function Pa({ data: e }) {
|
|
990
|
+
var a, o;
|
|
991
|
+
const t = (a = e.declaredParameterNames) == null ? void 0 : a.filter(
|
|
992
|
+
(r) => {
|
|
993
|
+
var n;
|
|
994
|
+
return !((n = e.parameterNames) != null && n.includes(r));
|
|
461
995
|
}
|
|
462
996
|
);
|
|
463
|
-
return /* @__PURE__ */
|
|
464
|
-
|
|
465
|
-
/* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ l("div", { className: "template-edge__params-tooltip", children: [
|
|
998
|
+
e.parameterNames && e.parameterNames.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__params-section", children: [
|
|
999
|
+
/* @__PURE__ */ l("div", { className: "template-edge__params-heading", children: [
|
|
466
1000
|
"✓ Passed (",
|
|
467
|
-
|
|
1001
|
+
e.parameterNames.length,
|
|
468
1002
|
")"
|
|
469
1003
|
] }),
|
|
470
|
-
/* @__PURE__ */ s("ul", { className: "template-edge__params-list", children:
|
|
1004
|
+
/* @__PURE__ */ s("ul", { className: "template-edge__params-list", children: e.parameterNames.map((r) => /* @__PURE__ */ s(
|
|
471
1005
|
"li",
|
|
472
1006
|
{
|
|
473
1007
|
className: "template-edge__params-item template-edge__params-item--passed",
|
|
474
|
-
children:
|
|
1008
|
+
children: r
|
|
475
1009
|
},
|
|
476
|
-
|
|
1010
|
+
r
|
|
477
1011
|
)) })
|
|
478
1012
|
] }),
|
|
479
|
-
|
|
480
|
-
/* @__PURE__ */
|
|
1013
|
+
t && t.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__params-section", children: [
|
|
1014
|
+
/* @__PURE__ */ l("div", { className: "template-edge__params-heading", children: [
|
|
481
1015
|
"○ Not passed (",
|
|
482
|
-
|
|
1016
|
+
t.length,
|
|
483
1017
|
")"
|
|
484
1018
|
] }),
|
|
485
|
-
/* @__PURE__ */ s("ul", { className: "template-edge__params-list", children:
|
|
1019
|
+
/* @__PURE__ */ s("ul", { className: "template-edge__params-list", children: t.map((r) => /* @__PURE__ */ s(
|
|
486
1020
|
"li",
|
|
487
1021
|
{
|
|
488
1022
|
className: "template-edge__params-item template-edge__params-item--missing",
|
|
489
|
-
children:
|
|
1023
|
+
children: r
|
|
490
1024
|
},
|
|
491
|
-
|
|
1025
|
+
r
|
|
492
1026
|
)) })
|
|
493
1027
|
] }),
|
|
494
|
-
|
|
1028
|
+
e.totalParameterCount == null && !((o = e.declaredParameterNames) != null && o.length) && /* @__PURE__ */ s("div", { className: "template-edge__params-hint", children: "Expand node to see all declared params" })
|
|
495
1029
|
] });
|
|
496
1030
|
}
|
|
497
|
-
const
|
|
1031
|
+
const Ea = Ze(ya), Ra = { fileNode: ba }, xa = { templateEdge: Ea }, ka = {
|
|
498
1032
|
animated: !0,
|
|
499
1033
|
style: { stroke: "var(--accent)", strokeWidth: 2 },
|
|
500
|
-
markerEnd: { type:
|
|
1034
|
+
markerEnd: { type: De.ArrowClosed, color: "var(--accent)" }
|
|
501
1035
|
};
|
|
502
|
-
function
|
|
503
|
-
var le,
|
|
1036
|
+
function Ta() {
|
|
1037
|
+
var le, be;
|
|
504
1038
|
const {
|
|
505
|
-
org:
|
|
506
|
-
project:
|
|
1039
|
+
org: e,
|
|
1040
|
+
project: t,
|
|
507
1041
|
selectedPipeline: a,
|
|
508
|
-
selectedPipelineLoading:
|
|
509
|
-
selectedPipelineError:
|
|
510
|
-
expandedTemplates:
|
|
511
|
-
setExpandedTemplate:
|
|
512
|
-
setSelectedNodeDetail:
|
|
513
|
-
} =
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}, [
|
|
517
|
-
const [
|
|
1042
|
+
selectedPipelineLoading: o,
|
|
1043
|
+
selectedPipelineError: r,
|
|
1044
|
+
expandedTemplates: n,
|
|
1045
|
+
setExpandedTemplate: c,
|
|
1046
|
+
setSelectedNodeDetail: d
|
|
1047
|
+
} = Ue(), u = _a(), [h, i, m] = ct([]), [f, p, w] = dt([]), E = Q(null), _ = Q(null), b = Q(""), y = Q([]);
|
|
1048
|
+
ee(() => {
|
|
1049
|
+
y.current = f;
|
|
1050
|
+
}, [f]);
|
|
1051
|
+
const [P, B] = L(/* @__PURE__ */ new Set()), k = Q(/* @__PURE__ */ new Set()), [T, se] = L(!1), C = ((be = (le = a == null ? void 0 : a.definition) == null ? void 0 : le.repository) == null ? void 0 : be.name) ?? "", V = ve(() => {
|
|
518
1052
|
if (!(a != null && a.yaml)) return [];
|
|
519
1053
|
try {
|
|
520
|
-
const
|
|
521
|
-
return (
|
|
1054
|
+
const N = ue(a.yaml), g = N == null ? void 0 : N.resources;
|
|
1055
|
+
return (g == null ? void 0 : g.repositories) ?? [];
|
|
522
1056
|
} catch {
|
|
523
1057
|
return [];
|
|
524
1058
|
}
|
|
525
|
-
}, [a == null ? void 0 : a.yaml]),
|
|
1059
|
+
}, [a == null ? void 0 : a.yaml]), K = ve(() => {
|
|
526
1060
|
if (!(a != null && a.yaml)) return {};
|
|
527
1061
|
try {
|
|
528
|
-
const
|
|
529
|
-
return Pe(
|
|
1062
|
+
const N = ue(a.yaml);
|
|
1063
|
+
return Pe(N ?? {});
|
|
530
1064
|
} catch {
|
|
531
1065
|
return {};
|
|
532
1066
|
}
|
|
533
1067
|
}, [a == null ? void 0 : a.yaml]);
|
|
534
|
-
|
|
535
|
-
var
|
|
1068
|
+
ee(() => {
|
|
1069
|
+
var R, F, j, ce, de, pe, oe;
|
|
536
1070
|
if (!(a != null && a.yaml)) {
|
|
537
|
-
|
|
1071
|
+
i([]), p([]);
|
|
538
1072
|
return;
|
|
539
1073
|
}
|
|
540
|
-
const
|
|
1074
|
+
const N = ue(a.yaml), g = ((R = a.definition) == null ? void 0 : R.path) ?? "", v = Oe(N ?? {}, { sourcePath: g }), x = ((F = a.definition) == null ? void 0 : F.name) ?? g.split("/").pop() ?? "Pipeline", $ = Ie(g), A = ze(N ?? {}), D = ((ce = (j = a.definition) == null ? void 0 : j.repository) == null ? void 0 : ce.name) ?? "", W = (oe = (pe = (de = a.definition) == null ? void 0 : de.repository) == null ? void 0 : pe.defaultBranch) == null ? void 0 : oe.replace(
|
|
541
1075
|
/^refs\/heads\//,
|
|
542
1076
|
""
|
|
543
|
-
), I =
|
|
544
|
-
org:
|
|
545
|
-
project:
|
|
546
|
-
repoName:
|
|
547
|
-
filePath:
|
|
1077
|
+
), I = e && t && D ? rt({
|
|
1078
|
+
org: e,
|
|
1079
|
+
project: t,
|
|
1080
|
+
repoName: D,
|
|
1081
|
+
filePath: g,
|
|
548
1082
|
branch: W
|
|
549
|
-
}) : void 0,
|
|
1083
|
+
}) : void 0, te = {
|
|
550
1084
|
id: "root",
|
|
551
1085
|
type: "fileNode",
|
|
552
1086
|
position: { x: 0, y: 0 },
|
|
553
1087
|
data: {
|
|
554
|
-
label:
|
|
555
|
-
filePath:
|
|
556
|
-
templateCount:
|
|
1088
|
+
label: x,
|
|
1089
|
+
filePath: g,
|
|
1090
|
+
templateCount: v.length,
|
|
557
1091
|
status: "root",
|
|
558
1092
|
isRoot: !0,
|
|
559
|
-
baseDir:
|
|
1093
|
+
baseDir: $,
|
|
560
1094
|
adoUrl: I
|
|
561
1095
|
}
|
|
562
|
-
}, { templateNodes:
|
|
1096
|
+
}, { templateNodes: H, templateEdges: Z } = qe(
|
|
563
1097
|
"root",
|
|
564
|
-
|
|
565
|
-
t,
|
|
1098
|
+
v,
|
|
566
1099
|
e,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
1100
|
+
t,
|
|
1101
|
+
C,
|
|
1102
|
+
V,
|
|
1103
|
+
A,
|
|
570
1104
|
void 0,
|
|
571
1105
|
// existingNodeIds
|
|
572
|
-
|
|
573
|
-
),
|
|
574
|
-
|
|
575
|
-
|
|
1106
|
+
K
|
|
1107
|
+
), q = [te, ...H], ae = [...Z], { nodes: O, edges: U } = Ke(
|
|
1108
|
+
q,
|
|
1109
|
+
ae
|
|
576
1110
|
);
|
|
577
|
-
|
|
578
|
-
}, [a,
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
if (!
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
584
|
-
return
|
|
585
|
-
var
|
|
586
|
-
(
|
|
1111
|
+
i(O), p(U), k.current = /* @__PURE__ */ new Set();
|
|
1112
|
+
}, [a, i, p]);
|
|
1113
|
+
const fe = Q(!1);
|
|
1114
|
+
ee(() => {
|
|
1115
|
+
if (!T || !E.current || h.length === 0) return;
|
|
1116
|
+
const N = `${h.length}:${f.length}`;
|
|
1117
|
+
if (N !== b.current)
|
|
1118
|
+
return b.current = N, _.current != null && cancelAnimationFrame(_.current), _.current = requestAnimationFrame(() => {
|
|
1119
|
+
var g;
|
|
1120
|
+
(g = E.current) == null || g.fitView({
|
|
587
1121
|
padding: 0.2,
|
|
588
1122
|
duration: 300
|
|
589
|
-
}),
|
|
1123
|
+
}), _.current = null;
|
|
590
1124
|
}), () => {
|
|
591
|
-
|
|
1125
|
+
_.current != null && (cancelAnimationFrame(_.current), _.current = null);
|
|
592
1126
|
};
|
|
593
|
-
}, [
|
|
594
|
-
if (
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
return !(
|
|
1127
|
+
}, [T, h.length, f.length]), ee(() => {
|
|
1128
|
+
if (fe.current) return;
|
|
1129
|
+
const N = h.filter((g) => {
|
|
1130
|
+
const v = g.data;
|
|
1131
|
+
if (v.status !== "collapsed" || k.current.has(g.id) || P.has(g.id)) return !1;
|
|
1132
|
+
const x = v._conditionResult;
|
|
1133
|
+
return !(x === !1 || x === "unknown" && !T);
|
|
600
1134
|
});
|
|
601
|
-
if (
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
return
|
|
1135
|
+
if (N.length !== 0) {
|
|
1136
|
+
N.sort((g, v) => {
|
|
1137
|
+
const x = g.data.templateLocation === "variables" ? 0 : 1, $ = v.data.templateLocation === "variables" ? 0 : 1;
|
|
1138
|
+
return x - $;
|
|
605
1139
|
});
|
|
606
|
-
for (const
|
|
607
|
-
const
|
|
608
|
-
|
|
1140
|
+
for (const g of N) {
|
|
1141
|
+
const v = g.data;
|
|
1142
|
+
v.dynamicPath && !v.expressionResolved || k.current.add(g.id);
|
|
609
1143
|
}
|
|
610
|
-
|
|
611
|
-
for (const
|
|
612
|
-
const
|
|
613
|
-
if (!(
|
|
1144
|
+
fe.current = !0, (async () => {
|
|
1145
|
+
for (const g of N) {
|
|
1146
|
+
const v = g.data;
|
|
1147
|
+
if (!(v.dynamicPath && !v.expressionResolved))
|
|
614
1148
|
try {
|
|
615
|
-
const { content:
|
|
616
|
-
t,
|
|
1149
|
+
const { content: x, actualPath: $ } = await Ye(
|
|
617
1150
|
e,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
1151
|
+
t,
|
|
1152
|
+
C,
|
|
1153
|
+
v,
|
|
1154
|
+
V,
|
|
1155
|
+
n,
|
|
1156
|
+
c,
|
|
1157
|
+
u
|
|
1158
|
+
), A = ue(x) ?? {}, D = v._ref, W = Oe(A, {
|
|
1159
|
+
contextRepoAlias: ie(D ?? {}),
|
|
1160
|
+
sourcePath: $
|
|
1161
|
+
}), I = Qe(A);
|
|
628
1162
|
if (W.length === 0) {
|
|
629
|
-
const
|
|
630
|
-
if (
|
|
631
|
-
for (const U of
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
const F =
|
|
1163
|
+
const H = v.templateLocation === "variables" ? Pe(A) : void 0, Z = H && Object.keys(H).length > 0, q = /* @__PURE__ */ new Set(), ae = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
|
|
1164
|
+
if (Z)
|
|
1165
|
+
for (const U of h) {
|
|
1166
|
+
const R = U.data;
|
|
1167
|
+
if (R.dynamicPath && !R.expressionResolved) {
|
|
1168
|
+
const F = xe(
|
|
635
1169
|
U,
|
|
636
|
-
|
|
637
|
-
t,
|
|
1170
|
+
H,
|
|
638
1171
|
e,
|
|
639
|
-
|
|
640
|
-
|
|
1172
|
+
t,
|
|
1173
|
+
C,
|
|
1174
|
+
V
|
|
641
1175
|
);
|
|
642
1176
|
if (F !== U) {
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
|
|
1177
|
+
q.add(U.id);
|
|
1178
|
+
const j = F.data;
|
|
1179
|
+
j.repoAlias && ae.add(U.id), O.set(U.id, j.filePath);
|
|
646
1180
|
}
|
|
647
1181
|
}
|
|
648
1182
|
}
|
|
649
|
-
|
|
650
|
-
(U) => U.map((
|
|
651
|
-
...
|
|
1183
|
+
i(
|
|
1184
|
+
(U) => U.map((R) => R.id === g.id ? {
|
|
1185
|
+
...R,
|
|
652
1186
|
data: {
|
|
653
|
-
...
|
|
1187
|
+
...R.data,
|
|
654
1188
|
status: "expanded",
|
|
655
1189
|
templateCount: 0,
|
|
656
1190
|
totalParameterCount: I.length || void 0,
|
|
657
1191
|
declaredParameterNames: I.length ? I : void 0
|
|
658
1192
|
}
|
|
659
|
-
} :
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
t,
|
|
1193
|
+
} : Z && q.has(R.id) ? xe(
|
|
1194
|
+
R,
|
|
1195
|
+
H,
|
|
663
1196
|
e,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
1197
|
+
t,
|
|
1198
|
+
C,
|
|
1199
|
+
V
|
|
1200
|
+
) : R)
|
|
1201
|
+
), q.size > 0 && p(
|
|
1202
|
+
(U) => U.map((R) => {
|
|
1203
|
+
if (!q.has(R.target)) return R;
|
|
1204
|
+
const F = R.data;
|
|
1205
|
+
if (!(F != null && F.dynamicPath)) return R;
|
|
1206
|
+
const j = ae.has(R.target);
|
|
673
1207
|
return {
|
|
674
|
-
...
|
|
1208
|
+
...R,
|
|
675
1209
|
data: {
|
|
676
1210
|
...F,
|
|
677
1211
|
expressionResolved: !0,
|
|
678
|
-
isExternal:
|
|
679
|
-
resolvedPath: O.get(
|
|
1212
|
+
isExternal: j || F.isExternal || void 0,
|
|
1213
|
+
resolvedPath: O.get(R.target) ?? F.resolvedPath,
|
|
680
1214
|
unresolvedExpressions: void 0
|
|
681
1215
|
},
|
|
682
|
-
style:
|
|
1216
|
+
style: j ? {
|
|
683
1217
|
stroke: "var(--badge-resources)",
|
|
684
1218
|
strokeWidth: 2,
|
|
685
1219
|
strokeDasharray: "6 3"
|
|
686
|
-
} :
|
|
687
|
-
markerEnd:
|
|
688
|
-
type:
|
|
1220
|
+
} : R.style,
|
|
1221
|
+
markerEnd: j ? {
|
|
1222
|
+
type: De.ArrowClosed,
|
|
689
1223
|
color: "var(--badge-resources)"
|
|
690
|
-
} :
|
|
1224
|
+
} : R.markerEnd
|
|
691
1225
|
};
|
|
692
1226
|
})
|
|
693
1227
|
);
|
|
694
|
-
} else if (
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
), O = { ...
|
|
700
|
-
...
|
|
1228
|
+
} else if (T) {
|
|
1229
|
+
const te = ze(A), H = v._parentParamContext, Z = v._accumulatedVariables, q = D == null ? void 0 : D.parameters, ae = Ae(
|
|
1230
|
+
q,
|
|
1231
|
+
H,
|
|
1232
|
+
Z
|
|
1233
|
+
), O = { ...te, ...ae }, U = Pe(A), R = {
|
|
1234
|
+
...Z ?? K,
|
|
701
1235
|
...U
|
|
702
|
-
}, F =
|
|
703
|
-
...F ??
|
|
704
|
-
...
|
|
1236
|
+
}, F = v._accumulatedResources, j = at(A), ce = nt([
|
|
1237
|
+
...F ?? V,
|
|
1238
|
+
...j
|
|
705
1239
|
]);
|
|
706
|
-
await new Promise((
|
|
707
|
-
const
|
|
708
|
-
|
|
1240
|
+
await new Promise((z) => setTimeout(z, 0));
|
|
1241
|
+
const de = new Set(h.map((z) => z.id)), { templateNodes: pe, templateEdges: oe } = qe(
|
|
1242
|
+
g.id,
|
|
709
1243
|
W,
|
|
710
|
-
t,
|
|
711
1244
|
e,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
O,
|
|
1245
|
+
t,
|
|
1246
|
+
C,
|
|
715
1247
|
ce,
|
|
716
|
-
|
|
1248
|
+
O,
|
|
1249
|
+
de,
|
|
1250
|
+
R
|
|
717
1251
|
);
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
(
|
|
721
|
-
),
|
|
722
|
-
(
|
|
723
|
-
...
|
|
1252
|
+
i((z) => {
|
|
1253
|
+
const re = new Set(z.map((S) => S.id)), ye = pe.filter(
|
|
1254
|
+
(S) => !re.has(S.id)
|
|
1255
|
+
), we = [...z.map(
|
|
1256
|
+
(S) => S.id === g.id ? {
|
|
1257
|
+
...S,
|
|
724
1258
|
data: {
|
|
725
|
-
...
|
|
1259
|
+
...S.data,
|
|
726
1260
|
status: "expanded",
|
|
727
1261
|
templateCount: W.length,
|
|
728
1262
|
totalParameterCount: I.length || void 0,
|
|
729
1263
|
declaredParameterNames: I.length ? I : void 0
|
|
730
1264
|
}
|
|
731
|
-
} :
|
|
732
|
-
), ...ye],
|
|
733
|
-
|
|
734
|
-
|
|
1265
|
+
} : S
|
|
1266
|
+
), ...ye], Y = [...I.length ? Re(
|
|
1267
|
+
y.current,
|
|
1268
|
+
g.id,
|
|
735
1269
|
I
|
|
736
|
-
) :
|
|
737
|
-
return
|
|
738
|
-
}),
|
|
739
|
-
|
|
740
|
-
|
|
1270
|
+
) : y.current, ...oe];
|
|
1271
|
+
return Ke(we, Y).nodes;
|
|
1272
|
+
}), p((z) => [...I.length ? Re(
|
|
1273
|
+
z,
|
|
1274
|
+
g.id,
|
|
741
1275
|
I
|
|
742
|
-
) :
|
|
1276
|
+
) : z, ...oe]), await new Promise((z) => setTimeout(z, 50));
|
|
743
1277
|
}
|
|
744
1278
|
} catch {
|
|
745
1279
|
}
|
|
746
1280
|
}
|
|
747
|
-
|
|
1281
|
+
fe.current = !1, T && i((g) => [...g]);
|
|
748
1282
|
})();
|
|
749
1283
|
}
|
|
750
1284
|
}, [
|
|
751
|
-
|
|
752
|
-
t,
|
|
1285
|
+
h,
|
|
753
1286
|
e,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
1287
|
+
t,
|
|
1288
|
+
C,
|
|
1289
|
+
V,
|
|
1290
|
+
n,
|
|
1291
|
+
c,
|
|
1292
|
+
P,
|
|
760
1293
|
i,
|
|
761
|
-
|
|
762
|
-
|
|
1294
|
+
p,
|
|
1295
|
+
T,
|
|
1296
|
+
u
|
|
763
1297
|
]);
|
|
764
|
-
const
|
|
765
|
-
async (
|
|
766
|
-
const
|
|
767
|
-
if (
|
|
768
|
-
|
|
769
|
-
nodeId:
|
|
770
|
-
label:
|
|
771
|
-
filePath:
|
|
1298
|
+
const G = ne(
|
|
1299
|
+
async (N, g) => {
|
|
1300
|
+
const v = g.data;
|
|
1301
|
+
if (v.status === "root" && (a != null && a.yaml)) {
|
|
1302
|
+
d({
|
|
1303
|
+
nodeId: g.id,
|
|
1304
|
+
label: v.label,
|
|
1305
|
+
filePath: v.filePath,
|
|
772
1306
|
yaml: a.yaml
|
|
773
1307
|
});
|
|
774
1308
|
return;
|
|
775
1309
|
}
|
|
776
|
-
if (
|
|
777
|
-
const
|
|
1310
|
+
if (v.status === "expanded") {
|
|
1311
|
+
const x = v._ref, $ = ie(x ?? {}) || "", A = `${$}:${v.filePath}`, D = v._fallbackPath, W = D ? `${$}:${D}` : void 0, I = n.get(A) ?? (W ? n.get(W) : void 0);
|
|
778
1312
|
if (I) {
|
|
779
|
-
|
|
780
|
-
nodeId:
|
|
781
|
-
label:
|
|
782
|
-
filePath:
|
|
1313
|
+
d({
|
|
1314
|
+
nodeId: g.id,
|
|
1315
|
+
label: v.label,
|
|
1316
|
+
filePath: v.filePath,
|
|
783
1317
|
yaml: I,
|
|
784
|
-
repoAlias:
|
|
1318
|
+
repoAlias: v.repoAlias
|
|
785
1319
|
});
|
|
786
1320
|
return;
|
|
787
1321
|
}
|
|
788
1322
|
try {
|
|
789
|
-
const { content:
|
|
790
|
-
t,
|
|
1323
|
+
const { content: te } = await Ye(
|
|
791
1324
|
e,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1325
|
+
t,
|
|
1326
|
+
C,
|
|
1327
|
+
v,
|
|
1328
|
+
V,
|
|
1329
|
+
n,
|
|
1330
|
+
c,
|
|
1331
|
+
u
|
|
798
1332
|
);
|
|
799
|
-
|
|
800
|
-
nodeId:
|
|
801
|
-
label:
|
|
802
|
-
filePath:
|
|
803
|
-
yaml:
|
|
804
|
-
repoAlias:
|
|
1333
|
+
d({
|
|
1334
|
+
nodeId: g.id,
|
|
1335
|
+
label: v.label,
|
|
1336
|
+
filePath: v.filePath,
|
|
1337
|
+
yaml: te,
|
|
1338
|
+
repoAlias: v.repoAlias
|
|
805
1339
|
});
|
|
806
1340
|
} catch {
|
|
807
1341
|
}
|
|
808
1342
|
return;
|
|
809
1343
|
}
|
|
810
|
-
if (
|
|
811
|
-
|
|
812
|
-
(
|
|
813
|
-
(
|
|
1344
|
+
if (v.status === "collapsed" && !P.has(g.id)) {
|
|
1345
|
+
B((x) => new Set(x).add(g.id)), i(
|
|
1346
|
+
(x) => x.map(
|
|
1347
|
+
($) => $.id === g.id ? { ...$, data: { ...$.data, status: "loading" } } : $
|
|
814
1348
|
)
|
|
815
1349
|
);
|
|
816
1350
|
try {
|
|
817
|
-
const { content:
|
|
818
|
-
t,
|
|
1351
|
+
const { content: x, actualPath: $ } = await Ye(
|
|
819
1352
|
e,
|
|
820
|
-
$,
|
|
821
|
-
u,
|
|
822
|
-
z,
|
|
823
|
-
o,
|
|
824
|
-
m,
|
|
825
|
-
v
|
|
826
|
-
), D = pe(E) ?? {}, C = u._ref, W = Se(D, {
|
|
827
|
-
contextRepoAlias: re(C ?? {}),
|
|
828
|
-
sourcePath: A
|
|
829
|
-
}), I = De(D), Q = u._parentParamContext, j = u._accumulatedVariables, J = C == null ? void 0 : C.parameters, Y = ke(
|
|
830
|
-
J,
|
|
831
|
-
Q,
|
|
832
|
-
j
|
|
833
|
-
), ee = { ...I, ...Y }, O = je(D), U = Ae(A), w = Pe(D), F = {
|
|
834
|
-
...j ?? H,
|
|
835
|
-
...w
|
|
836
|
-
}, B = u._accumulatedResources, ie = qe(D), ce = Je([
|
|
837
|
-
...B ?? z,
|
|
838
|
-
...ie
|
|
839
|
-
]), de = new Set(d.map((V) => V.id)), { templateNodes: ne, templateEdges: M } = Ue(
|
|
840
|
-
p.id,
|
|
841
|
-
W,
|
|
842
1353
|
t,
|
|
1354
|
+
C,
|
|
1355
|
+
v,
|
|
1356
|
+
V,
|
|
1357
|
+
n,
|
|
1358
|
+
c,
|
|
1359
|
+
u
|
|
1360
|
+
), A = ue(x) ?? {}, D = v._ref, W = Oe(A, {
|
|
1361
|
+
contextRepoAlias: ie(D ?? {}),
|
|
1362
|
+
sourcePath: $
|
|
1363
|
+
}), I = ze(A), te = v._parentParamContext, H = v._accumulatedVariables, Z = D == null ? void 0 : D.parameters, q = Ae(
|
|
1364
|
+
Z,
|
|
1365
|
+
te,
|
|
1366
|
+
H
|
|
1367
|
+
), ae = { ...I, ...q }, O = Qe(A), U = Ie($), R = Pe(A), F = {
|
|
1368
|
+
...H ?? K,
|
|
1369
|
+
...R
|
|
1370
|
+
}, j = v._accumulatedResources, ce = at(A), de = nt([
|
|
1371
|
+
...j ?? V,
|
|
1372
|
+
...ce
|
|
1373
|
+
]), pe = new Set(h.map((M) => M.id)), { templateNodes: oe, templateEdges: z } = qe(
|
|
1374
|
+
g.id,
|
|
1375
|
+
W,
|
|
843
1376
|
e,
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
ee,
|
|
1377
|
+
t,
|
|
1378
|
+
C,
|
|
847
1379
|
de,
|
|
1380
|
+
ae,
|
|
1381
|
+
pe,
|
|
848
1382
|
F
|
|
849
|
-
),
|
|
850
|
-
if (
|
|
851
|
-
for (const
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
t,
|
|
1383
|
+
), re = /* @__PURE__ */ new Set(), ye = /* @__PURE__ */ new Set(), Ve = /* @__PURE__ */ new Map(), we = v.templateLocation === "variables" && Object.keys(R).length > 0;
|
|
1384
|
+
if (we)
|
|
1385
|
+
for (const M of h) {
|
|
1386
|
+
const Y = M.data;
|
|
1387
|
+
if (Y.dynamicPath && !Y.expressionResolved) {
|
|
1388
|
+
const S = xe(
|
|
1389
|
+
M,
|
|
1390
|
+
R,
|
|
858
1391
|
e,
|
|
859
|
-
|
|
860
|
-
|
|
1392
|
+
t,
|
|
1393
|
+
C,
|
|
1394
|
+
V
|
|
861
1395
|
);
|
|
862
|
-
if (
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
1396
|
+
if (S !== M) {
|
|
1397
|
+
re.add(M.id);
|
|
1398
|
+
const J = S.data;
|
|
1399
|
+
J.repoAlias && ye.add(M.id), Ve.set(M.id, J.filePath);
|
|
866
1400
|
}
|
|
867
1401
|
}
|
|
868
1402
|
}
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
...
|
|
1403
|
+
i((M) => {
|
|
1404
|
+
const Y = new Set(M.map((X) => X.id)), S = oe.filter((X) => !Y.has(X.id)), ge = [...M.map((X) => X.id === g.id ? {
|
|
1405
|
+
...X,
|
|
872
1406
|
data: {
|
|
873
|
-
...
|
|
1407
|
+
...X.data,
|
|
874
1408
|
status: "expanded",
|
|
875
1409
|
templateCount: W.length,
|
|
876
1410
|
totalParameterCount: O.length || void 0,
|
|
877
1411
|
declaredParameterNames: O.length ? O : void 0
|
|
878
1412
|
}
|
|
879
|
-
} :
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
t,
|
|
1413
|
+
} : we && re.has(X.id) ? xe(
|
|
1414
|
+
X,
|
|
1415
|
+
R,
|
|
883
1416
|
e,
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1417
|
+
t,
|
|
1418
|
+
C,
|
|
1419
|
+
V
|
|
1420
|
+
) : X), ...S], bt = [...O.length ? Re(
|
|
1421
|
+
y.current,
|
|
1422
|
+
g.id,
|
|
889
1423
|
O
|
|
890
|
-
) :
|
|
891
|
-
return
|
|
892
|
-
}),
|
|
893
|
-
let
|
|
894
|
-
|
|
895
|
-
|
|
1424
|
+
) : y.current, ...z];
|
|
1425
|
+
return Ke(ge, bt).nodes;
|
|
1426
|
+
}), p((M) => {
|
|
1427
|
+
let Y = O.length ? Re(
|
|
1428
|
+
M,
|
|
1429
|
+
g.id,
|
|
896
1430
|
O
|
|
897
|
-
) :
|
|
898
|
-
return
|
|
899
|
-
if (!
|
|
900
|
-
const
|
|
901
|
-
if (!(
|
|
902
|
-
const
|
|
1431
|
+
) : M;
|
|
1432
|
+
return re.size > 0 && (Y = Y.map((S) => {
|
|
1433
|
+
if (!re.has(S.target)) return S;
|
|
1434
|
+
const J = S.data;
|
|
1435
|
+
if (!(J != null && J.dynamicPath)) return S;
|
|
1436
|
+
const ge = ye.has(S.target);
|
|
903
1437
|
return {
|
|
904
|
-
...
|
|
1438
|
+
...S,
|
|
905
1439
|
data: {
|
|
906
|
-
...
|
|
1440
|
+
...J,
|
|
907
1441
|
expressionResolved: !0,
|
|
908
|
-
isExternal:
|
|
909
|
-
resolvedPath:
|
|
1442
|
+
isExternal: ge || J.isExternal || void 0,
|
|
1443
|
+
resolvedPath: Ve.get(S.target) ?? J.resolvedPath,
|
|
910
1444
|
unresolvedExpressions: void 0
|
|
911
1445
|
},
|
|
912
|
-
style:
|
|
1446
|
+
style: ge ? {
|
|
913
1447
|
stroke: "var(--badge-resources)",
|
|
914
1448
|
strokeWidth: 2,
|
|
915
1449
|
strokeDasharray: "6 3"
|
|
916
|
-
} :
|
|
917
|
-
markerEnd:
|
|
918
|
-
type:
|
|
1450
|
+
} : S.style,
|
|
1451
|
+
markerEnd: ge ? {
|
|
1452
|
+
type: De.ArrowClosed,
|
|
919
1453
|
color: "var(--badge-resources)"
|
|
920
|
-
} :
|
|
1454
|
+
} : S.markerEnd
|
|
921
1455
|
};
|
|
922
|
-
})), [...
|
|
923
|
-
}),
|
|
924
|
-
nodeId:
|
|
925
|
-
label:
|
|
926
|
-
filePath:
|
|
927
|
-
yaml:
|
|
928
|
-
repoAlias:
|
|
1456
|
+
})), [...Y, ...z];
|
|
1457
|
+
}), d({
|
|
1458
|
+
nodeId: g.id,
|
|
1459
|
+
label: v.label,
|
|
1460
|
+
filePath: v.filePath,
|
|
1461
|
+
yaml: x,
|
|
1462
|
+
repoAlias: v.repoAlias
|
|
929
1463
|
});
|
|
930
|
-
} catch (
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
(
|
|
934
|
-
(
|
|
935
|
-
...
|
|
936
|
-
data: { ...
|
|
937
|
-
} :
|
|
1464
|
+
} catch (x) {
|
|
1465
|
+
const $ = x instanceof Error ? x.message : String(x);
|
|
1466
|
+
i(
|
|
1467
|
+
(A) => A.map(
|
|
1468
|
+
(D) => D.id === g.id ? {
|
|
1469
|
+
...D,
|
|
1470
|
+
data: { ...D.data, status: "error", errorMessage: $ }
|
|
1471
|
+
} : D
|
|
938
1472
|
)
|
|
939
1473
|
);
|
|
940
1474
|
} finally {
|
|
941
|
-
|
|
942
|
-
const
|
|
943
|
-
return
|
|
1475
|
+
B((x) => {
|
|
1476
|
+
const $ = new Set(x);
|
|
1477
|
+
return $.delete(g.id), $;
|
|
944
1478
|
});
|
|
945
1479
|
}
|
|
946
1480
|
}
|
|
947
1481
|
},
|
|
948
1482
|
[
|
|
949
|
-
t,
|
|
950
1483
|
e,
|
|
951
|
-
|
|
1484
|
+
t,
|
|
1485
|
+
C,
|
|
952
1486
|
a,
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1487
|
+
V,
|
|
1488
|
+
n,
|
|
1489
|
+
c,
|
|
1490
|
+
d,
|
|
956
1491
|
P,
|
|
957
|
-
_,
|
|
958
|
-
r,
|
|
959
1492
|
i,
|
|
960
|
-
|
|
1493
|
+
p,
|
|
1494
|
+
u
|
|
961
1495
|
]
|
|
962
|
-
),
|
|
963
|
-
|
|
1496
|
+
), Me = ne(() => {
|
|
1497
|
+
se((N) => (N || (k.current = /* @__PURE__ */ new Set(), b.current = ""), !N));
|
|
964
1498
|
}, []);
|
|
965
|
-
return
|
|
1499
|
+
return o ? /* @__PURE__ */ s("div", { className: "pipeline-tree__empty", children: /* @__PURE__ */ l("div", { className: "loading-indicator", children: [
|
|
966
1500
|
/* @__PURE__ */ s("span", { className: "loading-indicator__spinner", children: "⏳" }),
|
|
967
1501
|
/* @__PURE__ */ s("span", { children: "Loading pipeline..." })
|
|
968
|
-
] }) }) :
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
|
|
1502
|
+
] }) }) : r ? /* @__PURE__ */ s("div", { className: "error", children: r }) : a ? /* @__PURE__ */ l("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
|
|
1503
|
+
/* @__PURE__ */ l(
|
|
1504
|
+
pt,
|
|
971
1505
|
{
|
|
972
|
-
nodes:
|
|
973
|
-
edges:
|
|
974
|
-
onInit: (
|
|
975
|
-
|
|
1506
|
+
nodes: h,
|
|
1507
|
+
edges: f,
|
|
1508
|
+
onInit: (N) => {
|
|
1509
|
+
E.current = N;
|
|
976
1510
|
},
|
|
977
|
-
onNodesChange:
|
|
978
|
-
onEdgesChange:
|
|
979
|
-
onNodeClick:
|
|
980
|
-
nodeTypes:
|
|
981
|
-
edgeTypes:
|
|
982
|
-
defaultEdgeOptions:
|
|
1511
|
+
onNodesChange: m,
|
|
1512
|
+
onEdgesChange: w,
|
|
1513
|
+
onNodeClick: G,
|
|
1514
|
+
nodeTypes: Ra,
|
|
1515
|
+
edgeTypes: xa,
|
|
1516
|
+
defaultEdgeOptions: ka,
|
|
983
1517
|
fitView: !0,
|
|
984
1518
|
fitViewOptions: { padding: 0.2 },
|
|
985
1519
|
minZoom: 0.1,
|
|
@@ -987,521 +1521,434 @@ function qt() {
|
|
|
987
1521
|
proOptions: { hideAttribution: !0 },
|
|
988
1522
|
children: [
|
|
989
1523
|
/* @__PURE__ */ s(
|
|
990
|
-
|
|
1524
|
+
ut,
|
|
991
1525
|
{
|
|
992
|
-
variant:
|
|
1526
|
+
variant: Ft.Dots,
|
|
993
1527
|
color: "var(--border)",
|
|
994
1528
|
gap: 20
|
|
995
1529
|
}
|
|
996
1530
|
),
|
|
997
|
-
/* @__PURE__ */ s(
|
|
1531
|
+
/* @__PURE__ */ s(mt, {})
|
|
998
1532
|
]
|
|
999
1533
|
}
|
|
1000
1534
|
),
|
|
1001
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ l("label", { className: "auto-expand-toggle", children: [
|
|
1002
1536
|
/* @__PURE__ */ s(
|
|
1003
1537
|
"input",
|
|
1004
1538
|
{
|
|
1005
1539
|
type: "checkbox",
|
|
1006
|
-
checked:
|
|
1007
|
-
onChange:
|
|
1540
|
+
checked: T,
|
|
1541
|
+
onChange: Me
|
|
1008
1542
|
}
|
|
1009
1543
|
),
|
|
1010
1544
|
/* @__PURE__ */ s("span", { children: "Auto-expand all" })
|
|
1011
1545
|
] })
|
|
1012
1546
|
] }) : /* @__PURE__ */ s("div", { className: "pipeline-tree__empty", children: "Select a pipeline to visualize" });
|
|
1013
1547
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1548
|
+
function Re(e, t, a) {
|
|
1549
|
+
return e.map((o) => {
|
|
1550
|
+
if (o.target !== t) return o;
|
|
1551
|
+
const r = o.data ?? {};
|
|
1018
1552
|
return {
|
|
1019
|
-
...
|
|
1553
|
+
...o,
|
|
1020
1554
|
data: {
|
|
1021
|
-
...
|
|
1555
|
+
...r,
|
|
1022
1556
|
totalParameterCount: a.length,
|
|
1023
1557
|
declaredParameterNames: a
|
|
1024
1558
|
}
|
|
1025
1559
|
};
|
|
1026
1560
|
});
|
|
1027
1561
|
}
|
|
1028
|
-
function
|
|
1029
|
-
if (!
|
|
1030
|
-
return
|
|
1031
|
-
const
|
|
1032
|
-
for (const [
|
|
1033
|
-
if (typeof
|
|
1034
|
-
const { result:
|
|
1035
|
-
parameters:
|
|
1562
|
+
function Ae(e, t, a) {
|
|
1563
|
+
if (!e || !t && !a)
|
|
1564
|
+
return e;
|
|
1565
|
+
const o = {};
|
|
1566
|
+
for (const [r, n] of Object.entries(e))
|
|
1567
|
+
if (typeof n == "string" && me(n)) {
|
|
1568
|
+
const { result: c, isFullyResolved: d } = Ct(n, {
|
|
1569
|
+
parameters: t,
|
|
1036
1570
|
variables: a
|
|
1037
1571
|
});
|
|
1038
|
-
|
|
1039
|
-
} else
|
|
1040
|
-
|
|
1041
|
-
|
|
1572
|
+
o[r] = d ? $a(c) : n;
|
|
1573
|
+
} else n && typeof n == "object" && !Array.isArray(n) ? o[r] = Ae(
|
|
1574
|
+
n,
|
|
1575
|
+
t,
|
|
1042
1576
|
a
|
|
1043
|
-
) ??
|
|
1044
|
-
return
|
|
1577
|
+
) ?? n : o[r] = n;
|
|
1578
|
+
return o;
|
|
1045
1579
|
}
|
|
1046
|
-
function
|
|
1047
|
-
if (
|
|
1048
|
-
if (
|
|
1049
|
-
if (
|
|
1050
|
-
if (
|
|
1580
|
+
function $a(e) {
|
|
1581
|
+
if (e === "True" || e === "true") return !0;
|
|
1582
|
+
if (e === "False" || e === "false") return !1;
|
|
1583
|
+
if (e === "null") return null;
|
|
1584
|
+
if (e.startsWith("{") && e.endsWith("}") || e.startsWith("[") && e.endsWith("]"))
|
|
1051
1585
|
try {
|
|
1052
|
-
return JSON.parse(
|
|
1586
|
+
return JSON.parse(e);
|
|
1053
1587
|
} catch {
|
|
1054
1588
|
}
|
|
1055
|
-
return
|
|
1589
|
+
return e;
|
|
1056
1590
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const
|
|
1059
|
-
if (!
|
|
1060
|
-
const a =
|
|
1591
|
+
function at(e) {
|
|
1592
|
+
const t = e.resources;
|
|
1593
|
+
if (!t) return [];
|
|
1594
|
+
const a = t.repositories;
|
|
1061
1595
|
return Array.isArray(a) ? a.filter(
|
|
1062
|
-
(
|
|
1596
|
+
(o) => o != null && typeof o == "object" && "repository" in o && "name" in o && typeof o.repository == "string" && typeof o.name == "string"
|
|
1063
1597
|
) : [];
|
|
1064
1598
|
}
|
|
1065
|
-
function
|
|
1066
|
-
const
|
|
1067
|
-
for (const a of
|
|
1068
|
-
|
|
1069
|
-
return Array.from(
|
|
1599
|
+
function nt(e) {
|
|
1600
|
+
const t = /* @__PURE__ */ new Map();
|
|
1601
|
+
for (const a of e)
|
|
1602
|
+
t.set(a.repository, a);
|
|
1603
|
+
return Array.from(t.values());
|
|
1070
1604
|
}
|
|
1071
|
-
function
|
|
1072
|
-
return `tpl::${
|
|
1605
|
+
function Sa(e, t) {
|
|
1606
|
+
return `tpl::${e || "self"}::${t}`;
|
|
1073
1607
|
}
|
|
1074
|
-
function
|
|
1075
|
-
const
|
|
1076
|
-
for (let
|
|
1077
|
-
const
|
|
1078
|
-
let
|
|
1079
|
-
if (
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
|
|
1608
|
+
function qe(e, t, a, o, r, n, c, d, u) {
|
|
1609
|
+
const h = /* @__PURE__ */ new Set(), i = [], m = [];
|
|
1610
|
+
for (let f = 0; f < t.length; f++) {
|
|
1611
|
+
const p = t[f];
|
|
1612
|
+
let w = p.normalizedPath, E = !1, _ = !0, b, y;
|
|
1613
|
+
if (me(p.normalizedPath)) {
|
|
1614
|
+
E = !0, b = p.normalizedPath;
|
|
1615
|
+
const N = Te(
|
|
1616
|
+
p.normalizedPath,
|
|
1617
|
+
c,
|
|
1084
1618
|
void 0,
|
|
1085
|
-
|
|
1619
|
+
u
|
|
1086
1620
|
);
|
|
1087
|
-
|
|
1621
|
+
w = N.resolvedPath, _ = N.isFullyResolved, y = N.unresolved.length ? N.unresolved : void 0;
|
|
1088
1622
|
}
|
|
1089
|
-
let
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1623
|
+
let P = ie(p), B = !1, k = !0;
|
|
1624
|
+
if (P && me(P)) {
|
|
1625
|
+
B = !0;
|
|
1626
|
+
const N = Te(
|
|
1627
|
+
P,
|
|
1628
|
+
c,
|
|
1095
1629
|
void 0,
|
|
1096
|
-
|
|
1630
|
+
u
|
|
1097
1631
|
);
|
|
1098
|
-
|
|
1099
|
-
...
|
|
1100
|
-
...
|
|
1632
|
+
N.isFullyResolved ? P = N.resolvedPath : (k = !1, y = [
|
|
1633
|
+
...y ?? [],
|
|
1634
|
+
...N.unresolved
|
|
1101
1635
|
]);
|
|
1102
1636
|
}
|
|
1103
|
-
const
|
|
1104
|
-
...
|
|
1105
|
-
normalizedPath:
|
|
1106
|
-
repoAlias:
|
|
1107
|
-
sourcePath:
|
|
1108
|
-
}),
|
|
1109
|
-
if (
|
|
1110
|
-
|
|
1111
|
-
const
|
|
1112
|
-
let
|
|
1113
|
-
if (
|
|
1637
|
+
const T = E || B, se = _ && k, { primary: C, fallback: V } = it({
|
|
1638
|
+
...p,
|
|
1639
|
+
normalizedPath: w,
|
|
1640
|
+
repoAlias: p.repoAlias,
|
|
1641
|
+
sourcePath: p.sourcePath
|
|
1642
|
+
}), K = Sa(P, C);
|
|
1643
|
+
if (h.has(K)) continue;
|
|
1644
|
+
h.add(K);
|
|
1645
|
+
const fe = d == null ? void 0 : d.has(K);
|
|
1646
|
+
let G;
|
|
1647
|
+
if (p.conditional && p.conditionExpression)
|
|
1114
1648
|
try {
|
|
1115
|
-
const
|
|
1116
|
-
parameters:
|
|
1117
|
-
variables:
|
|
1649
|
+
const N = $t(p.conditionExpression, {
|
|
1650
|
+
parameters: c,
|
|
1651
|
+
variables: u
|
|
1118
1652
|
});
|
|
1119
|
-
typeof
|
|
1653
|
+
typeof N == "boolean" ? G = N : N === void 0 || N === p.conditionExpression ? G = "unknown" : G = !!N;
|
|
1120
1654
|
} catch {
|
|
1121
|
-
|
|
1655
|
+
G = "unknown";
|
|
1122
1656
|
}
|
|
1123
|
-
else
|
|
1124
|
-
if (
|
|
1125
|
-
if (!
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1657
|
+
else p.conditional && (G = "unknown");
|
|
1658
|
+
if (G === !1) continue;
|
|
1659
|
+
if (!fe) {
|
|
1660
|
+
const N = w.length > 40 ? `...${w.slice(-37)}` : w, { repoInfo: g, adoUrl: v } = Nt(
|
|
1661
|
+
p,
|
|
1662
|
+
P,
|
|
1663
|
+
C,
|
|
1130
1664
|
a,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
),
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
),
|
|
1139
|
-
...
|
|
1140
|
-
repoAlias:
|
|
1141
|
-
contextRepoAlias:
|
|
1142
|
-
parameters:
|
|
1143
|
-
} :
|
|
1144
|
-
|
|
1145
|
-
id:
|
|
1665
|
+
o,
|
|
1666
|
+
r,
|
|
1667
|
+
n
|
|
1668
|
+
), x = Ae(
|
|
1669
|
+
p.parameters,
|
|
1670
|
+
c,
|
|
1671
|
+
u
|
|
1672
|
+
), $ = P !== ie(p) || x !== p.parameters ? {
|
|
1673
|
+
...p,
|
|
1674
|
+
repoAlias: P || p.repoAlias,
|
|
1675
|
+
contextRepoAlias: P || p.contextRepoAlias,
|
|
1676
|
+
parameters: x
|
|
1677
|
+
} : p;
|
|
1678
|
+
i.push({
|
|
1679
|
+
id: K,
|
|
1146
1680
|
type: "fileNode",
|
|
1147
1681
|
position: { x: 0, y: 0 },
|
|
1148
1682
|
data: {
|
|
1149
|
-
label:
|
|
1150
|
-
filePath:
|
|
1151
|
-
repoAlias:
|
|
1683
|
+
label: N,
|
|
1684
|
+
filePath: C,
|
|
1685
|
+
repoAlias: P,
|
|
1152
1686
|
templateCount: 0,
|
|
1153
1687
|
status: "collapsed",
|
|
1154
1688
|
isRoot: !1,
|
|
1155
|
-
baseDir:
|
|
1156
|
-
adoUrl:
|
|
1157
|
-
repoInfo:
|
|
1158
|
-
templateLocation:
|
|
1689
|
+
baseDir: Ie(C),
|
|
1690
|
+
adoUrl: v,
|
|
1691
|
+
repoInfo: g,
|
|
1692
|
+
templateLocation: p.location,
|
|
1159
1693
|
// Dynamic path info for auto-expand to skip unresolved expression paths
|
|
1160
|
-
dynamicPath:
|
|
1161
|
-
expressionResolved:
|
|
1694
|
+
dynamicPath: T || void 0,
|
|
1695
|
+
expressionResolved: T ? se : void 0,
|
|
1162
1696
|
// Stash the resolved ref for expansion (with resolved repo alias + params)
|
|
1163
|
-
_ref:
|
|
1697
|
+
_ref: $,
|
|
1164
1698
|
// Stash fallback path for fetch retry (repo-root-relative)
|
|
1165
|
-
_fallbackPath:
|
|
1699
|
+
_fallbackPath: V,
|
|
1166
1700
|
// Stash the parent's parameter context so it can flow down during expansion
|
|
1167
|
-
_parentParamContext:
|
|
1701
|
+
_parentParamContext: c,
|
|
1168
1702
|
// Stash accumulated resources (root + all ancestor template resources)
|
|
1169
|
-
_accumulatedResources:
|
|
1703
|
+
_accumulatedResources: n,
|
|
1170
1704
|
// Stash accumulated variables for expression resolution in descendants
|
|
1171
|
-
_accumulatedVariables:
|
|
1705
|
+
_accumulatedVariables: u,
|
|
1172
1706
|
// Condition evaluation result for conditional refs
|
|
1173
1707
|
// true = expand, false = skip, 'unknown' = expand when autoExpandAll
|
|
1174
|
-
_conditionResult:
|
|
1708
|
+
_conditionResult: G
|
|
1175
1709
|
}
|
|
1176
1710
|
});
|
|
1177
1711
|
}
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
id: `${
|
|
1181
|
-
source:
|
|
1182
|
-
target:
|
|
1712
|
+
const Me = p.location === "extends" ? "extends" : p.location === "extends-parameters" ? "extends param" : p.location, le = !!P, be = p.parameters ? Object.keys(p.parameters) : void 0;
|
|
1713
|
+
m.push({
|
|
1714
|
+
id: `${e}->${K}`,
|
|
1715
|
+
source: e,
|
|
1716
|
+
target: K,
|
|
1183
1717
|
type: "templateEdge",
|
|
1184
1718
|
data: {
|
|
1185
|
-
edgeLabel:
|
|
1186
|
-
parameterNames:
|
|
1719
|
+
edgeLabel: Me,
|
|
1720
|
+
parameterNames: be,
|
|
1187
1721
|
isExternal: le || void 0,
|
|
1188
|
-
conditional:
|
|
1189
|
-
conditionExpression:
|
|
1190
|
-
conditionResult:
|
|
1191
|
-
dynamicPath:
|
|
1192
|
-
expressionResolved:
|
|
1193
|
-
originalPath:
|
|
1194
|
-
resolvedPath:
|
|
1195
|
-
unresolvedExpressions:
|
|
1722
|
+
conditional: p.conditional || void 0,
|
|
1723
|
+
conditionExpression: p.conditionExpression,
|
|
1724
|
+
conditionResult: G,
|
|
1725
|
+
dynamicPath: T || void 0,
|
|
1726
|
+
expressionResolved: T ? se : void 0,
|
|
1727
|
+
originalPath: b || (B ? p.rawPath : void 0),
|
|
1728
|
+
resolvedPath: T ? C : void 0,
|
|
1729
|
+
unresolvedExpressions: y
|
|
1196
1730
|
},
|
|
1197
1731
|
style: le ? {
|
|
1198
1732
|
stroke: "var(--badge-resources)",
|
|
1199
1733
|
strokeWidth: 2,
|
|
1200
1734
|
strokeDasharray: "6 3"
|
|
1201
1735
|
} : void 0,
|
|
1202
|
-
markerEnd: le ? { type:
|
|
1736
|
+
markerEnd: le ? { type: De.ArrowClosed, color: "var(--badge-resources)" } : void 0
|
|
1203
1737
|
});
|
|
1204
1738
|
}
|
|
1205
|
-
return { templateNodes:
|
|
1739
|
+
return { templateNodes: i, templateEdges: m };
|
|
1206
1740
|
}
|
|
1207
|
-
async function
|
|
1208
|
-
const
|
|
1209
|
-
if (!
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
if (
|
|
1213
|
-
const
|
|
1214
|
-
if (
|
|
1215
|
-
return { content:
|
|
1741
|
+
async function Ye(e, t, a, o, r, n, c, d) {
|
|
1742
|
+
const u = o._ref;
|
|
1743
|
+
if (!u) throw new Error("No template reference on this node");
|
|
1744
|
+
const h = o.filePath, i = o._fallbackPath, m = ie(u), f = `${m || ""}:${h}`, p = n.get(f);
|
|
1745
|
+
if (p) return { content: p, actualPath: h };
|
|
1746
|
+
if (i) {
|
|
1747
|
+
const k = `${m || ""}:${i}`, T = n.get(k);
|
|
1748
|
+
if (T)
|
|
1749
|
+
return { content: T, actualPath: i };
|
|
1216
1750
|
}
|
|
1217
|
-
const
|
|
1218
|
-
let
|
|
1219
|
-
if (
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
} else
|
|
1223
|
-
let
|
|
1751
|
+
const E = o._accumulatedResources ?? r;
|
|
1752
|
+
let _ = t, b = a, y;
|
|
1753
|
+
if (m && E.length) {
|
|
1754
|
+
const k = lt(m, E);
|
|
1755
|
+
k ? (_ = k.project || t, b = k.repoName, y = k.ref) : b = m;
|
|
1756
|
+
} else m && (b = m);
|
|
1757
|
+
let P, B = h;
|
|
1224
1758
|
try {
|
|
1225
|
-
|
|
1226
|
-
|
|
1759
|
+
P = await d(
|
|
1760
|
+
e,
|
|
1761
|
+
_,
|
|
1762
|
+
b,
|
|
1227
1763
|
h,
|
|
1228
|
-
|
|
1229
|
-
d,
|
|
1230
|
-
b
|
|
1764
|
+
y
|
|
1231
1765
|
);
|
|
1232
|
-
} catch (
|
|
1233
|
-
if (
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
),
|
|
1766
|
+
} catch (k) {
|
|
1767
|
+
if (i)
|
|
1768
|
+
P = await d(
|
|
1769
|
+
e,
|
|
1770
|
+
_,
|
|
1771
|
+
b,
|
|
1772
|
+
i,
|
|
1773
|
+
y
|
|
1774
|
+
), B = i;
|
|
1241
1775
|
else
|
|
1242
|
-
throw
|
|
1776
|
+
throw k;
|
|
1243
1777
|
}
|
|
1244
|
-
return
|
|
1778
|
+
return c(`${m || ""}:${B}`, P.content), { content: P.content, actualPath: B };
|
|
1245
1779
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const
|
|
1248
|
-
return a > 0 ?
|
|
1780
|
+
function Ie(e) {
|
|
1781
|
+
const t = e.replace(/\\/g, "/"), a = t.lastIndexOf("/");
|
|
1782
|
+
return a > 0 ? t.slice(0, a) : "";
|
|
1249
1783
|
}
|
|
1250
|
-
function
|
|
1251
|
-
let
|
|
1252
|
-
if (
|
|
1253
|
-
const
|
|
1254
|
-
(
|
|
1784
|
+
function Nt(e, t, a, o, r, n, c) {
|
|
1785
|
+
let d = r, u = n, h, i;
|
|
1786
|
+
if (t && c.length) {
|
|
1787
|
+
const f = lt(t, c), p = c.find(
|
|
1788
|
+
(w) => w.repository === t
|
|
1255
1789
|
);
|
|
1256
|
-
|
|
1257
|
-
alias:
|
|
1258
|
-
fullName:
|
|
1259
|
-
type:
|
|
1260
|
-
ref:
|
|
1261
|
-
project:
|
|
1790
|
+
f ? (d = f.project || r, u = f.repoName, h = f.ref) : u = t, p && (i = {
|
|
1791
|
+
alias: t,
|
|
1792
|
+
fullName: p.name,
|
|
1793
|
+
type: p.type,
|
|
1794
|
+
ref: p.ref,
|
|
1795
|
+
project: f == null ? void 0 : f.project
|
|
1262
1796
|
});
|
|
1263
|
-
} else
|
|
1264
|
-
const
|
|
1265
|
-
org:
|
|
1266
|
-
project:
|
|
1267
|
-
repoName:
|
|
1797
|
+
} else t && (u = t);
|
|
1798
|
+
const m = o && d && u ? rt({
|
|
1799
|
+
org: o,
|
|
1800
|
+
project: d,
|
|
1801
|
+
repoName: u,
|
|
1268
1802
|
filePath: a,
|
|
1269
|
-
ref:
|
|
1803
|
+
ref: h
|
|
1270
1804
|
}) : void 0;
|
|
1271
|
-
return { repoInfo:
|
|
1805
|
+
return { repoInfo: i, adoUrl: m };
|
|
1272
1806
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const
|
|
1275
|
-
if (!
|
|
1276
|
-
const
|
|
1277
|
-
let
|
|
1278
|
-
if (
|
|
1279
|
-
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
|
|
1807
|
+
function xe(e, t, a, o, r, n) {
|
|
1808
|
+
const c = e.data, u = { ...c._accumulatedVariables ?? {}, ...t }, h = c._ref;
|
|
1809
|
+
if (!h) return e;
|
|
1810
|
+
const i = c._parentParamContext;
|
|
1811
|
+
let m = h.normalizedPath, f = !1, p = !0, w = ie(h);
|
|
1812
|
+
if (me(h.normalizedPath)) {
|
|
1813
|
+
f = !0;
|
|
1814
|
+
const k = Te(
|
|
1815
|
+
h.normalizedPath,
|
|
1816
|
+
i,
|
|
1283
1817
|
void 0,
|
|
1284
|
-
|
|
1818
|
+
u
|
|
1285
1819
|
);
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1820
|
+
if (m = k.resolvedPath, p = k.isFullyResolved, p && !me(m)) {
|
|
1821
|
+
const T = St(m);
|
|
1822
|
+
m = T.normalizedPath, T.repoAlias && (w = T.repoAlias);
|
|
1289
1823
|
}
|
|
1290
1824
|
}
|
|
1291
|
-
if (
|
|
1292
|
-
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1825
|
+
if (w && me(w)) {
|
|
1826
|
+
f = !0;
|
|
1827
|
+
const k = Te(
|
|
1828
|
+
w,
|
|
1829
|
+
i,
|
|
1296
1830
|
void 0,
|
|
1297
|
-
|
|
1831
|
+
u
|
|
1298
1832
|
);
|
|
1299
|
-
|
|
1833
|
+
k.isFullyResolved ? w = k.resolvedPath : p = !1;
|
|
1300
1834
|
}
|
|
1301
|
-
const
|
|
1302
|
-
...
|
|
1303
|
-
normalizedPath:
|
|
1304
|
-
repoAlias:
|
|
1305
|
-
contextRepoAlias:
|
|
1306
|
-
}, { primary:
|
|
1307
|
-
...
|
|
1308
|
-
normalizedPath:
|
|
1309
|
-
repoAlias:
|
|
1310
|
-
sourcePath:
|
|
1311
|
-
}),
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1835
|
+
const E = {
|
|
1836
|
+
...h,
|
|
1837
|
+
normalizedPath: m,
|
|
1838
|
+
repoAlias: w || h.repoAlias,
|
|
1839
|
+
contextRepoAlias: w || h.contextRepoAlias
|
|
1840
|
+
}, { primary: _, fallback: b } = it({
|
|
1841
|
+
...E,
|
|
1842
|
+
normalizedPath: m,
|
|
1843
|
+
repoAlias: E.repoAlias,
|
|
1844
|
+
sourcePath: h.sourcePath
|
|
1845
|
+
}), y = m.length > 40 ? `...${m.slice(-37)}` : m, { repoInfo: P, adoUrl: B } = a && o && r && n ? Nt(
|
|
1846
|
+
E,
|
|
1847
|
+
w,
|
|
1848
|
+
_,
|
|
1315
1849
|
a,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1850
|
+
o,
|
|
1851
|
+
r,
|
|
1852
|
+
n
|
|
1319
1853
|
) : { repoInfo: void 0, adoUrl: void 0 };
|
|
1320
1854
|
return {
|
|
1321
|
-
...
|
|
1855
|
+
...e,
|
|
1322
1856
|
data: {
|
|
1323
|
-
...
|
|
1324
|
-
label:
|
|
1325
|
-
filePath:
|
|
1326
|
-
repoAlias:
|
|
1327
|
-
baseDir:
|
|
1328
|
-
dynamicPath:
|
|
1329
|
-
expressionResolved:
|
|
1330
|
-
adoUrl:
|
|
1331
|
-
repoInfo:
|
|
1332
|
-
_ref:
|
|
1333
|
-
_accumulatedVariables:
|
|
1334
|
-
_fallbackPath:
|
|
1857
|
+
...e.data,
|
|
1858
|
+
label: y,
|
|
1859
|
+
filePath: _,
|
|
1860
|
+
repoAlias: w,
|
|
1861
|
+
baseDir: Ie(_),
|
|
1862
|
+
dynamicPath: f || void 0,
|
|
1863
|
+
expressionResolved: f ? p : void 0,
|
|
1864
|
+
adoUrl: B || e.data.adoUrl,
|
|
1865
|
+
repoInfo: P || e.data.repoInfo,
|
|
1866
|
+
_ref: E,
|
|
1867
|
+
_accumulatedVariables: u,
|
|
1868
|
+
_fallbackPath: b
|
|
1335
1869
|
}
|
|
1336
1870
|
};
|
|
1337
1871
|
}
|
|
1338
|
-
|
|
1339
|
-
function Be(t, e) {
|
|
1340
|
-
return `https://dev.azure.com/${encodeURIComponent(t)}/${encodeURIComponent(e)}/_apis`;
|
|
1341
|
-
}
|
|
1342
|
-
function Qt(t) {
|
|
1343
|
-
return t.startsWith("refs/heads/") ? { version: t.slice(11), versionType: "branch" } : t.startsWith("refs/tags/") ? { version: t.slice(10), versionType: "tag" } : /^[0-9a-f]{40}$/i.test(t) ? { version: t, versionType: "commit" } : { version: t, versionType: "branch" };
|
|
1344
|
-
}
|
|
1345
|
-
async function We(t) {
|
|
1346
|
-
const e = await fetch(t, { credentials: "include" });
|
|
1347
|
-
if (!e.ok) {
|
|
1348
|
-
const a = await e.text();
|
|
1349
|
-
throw new Error(`ADO API error (${e.status}): ${a}`);
|
|
1350
|
-
}
|
|
1351
|
-
return e;
|
|
1352
|
-
}
|
|
1353
|
-
async function it(t, e, a, n, l) {
|
|
1354
|
-
const o = n.startsWith("/") ? n : `/${n}`, m = Nt(o);
|
|
1355
|
-
let P = `${Be(t, e)}/git/repositories/${encodeURIComponent(a)}/items?path=${encodeURIComponent(m)}&api-version=${Me}&includeContent=true&$format=text`;
|
|
1356
|
-
if (l) {
|
|
1357
|
-
const d = Qt(l);
|
|
1358
|
-
P += `&versionDescriptor.version=${encodeURIComponent(d.version)}&versionDescriptor.versionType=${d.versionType}`;
|
|
1359
|
-
}
|
|
1360
|
-
return (await We(P)).text();
|
|
1361
|
-
}
|
|
1362
|
-
async function ea(t, e) {
|
|
1363
|
-
const a = `${Be(t, e)}/pipelines?api-version=${Me}`;
|
|
1364
|
-
return (await (await We(a)).json()).value;
|
|
1365
|
-
}
|
|
1366
|
-
async function ta(t, e, a) {
|
|
1367
|
-
var v, d, r, y, g;
|
|
1368
|
-
const n = `${Be(t, e)}/build/definitions/${a}?api-version=${Me}`, o = await (await We(n)).json(), m = {
|
|
1369
|
-
id: o.id,
|
|
1370
|
-
name: o.name,
|
|
1371
|
-
path: ((v = o.process) == null ? void 0 : v.yamlFilename) ?? o.path,
|
|
1372
|
-
repository: {
|
|
1373
|
-
id: (d = o.repository) == null ? void 0 : d.id,
|
|
1374
|
-
name: (r = o.repository) == null ? void 0 : r.name,
|
|
1375
|
-
type: (y = o.repository) == null ? void 0 : y.type,
|
|
1376
|
-
defaultBranch: (g = o.repository) == null ? void 0 : g.defaultBranch
|
|
1377
|
-
}
|
|
1378
|
-
}, P = await it(
|
|
1379
|
-
t,
|
|
1380
|
-
e,
|
|
1381
|
-
m.repository.id,
|
|
1382
|
-
m.path,
|
|
1383
|
-
m.repository.defaultBranch
|
|
1384
|
-
);
|
|
1385
|
-
return { definition: m, yaml: P };
|
|
1386
|
-
}
|
|
1387
|
-
async function aa(t, e, a, n, l) {
|
|
1388
|
-
return { content: await it(t, e, a, n, l), path: n, repoId: a, repoName: a, branch: l || "" };
|
|
1389
|
-
}
|
|
1390
|
-
async function na() {
|
|
1391
|
-
return { customTaskDocs: {} };
|
|
1392
|
-
}
|
|
1393
|
-
async function sa(t) {
|
|
1394
|
-
return { tasks: [], cached: !1 };
|
|
1395
|
-
}
|
|
1396
|
-
const oa = "/api";
|
|
1397
|
-
var Qe;
|
|
1398
|
-
const ge = typeof window < "u" && ((Qe = window.location) == null ? void 0 : Qe.protocol) === "chrome-extension:";
|
|
1399
|
-
async function _e(t) {
|
|
1400
|
-
const e = await fetch(`${oa}${t}`);
|
|
1401
|
-
if (!e.ok) {
|
|
1402
|
-
const a = await e.text();
|
|
1403
|
-
throw new Error(`API error (${e.status}): ${a}`);
|
|
1404
|
-
}
|
|
1405
|
-
return e.json();
|
|
1406
|
-
}
|
|
1407
|
-
function wa(t, e) {
|
|
1408
|
-
return ge ? ea(t, e) : _e(`/${t}/${e}/pipelines`);
|
|
1409
|
-
}
|
|
1410
|
-
function ra(t, e, a) {
|
|
1411
|
-
return ge ? ta(t, e, a) : _e(`/${t}/${e}/pipelines/${a}/yaml`);
|
|
1412
|
-
}
|
|
1413
|
-
function ct(t, e, a, n, l) {
|
|
1414
|
-
if (ge)
|
|
1415
|
-
return aa(t, e, a, n, l);
|
|
1416
|
-
const o = new URLSearchParams({ repo: a, path: n });
|
|
1417
|
-
return l && o.set("branch", l), _e(`/${t}/${e}/file-by-repo-name?${o}`);
|
|
1418
|
-
}
|
|
1419
|
-
function la() {
|
|
1420
|
-
return ge ? na() : _e("/config/task-docs");
|
|
1421
|
-
}
|
|
1422
|
-
function ia(t) {
|
|
1423
|
-
return ge ? sa() : _e(`/${t}/schema/tasks`);
|
|
1424
|
-
}
|
|
1425
|
-
function ca(t) {
|
|
1872
|
+
function Ca(e) {
|
|
1426
1873
|
const {
|
|
1427
|
-
setConnection:
|
|
1874
|
+
setConnection: t,
|
|
1428
1875
|
setSelectedPipeline: a,
|
|
1429
|
-
setSelectedPipelineLoading:
|
|
1430
|
-
setSelectedPipelineError:
|
|
1431
|
-
} =
|
|
1432
|
-
|
|
1433
|
-
if (
|
|
1434
|
-
|
|
1435
|
-
const
|
|
1436
|
-
if (
|
|
1437
|
-
|
|
1438
|
-
else if (
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
} else
|
|
1876
|
+
setSelectedPipelineLoading: o,
|
|
1877
|
+
setSelectedPipelineError: r
|
|
1878
|
+
} = Ue(), [n, c] = L(""), [d, u] = L(null), [h, i] = L(!1), m = Q(!1);
|
|
1879
|
+
ee(() => {
|
|
1880
|
+
if (m.current) return;
|
|
1881
|
+
m.current = !0;
|
|
1882
|
+
const _ = new URLSearchParams(window.location.search), b = e.fileUrl || _.get("url"), y = e.org || _.get("org"), P = e.project || _.get("project"), B = e.repo || _.get("repo"), k = e.path || _.get("path"), T = e.branch || _.get("branch") || void 0, se = e.pipelineId ?? (_.get("pipelineId") ? Number(_.get("pipelineId")) : null);
|
|
1883
|
+
if (b)
|
|
1884
|
+
c(b), f(b);
|
|
1885
|
+
else if (y && P && B && k) {
|
|
1886
|
+
const C = `https://dev.azure.com/${y}/${P}/_git/${B}?path=${k}${T ? `&version=GB${T}` : ""}`;
|
|
1887
|
+
c(C), f(C);
|
|
1888
|
+
} else y && P && se != null && p(y, P, se);
|
|
1442
1889
|
}, []);
|
|
1443
|
-
const
|
|
1444
|
-
const
|
|
1445
|
-
if (!
|
|
1446
|
-
|
|
1890
|
+
const f = async (_) => {
|
|
1891
|
+
const b = Dt(_);
|
|
1892
|
+
if (!b) {
|
|
1893
|
+
u("Invalid Azure DevOps URL");
|
|
1447
1894
|
return;
|
|
1448
1895
|
}
|
|
1449
|
-
|
|
1896
|
+
t(b.org, b.project), o(!0), r(null), i(!0);
|
|
1450
1897
|
try {
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1898
|
+
const y = await gt(
|
|
1899
|
+
b.org,
|
|
1900
|
+
b.project,
|
|
1901
|
+
b.repoName,
|
|
1902
|
+
b.filePath,
|
|
1903
|
+
b.branch
|
|
1457
1904
|
);
|
|
1458
1905
|
a({
|
|
1459
1906
|
definition: {
|
|
1460
1907
|
id: 0,
|
|
1461
|
-
name:
|
|
1462
|
-
path:
|
|
1908
|
+
name: b.filePath.split("/").pop() || b.filePath,
|
|
1909
|
+
path: b.filePath,
|
|
1463
1910
|
repository: {
|
|
1464
|
-
id:
|
|
1465
|
-
name:
|
|
1911
|
+
id: y.repoId,
|
|
1912
|
+
name: y.repoName,
|
|
1466
1913
|
type: "git",
|
|
1467
|
-
defaultBranch:
|
|
1914
|
+
defaultBranch: y.branch || ""
|
|
1468
1915
|
}
|
|
1469
1916
|
},
|
|
1470
|
-
yaml:
|
|
1917
|
+
yaml: y.content
|
|
1471
1918
|
});
|
|
1472
|
-
} catch (
|
|
1473
|
-
|
|
1474
|
-
|
|
1919
|
+
} catch (y) {
|
|
1920
|
+
r(
|
|
1921
|
+
y instanceof Error ? y.message : String(y)
|
|
1475
1922
|
);
|
|
1476
1923
|
} finally {
|
|
1477
|
-
|
|
1924
|
+
o(!1), i(!1);
|
|
1478
1925
|
}
|
|
1479
|
-
},
|
|
1480
|
-
|
|
1926
|
+
}, p = async (_, b, y) => {
|
|
1927
|
+
t(_, b), o(!0), r(null);
|
|
1481
1928
|
try {
|
|
1482
|
-
const
|
|
1483
|
-
a(
|
|
1484
|
-
} catch (
|
|
1485
|
-
|
|
1486
|
-
|
|
1929
|
+
const P = await Gt(_, b, y);
|
|
1930
|
+
a(P);
|
|
1931
|
+
} catch (P) {
|
|
1932
|
+
r(
|
|
1933
|
+
P instanceof Error ? P.message : String(P)
|
|
1487
1934
|
);
|
|
1488
1935
|
} finally {
|
|
1489
|
-
|
|
1936
|
+
o(!1);
|
|
1490
1937
|
}
|
|
1491
|
-
},
|
|
1492
|
-
|
|
1938
|
+
}, w = async () => {
|
|
1939
|
+
n.trim() && (u(null), await f(n.trim()));
|
|
1493
1940
|
};
|
|
1494
|
-
return /* @__PURE__ */
|
|
1941
|
+
return /* @__PURE__ */ l("div", { className: "pipeline-url-bar", children: [
|
|
1495
1942
|
/* @__PURE__ */ s(
|
|
1496
1943
|
"input",
|
|
1497
1944
|
{
|
|
1498
1945
|
type: "text",
|
|
1499
1946
|
className: "pipeline-url-bar__input",
|
|
1500
1947
|
placeholder: "https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",
|
|
1501
|
-
value:
|
|
1502
|
-
onChange: (
|
|
1503
|
-
onKeyDown: (
|
|
1504
|
-
|
|
1948
|
+
value: n,
|
|
1949
|
+
onChange: (_) => c(_.target.value),
|
|
1950
|
+
onKeyDown: (_) => {
|
|
1951
|
+
_.key === "Enter" && (_.preventDefault(), w());
|
|
1505
1952
|
}
|
|
1506
1953
|
}
|
|
1507
1954
|
),
|
|
@@ -1509,104 +1956,136 @@ function ca(t) {
|
|
|
1509
1956
|
"button",
|
|
1510
1957
|
{
|
|
1511
1958
|
className: "pipeline-url-bar__btn",
|
|
1512
|
-
onClick:
|
|
1513
|
-
disabled: !
|
|
1514
|
-
children:
|
|
1959
|
+
onClick: w,
|
|
1960
|
+
disabled: !n.trim() || h,
|
|
1961
|
+
children: h ? "⏳ Loading..." : "Load"
|
|
1515
1962
|
}
|
|
1516
1963
|
),
|
|
1517
|
-
|
|
1964
|
+
d && /* @__PURE__ */ s("div", { className: "pipeline-url-bar__error", children: d })
|
|
1518
1965
|
] });
|
|
1519
1966
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1967
|
+
function Da() {
|
|
1968
|
+
const e = () => window.location.hash.startsWith("#/commit-flow") ? "commit-flow" : "pipeline", [t, a] = L(e);
|
|
1969
|
+
return ee(() => {
|
|
1970
|
+
const r = () => a(e());
|
|
1971
|
+
return window.addEventListener("hashchange", r), () => window.removeEventListener("hashchange", r);
|
|
1972
|
+
}, []), [t, (r) => {
|
|
1973
|
+
window.location.hash = r === "pipeline" ? "#/" : `#/${r}`;
|
|
1974
|
+
}];
|
|
1975
|
+
}
|
|
1976
|
+
const Aa = 280, Ia = 900, La = 420;
|
|
1977
|
+
function Fa(e) {
|
|
1978
|
+
const { setCustomTaskDocs: t, setTaskSchema: a, selectedNodeDetail: o, org: r } = Ue(), [n, c] = L(La), d = Q(!1), [u, h] = Da();
|
|
1979
|
+
ee(() => {
|
|
1980
|
+
qt().then((m) => t(m.customTaskDocs)).catch(() => {
|
|
1525
1981
|
});
|
|
1526
|
-
}, [
|
|
1527
|
-
|
|
1982
|
+
}, [t]), ee(() => {
|
|
1983
|
+
r && Yt(r).then((m) => a(m.tasks)).catch(() => {
|
|
1528
1984
|
});
|
|
1529
|
-
}, [
|
|
1530
|
-
const
|
|
1531
|
-
(
|
|
1532
|
-
|
|
1533
|
-
const
|
|
1985
|
+
}, [r, a]);
|
|
1986
|
+
const i = ne(
|
|
1987
|
+
(m) => {
|
|
1988
|
+
m.preventDefault(), d.current = !0;
|
|
1989
|
+
const f = m.clientX, p = n;
|
|
1534
1990
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1535
|
-
const
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
Math.max(
|
|
1991
|
+
const w = (_) => {
|
|
1992
|
+
const b = f - _.clientX, y = Math.min(
|
|
1993
|
+
Ia,
|
|
1994
|
+
Math.max(Aa, p + b)
|
|
1539
1995
|
);
|
|
1540
|
-
|
|
1541
|
-
},
|
|
1542
|
-
|
|
1996
|
+
c(y);
|
|
1997
|
+
}, E = () => {
|
|
1998
|
+
d.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", E);
|
|
1543
1999
|
};
|
|
1544
|
-
window.addEventListener("mousemove",
|
|
2000
|
+
window.addEventListener("mousemove", w), window.addEventListener("mouseup", E);
|
|
1545
2001
|
},
|
|
1546
|
-
[
|
|
2002
|
+
[n]
|
|
1547
2003
|
);
|
|
1548
|
-
return /* @__PURE__ */ s(
|
|
1549
|
-
/* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ s(ga, { value: gt, children: /* @__PURE__ */ l("div", { className: "app", children: [
|
|
2005
|
+
/* @__PURE__ */ l("header", { className: "app__header", children: [
|
|
1550
2006
|
/* @__PURE__ */ s("h1", { children: "🔧 Azure Pipelines Visualizer" }),
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
] }),
|
|
1553
|
-
/* @__PURE__ */ c("main", { className: "app__main", children: [
|
|
1554
|
-
/* @__PURE__ */ s("section", { className: "app__content", children: /* @__PURE__ */ s(Ie, { children: /* @__PURE__ */ s(qt, {}) }) }),
|
|
1555
|
-
n && /* @__PURE__ */ c(et, { children: [
|
|
2007
|
+
/* @__PURE__ */ l("nav", { className: "app__nav", children: [
|
|
1556
2008
|
/* @__PURE__ */ s(
|
|
1557
|
-
"
|
|
2009
|
+
"button",
|
|
1558
2010
|
{
|
|
1559
|
-
className: "
|
|
1560
|
-
|
|
1561
|
-
|
|
2011
|
+
className: `app__nav-btn ${u === "pipeline" ? "app__nav-btn--active" : ""}`,
|
|
2012
|
+
onClick: () => h("pipeline"),
|
|
2013
|
+
type: "button",
|
|
2014
|
+
children: "Pipeline Templates"
|
|
1562
2015
|
}
|
|
1563
2016
|
),
|
|
1564
|
-
/* @__PURE__ */ s(
|
|
1565
|
-
|
|
2017
|
+
/* @__PURE__ */ s(
|
|
2018
|
+
"button",
|
|
2019
|
+
{
|
|
2020
|
+
className: `app__nav-btn ${u === "commit-flow" ? "app__nav-btn--active" : ""}`,
|
|
2021
|
+
onClick: () => h("commit-flow"),
|
|
2022
|
+
type: "button",
|
|
2023
|
+
children: "Commit Flow"
|
|
2024
|
+
}
|
|
2025
|
+
)
|
|
2026
|
+
] }),
|
|
2027
|
+
u === "pipeline" && /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(Ca, { ...e }) })
|
|
2028
|
+
] }),
|
|
2029
|
+
/* @__PURE__ */ l("main", { className: "app__main", children: [
|
|
2030
|
+
u === "pipeline" && /* @__PURE__ */ l(Je, { children: [
|
|
2031
|
+
/* @__PURE__ */ s("section", { className: "app__content", children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(Ta, {}) }) }),
|
|
2032
|
+
o && /* @__PURE__ */ l(Je, { children: [
|
|
2033
|
+
/* @__PURE__ */ s(
|
|
2034
|
+
"div",
|
|
2035
|
+
{
|
|
2036
|
+
className: "app__detail-resize-handle",
|
|
2037
|
+
onMouseDown: i,
|
|
2038
|
+
title: "Drag to resize"
|
|
2039
|
+
}
|
|
2040
|
+
),
|
|
2041
|
+
/* @__PURE__ */ s("aside", { className: "app__detail", style: { width: n }, children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(ha, {}) }) })
|
|
2042
|
+
] })
|
|
2043
|
+
] }),
|
|
2044
|
+
u === "commit-flow" && /* @__PURE__ */ s("section", { className: "app__content", children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(pa, {}) }) })
|
|
1566
2045
|
] })
|
|
1567
2046
|
] }) });
|
|
1568
2047
|
}
|
|
1569
|
-
var
|
|
2048
|
+
var Xe, ke = Mt;
|
|
1570
2049
|
if (process.env.NODE_ENV === "production")
|
|
1571
|
-
|
|
2050
|
+
Xe = ke.createRoot, ke.hydrateRoot;
|
|
1572
2051
|
else {
|
|
1573
|
-
var
|
|
1574
|
-
|
|
1575
|
-
|
|
2052
|
+
var st = ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2053
|
+
Xe = function(e, t) {
|
|
2054
|
+
st.usingClientEntryPoint = !0;
|
|
1576
2055
|
try {
|
|
1577
|
-
return
|
|
2056
|
+
return ke.createRoot(e, t);
|
|
1578
2057
|
} finally {
|
|
1579
|
-
|
|
2058
|
+
st.usingClientEntryPoint = !1;
|
|
1580
2059
|
}
|
|
1581
2060
|
};
|
|
1582
2061
|
}
|
|
1583
|
-
function
|
|
1584
|
-
let a = { ...
|
|
1585
|
-
const
|
|
1586
|
-
function
|
|
1587
|
-
|
|
2062
|
+
function Ga(e, t = {}) {
|
|
2063
|
+
let a = { ...t };
|
|
2064
|
+
const o = Xe(e);
|
|
2065
|
+
function r(n) {
|
|
2066
|
+
o.render(Et(Fa, n));
|
|
1588
2067
|
}
|
|
1589
|
-
return
|
|
1590
|
-
unmount: () =>
|
|
1591
|
-
update: (
|
|
1592
|
-
a = { ...a, ...
|
|
2068
|
+
return r(a), {
|
|
2069
|
+
unmount: () => o.unmount(),
|
|
2070
|
+
update: (n) => {
|
|
2071
|
+
a = { ...a, ...n }, r(a);
|
|
1593
2072
|
}
|
|
1594
2073
|
};
|
|
1595
2074
|
}
|
|
1596
2075
|
export {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
2076
|
+
Fa as App,
|
|
2077
|
+
ha as DetailPanel,
|
|
2078
|
+
Ee as ErrorBoundary,
|
|
2079
|
+
ba as FileNode,
|
|
2080
|
+
Ta as PipelineDiagram,
|
|
2081
|
+
Ca as PipelineSelector,
|
|
2082
|
+
Ea as TemplateEdge,
|
|
2083
|
+
gt as fetchFileByRepoName,
|
|
2084
|
+
Gt as fetchPipelineYaml,
|
|
2085
|
+
Ka as fetchPipelines,
|
|
2086
|
+
qt as fetchTaskDocsConfig,
|
|
2087
|
+
Yt as fetchTaskSchema,
|
|
2088
|
+
Ke as getLayoutedElements,
|
|
2089
|
+
Ga as mount,
|
|
2090
|
+
Ue as usePipelineStore
|
|
1612
2091
|
};
|