flowpilot 0.0.2 → 0.1.16
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-DSXtnba0.js → client-Cc7BGooE.js} +1 -1
- package/dist/client/chunks/{client-oAYP8wOx.js → client-D1_CE06D.js} +423 -35
- package/dist/client/chunks/{client-Bb-xh-5_.js → client-IzVnMhfC.js} +1 -1
- 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 +22 -6
|
@@ -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,23 @@ 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
|
+
mrTargetBranch: "",
|
|
498
|
+
mrBranchOpen: false,
|
|
499
|
+
mrBranchSearch: "",
|
|
500
|
+
mrBranchIndex: -1,
|
|
461
501
|
history: [],
|
|
462
502
|
historyLoading: true,
|
|
463
503
|
quickExecuting: null,
|
|
464
504
|
quickResults: {},
|
|
465
505
|
quickErrors: {},
|
|
466
506
|
showNewModal: false,
|
|
467
|
-
clearConfirm: false
|
|
507
|
+
clearConfirm: false,
|
|
508
|
+
createMrChecked: {}
|
|
468
509
|
};
|
|
469
510
|
const reducer = (state, action) => {
|
|
470
511
|
switch (action.type) {
|
|
@@ -516,7 +557,16 @@ const reducer = (state, action) => {
|
|
|
516
557
|
selectedJiraProject: null,
|
|
517
558
|
jiraStatus: "idle",
|
|
518
559
|
jiraResult: null,
|
|
519
|
-
jiraError: ""
|
|
560
|
+
jiraError: "",
|
|
561
|
+
mrStatus: "idle",
|
|
562
|
+
mrUrl: "",
|
|
563
|
+
mrError: "",
|
|
564
|
+
mrBranches: [],
|
|
565
|
+
mrSourceBranch: "",
|
|
566
|
+
mrTargetBranch: "",
|
|
567
|
+
mrBranchOpen: false,
|
|
568
|
+
mrBranchSearch: "",
|
|
569
|
+
mrBranchIndex: -1
|
|
520
570
|
};
|
|
521
571
|
case "CLEAR_PROJECT": return {
|
|
522
572
|
...state,
|
|
@@ -532,7 +582,16 @@ const reducer = (state, action) => {
|
|
|
532
582
|
selectedJiraProject: null,
|
|
533
583
|
jiraStatus: "idle",
|
|
534
584
|
jiraResult: null,
|
|
535
|
-
jiraError: ""
|
|
585
|
+
jiraError: "",
|
|
586
|
+
mrStatus: "idle",
|
|
587
|
+
mrUrl: "",
|
|
588
|
+
mrError: "",
|
|
589
|
+
mrBranches: [],
|
|
590
|
+
mrSourceBranch: "",
|
|
591
|
+
mrTargetBranch: "",
|
|
592
|
+
mrBranchOpen: false,
|
|
593
|
+
mrBranchSearch: "",
|
|
594
|
+
mrBranchIndex: -1
|
|
536
595
|
};
|
|
537
596
|
case "BRANCHES_LOADING": return {
|
|
538
597
|
...state,
|
|
@@ -705,6 +764,78 @@ const reducer = (state, action) => {
|
|
|
705
764
|
quickResults: {},
|
|
706
765
|
quickErrors: {}
|
|
707
766
|
};
|
|
767
|
+
case "TOGGLE_CREATE_MR": return {
|
|
768
|
+
...state,
|
|
769
|
+
createMrChecked: {
|
|
770
|
+
...state.createMrChecked,
|
|
771
|
+
[action.id]: !state.createMrChecked[action.id]
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
case "MR_SELECTING": return {
|
|
775
|
+
...state,
|
|
776
|
+
mrStatus: "selecting",
|
|
777
|
+
mrBranches: action.branches,
|
|
778
|
+
mrSourceBranch: "",
|
|
779
|
+
mrTargetBranch: "",
|
|
780
|
+
mrError: ""
|
|
781
|
+
};
|
|
782
|
+
case "MR_SOURCE_SELECTED": return {
|
|
783
|
+
...state,
|
|
784
|
+
mrSourceBranch: action.branch,
|
|
785
|
+
mrBranchOpen: false,
|
|
786
|
+
mrBranchSearch: "",
|
|
787
|
+
mrBranchIndex: -1
|
|
788
|
+
};
|
|
789
|
+
case "SET_MR_BRANCH_OPEN": return {
|
|
790
|
+
...state,
|
|
791
|
+
mrBranchOpen: action.open,
|
|
792
|
+
...action.open ? {} : {
|
|
793
|
+
mrBranchSearch: "",
|
|
794
|
+
mrBranchIndex: -1
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
case "SET_MR_BRANCH_SEARCH": return {
|
|
798
|
+
...state,
|
|
799
|
+
mrBranchSearch: action.search,
|
|
800
|
+
mrBranchIndex: -1
|
|
801
|
+
};
|
|
802
|
+
case "SET_MR_BRANCH_INDEX": return {
|
|
803
|
+
...state,
|
|
804
|
+
mrBranchIndex: action.index
|
|
805
|
+
};
|
|
806
|
+
case "MR_LOADING": return {
|
|
807
|
+
...state,
|
|
808
|
+
mrStatus: "loading",
|
|
809
|
+
mrBranches: [],
|
|
810
|
+
mrSourceBranch: "",
|
|
811
|
+
mrTargetBranch: "",
|
|
812
|
+
mrError: ""
|
|
813
|
+
};
|
|
814
|
+
case "MR_CREATING": return {
|
|
815
|
+
...state,
|
|
816
|
+
mrStatus: "creating",
|
|
817
|
+
mrUrl: "",
|
|
818
|
+
mrTargetBranch: "",
|
|
819
|
+
mrError: ""
|
|
820
|
+
};
|
|
821
|
+
case "MR_DONE": return {
|
|
822
|
+
...state,
|
|
823
|
+
mrStatus: "done",
|
|
824
|
+
mrUrl: action.mrUrl,
|
|
825
|
+
mrSourceBranch: action.mrSourceBranch,
|
|
826
|
+
mrTargetBranch: action.mrTargetBranch,
|
|
827
|
+
history: state.history.map((e) => e.projectId === state.selected?.id && e.branch === state.selectedBranch ? {
|
|
828
|
+
...e,
|
|
829
|
+
mrUrl: action.mrUrl,
|
|
830
|
+
mrSourceBranch: action.mrSourceBranch,
|
|
831
|
+
mrTargetBranch: action.mrTargetBranch
|
|
832
|
+
} : e)
|
|
833
|
+
};
|
|
834
|
+
case "MR_ERROR": return {
|
|
835
|
+
...state,
|
|
836
|
+
mrStatus: "error",
|
|
837
|
+
mrError: action.error
|
|
838
|
+
};
|
|
708
839
|
}
|
|
709
840
|
};
|
|
710
841
|
const cleanVersion = (v) => (v ?? "").split("-")[0];
|
|
@@ -735,7 +866,11 @@ const HistoryList = ({ s, d }) => {
|
|
|
735
866
|
id
|
|
736
867
|
});
|
|
737
868
|
try {
|
|
738
|
-
const data = await (await fetch(`/release/api/history/${id}/execute`, {
|
|
869
|
+
const data = await (await fetch(`/release/api/history/${id}/execute`, {
|
|
870
|
+
method: "POST",
|
|
871
|
+
headers: { "Content-Type": "application/json" },
|
|
872
|
+
body: JSON.stringify({ createMr: s.createMrChecked[id] ?? false })
|
|
873
|
+
})).json();
|
|
739
874
|
if (data.error) d({
|
|
740
875
|
type: "QUICK_EXEC_FAIL",
|
|
741
876
|
id,
|
|
@@ -780,26 +915,46 @@ const HistoryList = ({ s, d }) => {
|
|
|
780
915
|
class: "history-item-row",
|
|
781
916
|
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
782
917
|
class: "history-info",
|
|
783
|
-
children: [
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
918
|
+
children: [
|
|
919
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
920
|
+
class: "history-project",
|
|
921
|
+
children: entry.projectName
|
|
922
|
+
}),
|
|
923
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
924
|
+
class: "history-detail",
|
|
925
|
+
children: [
|
|
926
|
+
entry.branch,
|
|
927
|
+
" / ",
|
|
928
|
+
entry.jiraProjectKey
|
|
929
|
+
]
|
|
930
|
+
}),
|
|
931
|
+
entry.mrUrl && /* @__PURE__ */ jsxDEV("span", {
|
|
932
|
+
style: "font-size:12px;color:var(--text-3);margin-left:6px",
|
|
933
|
+
children: t("release.mrFromTo", {
|
|
934
|
+
source: entry.mrSourceBranch ?? "",
|
|
935
|
+
target: entry.mrTargetBranch ?? entry.branch
|
|
936
|
+
})
|
|
937
|
+
})
|
|
938
|
+
]
|
|
794
939
|
}), /* @__PURE__ */ jsxDEV("div", {
|
|
795
940
|
class: "history-actions",
|
|
796
|
-
children: /* @__PURE__ */ jsxDEV("
|
|
941
|
+
children: [entry.mrUrl && /* @__PURE__ */ jsxDEV("label", {
|
|
942
|
+
style: "display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-3);cursor:pointer",
|
|
943
|
+
children: [/* @__PURE__ */ jsxDEV("input", {
|
|
944
|
+
type: "checkbox",
|
|
945
|
+
checked: s.createMrChecked[entry.id] ?? false,
|
|
946
|
+
onChange: () => d({
|
|
947
|
+
type: "TOGGLE_CREATE_MR",
|
|
948
|
+
id: entry.id
|
|
949
|
+
})
|
|
950
|
+
}), t("web.createMrCheckbox")]
|
|
951
|
+
}), /* @__PURE__ */ jsxDEV("button", {
|
|
797
952
|
class: `history-quick-btn${s.quickExecuting === entry.id ? " executing" : ""}`,
|
|
798
953
|
type: "button",
|
|
799
954
|
disabled: s.quickExecuting !== null,
|
|
800
955
|
onClick: () => handleQuickExecute(entry.id),
|
|
801
956
|
children: s.quickExecuting === entry.id ? t("web.executing") : t("web.quickExecute")
|
|
802
|
-
})
|
|
957
|
+
})]
|
|
803
958
|
})]
|
|
804
959
|
}),
|
|
805
960
|
s.quickResults[entry.id] && /* @__PURE__ */ jsxDEV("div", {
|
|
@@ -812,6 +967,10 @@ const HistoryList = ({ s, d }) => {
|
|
|
812
967
|
rel: "noreferrer",
|
|
813
968
|
children: s.quickResults[entry.id].issueKey
|
|
814
969
|
}),
|
|
970
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
971
|
+
class: `jira-result-badge ${s.quickResults[entry.id].issueCreated ? "created" : "exists"}`,
|
|
972
|
+
children: s.quickResults[entry.id].issueCreated ? t("web.createdBadge") : t("web.existsBadge")
|
|
973
|
+
}),
|
|
815
974
|
/* @__PURE__ */ jsxDEV("span", {
|
|
816
975
|
style: "font-size:12px;color:var(--text-3);margin-left:8px",
|
|
817
976
|
children: ["v", s.quickResults[entry.id].version]
|
|
@@ -819,6 +978,19 @@ const HistoryList = ({ s, d }) => {
|
|
|
819
978
|
s.quickResults[entry.id].versionCreated && /* @__PURE__ */ jsxDEV("span", {
|
|
820
979
|
style: "font-size:10px;color:var(--neon);margin-left:4px",
|
|
821
980
|
children: t("web.createdBadge")
|
|
981
|
+
}),
|
|
982
|
+
s.quickResults[entry.id].mrUrl && /* @__PURE__ */ jsxDEV("span", {
|
|
983
|
+
style: "font-size:12px;margin-left:12px",
|
|
984
|
+
children: /* @__PURE__ */ jsxDEV("a", {
|
|
985
|
+
href: s.quickResults[entry.id].mrUrl,
|
|
986
|
+
target: "_blank",
|
|
987
|
+
rel: "noreferrer",
|
|
988
|
+
style: "color:var(--cyan);text-decoration:none;border-bottom:1px dashed var(--cyan)",
|
|
989
|
+
children: t("release.mrFromTo", {
|
|
990
|
+
source: s.quickResults[entry.id].mrSourceBranch ?? "",
|
|
991
|
+
target: s.quickResults[entry.id].mrTargetBranch ?? entry.branch
|
|
992
|
+
})
|
|
993
|
+
})
|
|
822
994
|
})
|
|
823
995
|
]
|
|
824
996
|
}),
|
|
@@ -874,6 +1046,7 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
874
1046
|
const projectSearchRef = useRef(null);
|
|
875
1047
|
const branchSearchRef = useRef(null);
|
|
876
1048
|
const jiraSearchRef = useRef(null);
|
|
1049
|
+
const mrBranchSearchRef = useRef(null);
|
|
877
1050
|
useEffect(() => {
|
|
878
1051
|
fetch("/release/api/config").then((r) => r.json()).then((data) => {
|
|
879
1052
|
if (data.jiraHost) d({
|
|
@@ -898,9 +1071,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
898
1071
|
}));
|
|
899
1072
|
}, []);
|
|
900
1073
|
useEffect(() => {
|
|
901
|
-
if (!s.projectOpen && !s.branchOpen && !s.jiraProjectOpen) return;
|
|
1074
|
+
if (!s.projectOpen && !s.branchOpen && !s.jiraProjectOpen && !s.mrBranchOpen) return;
|
|
902
1075
|
const handler = (e) => {
|
|
903
|
-
|
|
1076
|
+
const target = e.target;
|
|
1077
|
+
if (!target.closest(".sel") && !target.closest(".mr-branch-sel")) {
|
|
904
1078
|
d({
|
|
905
1079
|
type: "SET_PROJECT_OPEN",
|
|
906
1080
|
open: false
|
|
@@ -909,6 +1083,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
909
1083
|
type: "SET_BRANCH_OPEN",
|
|
910
1084
|
open: false
|
|
911
1085
|
});
|
|
1086
|
+
d({
|
|
1087
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1088
|
+
open: false
|
|
1089
|
+
});
|
|
912
1090
|
d({
|
|
913
1091
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
914
1092
|
open: false
|
|
@@ -926,11 +1104,46 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
926
1104
|
if (s.projectOpen) setTimeout(() => projectSearchRef.current?.focus(), 50);
|
|
927
1105
|
if (s.branchOpen) setTimeout(() => branchSearchRef.current?.focus(), 50);
|
|
928
1106
|
if (s.jiraProjectOpen) setTimeout(() => jiraSearchRef.current?.focus(), 50);
|
|
1107
|
+
if (s.mrBranchOpen) setTimeout(() => mrBranchSearchRef.current?.focus(), 50);
|
|
929
1108
|
}, [
|
|
930
1109
|
s.projectOpen,
|
|
931
1110
|
s.branchOpen,
|
|
932
|
-
s.jiraProjectOpen
|
|
1111
|
+
s.jiraProjectOpen,
|
|
1112
|
+
s.mrBranchOpen
|
|
933
1113
|
]);
|
|
1114
|
+
useEffect(() => {
|
|
1115
|
+
if (s.mrStatus !== "creating" || !s.mrSourceBranch || !s.selected) return;
|
|
1116
|
+
const jiraUrl2 = s.jiraResult && s.jiraHost ? `${s.jiraHost}/browse/${s.jiraResult.key}` : "";
|
|
1117
|
+
fetch("/release/api/create-mr", {
|
|
1118
|
+
method: "POST",
|
|
1119
|
+
headers: { "Content-Type": "application/json" },
|
|
1120
|
+
body: JSON.stringify({
|
|
1121
|
+
projectId: s.selected.id,
|
|
1122
|
+
targetBranch: s.selectedBranch,
|
|
1123
|
+
sourceBranch: s.mrSourceBranch,
|
|
1124
|
+
jiraUrl: jiraUrl2
|
|
1125
|
+
})
|
|
1126
|
+
}).then((r) => r.json()).then((data) => {
|
|
1127
|
+
if (data.mrUrl) {
|
|
1128
|
+
d({
|
|
1129
|
+
type: "MR_DONE",
|
|
1130
|
+
mrUrl: data.mrUrl,
|
|
1131
|
+
mrSourceBranch: data.sourceBranch,
|
|
1132
|
+
mrTargetBranch: data.targetBranch
|
|
1133
|
+
});
|
|
1134
|
+
fetch("/release/api/history").then((r) => r.json()).then((h) => d({
|
|
1135
|
+
type: "HISTORY_LOADED",
|
|
1136
|
+
history: h
|
|
1137
|
+
}));
|
|
1138
|
+
} else d({
|
|
1139
|
+
type: "MR_ERROR",
|
|
1140
|
+
error: data.error ?? "Failed"
|
|
1141
|
+
});
|
|
1142
|
+
}).catch((e) => d({
|
|
1143
|
+
type: "MR_ERROR",
|
|
1144
|
+
error: e instanceof Error ? e.message : "Failed"
|
|
1145
|
+
}));
|
|
1146
|
+
}, [s.mrStatus, s.mrSourceBranch]);
|
|
934
1147
|
useEffect(() => {
|
|
935
1148
|
if (!s.pomInfo?.version || s.jiraProjects.length > 0 || s.jiraProjectsLoading) return;
|
|
936
1149
|
d({ type: "JIRA_PROJECTS_LOADING" });
|
|
@@ -1178,6 +1391,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1178
1391
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
1179
1392
|
open: false
|
|
1180
1393
|
});
|
|
1394
|
+
d({
|
|
1395
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1396
|
+
open: false
|
|
1397
|
+
});
|
|
1181
1398
|
d({
|
|
1182
1399
|
type: "SET_PROJECT_OPEN",
|
|
1183
1400
|
open: !s.projectOpen
|
|
@@ -1269,6 +1486,10 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1269
1486
|
type: "SET_JIRA_PROJECT_OPEN",
|
|
1270
1487
|
open: false
|
|
1271
1488
|
});
|
|
1489
|
+
d({
|
|
1490
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1491
|
+
open: false
|
|
1492
|
+
});
|
|
1272
1493
|
d({
|
|
1273
1494
|
type: "SET_BRANCH_OPEN",
|
|
1274
1495
|
open: !s.branchOpen
|
|
@@ -1491,6 +1712,173 @@ const ReleaseFlow = ({ s, d }) => {
|
|
|
1491
1712
|
class: "jira-error",
|
|
1492
1713
|
role: "alert",
|
|
1493
1714
|
children: s.jiraError
|
|
1715
|
+
}),
|
|
1716
|
+
s.jiraResult && (s.mrStatus === "idle" || s.mrStatus === "loading") && /* @__PURE__ */ jsxDEV("button", {
|
|
1717
|
+
class: "jira-btn",
|
|
1718
|
+
type: "button",
|
|
1719
|
+
disabled: s.mrStatus === "loading",
|
|
1720
|
+
style: "background:var(--cyan);margin-top:12px",
|
|
1721
|
+
onClick: async () => {
|
|
1722
|
+
if (s.mrStatus === "loading") return;
|
|
1723
|
+
d({ type: "MR_LOADING" });
|
|
1724
|
+
try {
|
|
1725
|
+
const data = await (await fetch(`/release/api/projects/${s.selected.id}/branches`)).json();
|
|
1726
|
+
const branches = (Array.isArray(data) ? data : []).filter((b) => b.name !== s.selectedBranch);
|
|
1727
|
+
if (branches.length === 0) {
|
|
1728
|
+
d({
|
|
1729
|
+
type: "MR_ERROR",
|
|
1730
|
+
error: t("release.noSourceBranches")
|
|
1731
|
+
});
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
d({
|
|
1735
|
+
type: "MR_SELECTING",
|
|
1736
|
+
branches
|
|
1737
|
+
});
|
|
1738
|
+
} catch (e) {
|
|
1739
|
+
d({
|
|
1740
|
+
type: "MR_ERROR",
|
|
1741
|
+
error: e instanceof Error ? e.message : "Failed"
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
},
|
|
1745
|
+
children: s.mrStatus === "loading" ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1746
|
+
class: "spinner",
|
|
1747
|
+
style: "width:12px;height:12px;border-width:1px;margin-right:6px;vertical-align:middle"
|
|
1748
|
+
}), t("web.loadingMr")] }) : t("web.createMrBtn")
|
|
1749
|
+
}),
|
|
1750
|
+
s.mrStatus === "selecting" && (() => {
|
|
1751
|
+
const mrb = s.mrBranches.filter((b) => b.name.toLowerCase().includes(s.mrBranchSearch.toLowerCase()));
|
|
1752
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
1753
|
+
class: "mr-branch-sel",
|
|
1754
|
+
style: "margin-top:12px",
|
|
1755
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1756
|
+
style: "font-size:13px;color:var(--text-2);margin-bottom:4px",
|
|
1757
|
+
children: t("release.selectMrBranch")
|
|
1758
|
+
}), /* @__PURE__ */ jsxDEV("div", {
|
|
1759
|
+
class: "sel",
|
|
1760
|
+
style: "position:relative;z-index:100",
|
|
1761
|
+
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
1762
|
+
type: "button",
|
|
1763
|
+
class: "sel-trigger",
|
|
1764
|
+
onClick: () => d({
|
|
1765
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1766
|
+
open: !s.mrBranchOpen
|
|
1767
|
+
}),
|
|
1768
|
+
children: [
|
|
1769
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1770
|
+
class: "sel-trigger-label",
|
|
1771
|
+
children: t("web.branchLabel")
|
|
1772
|
+
}),
|
|
1773
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1774
|
+
class: `sel-trigger-value${s.mrSourceBranch ? "" : " empty"}`,
|
|
1775
|
+
children: s.mrSourceBranch || t("web.selectBranch")
|
|
1776
|
+
}),
|
|
1777
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1778
|
+
class: "sel-trigger-arrow",
|
|
1779
|
+
children: "▼"
|
|
1780
|
+
})
|
|
1781
|
+
]
|
|
1782
|
+
}), s.mrBranchOpen && /* @__PURE__ */ jsxDEV("div", {
|
|
1783
|
+
class: "sel-dropdown",
|
|
1784
|
+
role: "listbox",
|
|
1785
|
+
"aria-label": t("release.selectMrBranch"),
|
|
1786
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1787
|
+
class: "sel-search",
|
|
1788
|
+
children: /* @__PURE__ */ jsxDEV("input", {
|
|
1789
|
+
ref: mrBranchSearchRef,
|
|
1790
|
+
class: "sel-search-input",
|
|
1791
|
+
type: "text",
|
|
1792
|
+
placeholder: t("web.filterBranches"),
|
|
1793
|
+
value: s.mrBranchSearch,
|
|
1794
|
+
onChange: (e) => d({
|
|
1795
|
+
type: "SET_MR_BRANCH_SEARCH",
|
|
1796
|
+
search: e.target.value
|
|
1797
|
+
}),
|
|
1798
|
+
onKeyDown: (e) => {
|
|
1799
|
+
const n = selKeyDown(e, s.mrBranchOpen, mrb.length, s.mrBranchIndex, (i) => {
|
|
1800
|
+
if (mrb[i]) d({
|
|
1801
|
+
type: "MR_SOURCE_SELECTED",
|
|
1802
|
+
branch: mrb[i].name
|
|
1803
|
+
});
|
|
1804
|
+
}, () => d({
|
|
1805
|
+
type: "SET_MR_BRANCH_OPEN",
|
|
1806
|
+
open: false
|
|
1807
|
+
}));
|
|
1808
|
+
if (n !== void 0) d({
|
|
1809
|
+
type: "SET_MR_BRANCH_INDEX",
|
|
1810
|
+
index: n
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
})
|
|
1814
|
+
}), mrb.length > 0 ? mrb.map((b, i) => /* @__PURE__ */ jsxDEV("div", {
|
|
1815
|
+
class: `sel-item${b.name === s.mrSourceBranch ? " active" : ""}${i === s.mrBranchIndex ? " highlighted" : ""}`,
|
|
1816
|
+
onMouseEnter: () => d({
|
|
1817
|
+
type: "SET_MR_BRANCH_INDEX",
|
|
1818
|
+
index: i
|
|
1819
|
+
}),
|
|
1820
|
+
onClick: () => d({
|
|
1821
|
+
type: "MR_SOURCE_SELECTED",
|
|
1822
|
+
branch: b.name
|
|
1823
|
+
}),
|
|
1824
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1825
|
+
class: "sel-item-name",
|
|
1826
|
+
children: b.name
|
|
1827
|
+
}), b.default && /* @__PURE__ */ jsxDEV("span", {
|
|
1828
|
+
style: "font-size:10px;color:var(--neon);margin-left:6px",
|
|
1829
|
+
children: t("web.defaultBranch")
|
|
1830
|
+
})]
|
|
1831
|
+
})) : /* @__PURE__ */ jsxDEV("div", {
|
|
1832
|
+
class: "sel-empty",
|
|
1833
|
+
children: t("web.noBranches")
|
|
1834
|
+
})]
|
|
1835
|
+
})]
|
|
1836
|
+
})]
|
|
1837
|
+
});
|
|
1838
|
+
})(),
|
|
1839
|
+
s.mrStatus === "selecting" && s.mrSourceBranch && /* @__PURE__ */ jsxDEV("div", {
|
|
1840
|
+
style: "margin-top:8px",
|
|
1841
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1842
|
+
style: "font-size:13px;color:var(--text-2);margin-bottom:6px",
|
|
1843
|
+
children: t("release.mrFromTo", {
|
|
1844
|
+
source: s.mrSourceBranch,
|
|
1845
|
+
target: s.selectedBranch
|
|
1846
|
+
})
|
|
1847
|
+
}), /* @__PURE__ */ jsxDEV("button", {
|
|
1848
|
+
class: "jira-btn",
|
|
1849
|
+
type: "button",
|
|
1850
|
+
style: "background:var(--cyan);font-size:13px;padding:4px 12px",
|
|
1851
|
+
onClick: () => d({ type: "MR_CREATING" }),
|
|
1852
|
+
children: t("release.confirmCreateMr")
|
|
1853
|
+
})]
|
|
1854
|
+
}),
|
|
1855
|
+
s.mrStatus === "creating" && /* @__PURE__ */ jsxDEV("div", {
|
|
1856
|
+
class: "loading-row",
|
|
1857
|
+
style: "margin-top:12px",
|
|
1858
|
+
children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("release.creatingMrBtn")]
|
|
1859
|
+
}),
|
|
1860
|
+
s.mrStatus === "done" && s.mrUrl && /* @__PURE__ */ jsxDEV("div", {
|
|
1861
|
+
class: "jira-result",
|
|
1862
|
+
style: "margin-top:12px",
|
|
1863
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1864
|
+
class: "jira-result-label",
|
|
1865
|
+
children: "MR"
|
|
1866
|
+
}), /* @__PURE__ */ jsxDEV("a", {
|
|
1867
|
+
class: "jira-result-key",
|
|
1868
|
+
href: s.mrUrl,
|
|
1869
|
+
target: "_blank",
|
|
1870
|
+
rel: "noreferrer",
|
|
1871
|
+
children: t("release.mrFromTo", {
|
|
1872
|
+
source: s.mrSourceBranch,
|
|
1873
|
+
target: s.selectedBranch
|
|
1874
|
+
})
|
|
1875
|
+
})]
|
|
1876
|
+
}),
|
|
1877
|
+
s.mrStatus === "error" && s.mrError && /* @__PURE__ */ jsxDEV("div", {
|
|
1878
|
+
class: "jira-error",
|
|
1879
|
+
role: "alert",
|
|
1880
|
+
style: "margin-top:12px",
|
|
1881
|
+
children: s.mrError
|
|
1494
1882
|
})
|
|
1495
1883
|
]
|
|
1496
1884
|
}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as instance, o as useState, r as useEffect, s as render, t as jsxDEV } from "./jsx-dev-runtime-
|
|
1
|
+
import { n as instance, o as useState, r as useEffect, s as render, t as jsxDEV } from "./jsx-dev-runtime-DOO7Tqjo.js";
|
|
2
2
|
//#region src/commands/config/client.tsx
|
|
3
3
|
const initPromise = typeof window !== "undefined" && window.__I18N_LOCALE__ && window.__I18N_RESOURCES__ ? instance.init({
|
|
4
4
|
lng: window.__I18N_LOCALE__,
|
|
@@ -3701,4 +3701,4 @@ function jsxDEV(tag, props, key) {
|
|
|
3701
3701
|
return node;
|
|
3702
3702
|
}
|
|
3703
3703
|
//#endregion
|
|
3704
|
-
export { useRef as a, useReducer as i, instance as n, useState as o, useEffect as r, render as s, jsxDEV as t };
|
|
3704
|
+
export { useRef as a, Fragment$1 as c, useReducer as i, instance as n, useState as o, useEffect as r, render as s, jsxDEV as t };
|
package/dist/client/client.js
CHANGED
|
@@ -21,9 +21,9 @@ const meta = {
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/client.ts
|
|
23
23
|
const routes = {
|
|
24
|
-
[meta$2.href]: () => import("./chunks/client-
|
|
25
|
-
[meta$1.href]: () => import("./chunks/client-
|
|
26
|
-
[meta.href]: () => import("./chunks/client-
|
|
24
|
+
[meta$2.href]: () => import("./chunks/client-IzVnMhfC.js"),
|
|
25
|
+
[meta$1.href]: () => import("./chunks/client-Cc7BGooE.js"),
|
|
26
|
+
[meta.href]: () => import("./chunks/client-D1_CE06D.js")
|
|
27
27
|
};
|
|
28
28
|
async function boot() {
|
|
29
29
|
const el = document.getElementById("app");
|