n8n-editor-ui 1.69.1 → 1.70.0
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/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-WFxE66IL.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-BntMIzDT.js} +1 -1
- package/dist/assets/{AuthView-CwyYsaEp.js → AuthView-Dxh8QCaY.js} +1 -1
- package/dist/assets/{CanvasChat-aNmHLHsk.js → CanvasChat-rOzwS7Vn.js} +5 -4
- package/dist/assets/{CanvasControls-B0XKV7Yl.js → CanvasControls-Bmo04dJ7.js} +1 -1
- package/dist/assets/{ChangePasswordView-brXzO3ZA.js → ChangePasswordView-BtxMhBmp.js} +2 -2
- package/dist/assets/CollectionParameter-B6D9F9ZW.js +4 -0
- package/dist/assets/{CredentialsView-DmCI_BFM.js → CredentialsView-B4KE87Vi.js} +5 -5
- package/dist/assets/{ErrorView-CgtXwolU.js → ErrorView-BIcv6TEp.js} +1 -1
- package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-DzSjE1X1.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-u1_TBZpo.js} +2 -2
- package/dist/assets/{ExecutionsView-BQFG-zfV.js → ExecutionsView-C8106X7e.js} +22 -22
- package/dist/assets/{ExecutionsView-DlxsqdiC.css → ExecutionsView-COFUjHqa.css} +31 -31
- package/dist/assets/{FileSaver.min-Dec4VlX4.js → FileSaver.min-BP27OS5o.js} +1 -1
- package/dist/assets/{FixedCollectionParameter-UONn8WZJ.js → FixedCollectionParameter-jU2z1mVN.js} +1 -1
- package/dist/assets/{ForgotMyPasswordView-9zRIxS-G.js → ForgotMyPasswordView-BPRVyjqF.js} +2 -2
- package/dist/assets/{MainHeader-Bc9p2q6U.js → MainHeader-C5fjzcBU.js} +50 -21
- package/dist/assets/{MainHeader-CgL_r4xK.css → MainHeader-ucYChAeW.css} +14 -10
- package/dist/assets/{MainSidebar-DlEV1cKl.js → MainSidebar-DDwUpW3R.js} +3 -3
- package/dist/assets/{NodeCreation-DT2fJ_vL.js → NodeCreation-fYCCIvH0.js} +4 -4
- package/dist/assets/{NodeCreator-D0GID8DN.js → NodeCreator-CIH8NrPP.js} +11 -11
- package/dist/assets/{NodeViewSwitcher-s2TUlOvE.css → NodeViewSwitcher-KdRgfKxB.css} +70 -61
- package/dist/assets/{NodeViewSwitcher-CTbxFDX4.js → NodeViewSwitcher-o9O7uIC5.js} +631 -435
- package/dist/assets/{ProjectCardBadge-CP5T2Lcg.js → ProjectCardBadge-rog20byy.js} +1 -1
- package/dist/assets/{ProjectHeader-oZWwGIoC.js → ProjectHeader-Ch7-0YgF.js} +2 -2
- package/dist/assets/{ProjectSettings-cWx0MJjr.css → ProjectSettings-CChpfrTS.css} +9 -9
- package/dist/assets/{ProjectSettings-DfDaR3aV.js → ProjectSettings-GsW7L_Gg.js} +7 -7
- package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-D1E6Idg4.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-DVCg4pLb.js} +1 -1
- package/dist/assets/{ResourcesListLayout-2lqLFJll.js → ResourcesListLayout-Btn9Hay8.js} +3 -3
- package/dist/assets/{ResourcesListLayout-BuxiQpsj.css → ResourcesListLayout-I4rYUdFt.css} +3 -3
- package/dist/assets/{RunDataJson-xyWfNyKi.js → RunDataJson-BHIY5dHu.js} +12 -12
- package/dist/assets/{RunDataJsonActions-SLxe6h_C.js → RunDataJsonActions-h2GG7hQH.js} +3 -3
- package/dist/assets/{RunDataSearch-CdLie2uo.js → RunDataSearch-C-CgDL9m.js} +1 -1
- package/dist/assets/{RunDataTable-D3iYKYbR.js → RunDataTable-DX2WMhyi.js} +2 -2
- package/dist/assets/{SamlOnboarding-CqbC519J.js → SamlOnboarding-DAv7qRQH.js} +2 -2
- package/dist/assets/{SettingsApiView-DqdLYzOz.js → SettingsApiView-BpT9mKIy.js} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-DND8OHjT.js → SettingsCommunityNodesView-C_eGce72.js} +3 -3
- package/dist/assets/{SettingsExternalSecrets-Cqr1K1PK.js → SettingsExternalSecrets-CGbkGSxM.js} +1 -1
- package/dist/assets/{SettingsLdapView-D1hHgVwD.js → SettingsLdapView-w-4uJ-WO.js} +1 -1
- package/dist/assets/{SettingsLogStreamingView-XmQhXkP8.js → SettingsLogStreamingView-dIzDyxR0.js} +1 -1
- package/dist/assets/{SettingsPersonalView-CoZXNkp0.js → SettingsPersonalView-Cqkzewwp.js} +1 -1
- package/dist/assets/{SettingsSourceControl-BapEFaNC.js → SettingsSourceControl-DvdzOGOW.js} +1 -1
- package/dist/assets/{SettingsSso-bibVg8kV.js → SettingsSso-CEyzwTf6.js} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-9Am89x9n.js → SettingsUsageAndPlan-BfvgFmrE.js} +1 -1
- package/dist/assets/{SettingsUsersView-PMEBNu_w.js → SettingsUsersView-B74JDNzE.js} +1 -1
- package/dist/assets/{SettingsView-C0FhNXC5.js → SettingsView-BXjB3fL0.js} +1 -1
- package/dist/assets/{SetupView-2ldaQ0LW.js → SetupView-CUYm-G9-.js} +2 -2
- package/dist/assets/{SetupWorkflowCredentialsButton-BVwfvnTr.js → SetupWorkflowCredentialsButton-ebC2FUi4.js} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-BG-AhIrZ.js → SetupWorkflowFromTemplateView-D9qMRkDl.js} +3 -3
- package/dist/assets/{SigninView-DF9tLSZu.js → SigninView-DJyuz9c2.js} +2 -2
- package/dist/assets/{SignoutView-CmernPNn.js → SignoutView-C6UBxu60.js} +1 -1
- package/dist/assets/{SignupView-Bu9MlpwT.js → SignupView-D2FWuaiH.js} +2 -2
- package/dist/assets/{TemplateDetails-TJ0yc1A9.js → TemplateDetails-B2Tjk70m.js} +1 -1
- package/dist/assets/{TemplateList-DNv_0Eyu.js → TemplateList-HMZjVMyp.js} +1 -1
- package/dist/assets/{TemplatesCollectionView-CntE56ke.js → TemplatesCollectionView-BIJyxp-d.js} +5 -5
- package/dist/assets/{TemplatesSearchView-CvjcFXUg.js → TemplatesSearchView-DZ_z-833.js} +3 -3
- package/dist/assets/{TemplatesView-YqT9aKyI.js → TemplatesView-9gF5kWu6.js} +5 -5
- package/dist/assets/{TemplatesView-CLyx9byp.css → TemplatesView-BfnDbKo5.css} +6 -6
- package/dist/assets/{TemplatesWorkflowView-CUFmfwQf.js → TemplatesWorkflowView-BuUff8HB.js} +5 -5
- package/dist/assets/TestDefinitionEditView-CQZkRDBJ.js +870 -0
- package/dist/assets/TestDefinitionEditView-szspUG0t.css +261 -0
- package/dist/assets/TestDefinitionListView-BfUssieW.css +117 -0
- package/dist/assets/TestDefinitionListView-CjZFxgTi.js +335 -0
- package/dist/assets/{VariablesView-CmQdhIWP.js → VariablesView-FC5wqShX.js} +2 -2
- package/dist/assets/WorkerView-C-nSya6I.js +791 -0
- package/dist/assets/WorkerView-C_d54L0W.css +181 -0
- package/dist/assets/{WorkflowActivator-CVDdqHMC.js → WorkflowActivator-CHX1pfvG.js} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-BoXSN3HK.js → WorkflowExecutionsInfoAccordion-BXyNsJxl.js} +1 -1
- package/dist/assets/{WorkflowExecutionsLandingPage-d6z9UgBQ.js → WorkflowExecutionsLandingPage-F1VtQsvR.js} +2 -2
- package/dist/assets/{WorkflowExecutionsPreview-BqiH-pqP.js → WorkflowExecutionsPreview-D0LX3heg.js} +5 -5
- package/dist/assets/{WorkflowExecutionsView-oRW-4d0o.js → WorkflowExecutionsView-CfNb8qea.js} +5 -5
- package/dist/assets/{WorkflowHistory-BTuLr3X9.js → WorkflowHistory-BbJWHQnH.js} +3 -3
- package/dist/assets/{WorkflowOnboardingView-0O56AGqh.js → WorkflowOnboardingView-DjX_Iu8m.js} +1 -1
- package/dist/assets/{WorkflowPreview-0bx0ypgw.js → WorkflowPreview-CHIMaYHv.js} +1 -1
- package/dist/assets/{WorkflowsView-CuBv1-1Q.js → WorkflowsView-TVYSIx1a.js} +7 -7
- package/dist/assets/{index-BIo0OZGX.js → index-CmLVLa2S.js} +1110 -808
- package/dist/assets/{index-CNnUWsS4.css → index-CnXoucRo.css} +45 -34
- package/dist/assets/{pushConnection.store-CabVI0Q4.js → pushConnection.store-CyaZOmSq.js} +1 -1
- package/dist/assets/{templateActions-CgLrOlVc.js → templateActions-BJQmBPkz.js} +1 -1
- package/dist/assets/testDefinition.store.ee-C_33eEVx.js +138 -0
- package/dist/assets/{useBugReporting-CYGmNuQ3.js → useBugReporting-B6XywIQp.js} +1 -1
- package/dist/assets/{useExecutionDebugging-IGp543Mo.js → useExecutionDebugging-3jTK_axu.js} +1 -1
- package/dist/assets/{useExecutionHelpers-cP7PTcvs.js → useExecutionHelpers-B2Hv6YkQ.js} +1 -1
- package/dist/assets/{useGlobalEntityCreation-DXZTxFMi.js → useGlobalEntityCreation-Bs_R5VRy.js} +1 -1
- package/dist/assets/{useNodeViewVersionSwitcher-Cyo5x7BB.js → useNodeViewVersionSwitcher-cbmuQpXh.js} +17 -11
- package/dist/assets/{usePushConnection-DKkZNdx4.js → usePushConnection-D2ReX4YT.js} +12 -6
- package/dist/assets/{useRunWorkflow-D18NuRU_.js → useRunWorkflow-D5J5xO1e.js} +3 -3
- package/dist/assets/{useWorkflowActivate-BC3Pdg08.js → useWorkflowActivate-Ck0ToSti.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/CollectionParameter-P2Jb6DYK.js +0 -4
- package/dist/assets/WorkerView-BxNqbqFw.js +0 -149
- package/dist/assets/WorkerView-Dm0b18Mh.css +0 -22
|
@@ -0,0 +1,870 @@
|
|
|
1
|
+
import { _ as _export_sfc, c as openBlock, h as createElementBlock, n as normalizeClass, r as ref, q as computed, d as defineComponent, i as createVNode, l as unref, j as createBaseVNode, F as Fragment, t as toDisplayString, e as createBlock, g as useI18n, m as resolveComponent, w as withCtx, s as renderSlot, f as createCommentVNode, k as createTextVNode, ay as withDirectives, az as vShow, je as ElCollapseTransition, y as nextTick, A as renderList, C as createEventBus, j7 as _sfc_main$8, jf as __unplugin_components_0$1, b as useRouter, U as useRoute, J as useDebounce, a as useToast, j5 as useAnnotationTagsStore, o as onMounted, V as VIEWS, H as watch } from "./index-CmLVLa2S.js";
|
|
2
|
+
import { u as useTestDefinitionStore } from "./testDefinition.store.ee-C_33eEVx.js";
|
|
3
|
+
const arrowConnector = "_arrowConnector_1ffe6_1";
|
|
4
|
+
const style0$6 = {
|
|
5
|
+
arrowConnector
|
|
6
|
+
};
|
|
7
|
+
const _sfc_main$7 = {};
|
|
8
|
+
function _sfc_render(_ctx, _cache) {
|
|
9
|
+
return openBlock(), createElementBlock("div", {
|
|
10
|
+
class: normalizeClass(_ctx.$style.arrowConnector)
|
|
11
|
+
}, null, 2);
|
|
12
|
+
}
|
|
13
|
+
const cssModules$6 = {
|
|
14
|
+
"$style": style0$6
|
|
15
|
+
};
|
|
16
|
+
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render], ["__cssModules", cssModules$6]]);
|
|
17
|
+
function useTestDefinitionForm() {
|
|
18
|
+
const evaluationsStore = useTestDefinitionStore();
|
|
19
|
+
const state = ref({
|
|
20
|
+
description: "",
|
|
21
|
+
name: {
|
|
22
|
+
value: `My Test [${(/* @__PURE__ */ new Date()).toLocaleString(void 0, { month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" })}]`,
|
|
23
|
+
isEditing: false,
|
|
24
|
+
tempValue: ""
|
|
25
|
+
},
|
|
26
|
+
tags: {
|
|
27
|
+
isEditing: false,
|
|
28
|
+
appliedTagIds: []
|
|
29
|
+
},
|
|
30
|
+
evaluationWorkflow: {
|
|
31
|
+
mode: "list",
|
|
32
|
+
value: "",
|
|
33
|
+
__rl: true
|
|
34
|
+
},
|
|
35
|
+
metrics: [""]
|
|
36
|
+
});
|
|
37
|
+
const isSaving = ref(false);
|
|
38
|
+
const fieldsIssues = ref([]);
|
|
39
|
+
const fields = ref({});
|
|
40
|
+
const loadTestData = async (testId) => {
|
|
41
|
+
try {
|
|
42
|
+
await evaluationsStore.fetchAll({ force: true });
|
|
43
|
+
const testDefinition = evaluationsStore.testDefinitionsById[testId];
|
|
44
|
+
if (testDefinition) {
|
|
45
|
+
state.value = {
|
|
46
|
+
description: testDefinition.description ?? "",
|
|
47
|
+
name: {
|
|
48
|
+
value: testDefinition.name ?? "",
|
|
49
|
+
isEditing: false,
|
|
50
|
+
tempValue: ""
|
|
51
|
+
},
|
|
52
|
+
tags: {
|
|
53
|
+
isEditing: false,
|
|
54
|
+
appliedTagIds: testDefinition.annotationTagId ? [testDefinition.annotationTagId] : []
|
|
55
|
+
},
|
|
56
|
+
evaluationWorkflow: {
|
|
57
|
+
mode: "list",
|
|
58
|
+
value: testDefinition.evaluationWorkflowId ?? "",
|
|
59
|
+
__rl: true
|
|
60
|
+
},
|
|
61
|
+
metrics: [""]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error("Failed to load test data", error);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const createTest = async (workflowId) => {
|
|
69
|
+
if (isSaving.value) return;
|
|
70
|
+
isSaving.value = true;
|
|
71
|
+
fieldsIssues.value = [];
|
|
72
|
+
try {
|
|
73
|
+
const params = {
|
|
74
|
+
name: state.value.name.value,
|
|
75
|
+
workflowId,
|
|
76
|
+
description: state.value.description
|
|
77
|
+
};
|
|
78
|
+
const newTest = await evaluationsStore.create(params);
|
|
79
|
+
return newTest;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw error;
|
|
82
|
+
} finally {
|
|
83
|
+
isSaving.value = false;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const updateTest = async (testId) => {
|
|
87
|
+
if (isSaving.value) return;
|
|
88
|
+
isSaving.value = true;
|
|
89
|
+
fieldsIssues.value = [];
|
|
90
|
+
try {
|
|
91
|
+
if (!testId) {
|
|
92
|
+
throw new Error("Test ID is required for updating a test");
|
|
93
|
+
}
|
|
94
|
+
const params = {
|
|
95
|
+
name: state.value.name.value,
|
|
96
|
+
description: state.value.description
|
|
97
|
+
};
|
|
98
|
+
if (state.value.evaluationWorkflow.value) {
|
|
99
|
+
params.evaluationWorkflowId = state.value.evaluationWorkflow.value.toString();
|
|
100
|
+
}
|
|
101
|
+
const annotationTagId = state.value.tags.appliedTagIds[0];
|
|
102
|
+
if (annotationTagId) {
|
|
103
|
+
params.annotationTagId = annotationTagId;
|
|
104
|
+
}
|
|
105
|
+
return await evaluationsStore.update({ ...params, id: testId });
|
|
106
|
+
} catch (error) {
|
|
107
|
+
throw error;
|
|
108
|
+
} finally {
|
|
109
|
+
isSaving.value = false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const startEditing = async (field2) => {
|
|
113
|
+
if (field2 === "name") {
|
|
114
|
+
state.value.name.tempValue = state.value.name.value;
|
|
115
|
+
state.value.name.isEditing = true;
|
|
116
|
+
} else {
|
|
117
|
+
state.value.tags.isEditing = true;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const saveChanges = (field2) => {
|
|
121
|
+
if (field2 === "name") {
|
|
122
|
+
state.value.name.value = state.value.name.tempValue;
|
|
123
|
+
state.value.name.isEditing = false;
|
|
124
|
+
} else {
|
|
125
|
+
state.value.tags.isEditing = false;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const cancelEditing = (field2) => {
|
|
129
|
+
if (field2 === "name") {
|
|
130
|
+
state.value.name.isEditing = false;
|
|
131
|
+
state.value.name.tempValue = "";
|
|
132
|
+
} else {
|
|
133
|
+
state.value.tags.isEditing = false;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const handleKeydown = (event, field2) => {
|
|
137
|
+
if (event.key === "Escape") {
|
|
138
|
+
cancelEditing(field2);
|
|
139
|
+
} else if (event.key === "Enter" && !event.shiftKey) {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
saveChanges(field2);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
state,
|
|
146
|
+
fields,
|
|
147
|
+
isSaving: computed(() => isSaving.value),
|
|
148
|
+
fieldsIssues: computed(() => fieldsIssues.value),
|
|
149
|
+
loadTestData,
|
|
150
|
+
createTest,
|
|
151
|
+
updateTest,
|
|
152
|
+
startEditing,
|
|
153
|
+
saveChanges,
|
|
154
|
+
cancelEditing,
|
|
155
|
+
handleKeydown
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
159
|
+
__name: "EvaluationHeader",
|
|
160
|
+
props: {
|
|
161
|
+
modelValue: {},
|
|
162
|
+
startEditing: { type: Function },
|
|
163
|
+
saveChanges: { type: Function },
|
|
164
|
+
handleKeydown: { type: Function }
|
|
165
|
+
},
|
|
166
|
+
emits: ["update:modelValue"],
|
|
167
|
+
setup(__props) {
|
|
168
|
+
const locale = useI18n();
|
|
169
|
+
return (_ctx, _cache) => {
|
|
170
|
+
const _component_n8n_icon_button = resolveComponent("n8n-icon-button");
|
|
171
|
+
const _component_N8nInput = resolveComponent("N8nInput");
|
|
172
|
+
return openBlock(), createElementBlock("div", {
|
|
173
|
+
class: normalizeClass(_ctx.$style.header)
|
|
174
|
+
}, [
|
|
175
|
+
createVNode(_component_n8n_icon_button, {
|
|
176
|
+
icon: "arrow-left",
|
|
177
|
+
class: normalizeClass(_ctx.$style.backButton),
|
|
178
|
+
type: "tertiary",
|
|
179
|
+
title: unref(locale).baseText("testDefinition.edit.backButtonTitle"),
|
|
180
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$router.back())
|
|
181
|
+
}, null, 8, ["class", "title"]),
|
|
182
|
+
createBaseVNode("h2", {
|
|
183
|
+
class: normalizeClass(_ctx.$style.title)
|
|
184
|
+
}, [
|
|
185
|
+
!_ctx.modelValue.isEditing ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
186
|
+
createBaseVNode("span", {
|
|
187
|
+
class: normalizeClass(_ctx.$style.titleText)
|
|
188
|
+
}, toDisplayString(_ctx.modelValue.value), 3),
|
|
189
|
+
createVNode(_component_n8n_icon_button, {
|
|
190
|
+
class: normalizeClass(_ctx.$style.editInputButton),
|
|
191
|
+
icon: "pen",
|
|
192
|
+
type: "tertiary",
|
|
193
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.startEditing("name"))
|
|
194
|
+
}, null, 8, ["class"])
|
|
195
|
+
], 64)) : (openBlock(), createBlock(_component_N8nInput, {
|
|
196
|
+
key: 1,
|
|
197
|
+
ref: "nameInput",
|
|
198
|
+
"data-test-id": "evaluation-name-input",
|
|
199
|
+
"model-value": _ctx.modelValue.tempValue,
|
|
200
|
+
type: "text",
|
|
201
|
+
placeholder: unref(locale).baseText("testDefinition.edit.namePlaceholder"),
|
|
202
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:modelValue", { ..._ctx.modelValue, tempValue: $event })),
|
|
203
|
+
onBlur: _cache[3] || (_cache[3] = () => _ctx.saveChanges("name")),
|
|
204
|
+
onKeydown: _cache[4] || (_cache[4] = (e) => _ctx.handleKeydown(e, "name"))
|
|
205
|
+
}, null, 8, ["model-value", "placeholder"]))
|
|
206
|
+
], 2)
|
|
207
|
+
], 2);
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const header$1 = "_header_1htk6_1";
|
|
212
|
+
const editInputButton$1 = "_editInputButton_1htk6_7";
|
|
213
|
+
const title$1 = "_title_1htk6_11";
|
|
214
|
+
const titleText = "_titleText_1htk6_22";
|
|
215
|
+
const backButton = "_backButton_1htk6_35";
|
|
216
|
+
const style0$5 = {
|
|
217
|
+
header: header$1,
|
|
218
|
+
editInputButton: editInputButton$1,
|
|
219
|
+
title: title$1,
|
|
220
|
+
titleText,
|
|
221
|
+
backButton
|
|
222
|
+
};
|
|
223
|
+
const cssModules$5 = {
|
|
224
|
+
"$style": style0$5
|
|
225
|
+
};
|
|
226
|
+
const EvaluationHeader = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__cssModules", cssModules$5]]);
|
|
227
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
228
|
+
__name: "DescriptionInput",
|
|
229
|
+
props: {
|
|
230
|
+
modelValue: { default: "" }
|
|
231
|
+
},
|
|
232
|
+
emits: ["update:modelValue"],
|
|
233
|
+
setup(__props) {
|
|
234
|
+
const locale = useI18n();
|
|
235
|
+
return (_ctx, _cache) => {
|
|
236
|
+
const _component_N8nInput = resolveComponent("N8nInput");
|
|
237
|
+
const _component_n8n_input_label = resolveComponent("n8n-input-label");
|
|
238
|
+
return openBlock(), createElementBlock("div", {
|
|
239
|
+
class: normalizeClass([_ctx.$style.description])
|
|
240
|
+
}, [
|
|
241
|
+
createVNode(_component_n8n_input_label, {
|
|
242
|
+
label: unref(locale).baseText("testDefinition.edit.description"),
|
|
243
|
+
bold: false,
|
|
244
|
+
size: "small",
|
|
245
|
+
class: normalizeClass(_ctx.$style.field)
|
|
246
|
+
}, {
|
|
247
|
+
default: withCtx(() => [
|
|
248
|
+
createVNode(_component_N8nInput, {
|
|
249
|
+
"model-value": _ctx.modelValue,
|
|
250
|
+
type: "textarea",
|
|
251
|
+
placeholder: unref(locale).baseText("testDefinition.edit.descriptionPlaceholder"),
|
|
252
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event))
|
|
253
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 8, ["label", "class"])
|
|
257
|
+
], 2);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
const field = "_field_15r7v_1";
|
|
262
|
+
const style0$4 = {
|
|
263
|
+
field
|
|
264
|
+
};
|
|
265
|
+
const cssModules$4 = {
|
|
266
|
+
"$style": style0$4
|
|
267
|
+
};
|
|
268
|
+
const DescriptionInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__cssModules", cssModules$4]]);
|
|
269
|
+
const _hoisted_1$1 = ["aria-expanded", "aria-controls"];
|
|
270
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
271
|
+
__name: "EvaluationStep",
|
|
272
|
+
props: {
|
|
273
|
+
title: {},
|
|
274
|
+
warning: { type: Boolean, default: false },
|
|
275
|
+
small: { type: Boolean, default: false },
|
|
276
|
+
expanded: { type: Boolean, default: true }
|
|
277
|
+
},
|
|
278
|
+
setup(__props) {
|
|
279
|
+
const props = __props;
|
|
280
|
+
const locale = useI18n();
|
|
281
|
+
const isExpanded = ref(props.expanded);
|
|
282
|
+
const contentRef = ref(null);
|
|
283
|
+
const containerRef = ref(null);
|
|
284
|
+
const toggleExpand = async () => {
|
|
285
|
+
isExpanded.value = !isExpanded.value;
|
|
286
|
+
if (isExpanded.value) {
|
|
287
|
+
await nextTick();
|
|
288
|
+
if (containerRef.value) {
|
|
289
|
+
containerRef.value.style.height = "auto";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
return (_ctx, _cache) => {
|
|
294
|
+
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
295
|
+
return openBlock(), createElementBlock("div", {
|
|
296
|
+
ref_key: "containerRef",
|
|
297
|
+
ref: containerRef,
|
|
298
|
+
class: normalizeClass([_ctx.$style.evaluationStep, _ctx.small && _ctx.$style.small])
|
|
299
|
+
}, [
|
|
300
|
+
createBaseVNode("div", {
|
|
301
|
+
class: normalizeClass(_ctx.$style.content)
|
|
302
|
+
}, [
|
|
303
|
+
createBaseVNode("div", {
|
|
304
|
+
class: normalizeClass(_ctx.$style.header)
|
|
305
|
+
}, [
|
|
306
|
+
createBaseVNode("div", {
|
|
307
|
+
class: normalizeClass([_ctx.$style.icon, _ctx.warning && _ctx.$style.warning])
|
|
308
|
+
}, [
|
|
309
|
+
renderSlot(_ctx.$slots, "icon")
|
|
310
|
+
], 2),
|
|
311
|
+
createBaseVNode("h3", {
|
|
312
|
+
class: normalizeClass(_ctx.$style.title)
|
|
313
|
+
}, toDisplayString(_ctx.title), 3),
|
|
314
|
+
_ctx.warning ? (openBlock(), createElementBlock("span", {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: normalizeClass(_ctx.$style.warningIcon)
|
|
317
|
+
}, "⚠", 2)) : createCommentVNode("", true),
|
|
318
|
+
_ctx.$slots.cardContent ? (openBlock(), createElementBlock("button", {
|
|
319
|
+
key: 1,
|
|
320
|
+
class: normalizeClass(_ctx.$style.collapseButton),
|
|
321
|
+
"aria-expanded": isExpanded.value,
|
|
322
|
+
"aria-controls": "content-" + _ctx.title.replace(/\s+/g, "-"),
|
|
323
|
+
onClick: toggleExpand
|
|
324
|
+
}, [
|
|
325
|
+
createTextVNode(toDisplayString(isExpanded.value ? unref(locale).baseText("testDefinition.edit.step.collapse") : unref(locale).baseText("testDefinition.edit.step.expand")) + " ", 1),
|
|
326
|
+
createVNode(_component_font_awesome_icon, {
|
|
327
|
+
icon: isExpanded.value ? "angle-down" : "angle-right",
|
|
328
|
+
size: "lg"
|
|
329
|
+
}, null, 8, ["icon"])
|
|
330
|
+
], 10, _hoisted_1$1)) : createCommentVNode("", true)
|
|
331
|
+
], 2),
|
|
332
|
+
_ctx.$slots.cardContent ? (openBlock(), createBlock(unref(ElCollapseTransition), { key: 0 }, {
|
|
333
|
+
default: withCtx(() => [
|
|
334
|
+
withDirectives(createBaseVNode("div", {
|
|
335
|
+
class: normalizeClass(_ctx.$style.cardContentWrapper)
|
|
336
|
+
}, [
|
|
337
|
+
createBaseVNode("div", {
|
|
338
|
+
ref_key: "contentRef",
|
|
339
|
+
ref: contentRef,
|
|
340
|
+
class: normalizeClass(_ctx.$style.cardContent)
|
|
341
|
+
}, [
|
|
342
|
+
renderSlot(_ctx.$slots, "cardContent")
|
|
343
|
+
], 2)
|
|
344
|
+
], 2), [
|
|
345
|
+
[vShow, isExpanded.value]
|
|
346
|
+
])
|
|
347
|
+
]),
|
|
348
|
+
_: 3
|
|
349
|
+
})) : createCommentVNode("", true)
|
|
350
|
+
], 2)
|
|
351
|
+
], 2);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
const evaluationStep = "_evaluationStep_efi3y_1";
|
|
356
|
+
const small = "_small_efi3y_13";
|
|
357
|
+
const icon = "_icon_efi3y_17";
|
|
358
|
+
const warning = "_warning_efi3y_26";
|
|
359
|
+
const content$1 = "_content_efi3y_30";
|
|
360
|
+
const header = "_header_efi3y_35";
|
|
361
|
+
const title = "_title_efi3y_41";
|
|
362
|
+
const warningIcon = "_warningIcon_efi3y_47";
|
|
363
|
+
const cardContent = "_cardContent_efi3y_51";
|
|
364
|
+
const collapseButton = "_collapseButton_efi3y_56";
|
|
365
|
+
const cardContentWrapper = "_cardContentWrapper_efi3y_69";
|
|
366
|
+
const style0$3 = {
|
|
367
|
+
evaluationStep,
|
|
368
|
+
small,
|
|
369
|
+
icon,
|
|
370
|
+
warning,
|
|
371
|
+
content: content$1,
|
|
372
|
+
header,
|
|
373
|
+
title,
|
|
374
|
+
warningIcon,
|
|
375
|
+
cardContent,
|
|
376
|
+
collapseButton,
|
|
377
|
+
cardContentWrapper
|
|
378
|
+
};
|
|
379
|
+
const cssModules$3 = {
|
|
380
|
+
"$style": style0$3
|
|
381
|
+
};
|
|
382
|
+
const EvaluationStep = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$3]]);
|
|
383
|
+
const _hoisted_1 = { "data-test-id": "workflow-tags-field" };
|
|
384
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
385
|
+
__name: "TagsInput",
|
|
386
|
+
props: {
|
|
387
|
+
modelValue: { default: () => ({
|
|
388
|
+
isEditing: false,
|
|
389
|
+
appliedTagIds: []
|
|
390
|
+
}) },
|
|
391
|
+
allTags: {},
|
|
392
|
+
tagsById: {},
|
|
393
|
+
isLoading: { type: Boolean },
|
|
394
|
+
startEditing: {},
|
|
395
|
+
saveChanges: {},
|
|
396
|
+
cancelEditing: {}
|
|
397
|
+
},
|
|
398
|
+
emits: ["update:modelValue"],
|
|
399
|
+
setup(__props, { emit: __emit }) {
|
|
400
|
+
const props = __props;
|
|
401
|
+
const emit = __emit;
|
|
402
|
+
const locale = useI18n();
|
|
403
|
+
const tagsEventBus = createEventBus();
|
|
404
|
+
const getTagName = computed(() => (tagId) => {
|
|
405
|
+
var _a;
|
|
406
|
+
return ((_a = props.tagsById[tagId]) == null ? void 0 : _a.name) ?? "";
|
|
407
|
+
});
|
|
408
|
+
function updateTags(tags) {
|
|
409
|
+
const newTags = tags[0] ? [tags[0]] : [];
|
|
410
|
+
emit("update:modelValue", {
|
|
411
|
+
...props.modelValue,
|
|
412
|
+
appliedTagIds: newTags
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
return (_ctx, _cache) => {
|
|
416
|
+
const _component_n8n_text = resolveComponent("n8n-text");
|
|
417
|
+
const _component_n8n_tag = resolveComponent("n8n-tag");
|
|
418
|
+
const _component_n8n_icon_button = resolveComponent("n8n-icon-button");
|
|
419
|
+
const _component_TagsDropdown = _sfc_main$8;
|
|
420
|
+
const _component_n8n_input_label = resolveComponent("n8n-input-label");
|
|
421
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
422
|
+
createVNode(_component_n8n_input_label, {
|
|
423
|
+
label: unref(locale).baseText("testDefinition.edit.tagName"),
|
|
424
|
+
bold: false,
|
|
425
|
+
size: "small"
|
|
426
|
+
}, {
|
|
427
|
+
default: withCtx(() => [
|
|
428
|
+
!_ctx.modelValue.isEditing ? (openBlock(), createElementBlock("div", {
|
|
429
|
+
key: 0,
|
|
430
|
+
class: normalizeClass(_ctx.$style.tagsRead),
|
|
431
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.startEditing("tags"))
|
|
432
|
+
}, [
|
|
433
|
+
_ctx.modelValue.appliedTagIds.length === 0 ? (openBlock(), createBlock(_component_n8n_text, {
|
|
434
|
+
key: 0,
|
|
435
|
+
size: "small"
|
|
436
|
+
}, {
|
|
437
|
+
default: withCtx(() => [
|
|
438
|
+
createTextVNode(toDisplayString(unref(locale).baseText("testDefinition.edit.selectTag")), 1)
|
|
439
|
+
]),
|
|
440
|
+
_: 1
|
|
441
|
+
})) : createCommentVNode("", true),
|
|
442
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.modelValue.appliedTagIds, (tagId) => {
|
|
443
|
+
return openBlock(), createBlock(_component_n8n_tag, {
|
|
444
|
+
key: tagId,
|
|
445
|
+
text: getTagName.value(tagId),
|
|
446
|
+
"data-test-id": "evaluation-tag-field"
|
|
447
|
+
}, null, 8, ["text"]);
|
|
448
|
+
}), 128)),
|
|
449
|
+
createVNode(_component_n8n_icon_button, {
|
|
450
|
+
class: normalizeClass(_ctx.$style.editInputButton),
|
|
451
|
+
icon: "pen",
|
|
452
|
+
type: "tertiary",
|
|
453
|
+
size: "small",
|
|
454
|
+
transparent: ""
|
|
455
|
+
}, null, 8, ["class"])
|
|
456
|
+
], 2)) : (openBlock(), createBlock(_component_TagsDropdown, {
|
|
457
|
+
key: 1,
|
|
458
|
+
"model-value": _ctx.modelValue.appliedTagIds,
|
|
459
|
+
placeholder: unref(locale).baseText("executionAnnotationView.chooseOrCreateATag"),
|
|
460
|
+
"create-enabled": false,
|
|
461
|
+
"all-tags": _ctx.allTags,
|
|
462
|
+
"is-loading": _ctx.isLoading,
|
|
463
|
+
"tags-by-id": _ctx.tagsById,
|
|
464
|
+
"data-test-id": "workflow-tags-dropdown",
|
|
465
|
+
"event-bus": unref(tagsEventBus),
|
|
466
|
+
"onUpdate:modelValue": updateTags,
|
|
467
|
+
onEsc: _cache[1] || (_cache[1] = ($event) => _ctx.cancelEditing("tags")),
|
|
468
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.saveChanges("tags"))
|
|
469
|
+
}, null, 8, ["model-value", "placeholder", "all-tags", "is-loading", "tags-by-id", "event-bus"]))
|
|
470
|
+
]),
|
|
471
|
+
_: 1
|
|
472
|
+
}, 8, ["label"]),
|
|
473
|
+
createVNode(_component_n8n_text, {
|
|
474
|
+
size: "small",
|
|
475
|
+
color: "text-light"
|
|
476
|
+
}, {
|
|
477
|
+
default: withCtx(() => [
|
|
478
|
+
createTextVNode(toDisplayString(unref(locale).baseText("testDefinition.edit.tagsHelpText")), 1)
|
|
479
|
+
]),
|
|
480
|
+
_: 1
|
|
481
|
+
})
|
|
482
|
+
]);
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
const tagsRead = "_tagsRead_ekbvu_1";
|
|
487
|
+
const editInputButton = "_editInputButton_ekbvu_1";
|
|
488
|
+
const style0$2 = {
|
|
489
|
+
tagsRead,
|
|
490
|
+
editInputButton
|
|
491
|
+
};
|
|
492
|
+
const cssModules$2 = {
|
|
493
|
+
"$style": style0$2
|
|
494
|
+
};
|
|
495
|
+
const TagsInput = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__cssModules", cssModules$2]]);
|
|
496
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
497
|
+
__name: "WorkflowSelector",
|
|
498
|
+
props: {
|
|
499
|
+
modelValue: { default: () => ({
|
|
500
|
+
mode: "id",
|
|
501
|
+
value: "",
|
|
502
|
+
__rl: true
|
|
503
|
+
}) }
|
|
504
|
+
},
|
|
505
|
+
emits: ["update:modelValue"],
|
|
506
|
+
setup(__props) {
|
|
507
|
+
const locale = useI18n();
|
|
508
|
+
return (_ctx, _cache) => {
|
|
509
|
+
const _component_WorkflowSelectorParameterInput = __unplugin_components_0$1;
|
|
510
|
+
const _component_n8n_input_label = resolveComponent("n8n-input-label");
|
|
511
|
+
return openBlock(), createElementBlock("div", null, [
|
|
512
|
+
createVNode(_component_n8n_input_label, {
|
|
513
|
+
label: unref(locale).baseText("testDefinition.edit.workflowSelectorLabel"),
|
|
514
|
+
bold: false
|
|
515
|
+
}, {
|
|
516
|
+
default: withCtx(() => [
|
|
517
|
+
createVNode(_component_WorkflowSelectorParameterInput, {
|
|
518
|
+
ref: "workflowInput",
|
|
519
|
+
parameter: {
|
|
520
|
+
displayName: unref(locale).baseText("testDefinition.edit.workflowSelectorDisplayName"),
|
|
521
|
+
name: "workflowId",
|
|
522
|
+
type: "workflowSelector",
|
|
523
|
+
default: ""
|
|
524
|
+
},
|
|
525
|
+
"model-value": _ctx.modelValue,
|
|
526
|
+
"display-title": unref(locale).baseText("testDefinition.edit.workflowSelectorTitle"),
|
|
527
|
+
"is-value-expression": false,
|
|
528
|
+
"expression-edit-dialog-visible": false,
|
|
529
|
+
path: "workflows",
|
|
530
|
+
"allow-new": "",
|
|
531
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event))
|
|
532
|
+
}, null, 8, ["parameter", "model-value", "display-title"])
|
|
533
|
+
]),
|
|
534
|
+
_: 1
|
|
535
|
+
}, 8, ["label"])
|
|
536
|
+
]);
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
541
|
+
__name: "MetricsInput",
|
|
542
|
+
props: {
|
|
543
|
+
modelValue: {}
|
|
544
|
+
},
|
|
545
|
+
emits: ["update:modelValue"],
|
|
546
|
+
setup(__props, { emit: __emit }) {
|
|
547
|
+
const props = __props;
|
|
548
|
+
const emit = __emit;
|
|
549
|
+
const locale = useI18n();
|
|
550
|
+
function addNewMetric() {
|
|
551
|
+
emit("update:modelValue", [...props.modelValue, ""]);
|
|
552
|
+
}
|
|
553
|
+
function updateMetric(index, value) {
|
|
554
|
+
const newMetrics = [...props.modelValue];
|
|
555
|
+
newMetrics[index] = value;
|
|
556
|
+
emit("update:modelValue", newMetrics);
|
|
557
|
+
}
|
|
558
|
+
return (_ctx, _cache) => {
|
|
559
|
+
const _component_N8nInput = resolveComponent("N8nInput");
|
|
560
|
+
const _component_n8n_button = resolveComponent("n8n-button");
|
|
561
|
+
const _component_n8n_input_label = resolveComponent("n8n-input-label");
|
|
562
|
+
return openBlock(), createElementBlock("div", {
|
|
563
|
+
class: normalizeClass([_ctx.$style.metrics])
|
|
564
|
+
}, [
|
|
565
|
+
createVNode(_component_n8n_input_label, {
|
|
566
|
+
label: unref(locale).baseText("testDefinition.edit.metricsFields"),
|
|
567
|
+
bold: false,
|
|
568
|
+
class: normalizeClass(_ctx.$style.metricField)
|
|
569
|
+
}, {
|
|
570
|
+
default: withCtx(() => [
|
|
571
|
+
createBaseVNode("div", {
|
|
572
|
+
class: normalizeClass(_ctx.$style.metricsContainer)
|
|
573
|
+
}, [
|
|
574
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.modelValue, (metric, index) => {
|
|
575
|
+
return openBlock(), createElementBlock("div", { key: index }, [
|
|
576
|
+
createVNode(_component_N8nInput, {
|
|
577
|
+
ref_for: true,
|
|
578
|
+
ref: `metric_${index}`,
|
|
579
|
+
"data-test-id": "evaluation-metric-item",
|
|
580
|
+
"model-value": metric,
|
|
581
|
+
placeholder: unref(locale).baseText("testDefinition.edit.metricsPlaceholder"),
|
|
582
|
+
"onUpdate:modelValue": (value) => updateMetric(index, value)
|
|
583
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
|
|
584
|
+
]);
|
|
585
|
+
}), 128)),
|
|
586
|
+
createVNode(_component_n8n_button, {
|
|
587
|
+
type: "tertiary",
|
|
588
|
+
label: unref(locale).baseText("testDefinition.edit.metricsNew"),
|
|
589
|
+
class: normalizeClass(_ctx.$style.newMetricButton),
|
|
590
|
+
onClick: addNewMetric
|
|
591
|
+
}, null, 8, ["label", "class"])
|
|
592
|
+
], 2)
|
|
593
|
+
]),
|
|
594
|
+
_: 1
|
|
595
|
+
}, 8, ["label", "class"])
|
|
596
|
+
], 2);
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
const metricsContainer = "_metricsContainer_lwkya_1";
|
|
601
|
+
const metricField = "_metricField_lwkya_7";
|
|
602
|
+
const metricsDivider = "_metricsDivider_lwkya_12";
|
|
603
|
+
const newMetricButton = "_newMetricButton_lwkya_17";
|
|
604
|
+
const style0$1 = {
|
|
605
|
+
metricsContainer,
|
|
606
|
+
metricField,
|
|
607
|
+
metricsDivider,
|
|
608
|
+
newMetricButton
|
|
609
|
+
};
|
|
610
|
+
const cssModules$1 = {
|
|
611
|
+
"$style": style0$1
|
|
612
|
+
};
|
|
613
|
+
const MetricsInput = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
|
|
614
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
615
|
+
__name: "TestDefinitionEditView",
|
|
616
|
+
props: {
|
|
617
|
+
testId: {}
|
|
618
|
+
},
|
|
619
|
+
setup(__props) {
|
|
620
|
+
const props = __props;
|
|
621
|
+
const router = useRouter();
|
|
622
|
+
const route = useRoute();
|
|
623
|
+
const locale = useI18n();
|
|
624
|
+
const { debounce } = useDebounce();
|
|
625
|
+
const toast = useToast();
|
|
626
|
+
const { isLoading, allTags, tagsById, fetchAll } = useAnnotationTagsStore();
|
|
627
|
+
const testId = computed(() => props.testId ?? route.params.testId);
|
|
628
|
+
const currentWorkflowId = computed(() => route.params.name);
|
|
629
|
+
const buttonLabel = computed(
|
|
630
|
+
() => testId.value ? locale.baseText("testDefinition.edit.updateTest") : locale.baseText("testDefinition.edit.saveTest")
|
|
631
|
+
);
|
|
632
|
+
const {
|
|
633
|
+
state,
|
|
634
|
+
fieldsIssues,
|
|
635
|
+
isSaving,
|
|
636
|
+
loadTestData,
|
|
637
|
+
createTest,
|
|
638
|
+
updateTest,
|
|
639
|
+
startEditing,
|
|
640
|
+
saveChanges,
|
|
641
|
+
cancelEditing,
|
|
642
|
+
handleKeydown
|
|
643
|
+
} = useTestDefinitionForm();
|
|
644
|
+
onMounted(async () => {
|
|
645
|
+
await fetchAll();
|
|
646
|
+
if (testId.value) {
|
|
647
|
+
await loadTestData(testId.value);
|
|
648
|
+
} else {
|
|
649
|
+
await onSaveTest();
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
async function onSaveTest() {
|
|
653
|
+
try {
|
|
654
|
+
let savedTest;
|
|
655
|
+
if (testId.value) {
|
|
656
|
+
savedTest = await updateTest(testId.value);
|
|
657
|
+
} else {
|
|
658
|
+
savedTest = await createTest(currentWorkflowId.value);
|
|
659
|
+
}
|
|
660
|
+
if (savedTest && route.name === VIEWS.TEST_DEFINITION_EDIT) {
|
|
661
|
+
await router.replace({
|
|
662
|
+
name: VIEWS.TEST_DEFINITION_EDIT,
|
|
663
|
+
params: { testId: savedTest.id }
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
toast.showMessage({
|
|
667
|
+
title: locale.baseText("testDefinition.edit.testSaved"),
|
|
668
|
+
type: "success"
|
|
669
|
+
});
|
|
670
|
+
} catch (e) {
|
|
671
|
+
toast.showError(e, locale.baseText("testDefinition.edit.testSaveFailed"));
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
function hasIssues(key) {
|
|
675
|
+
return fieldsIssues.value.some((issue) => issue.field === key);
|
|
676
|
+
}
|
|
677
|
+
watch(() => state.value, debounce(onSaveTest, { debounceTime: 400 }), { deep: true });
|
|
678
|
+
return (_ctx, _cache) => {
|
|
679
|
+
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
680
|
+
const _component_BlockArrow = __unplugin_components_0;
|
|
681
|
+
const _component_n8n_button = resolveComponent("n8n-button");
|
|
682
|
+
return openBlock(), createElementBlock("div", {
|
|
683
|
+
class: normalizeClass(_ctx.$style.container)
|
|
684
|
+
}, [
|
|
685
|
+
createBaseVNode("div", {
|
|
686
|
+
class: normalizeClass(_ctx.$style.content)
|
|
687
|
+
}, [
|
|
688
|
+
createVNode(EvaluationHeader, {
|
|
689
|
+
modelValue: unref(state).name,
|
|
690
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(state).name = $event),
|
|
691
|
+
class: normalizeClass({ "has-issues": hasIssues("name") }),
|
|
692
|
+
"start-editing": unref(startEditing),
|
|
693
|
+
"save-changes": unref(saveChanges),
|
|
694
|
+
"handle-keydown": unref(handleKeydown)
|
|
695
|
+
}, null, 8, ["modelValue", "class", "start-editing", "save-changes", "handle-keydown"]),
|
|
696
|
+
createVNode(EvaluationStep, {
|
|
697
|
+
class: normalizeClass(_ctx.$style.step),
|
|
698
|
+
title: unref(locale).baseText("testDefinition.edit.description"),
|
|
699
|
+
expanded: false
|
|
700
|
+
}, {
|
|
701
|
+
icon: withCtx(() => [
|
|
702
|
+
createVNode(_component_font_awesome_icon, {
|
|
703
|
+
icon: "thumbtack",
|
|
704
|
+
size: "lg"
|
|
705
|
+
})
|
|
706
|
+
]),
|
|
707
|
+
cardContent: withCtx(() => [
|
|
708
|
+
createVNode(DescriptionInput, {
|
|
709
|
+
modelValue: unref(state).description,
|
|
710
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(state).description = $event)
|
|
711
|
+
}, null, 8, ["modelValue"])
|
|
712
|
+
]),
|
|
713
|
+
_: 1
|
|
714
|
+
}, 8, ["class", "title"]),
|
|
715
|
+
createBaseVNode("div", {
|
|
716
|
+
class: normalizeClass(_ctx.$style.panelIntro)
|
|
717
|
+
}, toDisplayString(unref(locale).baseText("testDefinition.edit.step.intro")), 3),
|
|
718
|
+
createVNode(_component_BlockArrow, {
|
|
719
|
+
class: normalizeClass(_ctx.$style.introArrow)
|
|
720
|
+
}, null, 8, ["class"]),
|
|
721
|
+
createBaseVNode("div", {
|
|
722
|
+
class: normalizeClass(_ctx.$style.panelBlock)
|
|
723
|
+
}, [
|
|
724
|
+
createVNode(EvaluationStep, {
|
|
725
|
+
class: normalizeClass(_ctx.$style.step),
|
|
726
|
+
title: unref(locale).baseText("testDefinition.edit.step.executions")
|
|
727
|
+
}, {
|
|
728
|
+
icon: withCtx(() => [
|
|
729
|
+
createVNode(_component_font_awesome_icon, {
|
|
730
|
+
icon: "history",
|
|
731
|
+
size: "lg"
|
|
732
|
+
})
|
|
733
|
+
]),
|
|
734
|
+
cardContent: withCtx(() => [
|
|
735
|
+
createVNode(TagsInput, {
|
|
736
|
+
modelValue: unref(state).tags,
|
|
737
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(state).tags = $event),
|
|
738
|
+
class: normalizeClass({ "has-issues": hasIssues("tags") }),
|
|
739
|
+
"all-tags": unref(allTags),
|
|
740
|
+
"tags-by-id": unref(tagsById),
|
|
741
|
+
"is-loading": unref(isLoading),
|
|
742
|
+
"start-editing": unref(startEditing),
|
|
743
|
+
"save-changes": unref(saveChanges),
|
|
744
|
+
"cancel-editing": unref(cancelEditing)
|
|
745
|
+
}, null, 8, ["modelValue", "class", "all-tags", "tags-by-id", "is-loading", "start-editing", "save-changes", "cancel-editing"])
|
|
746
|
+
]),
|
|
747
|
+
_: 1
|
|
748
|
+
}, 8, ["class", "title"]),
|
|
749
|
+
createBaseVNode("div", {
|
|
750
|
+
class: normalizeClass(_ctx.$style.evaluationArrows)
|
|
751
|
+
}, [
|
|
752
|
+
createVNode(_component_BlockArrow),
|
|
753
|
+
createVNode(_component_BlockArrow)
|
|
754
|
+
], 2),
|
|
755
|
+
createVNode(EvaluationStep, {
|
|
756
|
+
class: normalizeClass(_ctx.$style.step),
|
|
757
|
+
title: unref(locale).baseText("testDefinition.edit.step.nodes"),
|
|
758
|
+
small: true,
|
|
759
|
+
expanded: false
|
|
760
|
+
}, {
|
|
761
|
+
icon: withCtx(() => [
|
|
762
|
+
createVNode(_component_font_awesome_icon, {
|
|
763
|
+
icon: "thumbtack",
|
|
764
|
+
size: "lg"
|
|
765
|
+
})
|
|
766
|
+
]),
|
|
767
|
+
cardContent: withCtx(() => [
|
|
768
|
+
createTextVNode(toDisplayString(unref(locale).baseText("testDefinition.edit.step.mockedNodes", { adjustToNumber: 0 })), 1)
|
|
769
|
+
]),
|
|
770
|
+
_: 1
|
|
771
|
+
}, 8, ["class", "title"]),
|
|
772
|
+
createVNode(EvaluationStep, {
|
|
773
|
+
class: normalizeClass(_ctx.$style.step),
|
|
774
|
+
title: unref(locale).baseText("testDefinition.edit.step.reRunExecutions"),
|
|
775
|
+
small: true
|
|
776
|
+
}, {
|
|
777
|
+
icon: withCtx(() => [
|
|
778
|
+
createVNode(_component_font_awesome_icon, {
|
|
779
|
+
icon: "redo",
|
|
780
|
+
size: "lg"
|
|
781
|
+
})
|
|
782
|
+
]),
|
|
783
|
+
_: 1
|
|
784
|
+
}, 8, ["class", "title"]),
|
|
785
|
+
createVNode(EvaluationStep, {
|
|
786
|
+
class: normalizeClass(_ctx.$style.step),
|
|
787
|
+
title: unref(locale).baseText("testDefinition.edit.step.compareExecutions")
|
|
788
|
+
}, {
|
|
789
|
+
icon: withCtx(() => [
|
|
790
|
+
createVNode(_component_font_awesome_icon, {
|
|
791
|
+
icon: "equals",
|
|
792
|
+
size: "lg"
|
|
793
|
+
})
|
|
794
|
+
]),
|
|
795
|
+
cardContent: withCtx(() => [
|
|
796
|
+
createVNode(_sfc_main$2, {
|
|
797
|
+
modelValue: unref(state).evaluationWorkflow,
|
|
798
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(state).evaluationWorkflow = $event),
|
|
799
|
+
class: normalizeClass({ "has-issues": hasIssues("evaluationWorkflow") })
|
|
800
|
+
}, null, 8, ["modelValue", "class"])
|
|
801
|
+
]),
|
|
802
|
+
_: 1
|
|
803
|
+
}, 8, ["class", "title"]),
|
|
804
|
+
createVNode(EvaluationStep, {
|
|
805
|
+
class: normalizeClass(_ctx.$style.step),
|
|
806
|
+
title: unref(locale).baseText("testDefinition.edit.step.metrics")
|
|
807
|
+
}, {
|
|
808
|
+
icon: withCtx(() => [
|
|
809
|
+
createVNode(_component_font_awesome_icon, {
|
|
810
|
+
icon: "chart-bar",
|
|
811
|
+
size: "lg"
|
|
812
|
+
})
|
|
813
|
+
]),
|
|
814
|
+
cardContent: withCtx(() => [
|
|
815
|
+
createVNode(MetricsInput, {
|
|
816
|
+
modelValue: unref(state).metrics,
|
|
817
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(state).metrics = $event),
|
|
818
|
+
class: normalizeClass({ "has-issues": hasIssues("metrics") })
|
|
819
|
+
}, null, 8, ["modelValue", "class"])
|
|
820
|
+
]),
|
|
821
|
+
_: 1
|
|
822
|
+
}, 8, ["class", "title"])
|
|
823
|
+
], 2),
|
|
824
|
+
createBaseVNode("div", {
|
|
825
|
+
class: normalizeClass(_ctx.$style.footer)
|
|
826
|
+
}, [
|
|
827
|
+
createVNode(_component_n8n_button, {
|
|
828
|
+
type: "primary",
|
|
829
|
+
"data-test-id": "run-test-button",
|
|
830
|
+
label: buttonLabel.value,
|
|
831
|
+
loading: unref(isSaving),
|
|
832
|
+
onClick: onSaveTest
|
|
833
|
+
}, null, 8, ["label", "loading"])
|
|
834
|
+
], 2)
|
|
835
|
+
], 2)
|
|
836
|
+
], 2);
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
const container = "_container_1lz9n_1";
|
|
841
|
+
const content = "_content_1lz9n_10";
|
|
842
|
+
const panelBlock = "_panelBlock_1lz9n_15";
|
|
843
|
+
const panelIntro = "_panelIntro_1lz9n_21";
|
|
844
|
+
const step = "_step_1lz9n_30";
|
|
845
|
+
const introArrow = "_introArrow_1lz9n_37";
|
|
846
|
+
const evaluationArrows = "_evaluationArrows_1lz9n_42";
|
|
847
|
+
const footer = "_footer_1lz9n_53";
|
|
848
|
+
const workflow = "_workflow_1lz9n_59";
|
|
849
|
+
const workflowSteps = "_workflowSteps_1lz9n_66";
|
|
850
|
+
const sideBySide = "_sideBySide_1lz9n_73";
|
|
851
|
+
const style0 = {
|
|
852
|
+
container,
|
|
853
|
+
content,
|
|
854
|
+
panelBlock,
|
|
855
|
+
panelIntro,
|
|
856
|
+
step,
|
|
857
|
+
introArrow,
|
|
858
|
+
evaluationArrows,
|
|
859
|
+
footer,
|
|
860
|
+
workflow,
|
|
861
|
+
workflowSteps,
|
|
862
|
+
sideBySide
|
|
863
|
+
};
|
|
864
|
+
const cssModules = {
|
|
865
|
+
"$style": style0
|
|
866
|
+
};
|
|
867
|
+
const TestDefinitionEditView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
868
|
+
export {
|
|
869
|
+
TestDefinitionEditView as default
|
|
870
|
+
};
|