n8n-editor-ui 1.75.1 → 1.77.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.
Files changed (96) hide show
  1. package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-BhRv3Xk0.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DI9LKNPl.js} +1 -1
  2. package/dist/assets/{AuthView-vL9vjCvD.js → AuthView-DM7o3O4n.js} +2 -2
  3. package/dist/assets/{CanvasChat-B69VJDcA.js → CanvasChat-D_6gR76j.js} +19 -18
  4. package/dist/assets/{CanvasControls-DhhKk7yf.js → CanvasControls-Nhfb4Lvl.js} +1 -1
  5. package/dist/assets/{ChangePasswordView-D8y2rYLl.js → ChangePasswordView-BaAm4ZVG.js} +3 -3
  6. package/dist/assets/CollectionParameter-B6Y-W51v.js +4 -0
  7. package/dist/assets/{ConcurrentExecutionsHeader-Dv0s5rxY.js → ConcurrentExecutionsHeader-DIjBdza6.js} +2 -2
  8. package/dist/assets/{CredentialsView-Dp0fVbpZ.js → CredentialsView-Xu6hENWr.js} +4 -4
  9. package/dist/assets/{ErrorView-a6qq4rkt.js → ErrorView-DUTGEeMV.js} +1 -1
  10. package/dist/assets/{ExecutionsView-CpILe_1o.js → ExecutionsView-BUxJO71n.js} +17 -5
  11. package/dist/assets/{FileSaver.min-C1QTiJmy.js → FileSaver.min-BEdek61R.js} +1 -1
  12. package/dist/assets/{FixedCollectionParameter-DvdC-9QQ.css → FixedCollectionParameter-BReT5syB.css} +18 -18
  13. package/dist/assets/{FixedCollectionParameter-kphzKyyy.js → FixedCollectionParameter-C347CzJX.js} +27 -3
  14. package/dist/assets/{ForgotMyPasswordView-DzUekqel.js → ForgotMyPasswordView-COBAL4BR.js} +3 -3
  15. package/dist/assets/{Logo-B-pFOUGc.js → Logo-D0YIkpeq.js} +1 -1
  16. package/dist/assets/{MainHeader-C6S60KwG.js → MainHeader-C9fFpTj2.js} +15 -105
  17. package/dist/assets/{MainHeader-BIKp2Ncp.css → MainHeader-DC-g9NGP.css} +12 -11
  18. package/dist/assets/{MainSidebar-CJ-OKhK-.js → MainSidebar-DqTz49bY.js} +38 -81
  19. package/dist/assets/{NodeCreation-CNcty5fl.js → NodeCreation-BfPITu8g.js} +4 -4
  20. package/dist/assets/{NodeCreator-DAW2sX8p.js → NodeCreator-CK6kn0Jv.js} +4 -5
  21. package/dist/assets/{NodeViewSwitcher-mtWBt9cw.js → NodeViewSwitcher-Ccwulgc_.js} +164 -83
  22. package/dist/assets/{NodeViewSwitcher-CB1zkjni.css → NodeViewSwitcher-DApULbEt.css} +36 -39
  23. package/dist/assets/{ProjectCardBadge-DcWhzEr6.js → ProjectCardBadge-Dzk3JBiy.js} +2 -15
  24. package/dist/assets/{ProjectHeader-D2FCquSr.js → ProjectHeader-DScDlb97.js} +1 -1
  25. package/dist/assets/{ProjectSettings-CDg4IQw7.js → ProjectSettings-BKBT1ZQ3.js} +2 -2
  26. package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-BPBen7Li.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-vHkaCcgH.js} +1 -1
  27. package/dist/assets/{ResourcesListLayout-DWASP6Vp.js → ResourcesListLayout-Bm25PbPe.js} +21 -11
  28. package/dist/assets/{ResourcesListLayout-CJC-YvjD.css → ResourcesListLayout-d7mMNhOL.css} +6 -6
  29. package/dist/assets/{RunDataJson-CFNeORgR.js → RunDataJson-DdPA-vUg.js} +14 -15
  30. package/dist/assets/{RunDataJson-BXTLuo7i.css → RunDataJson-Txw0lqay.css} +1 -0
  31. package/dist/assets/{RunDataJsonActions-COFXneND.js → RunDataJsonActions-DQOpbX-O.js} +2 -2
  32. package/dist/assets/{RunDataSearch-D9UDSGjR.js → RunDataSearch-CouFZTIv.js} +1 -1
  33. package/dist/assets/{RunDataTable-C3flt0dy.js → RunDataTable-BTSlSsV8.js} +18 -20
  34. package/dist/assets/{SamlOnboarding-CWM-8qu7.js → SamlOnboarding-ByjacAW7.js} +3 -3
  35. package/dist/assets/{SettingsApiView-Bl6jvpWQ.js → SettingsApiView-Bcy_zE6E.js} +1 -1
  36. package/dist/assets/{SettingsCommunityNodesView-5Dl4EOzd.js → SettingsCommunityNodesView-Cjl8HKbz.js} +4 -4
  37. package/dist/assets/{SettingsExternalSecrets-DljwCjwW.js → SettingsExternalSecrets-BdjUgns5.js} +1 -1
  38. package/dist/assets/{SettingsLdapView-5kgLPxB7.js → SettingsLdapView-JZznK2gT.js} +1 -1
  39. package/dist/assets/{SettingsLogStreamingView-CsB-E4Kv.js → SettingsLogStreamingView-Dr-YFp2W.js} +1 -1
  40. package/dist/assets/{SettingsPersonalView-B0vJNuPt.js → SettingsPersonalView-inpY_nzK.js} +1 -1
  41. package/dist/assets/{SettingsSourceControl-B7SGpzBu.js → SettingsSourceControl-Cg7lS-SE.js} +1 -1
  42. package/dist/assets/{SettingsSso-pDsu2lsS.js → SettingsSso-NG13hUzi.js} +1 -1
  43. package/dist/assets/{SettingsUsageAndPlan-B83lunzH.js → SettingsUsageAndPlan-BgSLN2VF.js} +1 -1
  44. package/dist/assets/{SettingsUsersView-DPM5R_9p.js → SettingsUsersView-DUmnh2jo.js} +1 -1
  45. package/dist/assets/{SettingsView-NF_8zzqr.js → SettingsView-DdHGr_vR.js} +1 -1
  46. package/dist/assets/{SetupView-Dzehb2sC.js → SetupView-ByLBPzaO.js} +3 -3
  47. package/dist/assets/{SetupWorkflowCredentialsButton-Bhx7c9Lu.js → SetupWorkflowCredentialsButton-Dv3O2B1n.js} +3 -2
  48. package/dist/assets/{SetupWorkflowFromTemplateView-DaP6_l4S.js → SetupWorkflowFromTemplateView-DFn8kOzj.js} +3 -3
  49. package/dist/assets/{SigninView-BLyXzN0c.js → SigninView-DIJ4QhSe.js} +3 -3
  50. package/dist/assets/{SignoutView-BsaJctbQ.js → SignoutView-CzgpQ3SX.js} +1 -1
  51. package/dist/assets/{SignupView-m53hHk3y.js → SignupView-Ki2_QcUU.js} +3 -3
  52. package/dist/assets/{TemplateDetails-CWR4kXyf.js → TemplateDetails-BSeVX-wU.js} +1 -1
  53. package/dist/assets/{TemplateList-DLQxEmgt.js → TemplateList-CM9EZ6da.js} +1 -1
  54. package/dist/assets/{TemplatesCollectionView-CobxDh9v.js → TemplatesCollectionView-DQMG3Nx0.js} +5 -5
  55. package/dist/assets/{TemplatesSearchView-CDW7EH1p.js → TemplatesSearchView-BG5Bfpq9.js} +3 -3
  56. package/dist/assets/{TemplatesView-DJCodjB-.js → TemplatesView-D3vhmKK2.js} +1 -1
  57. package/dist/assets/{TemplatesWorkflowView-DOlLEzEa.js → TemplatesWorkflowView-BVZExmo-.js} +5 -5
  58. package/dist/assets/{TestDefinitionEditView-Cuphh86f.js → TestDefinitionEditView-DeYXSHuX.js} +837 -549
  59. package/dist/assets/{TestDefinitionEditView-FI1GVbhl.css → TestDefinitionEditView-d7yfvp9P.css} +601 -238
  60. package/dist/assets/{TestDefinitionListView-Dgq9dXJL.js → TestDefinitionListView-Dm0Wfpbk.js} +93 -68
  61. package/dist/assets/{TestDefinitionRootView-DU-JMBSH.js → TestDefinitionRootView-v_AUC4gJ.js} +1 -1
  62. package/dist/assets/VariablesView-BBjPCn4K.js +509 -0
  63. package/dist/assets/{VariablesView-D4pRzSuY.css → VariablesView-CIfrpJdg.css} +21 -54
  64. package/dist/assets/{WorkerView-CbqToUTB.js → WorkerView-wAx-DxZp.js} +5 -5
  65. package/dist/assets/{WorkflowActivator-BaM6Tydw.js → WorkflowActivator-KzTynbZM.js} +2 -2
  66. package/dist/assets/{WorkflowExecutionsInfoAccordion-6kKOPXK7.js → WorkflowExecutionsInfoAccordion-BWYv1FIv.js} +1 -1
  67. package/dist/assets/{WorkflowExecutionsLandingPage-Cqq5FeZE.js → WorkflowExecutionsLandingPage-LwIHX7rs.js} +2 -2
  68. package/dist/assets/{WorkflowExecutionsPreview-D1cSllVi.js → WorkflowExecutionsPreview-D68OCpWf.js} +8 -7
  69. package/dist/assets/{WorkflowExecutionsView-BUHtKz5M.css → WorkflowExecutionsView-BjdRnQOE.css} +32 -32
  70. package/dist/assets/{WorkflowExecutionsView-qTFEWbeC.js → WorkflowExecutionsView-C47WjaF2.js} +43 -29
  71. package/dist/assets/{WorkflowHistory-De54-QkN.js → WorkflowHistory-VBfitRhR.js} +3 -3
  72. package/dist/assets/{WorkflowOnboardingView-p6cAElRZ.js → WorkflowOnboardingView-X9Yz2kZe.js} +1 -31
  73. package/dist/assets/{WorkflowPreview-CKK96lnJ.js → WorkflowPreview-D0IqMbWq.js} +24 -6
  74. package/dist/assets/{WorkflowsView-D5G530AX.js → WorkflowsView-CXhmco5U.js} +7 -7
  75. package/dist/assets/{easyAiWorkflowUtils-eykvtlKm.js → easyAiWorkflowUtils-B7xBZAZO.js} +1 -1
  76. package/dist/assets/{index-CWcTt6jd.js → index-BW7gX0J2.js} +232838 -231981
  77. package/dist/assets/{index-DXFsvbJ_.css → index-Bs_8II2j.css} +257 -38
  78. package/dist/assets/{polyfills-BN5TIqPj.js → polyfills-DNwgos9f.js} +650 -0
  79. package/dist/assets/{pushConnection.store-CTrZ_kO6.js → pushConnection.store-C6PSl50Z.js} +1 -1
  80. package/dist/assets/{templateActions-B712CNo3.js → templateActions-BHlzMnfj.js} +1 -1
  81. package/dist/assets/useBeforeUnload-BudMrcxz.js +43 -0
  82. package/dist/assets/{useCanvasOperations-BSKKylIT.css → useCanvasOperations-CEWecDkR.css} +12 -12
  83. package/dist/assets/{useCanvasOperations-DTx4vbp_.js → useCanvasOperations-ZjLeZwpS.js} +62 -61
  84. package/dist/assets/{useExecutionDebugging-DjYGtT4w.js → useExecutionDebugging-C_Y6ee_L.js} +1 -1
  85. package/dist/assets/{useExecutionHelpers-DcyS3__o.js → useExecutionHelpers-MX6P-wr8.js} +1 -1
  86. package/dist/assets/{usePinnedData-C5NRkSpx.js → usePinnedData-CHMuwypo.js} +1 -1
  87. package/dist/assets/{usePushConnection-CGv57TM5.js → usePushConnection-3HzYJp1-.js} +3 -3
  88. package/dist/assets/{useRunWorkflow-C_vazd74.js → useRunWorkflow-DUK8ev8x.js} +19 -7
  89. package/dist/assets/{useWorkflowActivate-Dxi5zSSs.js → useWorkflowActivate-BjJ3P-qa.js} +1 -1
  90. package/dist/index.html +3 -3
  91. package/dist/static/n8n-logo.png +0 -0
  92. package/package.json +1 -1
  93. package/dist/assets/CollectionParameter-djLQ8MUO.js +0 -4
  94. package/dist/assets/VariablesView-CaGkZXjl.js +0 -599
  95. package/dist/assets/useBugReporting-BxDqzvRW.js +0 -38
  96. package/dist/assets/useNodeViewVersionSwitcher-CXU1PYlK.js +0 -93
