flowpilot 0.0.2 → 0.0.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/README.md +34 -145
- package/dist/cli.js +309 -82
- package/dist/client/chunks/client--NE0zi4T.js +1920 -0
- package/dist/client/chunks/{client-oAYP8wOx.js → client-BF_WM329.js} +354 -24
- package/dist/client/chunks/client-BGmrOa8Y.js +1946 -0
- package/dist/client/chunks/client-BluVbVm8.js +1952 -0
- package/dist/client/chunks/client-C0KoXDjl.js +1944 -0
- package/dist/client/chunks/client-CDHibxXX.js +1928 -0
- package/dist/client/chunks/client-CLsT0Mu4.js +1960 -0
- package/dist/client/chunks/client-CT2KUspC.js +1921 -0
- package/dist/client/chunks/{client-DSXtnba0.js → client-Cc7BGooE.js} +1 -1
- package/dist/client/chunks/client-Cp__BVLw.js +1944 -0
- package/dist/client/chunks/client-D1_CE06D.js +1962 -0
- package/dist/client/chunks/client-DTD3V4tx.js +1948 -0
- package/dist/client/chunks/client-F7AJUX5n.js +1965 -0
- package/dist/client/chunks/{client-Bb-xh-5_.js → client-IzVnMhfC.js} +1 -1
- package/dist/client/chunks/client-J1BWGN98.js +1949 -0
- package/dist/client/chunks/client-LpHagnEc.js +1931 -0
- package/dist/client/chunks/client-flsn8fYd.js +1954 -0
- package/dist/client/chunks/client-ub-snoTu.js +1922 -0
- package/dist/client/chunks/client-um7et8ko.js +1931 -0
- package/dist/client/chunks/{jsx-dev-runtime-DGBfem3G.js → jsx-dev-runtime-DOO7Tqjo.js} +1 -1
- package/dist/client/client.js +3 -3
- package/dist/serve.js +116 -14
- package/dist/server.js +116 -14
- package/package.json +11 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as useRef, i as useReducer, n as instance, r as useEffect, s as render, t as jsxDEV } from "./jsx-dev-runtime-
|
|
1
|
+
import { a as useRef, c as Fragment, i as useReducer, n as instance, r as useEffect, s as render, t as jsxDEV } from "./jsx-dev-runtime-DOO7Tqjo.js";
|
|
2
2
|
import { t as filterByRelevance } from "./search-cPm8k8mK.js";
|
|
3
3
|
//#region src/commands/release/client.tsx
|
|
4
4
|
const initPromise = typeof window !== "undefined" && window.__I18N_LOCALE__ && window.__I18N_RESOURCES__ ? instance.init({
|
|
@@ -90,8 +90,8 @@ const releaseStyle = `
|
|
|
90
90
|
padding: 12px 14px;
|
|
91
91
|
font-size: 13px;
|
|
92
92
|
font-family: var(--sans);
|
|
93
|
-
color: var(--text-1);
|
|
94
|
-
background: var(--bg-input);
|
|
93
|
+
color: var(--text-1, #E2E8F0);
|
|
94
|
+
background: var(--bg-input, #0A0E14);
|
|
95
95
|
border: 1px solid var(--border);
|
|
96
96
|
border-radius: 8px;
|
|
97
97
|
cursor: pointer;
|
|
@@ -107,7 +107,7 @@ const releaseStyle = `
|
|
|
107
107
|
}
|
|
108
108
|
.sel-trigger-label {
|
|
109
109
|
font-size: 11px;
|
|
110
|
-
color: var(--text-3);
|
|
110
|
+
color: var(--text-3, #64748B);
|
|
111
111
|
flex-shrink: 0;
|
|
112
112
|
}
|
|
113
113
|
.sel-trigger-value {
|
|
@@ -115,14 +115,14 @@ const releaseStyle = `
|
|
|
115
115
|
font-family: var(--mono);
|
|
116
116
|
font-size: 13px;
|
|
117
117
|
font-weight: 500;
|
|
118
|
-
color: var(--text-1);
|
|
118
|
+
color: var(--text-1, #E2E8F0);
|
|
119
119
|
}
|
|
120
120
|
.sel-trigger-value.empty {
|
|
121
121
|
color: var(--text-3);
|
|
122
122
|
font-weight: 300;
|
|
123
123
|
}
|
|
124
124
|
.sel-trigger-arrow {
|
|
125
|
-
color: var(--text-3);
|
|
125
|
+
color: var(--text-3, #64748B);
|
|
126
126
|
font-size: 10px;
|
|
127
127
|
transition: transform 0.2s;
|
|
128
128
|
}
|
|
@@ -135,7 +135,7 @@ const releaseStyle = `
|
|
|
135
135
|
left: 0; right: 0;
|
|
136
136
|
max-height: 280px;
|
|
137
137
|
overflow-y: auto;
|
|
138
|
-
background: var(--bg-card);
|
|
138
|
+
background: var(--bg-card, #111820);
|
|
139
139
|
border: 1px solid rgba(0,255,136,0.08);
|
|
140
140
|
border-radius: 8px;
|
|
141
141
|
box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 12px rgba(0,255,136,0.03);
|
|
@@ -150,7 +150,7 @@ const releaseStyle = `
|
|
|
150
150
|
border-bottom: 1px solid var(--border);
|
|
151
151
|
position: sticky;
|
|
152
152
|
top: 0;
|
|
153
|
-
background: var(--bg-card);
|
|
153
|
+
background: var(--bg-card, #111820);
|
|
154
154
|
z-index: 1;
|
|
155
155
|
}
|
|
156
156
|
.sel-search-input {
|
|
@@ -158,8 +158,8 @@ const releaseStyle = `
|
|
|
158
158
|
padding: 6px 10px;
|
|
159
159
|
font-size: 12px;
|
|
160
160
|
font-family: var(--mono);
|
|
161
|
-
color: var(--text-1);
|
|
162
|
-
background: var(--bg-void);
|
|
161
|
+
color: var(--text-1, #E2E8F0);
|
|
162
|
+
background: var(--bg-void, #0A0A0F);
|
|
163
163
|
border: 1px solid var(--border);
|
|
164
164
|
border-radius: 4px;
|
|
165
165
|
outline: none;
|
|
@@ -173,19 +173,20 @@ const releaseStyle = `
|
|
|
173
173
|
cursor: pointer;
|
|
174
174
|
transition: background 0.1s;
|
|
175
175
|
border-left: 3px solid transparent;
|
|
176
|
+
color: var(--text-1, #E2E8F0);
|
|
176
177
|
}
|
|
177
178
|
.sel-item:first-child { border-radius: 7px 7px 0 0; }
|
|
178
179
|
.sel-item:last-child { border-radius: 0 0 7px 7px; }
|
|
179
180
|
.sel-item:hover,
|
|
180
|
-
.sel-item.highlighted { background: var(--bg-hover); }
|
|
181
|
+
.sel-item.highlighted { background: var(--bg-hover, rgba(0,255,136,0.04)); }
|
|
181
182
|
.sel-item.active {
|
|
182
|
-
background: var(--neon-soft);
|
|
183
|
+
background: var(--neon-soft, rgba(0,255,136,0.08));
|
|
183
184
|
border-left-color: var(--neon);
|
|
184
185
|
font-weight: 500;
|
|
185
186
|
}
|
|
186
|
-
.sel-item-name { font-weight: 500; color: var(--text-1); }
|
|
187
|
-
.sel-item-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; }
|
|
188
|
-
.sel-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 12px; }
|
|
187
|
+
.sel-item-name { font-weight: 500; color: var(--text-1, #E2E8F0); }
|
|
188
|
+
.sel-item-sub { font-size: 11px; color: var(--text-3, #64748B); font-family: var(--mono); margin-top: 2px; }
|
|
189
|
+
.sel-empty { padding: 12px; text-align: center; color: var(--text-3, #64748B); font-size: 12px; }
|
|
189
190
|
|
|
190
191
|
/* ── Spinner ── */
|
|
191
192
|
.spinner {
|
|
@@ -247,6 +248,36 @@ const releaseStyle = `
|
|
|
247
248
|
}
|
|
248
249
|
.jira-btn:hover { background: var(--neon-hover); box-shadow: 0 0 12px var(--neon-glow), 0 2px 12px rgba(0,255,136,0.2); }
|
|
249
250
|
.jira-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
251
|
+
|
|
252
|
+
/* ── Custom Checkbox ── */
|
|
253
|
+
input[type="checkbox"] {
|
|
254
|
+
appearance: none;
|
|
255
|
+
width: 16px;
|
|
256
|
+
height: 16px;
|
|
257
|
+
border: 1px solid var(--border, rgba(0,255,136,0.2));
|
|
258
|
+
border-radius: 3px;
|
|
259
|
+
background: var(--bg-input, #0A0E14);
|
|
260
|
+
cursor: pointer;
|
|
261
|
+
position: relative;
|
|
262
|
+
transition: border-color 0.15s, background 0.15s;
|
|
263
|
+
}
|
|
264
|
+
input[type="checkbox"]:checked {
|
|
265
|
+
background: var(--neon, #00ff88);
|
|
266
|
+
border-color: var(--neon, #00ff88);
|
|
267
|
+
}
|
|
268
|
+
input[type="checkbox"]:checked::after {
|
|
269
|
+
content: "✓";
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: -1px;
|
|
272
|
+
left: 2px;
|
|
273
|
+
font-size: 12px;
|
|
274
|
+
font-weight: 700;
|
|
275
|
+
color: var(--bg-void, #0A0A0F);
|
|
276
|
+
}
|
|
277
|
+
input[type="checkbox"]:focus-visible {
|
|
278
|
+
outline: 2px solid var(--neon-soft, rgba(0,255,136,0.2));
|
|
279
|
+
outline-offset: 2px;
|
|
280
|
+
}
|
|
250
281
|
.jira-result {
|
|
251
282
|
margin-top: 12px;
|
|
252
283
|
padding: 12px 16px;
|
|
@@ -458,13 +489,22 @@ const initial = {
|
|
|
458
489
|
jiraStatus: "idle",
|
|
459
490
|
jiraResult: null,
|
|
460
491
|
jiraError: "",
|
|
492
|
+
mrStatus: "idle",
|
|
493
|
+
mrUrl: "",
|
|
494
|
+
mrError: "",
|
|
495
|
+
mrBranches: [],
|
|
496
|
+
mrSourceBranch: "",
|
|
497
|
+
mrBranchOpen: false,
|
|
498
|
+
mrBranchSearch: "",
|
|
499
|
+
mrBranchIndex: -1,
|
|
461
500
|
history: [],
|
|
462
501
|
historyLoading: true,
|
|
463
502
|
quickExecuting: null,
|
|
464
503
|
quickResults: {},
|
|
465
504
|
quickErrors: {},
|
|
466
505
|
showNewModal: false,
|
|
467
|
-
clearConfirm: false
|
|
506
|
+
clearConfirm: false,
|
|
507
|
+
createMrChecked: {}
|
|
468
508
|
};
|
|
469
509
|
const reducer = (state, action) => {
|
|
470
510
|
switch (action.type) {
|
|
@@ -516,7 +556,15 @@ const reducer = (state, action) => {
|
|
|
516
556
|
selectedJiraProject: null,
|
|
517
557
|
jiraStatus: "idle",
|
|
518
558
|
jiraResult: null,
|
|
519
|
-
jiraError: ""
|
|
559
|
+
jiraError: "",
|
|
560
|
+
mrStatus: "idle",
|
|
561
|
+
mrUrl: "",
|
|
562
|
+
mrError: "",
|
|
563
|
+
mrBranches: [],
|
|
564
|
+
mrSourceBranch: "",
|
|
565
|
+
mrBranchOpen: false,
|
|
566
|
+
mrBranchSearch: "",
|
|
567
|
+
mrBranchIndex: -1
|
|
520
568
|
};
|
|
521
569
|
case "CLEAR_PROJECT": return {
|
|
522
570
|
...state,
|
|
@@ -532,7 +580,15 @@ const reducer = (state, action) => {
|
|
|
532
580
|
selectedJiraProject: null,
|
|
533
581
|
jiraStatus: "idle",
|
|
534
582
|
jiraResult: null,
|
|
535
|
-
jiraError: ""
|
|
583
|
+
jiraError: "",
|
|
584
|
+
mrStatus: "idle",
|
|
585
|
+
mrUrl: "",
|
|
586
|
+
mrError: "",
|
|
587
|
+
mrBranches: [],
|
|
588
|
+
mrSourceBranch: "",
|
|
589
|
+
mrBranchOpen: false,
|
|
590
|
+
mrBranchSearch: "",
|
|
591
|
+
mrBranchIndex: -1
|
|
536
592
|
};
|
|
537
593
|
case "BRANCHES_LOADING": return {
|
|
538
594
|
...state,
|
|
@@ -705,6 +761,68 @@ const reducer = (state, action) => {
|
|
|
705
761
|
quickResults: {},
|
|
706
762
|
quickErrors: {}
|
|
707
763
|
};
|
|
764
|
+
case "TOGGLE_CREATE_MR": return {
|
|
765
|
+
...state,
|
|
766
|
+
createMrChecked: {
|
|
767
|
+
...state.createMrChecked,
|
|
768
|
+
[action.id]: !state.createMrChecked[action.id]
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
case "MR_SELECTING": return {
|
|
772
|
+
...state,
|
|
773
|
+
mrStatus: "selecting",
|
|
774
|
+
mrBranches: action.branches,
|
|
775
|
+
mrSourceBranch: "",
|
|
776
|
+
mrError: ""
|
|
777
|
+
};
|
|
778
|
+
case "MR_SOURCE_SELECTED": return {
|
|
779
|
+
...state,
|
|
780
|
+
mrSourceBranch: action.branch,
|
|
781
|
+
mrBranchOpen: false,
|
|
782
|
+
mrBranchSearch: "",
|
|
783
|
+
mrBranchIndex: -1
|
|
784
|
+
};
|
|
785
|
+
case "SET_MR_BRANCH_OPEN": return {
|
|
786
|
+
...state,
|
|
787
|
+
mrBranchOpen: action.open,
|
|
788
|
+
...action.open ? {} : {
|
|
789
|
+
mrBranchSearch: "",
|
|
790
|
+
mrBranchIndex: -1
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
case "SET_MR_BRANCH_SEARCH": return {
|
|
794
|
+
...state,
|
|
795
|
+
mrBranchSearch: action.search,
|
|
796
|
+
mrBranchIndex: -1
|
|
797
|
+
};
|
|
798
|
+
case "SET_MR_BRANCH_INDEX": return {
|
|
799
|
+
...state,
|
|
800
|
+
mrBranchIndex: action.index
|
|
801
|
+
};
|
|
802
|
+
case "MR_LOADING": return {
|
|
803
|
+
...state,
|
|
804
|
+
mrStatus: "loading",
|
|
805
|
+
mrBranches: [],
|
|
806
|
+
mrSourceBranch: "",
|
|
807
|
+
mrError: ""
|
|
808
|
+
};
|
|
809
|
+
case "MR_CREATING": return {
|
|
810
|
+
...state,
|
|
811
|
+
mrStatus: "creating",
|
|
812
|
+
mrUrl: "",
|
|
813
|
+
mrError: "",
|
|
814
|
+
mrSourceBranch: ""
|
|
815
|
+
};
|
|
816
|
+
case "MR_DONE": return {
|
|
817
|
+
...state,
|
|
818
|
+
mrStatus: "done",
|
|
819
|
+
mrUrl: action.mrUrl
|
|
820
|
+
};
|
|
821
|
+
case "MR_ERROR": return {
|
|
822
|
+
...state,
|
|
823
|
+
mrStatus: "error",
|
|
824
|
+
mrError: action.error
|
|
825
|
+
};
|
|
708
826
|
}
|
|
709
827
|
};
|
|
710
828
|
const cleanVersion = (v) => (v ?? "").split("-")[0];
|
|
@@ -735,7 +853,11 @@ const HistoryList = ({ s, d }) => {
|
|
|
735
853
|
id
|
|
736
854
|
});
|
|
737
855
|
try {
|
|
738
|
-
const data = await (await fetch(`/release/api/history/${id}/execute`, {
|
|
856
|
+
const data = await (await fetch(`/release/api/history/${id}/execute`, {
|
|
857
|
+
method: "POST",
|
|
858
|
+
headers: { "Content-Type": "application/json" },
|
|
859
|
+
body: JSON.stringify({ createMr: s.createMrChecked[id] ?? false })
|
|
860
|
+
})).json();
|
|
739
861
|
if (data.error) d({
|
|
740
862
|
type: "QUICK_EXEC_FAIL",
|
|
741
863
|
id,
|
|
@@ -793,13 +915,23 @@ const HistoryList = ({ s, d }) => {
|
|
|
793
915
|
})]
|
|
794
916
|
}), /* @__PURE__ */ jsxDEV("div", {
|
|
795
917
|
class: "history-actions",
|
|
796
|
-
children: /* @__PURE__ */ jsxDEV("
|
|
918
|
+
children: [/* @__PURE__ */ jsxDEV("label", {
|
|
919
|
+
style: "display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-3);cursor:pointer",
|
|
920
|
+
children: [/* @__PURE__ */ jsxDEV("input", {
|
|
921
|
+
type: "checkbox",
|
|
922
|
+
checked: s.createMrChecked[entry.id] ?? false,
|
|
923
|
+
onChange: () => d({
|
|
924
|
+
type: "TOGGLE_CREATE_MR",
|
|
925
|
+
id: entry.id
|
|
926
|
+
})
|
|
927
|
+
}), t("web.createMrCheckbox")]
|
|
928
|
+
}), /* @__PURE__ */ jsxDEV("button", {
|
|
797
929
|
class: `history-quick-btn${s.quickExecuting === entry.id ? " executing" : ""}`,
|
|
798
930
|
type: "button",
|
|
799
931
|
disabled: s.quickExecuting !== null,
|
|
800
932
|
onClick: () => handleQuickExecute(entry.id),
|
|
801
933
|
children: s.quickExecuting === entry.id ? t("web.executing") : t("web.quickExecute")
|
|
802
|
-
})
|
|
934
|
+
})]
|
|
803
935
|
})]
|
|
804
936
|
}),
|
|
805
937
|
s.quickResults[entry.id] && /* @__PURE__ */ jsxDEV("div", {
|
|
@@ -819,6 +951,16 @@ const HistoryList = ({ s, d }) => {
|
|
|
819
951
|
s.quickResults[entry.id].versionCreated && /* @__PURE__ */ jsxDEV("span", {
|
|
820
952
|
style: "font-size:10px;color:var(--neon);margin-left:4px",
|
|
821
953
|
children: t("web.createdBadge")
|
|
954
|
+
}),
|
|
955
|
+
s.quickResults[entry.id].mrUrl && /* @__PURE__ */ jsxDEV("span", {
|
|
956
|
+
style: "font-size:12px;margin-left:12px",
|
|
957
|
+
children: /* @__PURE__ */ jsxDEV("a", {
|
|
958
|
+
href: s.quickResults[entry.id].mrUrl,
|
|
959
|
+
target: "_blank",
|
|
960
|
+
rel: "noreferrer",
|
|
961
|
+
style: "color:var(--cyan);text-decoration:none;border-bottom:1px dashed var(--cyan)",
|
|
962
|
+
children: "MR"
|
|
963
|
+
})
|
|
822
964
|
})
|
|
823
965
|
]
|
|
824
966
|
}),
|
|
@@ -874,6 +1016,7 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
874
1016
|
const projectSearchRef = useRef(null);
|
|
875
1017
|
const branchSearchRef = useRef(null);
|
|
876
1018
|
const jiraSearchRef = useRef(null);
|
|
1019
|
+
const mrBranchSearchRef = useRef(null);
|
|
877
1020
|
useEffect(() => {
|
|
878
1021
|
fetch("/release/api/config").then((r) => r.json()).then((data) => {
|
|
879
1022
|
if (data.jiraHost) d({
|
|
@@ -898,9 +1041,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
898
1041
|
}));
|
|
899
1042
|
}, []);
|
|
900
1043
|
useEffect(() => {
|
|
901
|
-
if (!s.projectOpen && !s.branchOpen && !s.jiraProjectOpen) return;
|
|
1044
|
+
if (!s.projectOpen && !s.branchOpen && !s.jiraProjectOpen && !s.mrBranchOpen) return;
|
|
902
1045
|
const handler = (e) => {
|
|
903
|
-
|
|
1046
|
+
const target = e.target;
|
|
1047
|
+
if (!target.closest(".sel") && !target.closest(".mr-branch-sel")) {
|
|
904
1048
|
d({
|
|
905
1049
|
type: "SET_PROJECT_OPEN",
|
|
906
1050
|
open: false
|
|
@@ -909,6 +1053,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
909
1053
|
type: "SET_BRANCH_OPEN",
|
|
910
1054
|
open: false
|
|
911
1055
|
});
|
|
1056
|
+
d({
|
|
1057
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1058
|
+
open: false
|
|
1059
|
+
});
|
|
912
1060
|
d({
|
|
913
1061
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
914
1062
|
open: false
|
|
@@ -926,11 +1074,39 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
926
1074
|
if (s.projectOpen) setTimeout(() => projectSearchRef.current?.focus(), 50);
|
|
927
1075
|
if (s.branchOpen) setTimeout(() => branchSearchRef.current?.focus(), 50);
|
|
928
1076
|
if (s.jiraProjectOpen) setTimeout(() => jiraSearchRef.current?.focus(), 50);
|
|
1077
|
+
if (s.mrBranchOpen) setTimeout(() => mrBranchSearchRef.current?.focus(), 50);
|
|
929
1078
|
}, [
|
|
930
1079
|
s.projectOpen,
|
|
931
1080
|
s.branchOpen,
|
|
932
|
-
s.jiraProjectOpen
|
|
1081
|
+
s.jiraProjectOpen,
|
|
1082
|
+
s.mrBranchOpen
|
|
933
1083
|
]);
|
|
1084
|
+
useEffect(() => {
|
|
1085
|
+
if (s.mrStatus !== "creating" || !s.mrSourceBranch || !s.selected) return;
|
|
1086
|
+
const jiraUrl2 = s.jiraResult && s.jiraHost ? `${s.jiraHost}/browse/${s.jiraResult.key}` : "";
|
|
1087
|
+
fetch("/release/api/create-mr", {
|
|
1088
|
+
method: "POST",
|
|
1089
|
+
headers: { "Content-Type": "application/json" },
|
|
1090
|
+
body: JSON.stringify({
|
|
1091
|
+
projectId: s.selected.id,
|
|
1092
|
+
targetBranch: s.selectedBranch,
|
|
1093
|
+
sourceBranch: s.mrSourceBranch,
|
|
1094
|
+
jiraUrl: jiraUrl2
|
|
1095
|
+
})
|
|
1096
|
+
}).then((r) => r.json()).then((data) => {
|
|
1097
|
+
if (data.mrUrl) d({
|
|
1098
|
+
type: "MR_DONE",
|
|
1099
|
+
mrUrl: data.mrUrl
|
|
1100
|
+
});
|
|
1101
|
+
else d({
|
|
1102
|
+
type: "MR_ERROR",
|
|
1103
|
+
error: data.error ?? "Failed"
|
|
1104
|
+
});
|
|
1105
|
+
}).catch((e) => d({
|
|
1106
|
+
type: "MR_ERROR",
|
|
1107
|
+
error: e instanceof Error ? e.message : "Failed"
|
|
1108
|
+
}));
|
|
1109
|
+
}, [s.mrStatus, s.mrSourceBranch]);
|
|
934
1110
|
useEffect(() => {
|
|
935
1111
|
if (!s.pomInfo?.version || s.jiraProjects.length > 0 || s.jiraProjectsLoading) return;
|
|
936
1112
|
d({ type: "JIRA_PROJECTS_LOADING" });
|
|
@@ -1178,6 +1354,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1178
1354
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
1179
1355
|
open: false
|
|
1180
1356
|
});
|
|
1357
|
+
d({
|
|
1358
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1359
|
+
open: false
|
|
1360
|
+
});
|
|
1181
1361
|
d({
|
|
1182
1362
|
type: "SET_PROJECT_OPEN",
|
|
1183
1363
|
open: !s.projectOpen
|
|
@@ -1269,6 +1449,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1269
1449
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
1270
1450
|
open: false
|
|
1271
1451
|
});
|
|
1452
|
+
d({
|
|
1453
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1454
|
+
open: false
|
|
1455
|
+
});
|
|
1272
1456
|
d({
|
|
1273
1457
|
type: "SET_BRANCH_OPEN",
|
|
1274
1458
|
open: !s.branchOpen
|
|
@@ -1491,6 +1675,152 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1491
1675
|
class: "jira-error",
|
|
1492
1676
|
role: "alert",
|
|
1493
1677
|
children: s.jiraError
|
|
1678
|
+
}),
|
|
1679
|
+
s.jiraResult && (s.mrStatus === "idle" || s.mrStatus === "loading") && /* @__PURE__ */ jsxDEV("button", {
|
|
1680
|
+
class: "jira-btn",
|
|
1681
|
+
type: "button",
|
|
1682
|
+
style: "background:var(--cyan);margin-top:12px",
|
|
1683
|
+
onClick: async () => {
|
|
1684
|
+
d({ type: "MR_LOADING" });
|
|
1685
|
+
try {
|
|
1686
|
+
const data = await (await fetch(`/release/api/projects/${s.selected.id}/branches`)).json();
|
|
1687
|
+
const branches = (Array.isArray(data) ? data : []).filter((b) => b.name !== s.selectedBranch);
|
|
1688
|
+
if (branches.length === 0) {
|
|
1689
|
+
d({
|
|
1690
|
+
type: "MR_ERROR",
|
|
1691
|
+
error: t("release.noSourceBranches")
|
|
1692
|
+
});
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1695
|
+
d({
|
|
1696
|
+
type: "MR_SELECTING",
|
|
1697
|
+
branches
|
|
1698
|
+
});
|
|
1699
|
+
} catch (e) {
|
|
1700
|
+
d({
|
|
1701
|
+
type: "MR_ERROR",
|
|
1702
|
+
error: e instanceof Error ? e.message : "Failed"
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
children: s.mrStatus === "loading" ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1707
|
+
class: "spinner",
|
|
1708
|
+
style: "width:12px;height:12px;border-width:1px;margin-right:6px;vertical-align:middle"
|
|
1709
|
+
}), t("web.loadingMr")] }) : t("web.createMrBtn")
|
|
1710
|
+
}),
|
|
1711
|
+
s.mrStatus === "selecting" && (() => {
|
|
1712
|
+
const mrb = s.mrBranches.filter((b) => b.name.toLowerCase().includes(s.mrBranchSearch.toLowerCase()));
|
|
1713
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
1714
|
+
class: "mr-branch-sel",
|
|
1715
|
+
style: "margin-top:12px",
|
|
1716
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1717
|
+
style: "font-size:13px;color:var(--text-2);margin-bottom:4px",
|
|
1718
|
+
children: t("release.selectMrBranch")
|
|
1719
|
+
}), /* @__PURE__ */ jsxDEV("div", {
|
|
1720
|
+
class: "sel",
|
|
1721
|
+
style: "position:relative;z-index:100",
|
|
1722
|
+
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
1723
|
+
type: "button",
|
|
1724
|
+
class: "sel-trigger",
|
|
1725
|
+
onClick: () => d({
|
|
1726
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1727
|
+
open: !s.mrBranchOpen
|
|
1728
|
+
}),
|
|
1729
|
+
children: [
|
|
1730
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1731
|
+
class: "sel-trigger-label",
|
|
1732
|
+
children: t("web.branchLabel")
|
|
1733
|
+
}),
|
|
1734
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1735
|
+
class: `sel-trigger-value${s.mrSourceBranch ? "" : " empty"}`,
|
|
1736
|
+
children: s.mrSourceBranch || t("web.selectBranch")
|
|
1737
|
+
}),
|
|
1738
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1739
|
+
class: "sel-trigger-arrow",
|
|
1740
|
+
children: "▼"
|
|
1741
|
+
})
|
|
1742
|
+
]
|
|
1743
|
+
}), s.mrBranchOpen && /* @__PURE__ */ jsxDEV("div", {
|
|
1744
|
+
class: "sel-dropdown",
|
|
1745
|
+
role: "listbox",
|
|
1746
|
+
"aria-label": t("release.selectMrBranch"),
|
|
1747
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1748
|
+
class: "sel-search",
|
|
1749
|
+
children: /* @__PURE__ */ jsxDEV("input", {
|
|
1750
|
+
ref: mrBranchSearchRef,
|
|
1751
|
+
class: "sel-search-input",
|
|
1752
|
+
type: "text",
|
|
1753
|
+
placeholder: t("web.filterBranches"),
|
|
1754
|
+
value: s.mrBranchSearch,
|
|
1755
|
+
onChange: (e) => d({
|
|
1756
|
+
type: "SET_MR_BRANCH_SEARCH",
|
|
1757
|
+
search: e.target.value
|
|
1758
|
+
}),
|
|
1759
|
+
onKeyDown: (e) => {
|
|
1760
|
+
const n = selKeyDown(e, s.mrBranchOpen, mrb.length, s.mrBranchIndex, (i) => {
|
|
1761
|
+
if (mrb[i]) d({
|
|
1762
|
+
type: "MR_SOURCE_SELECTED",
|
|
1763
|
+
branch: mrb[i].name
|
|
1764
|
+
});
|
|
1765
|
+
}, () => d({
|
|
1766
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1767
|
+
open: false
|
|
1768
|
+
}));
|
|
1769
|
+
if (n !== void 0) d({
|
|
1770
|
+
type: "SET_MR_BRANCH_INDEX",
|
|
1771
|
+
index: n
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
})
|
|
1775
|
+
}), mrb.length > 0 ? mrb.map((b, i) => /* @__PURE__ */ jsxDEV("div", {
|
|
1776
|
+
class: `sel-item${b.name === s.mrSourceBranch ? " active" : ""}${i === s.mrBranchIndex ? " highlighted" : ""}`,
|
|
1777
|
+
onMouseEnter: () => d({
|
|
1778
|
+
type: "SET_MR_BRANCH_INDEX",
|
|
1779
|
+
index: i
|
|
1780
|
+
}),
|
|
1781
|
+
onClick: () => d({
|
|
1782
|
+
type: "MR_SOURCE_SELECTED",
|
|
1783
|
+
branch: b.name
|
|
1784
|
+
}),
|
|
1785
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1786
|
+
class: "sel-item-name",
|
|
1787
|
+
children: b.name
|
|
1788
|
+
}), b.default && /* @__PURE__ */ jsxDEV("span", {
|
|
1789
|
+
style: "font-size:10px;color:var(--neon);margin-left:6px",
|
|
1790
|
+
children: t("web.defaultBranch")
|
|
1791
|
+
})]
|
|
1792
|
+
})) : /* @__PURE__ */ jsxDEV("div", {
|
|
1793
|
+
class: "sel-empty",
|
|
1794
|
+
children: t("web.noBranches")
|
|
1795
|
+
})]
|
|
1796
|
+
})]
|
|
1797
|
+
})]
|
|
1798
|
+
});
|
|
1799
|
+
})(),
|
|
1800
|
+
s.mrStatus === "creating" && /* @__PURE__ */ jsxDEV("div", {
|
|
1801
|
+
class: "loading-row",
|
|
1802
|
+
style: "margin-top:12px",
|
|
1803
|
+
children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("end.creatingMR")]
|
|
1804
|
+
}),
|
|
1805
|
+
s.mrStatus === "done" && s.mrUrl && /* @__PURE__ */ jsxDEV("div", {
|
|
1806
|
+
class: "jira-result",
|
|
1807
|
+
style: "margin-top:12px",
|
|
1808
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1809
|
+
class: "jira-result-label",
|
|
1810
|
+
children: "MR"
|
|
1811
|
+
}), /* @__PURE__ */ jsxDEV("a", {
|
|
1812
|
+
class: "jira-result-key",
|
|
1813
|
+
href: s.mrUrl,
|
|
1814
|
+
target: "_blank",
|
|
1815
|
+
rel: "noreferrer",
|
|
1816
|
+
children: t("end.mrCreated")
|
|
1817
|
+
})]
|
|
1818
|
+
}),
|
|
1819
|
+
s.mrStatus === "error" && s.mrError && /* @__PURE__ */ jsxDEV("div", {
|
|
1820
|
+
class: "jira-error",
|
|
1821
|
+
role: "alert",
|
|
1822
|
+
style: "margin-top:12px",
|
|
1823
|
+
children: s.mrError
|
|
1494
1824
|
})
|
|
1495
1825
|
]
|
|
1496
1826
|
}),
|