@@ -1,599 +0,0 @@
1
- import { d as defineComponent, b7 as useClipboard, a as useToast, p as useSettingsStore, u as useUsersStore, q as computed, r as ref, o as onMounted, H as watch, c as openBlock, h as createElementBlock, j as createBaseVNode, t as toDisplayString, e as createBlock, l as unref, i as createVNode, w as withCtx, k as createTextVNode, n as normalizeClass, f as createCommentVNode, g as useI18n, y as nextTick, m as resolveComponent, am as getResourcePermissions, a8 as EnterpriseEditionFeature, _ as _export_sfc, dK as useEnvironmentsStore, K as useUIStore, a0 as useSourceControlStore, a3 as useDocumentTitle, a5 as usePageRedirectionHelper, ax as onBeforeMount, x as onBeforeUnmount, aT as createSlots, fN as uid, ae as MODAL_CONFIRM, ak as useTelemetry, al as useMessage } from "./index-CWcTt6jd.js";
2
- import { R as ResourcesListLayout } from "./ResourcesListLayout-DWASP6Vp.js";
3
- const _hoisted_1$1 = { class: "variables-key-column" };
4
- const _hoisted_2$1 = { key: 0 };
5
- const _hoisted_3 = { class: "variables-value-column" };
6
- const _hoisted_4 = { key: 0 };
7
- const _hoisted_5 = { class: "variables-usage-column" };
8
- const _hoisted_6 = { key: 0 };
9
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10
- __name: "VariablesRow",
11
- props: {
12
- data: {},
13
- editing: { type: Boolean, default: false }
14
- },
15
- emits: ["save", "cancel", "edit", "delete"],
16
- setup(__props, { emit: __emit }) {
17
- const i18n = useI18n();
18
- const clipboard = useClipboard();
19
- const { showMessage } = useToast();
20
- const settingsStore = useSettingsStore();
21
- const usersStore = useUsersStore();
22
- const emit = __emit;
23
- const props = __props;
24
- const permissions = computed(
25
- () => getResourcePermissions(usersStore.currentUser?.globalScopes).variable
26
- );
27
- const modelValue = ref({ ...props.data });
28
- const formValidationStatus = ref({
29
- key: false,
30
- value: false
31
- });
32
- const formValid = computed(() => {
33
- return formValidationStatus.value.name && formValidationStatus.value.value;
34
- });
35
- const keyInputRef = ref();
36
- const valueInputRef = ref();
37
- const usage = ref(`$vars.${props.data.name}`);
38
- const isFeatureEnabled = computed(
39
- () => settingsStore.isEnterpriseFeatureEnabled[EnterpriseEditionFeature.Variables]
40
- );
41
- onMounted(() => {
42
- focusFirstInput();
43
- });
44
- const keyValidationRules = [
45
- { name: "REQUIRED" },
46
- { name: "MAX_LENGTH", config: { maximum: 50 } },
47
- {
48
- name: "MATCH_REGEX",
49
- config: {
50
- regex: /^[a-zA-Z]/,
51
- message: i18n.baseText("variables.editing.key.error.startsWithLetter")
52
- }
53
- },
54
- {
55
- name: "MATCH_REGEX",
56
- config: {
57
- regex: /^[a-zA-Z][a-zA-Z0-9_]*$/,
58
- message: i18n.baseText("variables.editing.key.error.jsonKey")
59
- }
60
- }
61
- ];
62
- const valueValidationRules = [
63
- { name: "MAX_LENGTH", config: { maximum: 220 } }
64
- ];
65
- watch(
66
- () => modelValue.value.name,
67
- async () => {
68
- await nextTick();
69
- if (formValidationStatus.value.name) {
70
- updateUsageSyntax();
71
- }
72
- }
73
- );
74
- function updateUsageSyntax() {
75
- usage.value = `$vars.${modelValue.value.name || props.data.name}`;
76
- }
77
- async function onCancel() {
78
- modelValue.value = { ...props.data };
79
- emit("cancel", modelValue.value);
80
- }
81
- async function onSave() {
82
- emit("save", modelValue.value);
83
- }
84
- async function onEdit() {
85
- emit("edit", modelValue.value);
86
- await nextTick();
87
- focusFirstInput();
88
- }
89
- async function onDelete() {
90
- emit("delete", modelValue.value);
91
- }
92
- function onValidate(name, value) {
93
- formValidationStatus.value[name] = value;
94
- }
95
- function onUsageClick() {
96
- void clipboard.copy(usage.value);
97
- showMessage({
98
- title: i18n.baseText("variables.row.usage.copiedToClipboard"),
99
- type: "success"
100
- });
101
- }
102
- function focusFirstInput() {
103
- keyInputRef.value?.inputRef?.focus?.();
104
- }
105
- return (_ctx, _cache) => {
106
- const _component_n8n_form_input = resolveComponent("n8n-form-input");
107
- const _component_n8n_tooltip = resolveComponent("n8n-tooltip");
108
- const _component_n8n_button = resolveComponent("n8n-button");
109
- return openBlock(), createElementBlock("tr", {
110
- class: normalizeClass(_ctx.$style.variablesRow),
111
- "data-test-id": "variables-row"
112
- }, [
113
- createBaseVNode("td", _hoisted_1$1, [
114
- createBaseVNode("div", null, [
115
- !_ctx.editing ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(_ctx.data.name), 1)) : (openBlock(), createBlock(_component_n8n_form_input, {
116
- key: 1,
117
- ref_key: "keyInputRef",
118
- ref: keyInputRef,
119
- modelValue: modelValue.value.name,
120
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value.name = $event),
121
- label: "",
122
- name: "name",
123
- "data-test-id": "variable-row-key-input",
124
- placeholder: unref(i18n).baseText("variables.editing.key.placeholder"),
125
- required: "",
126
- "validate-on-blur": "",
127
- "validation-rules": keyValidationRules,
128
- onValidate: _cache[1] || (_cache[1] = (value) => onValidate("name", value))
129
- }, null, 8, ["modelValue", "placeholder"]))
130
- ])
131
- ]),
132
- createBaseVNode("td", _hoisted_3, [
133
- createBaseVNode("div", null, [
134
- !_ctx.editing ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(_ctx.data.value), 1)) : (openBlock(), createBlock(_component_n8n_form_input, {
135
- key: 1,
136
- ref_key: "valueInputRef",
137
- ref: valueInputRef,
138
- modelValue: modelValue.value.value,
139
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => modelValue.value.value = $event),
140
- label: "",
141
- name: "value",
142
- "data-test-id": "variable-row-value-input",
143
- placeholder: unref(i18n).baseText("variables.editing.value.placeholder"),
144
- "validate-on-blur": "",
145
- "validation-rules": valueValidationRules,
146
- onValidate: _cache[3] || (_cache[3] = (value) => onValidate("value", value))
147
- }, null, 8, ["modelValue", "placeholder"]))
148
- ])
149
- ]),
150
- createBaseVNode("td", _hoisted_5, [
151
- createBaseVNode("div", null, [
152
- createVNode(_component_n8n_tooltip, { placement: "top" }, {
153
- content: withCtx(() => [
154
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.usage.copyToClipboard")), 1)
155
- ]),
156
- default: withCtx(() => [
157
- modelValue.value.name && usage.value ? (openBlock(), createElementBlock("span", {
158
- key: 0,
159
- class: normalizeClass(_ctx.$style.usageSyntax),
160
- onClick: onUsageClick
161
- }, toDisplayString(usage.value), 3)) : createCommentVNode("", true)
162
- ]),
163
- _: 1
164
- })
165
- ])
166
- ]),
167
- isFeatureEnabled.value ? (openBlock(), createElementBlock("td", _hoisted_6, [
168
- _ctx.editing ? (openBlock(), createElementBlock("div", {
169
- key: 0,
170
- class: normalizeClass(_ctx.$style.buttons)
171
- }, [
172
- createVNode(_component_n8n_button, {
173
- "data-test-id": "variable-row-cancel-button",
174
- type: "tertiary",
175
- class: "mr-xs",
176
- onClick: onCancel
177
- }, {
178
- default: withCtx(() => [
179
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.cancel")), 1)
180
- ]),
181
- _: 1
182
- }),
183
- createVNode(_component_n8n_button, {
184
- "data-test-id": "variable-row-save-button",
185
- disabled: !formValid.value,
186
- type: "primary",
187
- onClick: onSave
188
- }, {
189
- default: withCtx(() => [
190
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.save")), 1)
191
- ]),
192
- _: 1
193
- }, 8, ["disabled"])
194
- ], 2)) : (openBlock(), createElementBlock("div", {
195
- key: 1,
196
- class: normalizeClass([_ctx.$style.buttons, _ctx.$style.hoverButtons])
197
- }, [
198
- createVNode(_component_n8n_tooltip, {
199
- disabled: permissions.value.update,
200
- placement: "top"
201
- }, {
202
- content: withCtx(() => [
203
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.edit.onlyRoleCanEdit")), 1)
204
- ]),
205
- default: withCtx(() => [
206
- createBaseVNode("div", null, [
207
- createVNode(_component_n8n_button, {
208
- "data-test-id": "variable-row-edit-button",
209
- type: "tertiary",
210
- class: "mr-xs",
211
- disabled: !permissions.value.update,
212
- onClick: onEdit
213
- }, {
214
- default: withCtx(() => [
215
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.edit")), 1)
216
- ]),
217
- _: 1
218
- }, 8, ["disabled"])
219
- ])
220
- ]),
221
- _: 1
222
- }, 8, ["disabled"]),
223
- createVNode(_component_n8n_tooltip, {
224
- disabled: permissions.value.delete,
225
- placement: "top"
226
- }, {
227
- content: withCtx(() => [
228
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.delete.onlyRoleCanDelete")), 1)
229
- ]),
230
- default: withCtx(() => [
231
- createBaseVNode("div", null, [
232
- createVNode(_component_n8n_button, {
233
- "data-test-id": "variable-row-delete-button",
234
- type: "tertiary",
235
- disabled: !permissions.value.delete,
236
- onClick: onDelete
237
- }, {
238
- default: withCtx(() => [
239
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.row.button.delete")), 1)
240
- ]),
241
- _: 1
242
- }, 8, ["disabled"])
243
- ])
244
- ]),
245
- _: 1
246
- }, 8, ["disabled"])
247
- ], 2))
248
- ])) : createCommentVNode("", true)
249
- ], 2);
250
- };
251
- }
252
- });
253
- const variablesRow = "_variablesRow_1wkcr_123";
254
- const hoverButtons = "_hoverButtons_1wkcr_123";
255
- const buttons = "_buttons_1wkcr_132";
256
- const usageSyntax = "_usageSyntax_1wkcr_143";
257
- const style0$1 = {
258
- variablesRow,
259
- hoverButtons,
260
- buttons,
261
- usageSyntax
262
- };
263
- const cssModules$1 = {
264
- "$style": style0$1
265
- };
266
- const VariablesRow = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
267
- const _hoisted_1 = { key: 0 };
268
- const _hoisted_2 = { key: 1 };
269
- const TEMPORARY_VARIABLE_UID_BASE = "@tmpvar";
270
- const _sfc_main = /* @__PURE__ */ defineComponent({
271
- __name: "VariablesView",
272
- setup(__props) {
273
- const settingsStore = useSettingsStore();
274
- const environmentsStore = useEnvironmentsStore();
275
- const usersStore = useUsersStore();
276
- const uiStore = useUIStore();
277
- const telemetry = useTelemetry();
278
- const i18n = useI18n();
279
- const message = useMessage();
280
- const sourceControlStore = useSourceControlStore();
281
- const documentTitle = useDocumentTitle();
282
- const pageRedirectionHelper = usePageRedirectionHelper();
283
- let sourceControlStoreUnsubscribe = () => {
284
- };
285
- const layoutRef = ref(null);
286
- const { showError } = useToast();
287
- const allVariables = ref([]);
288
- const editMode = ref({});
289
- const loading = ref(false);
290
- const permissions = computed(
291
- () => getResourcePermissions(usersStore.currentUser?.globalScopes).variable
292
- );
293
- const isFeatureEnabled = computed(
294
- () => settingsStore.isEnterpriseFeatureEnabled[EnterpriseEditionFeature.Variables]
295
- );
296
- const variablesToResources = computed(
297
- () => allVariables.value.map((v) => ({ id: v.id, name: v.key, value: v.value }))
298
- );
299
- const canCreateVariables = computed(() => isFeatureEnabled.value && permissions.value.create);
300
- const datatableColumns = computed(() => [
301
- {
302
- id: 0,
303
- path: "name",
304
- label: i18n.baseText("variables.table.key"),
305
- classes: ["variables-key-column"]
306
- },
307
- {
308
- id: 1,
309
- path: "value",
310
- label: i18n.baseText("variables.table.value"),
311
- classes: ["variables-value-column"]
312
- },
313
- {
314
- id: 2,
315
- path: "usage",
316
- label: i18n.baseText("variables.table.usage"),
317
- classes: ["variables-usage-column"]
318
- },
319
- ...isFeatureEnabled.value ? [
320
- {
321
- id: 3,
322
- path: "actions",
323
- label: ""
324
- }
325
- ] : []
326
- ]);
327
- const contextBasedTranslationKeys = computed(() => uiStore.contextBasedTranslationKeys);
328
- const newlyAddedVariableIds = ref([]);
329
- const nameSortFn = (a, b, direction) => {
330
- if (`${a.id}`.startsWith(TEMPORARY_VARIABLE_UID_BASE)) {
331
- return -1;
332
- } else if (`${b.id}`.startsWith(TEMPORARY_VARIABLE_UID_BASE)) {
333
- return 1;
334
- } else if (newlyAddedVariableIds.value.includes(a.id) && newlyAddedVariableIds.value.includes(b.id)) {
335
- return newlyAddedVariableIds.value.indexOf(a.id) - newlyAddedVariableIds.value.indexOf(b.id);
336
- } else if (newlyAddedVariableIds.value.includes(a.id)) {
337
- return -1;
338
- } else if (newlyAddedVariableIds.value.includes(b.id)) {
339
- return 1;
340
- }
341
- return direction === "asc" ? displayName(a).trim().localeCompare(displayName(b).trim()) : displayName(b).trim().localeCompare(displayName(a).trim());
342
- };
343
- const sortFns = {
344
- nameAsc: (a, b) => {
345
- return nameSortFn(a, b, "asc");
346
- },
347
- nameDesc: (a, b) => {
348
- return nameSortFn(a, b, "desc");
349
- }
350
- };
351
- function resetNewVariablesList() {
352
- newlyAddedVariableIds.value = [];
353
- }
354
- const resourceToEnvironmentVariable = (data) => ({
355
- id: data.id,
356
- key: data.name,
357
- value: "value" in data ? data.value ?? "" : ""
358
- });
359
- const environmentVariableToResource = (data) => ({
360
- id: data.id,
361
- name: data.key,
362
- value: "value" in data ? data.value : ""
363
- });
364
- async function initialize() {
365
- if (!isFeatureEnabled.value) return;
366
- loading.value = true;
367
- await environmentsStore.fetchAllVariables();
368
- allVariables.value = [...environmentsStore.variables];
369
- loading.value = false;
370
- }
371
- function addTemporaryVariable() {
372
- const temporaryVariable = {
373
- id: uid(TEMPORARY_VARIABLE_UID_BASE),
374
- key: "",
375
- value: ""
376
- };
377
- if (layoutRef.value) {
378
- if (layoutRef.value.$refs.listWrapperRef) {
379
- layoutRef.value.$refs.listWrapperRef.scrollTop = 0;
380
- }
381
- if (layoutRef.value.currentPage !== 1) {
382
- layoutRef.value.setCurrentPage(1);
383
- }
384
- }
385
- allVariables.value.unshift(temporaryVariable);
386
- editMode.value[temporaryVariable.id] = true;
387
- telemetry.track("User clicked add variable button");
388
- }
389
- async function saveVariable(data) {
390
- const variable = resourceToEnvironmentVariable(data);
391
- try {
392
- if (typeof variable.id === "string" && variable.id.startsWith(TEMPORARY_VARIABLE_UID_BASE)) {
393
- const { id, ...rest } = variable;
394
- const updatedVariable = await environmentsStore.createVariable(rest);
395
- allVariables.value.unshift(updatedVariable);
396
- allVariables.value = allVariables.value.filter((variable2) => variable2.id !== data.id);
397
- newlyAddedVariableIds.value.unshift(updatedVariable.id);
398
- } else {
399
- const updatedVariable = await environmentsStore.updateVariable(variable);
400
- allVariables.value = allVariables.value.filter((variable2) => variable2.id !== data.id);
401
- allVariables.value.push(updatedVariable);
402
- toggleEditing(environmentVariableToResource(updatedVariable));
403
- }
404
- } catch (error) {
405
- showError(error, i18n.baseText("variables.errors.save"));
406
- }
407
- }
408
- function toggleEditing(data) {
409
- editMode.value = {
410
- ...editMode.value,
411
- [data.id]: !editMode.value[data.id]
412
- };
413
- }
414
- function cancelEditing(data) {
415
- if (typeof data.id === "string" && data.id.startsWith(TEMPORARY_VARIABLE_UID_BASE)) {
416
- allVariables.value = allVariables.value.filter((variable) => variable.id !== data.id);
417
- } else {
418
- toggleEditing(data);
419
- }
420
- }
421
- async function deleteVariable(data) {
422
- const variable = resourceToEnvironmentVariable(data);
423
- try {
424
- const confirmed = await message.confirm(
425
- i18n.baseText("variables.modals.deleteConfirm.message", {
426
- interpolate: { name: variable.key }
427
- }),
428
- i18n.baseText("variables.modals.deleteConfirm.title"),
429
- {
430
- confirmButtonText: i18n.baseText("variables.modals.deleteConfirm.confirmButton"),
431
- cancelButtonText: i18n.baseText("variables.modals.deleteConfirm.cancelButton")
432
- }
433
- );
434
- if (confirmed !== MODAL_CONFIRM) {
435
- return;
436
- }
437
- await environmentsStore.deleteVariable(variable);
438
- allVariables.value = allVariables.value.filter((variable2) => variable2.id !== data.id);
439
- } catch (error) {
440
- showError(error, i18n.baseText("variables.errors.delete"));
441
- }
442
- }
443
- function goToUpgrade() {
444
- void pageRedirectionHelper.goToUpgrade("variables", "upgrade-variables");
445
- }
446
- function displayName(resource) {
447
- return resource.name;
448
- }
449
- onBeforeMount(() => {
450
- sourceControlStoreUnsubscribe = sourceControlStore.$onAction(({ name, after }) => {
451
- if (name === "pullWorkfolder" && after) {
452
- after(() => {
453
- void initialize();
454
- });
455
- }
456
- });
457
- });
458
- onBeforeUnmount(() => {
459
- sourceControlStoreUnsubscribe();
460
- });
461
- onMounted(() => {
462
- documentTitle.set(i18n.baseText("variables.heading"));
463
- });
464
- return (_ctx, _cache) => {
465
- const _component_n8n_heading = resolveComponent("n8n-heading");
466
- const _component_n8n_button = resolveComponent("n8n-button");
467
- const _component_n8n_tooltip = resolveComponent("n8n-tooltip");
468
- const _component_n8n_action_box = resolveComponent("n8n-action-box");
469
- return openBlock(), createBlock(ResourcesListLayout, {
470
- ref_key: "layoutRef",
471
- ref: layoutRef,
472
- class: "variables-view",
473
- "resource-key": "variables",
474
- disabled: !isFeatureEnabled.value,
475
- resources: variablesToResources.value,
476
- initialize,
477
- shareable: false,
478
- "display-name": displayName,
479
- "sort-fns": sortFns,
480
- "sort-options": ["nameAsc", "nameDesc"],
481
- "show-filters-dropdown": false,
482
- type: "datatable",
483
- "type-props": { columns: datatableColumns.value },
484
- loading: loading.value,
485
- onSort: resetNewVariablesList,
486
- "onClick:add": addTemporaryVariable
487
- }, createSlots({
488
- header: withCtx(() => [
489
- createVNode(_component_n8n_heading, {
490
- size: "2xlarge",
491
- class: "mb-m"
492
- }, {
493
- default: withCtx(() => [
494
- createTextVNode(toDisplayString(unref(i18n).baseText("variables.heading")), 1)
495
- ]),
496
- _: 1
497
- })
498
- ]),
499
- "add-button": withCtx(() => [
500
- createVNode(_component_n8n_tooltip, {
501
- placement: "top",
502
- disabled: canCreateVariables.value
503
- }, {
504
- content: withCtx(() => [
505
- !isFeatureEnabled.value ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(unref(i18n).baseText(`variables.add.unavailable${allVariables.value.length === 0 ? ".empty" : ""}`)), 1)) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(i18n).baseText("variables.add.onlyOwnerCanCreate")), 1))
506
- ]),
507
- default: withCtx(() => [
508
- createBaseVNode("div", null, [
509
- createVNode(_component_n8n_button, {
510
- size: "large",
511
- block: "",
512
- disabled: !canCreateVariables.value,
513
- "data-test-id": "resources-list-add",
514
- onClick: addTemporaryVariable
515
- }, {
516
- default: withCtx(() => [
517
- createTextVNode(toDisplayString(unref(i18n).baseText(`variables.add`)), 1)
518
- ]),
519
- _: 1
520
- }, 8, ["disabled"])
521
- ])
522
- ]),
523
- _: 1
524
- }, 8, ["disabled"])
525
- ]),
526
- default: withCtx(({ data }) => [
527
- (openBlock(), createBlock(VariablesRow, {
528
- key: data.id,
529
- editing: editMode.value[data.id],
530
- data,
531
- onSave: saveVariable,
532
- onEdit: toggleEditing,
533
- onCancel: cancelEditing,
534
- onDelete: deleteVariable
535
- }, null, 8, ["editing", "data"]))
536
- ]),
537
- _: 2
538
- }, [
539
- !isFeatureEnabled.value ? {
540
- name: "preamble",
541
- fn: withCtx(() => [
542
- createVNode(_component_n8n_action_box, {
543
- class: "mb-m",
544
- "data-test-id": "unavailable-resources-list",
545
- emoji: "👋",
546
- heading: unref(i18n).baseText(contextBasedTranslationKeys.value.variables.unavailable.title),
547
- description: unref(i18n).baseText(
548
- contextBasedTranslationKeys.value.variables.unavailable.description
549
- ),
550
- "button-text": unref(i18n).baseText(contextBasedTranslationKeys.value.variables.unavailable.button),
551
- "button-type": "secondary",
552
- "onClick:button": goToUpgrade
553
- }, null, 8, ["heading", "description", "button-text"])
554
- ]),
555
- key: "0"
556
- } : void 0,
557
- !isFeatureEnabled.value || isFeatureEnabled.value && !canCreateVariables.value ? {
558
- name: "empty",
559
- fn: withCtx(() => [
560
- !isFeatureEnabled.value ? (openBlock(), createBlock(_component_n8n_action_box, {
561
- key: 0,
562
- "data-test-id": "unavailable-resources-list",
563
- emoji: "👋",
564
- heading: unref(i18n).baseText(contextBasedTranslationKeys.value.variables.unavailable.title),
565
- description: unref(i18n).baseText(
566
- contextBasedTranslationKeys.value.variables.unavailable.description
567
- ),
568
- "button-text": unref(i18n).baseText(contextBasedTranslationKeys.value.variables.unavailable.button),
569
- "button-type": "secondary",
570
- "onClick:button": goToUpgrade
571
- }, null, 8, ["heading", "description", "button-text"])) : !canCreateVariables.value ? (openBlock(), createBlock(_component_n8n_action_box, {
572
- key: 1,
573
- "data-test-id": "cannot-create-variables",
574
- emoji: "👋",
575
- heading: unref(i18n).baseText("variables.empty.notAllowedToCreate.heading", {
576
- interpolate: { name: unref(usersStore).currentUser?.firstName ?? "" }
577
- }),
578
- description: unref(i18n).baseText("variables.empty.notAllowedToCreate.description"),
579
- onClick: goToUpgrade
580
- }, null, 8, ["heading", "description"])) : createCommentVNode("", true)
581
- ]),
582
- key: "1"
583
- } : void 0
584
- ]), 1032, ["disabled", "resources", "type-props", "loading"]);
585
- };
586
- }
587
- });
588
- const sidebarContainer = "_sidebarContainer_d99g5_127";
589
- const style0 = {
590
- "type-input": "_type-input_d99g5_123",
591
- sidebarContainer
592
- };
593
- const cssModules = {
594
- "$style": style0
595
- };
596
- const VariablesView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-626399fb"]]);
597
- export {
598
- VariablesView as default
599
- };
@@ -1,38 +0,0 @@
1
- import { g8 as useDebugInfo } from "./index-CWcTt6jd.js";
2
- const BASE_FORUM_URL = "https://github.com/n8n-io/n8n/issues/new?labels=bug-report";
3
- const REPORT_TEMPLATE = `
4
- <!-- Please follow the template below. Skip the questions that are not relevant to you. -->
5
-
6
- ## Describe the problem/error/question
7
-
8
-
9
- ## What is the error message (if any)?
10
-
11
-
12
- ## Please share your workflow/screenshots/recording
13
-
14
- \`\`\`
15
- (Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
16
- \`\`\`
17
-
18
-
19
- ## Share the output returned by the last node
20
- <!-- If you need help with data transformations, please also share your expected output. -->
21
-
22
- `;
23
- function useBugReporting() {
24
- const debugInfo = useDebugInfo();
25
- const getReportingURL = () => {
26
- const url = new URL(BASE_FORUM_URL);
27
- const report = `${REPORT_TEMPLATE}
28
- ${debugInfo.generateDebugInfo({ skipSensitive: true, secondaryHeader: true })}}`;
29
- url.searchParams.append("body", report);
30
- return url.toString();
31
- };
32
- return {
33
- getReportingURL
34
- };
35
- }
36
- export {
37
- useBugReporting as u
38
- };