diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
index 0b6cc6d78c..568590db19 100644
--- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
+++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
@@ -133,8 +133,6 @@ export class OutputParserStructured implements INodeType {
}`,
typeOptions: {
rows: 10,
- editor: 'json',
- editorLanguage: 'json',
},
required: true,
},
diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts
index 458f5745e3..baa6c39912 100644
--- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts
+++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts
@@ -117,9 +117,8 @@ export class RetrieverWorkflow implements INodeType {
{
displayName: 'Workflow JSON',
name: 'workflowJson',
- type: 'string',
+ type: 'json',
typeOptions: {
- editor: 'json',
rows: 10,
},
displayOptions: {
@@ -257,11 +256,9 @@ export class RetrieverWorkflow implements INodeType {
{
displayName: 'Value',
name: 'objectValue',
- type: 'string',
+ type: 'json',
default: '={}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 2,
},
displayOptions: {
diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts
index 79ef9b898b..14e8511168 100644
--- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts
+++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts
@@ -119,9 +119,8 @@ export class ToolWorkflow implements INodeType {
{
displayName: 'Workflow JSON',
name: 'workflowJson',
- type: 'string',
+ type: 'json',
typeOptions: {
- editor: 'json',
rows: 10,
},
displayOptions: {
@@ -266,11 +265,9 @@ export class ToolWorkflow implements INodeType {
{
displayName: 'Value',
name: 'objectValue',
- type: 'string',
+ type: 'json',
default: '={}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 2,
},
displayOptions: {
diff --git a/packages/core/test/Validation.test.ts b/packages/core/test/Validation.test.ts
index 2554abb05b..a19422a090 100644
--- a/packages/core/test/Validation.test.ts
+++ b/packages/core/test/Validation.test.ts
@@ -123,11 +123,9 @@ describe('Validation', () => {
{
displayName: 'Value',
name: 'objectValue',
- type: 'string',
+ type: 'json',
default: '={}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 2,
},
displayOptions: {
diff --git a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
index 3f5fa02c50..9827cd5567 100644
--- a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
+++ b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
@@ -52,7 +52,6 @@ import { Compartment, EditorState } from '@codemirror/state';
import type { ViewUpdate } from '@codemirror/view';
import { EditorView } from '@codemirror/view';
import { javascript } from '@codemirror/lang-javascript';
-import { json } from '@codemirror/lang-json';
import { python } from '@codemirror/lang-python';
import type { CodeExecutionMode, CodeNodeEditorLanguage } from 'n8n-workflow';
import { CODE_EXECUTION_MODES, CODE_LANGUAGES } from 'n8n-workflow';
@@ -97,10 +96,9 @@ export default defineComponent({
type: Boolean,
default: false,
},
-
rows: {
type: Number,
- default: -1,
+ default: 4,
},
modelValue: {
type: String,
@@ -177,8 +175,6 @@ export default defineComponent({
// eslint-disable-next-line vue/return-in-computed-property
languageExtensions(): [LanguageSupport, ...Extension[]] {
switch (this.language) {
- case 'json':
- return [json()];
case 'javaScript':
return [javascript(), this.autocompletionExtension('javaScript')];
case 'python':
diff --git a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts
index f1fe9db6d4..d64d4f83cd 100644
--- a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts
+++ b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts
@@ -1,7 +1,6 @@
import { defineComponent } from 'vue';
import type { Diagnostic } from '@codemirror/lint';
import { linter as createLinter } from '@codemirror/lint';
-import { jsonParseLinter } from '@codemirror/lang-json';
import type { EditorView } from '@codemirror/view';
import * as esprima from 'esprima-next';
import type { Node } from 'estree';
@@ -21,8 +20,6 @@ export const linterExtension = defineComponent({
switch (language) {
case 'javaScript':
return createLinter(this.lintSource, { delay: DEFAULT_LINTER_DELAY_IN_MS });
- case 'json':
- return createLinter(jsonParseLinter());
}
return undefined;
},
diff --git a/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue b/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue
index 84dcd0fd5e..1b91d9c00d 100644
--- a/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue
+++ b/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue
@@ -54,7 +54,7 @@ export default defineComponent({
},
rows: {
type: Number,
- default: -1,
+ default: 4,
},
disableExpressionColoring: {
type: Boolean,
@@ -67,7 +67,8 @@ export default defineComponent({
},
data() {
return {
- editor: {} as EditorView,
+ editor: null as EditorView | null,
+ editorState: null as EditorState | null,
};
},
computed: {
@@ -111,8 +112,6 @@ export default defineComponent({
EditorView.updateListener.of((viewUpdate: ViewUpdate) => {
if (!viewUpdate.docChanged) return;
- this.editorState = this.editor.state;
-
this.getHighlighter()?.removeColor(this.editor, this.htmlSegments);
this.getHighlighter()?.addColor(this.editor, this.resolvableSegments);
diff --git a/packages/editor-ui/src/components/JsEditor/JsEditor.vue b/packages/editor-ui/src/components/JsEditor/JsEditor.vue
new file mode 100644
index 0000000000..805eb13893
--- /dev/null
+++ b/packages/editor-ui/src/components/JsEditor/JsEditor.vue
@@ -0,0 +1,95 @@
+
+
+
+
+
diff --git a/packages/editor-ui/src/components/JsonEditor/JsonEditor.vue b/packages/editor-ui/src/components/JsonEditor/JsonEditor.vue
new file mode 100644
index 0000000000..be5762f5d8
--- /dev/null
+++ b/packages/editor-ui/src/components/JsonEditor/JsonEditor.vue
@@ -0,0 +1,95 @@
+
+
+
+
+
diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue
index c6d15bdab1..7860c2030d 100644
--- a/packages/editor-ui/src/components/ParameterInput.vue
+++ b/packages/editor-ui/src/components/ParameterInput.vue
@@ -124,14 +124,18 @@
@update:modelValue="valueChangedDebounced"
/>
-
+
+
@@ -396,18 +400,15 @@ import ExpressionParameterInput from '@/components/ExpressionParameterInput.vue'
import TextEdit from '@/components/TextEdit.vue';
import CodeNodeEditor from '@/components/CodeNodeEditor/CodeNodeEditor.vue';
import HtmlEditor from '@/components/HtmlEditor/HtmlEditor.vue';
+import JsEditor from '@/components/JsEditor/JsEditor.vue';
+import JsonEditor from '@/components/JsonEditor/JsonEditor.vue';
import SqlEditor from '@/components/SqlEditor/SqlEditor.vue';
import { workflowHelpers } from '@/mixins/workflowHelpers';
import { hasExpressionMapping, isValueExpression } from '@/utils/nodeTypesUtils';
import { isResourceLocatorValue } from '@/utils/typeGuards';
-import {
- CUSTOM_API_CALL_KEY,
- EXECUTE_WORKFLOW_NODE_TYPE,
- HTML_NODE_TYPE,
- NODES_USING_CODE_NODE_EDITOR,
-} from '@/constants';
+import { CUSTOM_API_CALL_KEY, HTML_NODE_TYPE, NODES_USING_CODE_NODE_EDITOR } from '@/constants';
import type { PropType } from 'vue';
import { debounceHelper } from '@/mixins/debounce';
@@ -432,6 +433,8 @@ export default defineComponent({
components: {
CodeNodeEditor,
HtmlEditor,
+ JsEditor,
+ JsonEditor,
SqlEditor,
ExpressionEdit,
ExpressionParameterInput,
@@ -1119,9 +1122,6 @@ export default defineComponent({
isHtmlNode(node: INodeUi): boolean {
return node.type === HTML_NODE_TYPE;
},
- isExecuteWorkflowNode(node: INodeUi): boolean {
- return node.type === EXECUTE_WORKFLOW_NODE_TYPE;
- },
rgbaToHex(value: string): string | null {
// Convert rgba to hex from: https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
const valueMatch = value.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+(\.\d+)?)\)$/);
diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue
index ba607c1cd2..062e32923e 100644
--- a/packages/editor-ui/src/components/RunData.vue
+++ b/packages/editor-ui/src/components/RunData.vue
@@ -236,9 +236,8 @@
-
@@ -604,11 +603,11 @@ import {
import BinaryDataDisplay from '@/components/BinaryDataDisplay.vue';
import NodeErrorView from '@/components/Error/NodeErrorView.vue';
+import JsonEditor from '@/components/JsonEditor/JsonEditor.vue';
import { genericHelpers } from '@/mixins/genericHelpers';
import { pinData } from '@/mixins/pinData';
import type { PinDataSource } from '@/mixins/pinData';
-import CodeNodeEditor from '@/components/CodeNodeEditor/CodeNodeEditor.vue';
import { dataPinningEventBus } from '@/event-bus';
import { clearJsonKey, isEmpty } from '@/utils/typesUtils';
import { executionDataToJson } from '@/utils/nodeTypesUtils';
@@ -636,7 +635,7 @@ export default defineComponent({
components: {
BinaryDataDisplay,
NodeErrorView,
- CodeNodeEditor,
+ JsonEditor,
RunDataTable,
RunDataJson,
RunDataSchema,
diff --git a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue
index 242b6ab61a..7847cc75f8 100644
--- a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue
+++ b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue
@@ -60,6 +60,7 @@ const SQL_DIALECTS = {
type SQLEditorData = {
editor: EditorView | null;
+ editorState: EditorState | null;
isFocused: boolean;
skipSegments: string[];
expressionsDocsUrl: string;
@@ -89,12 +90,13 @@ export default defineComponent({
},
rows: {
type: Number,
- default: -1,
+ default: 4,
},
},
data(): SQLEditorData {
return {
editor: null,
+ editorState: null,
expressionsDocsUrl: EXPRESSIONS_DOCS_URL,
isFocused: false,
skipSegments: ['Statement', 'CompositeIdentifier', 'Parens'],
@@ -132,7 +134,6 @@ export default defineComponent({
}),
lineNumbers(),
EditorView.lineWrapping,
- EditorState.readOnly.of(this.isReadOnly),
EditorView.domEventHandlers({
focus: () => {
this.isFocused = true;
@@ -162,8 +163,6 @@ export default defineComponent({
EditorView.updateListener.of((viewUpdate: ViewUpdate) => {
if (!viewUpdate.docChanged || !this.editor) return;
- this.editorState = this.editor.state;
-
highlighter.removeColor(this.editor as EditorView, this.plaintextSegments);
highlighter.addColor(this.editor as EditorView, this.resolvableSegments);
diff --git a/packages/editor-ui/src/components/__tests__/JsEditor.test.ts b/packages/editor-ui/src/components/__tests__/JsEditor.test.ts
new file mode 100644
index 0000000000..f29ea4424a
--- /dev/null
+++ b/packages/editor-ui/src/components/__tests__/JsEditor.test.ts
@@ -0,0 +1,19 @@
+import { createTestingPinia } from '@pinia/testing';
+import JsEditor from '@/components/JsEditor/JsEditor.vue';
+import { renderComponent } from '@/__tests__/render';
+
+describe('JsEditor', () => {
+ const renderEditor = (jsonString: string) =>
+ renderComponent(JsEditor, {
+ global: {
+ plugins: [createTestingPinia()],
+ },
+ props: { modelValue: jsonString },
+ });
+
+ it('renders simple js', async () => {
+ const modelValue = 'return [1, 2, 3]';
+ const result = renderEditor(modelValue);
+ expect(result.container.querySelector('.cm-content')?.textContent).toEqual(modelValue);
+ });
+});
diff --git a/packages/editor-ui/src/components/__tests__/JsonEditor.test.ts b/packages/editor-ui/src/components/__tests__/JsonEditor.test.ts
new file mode 100644
index 0000000000..74f5e17be7
--- /dev/null
+++ b/packages/editor-ui/src/components/__tests__/JsonEditor.test.ts
@@ -0,0 +1,30 @@
+import { createTestingPinia } from '@pinia/testing';
+import JsonEditor from '@/components/JsonEditor/JsonEditor.vue';
+import { renderComponent } from '@/__tests__/render';
+
+describe('JsonEditor', () => {
+ const renderEditor = (jsonString: string) =>
+ renderComponent(JsonEditor, {
+ global: {
+ plugins: [createTestingPinia()],
+ },
+ props: { modelValue: jsonString },
+ });
+
+ it('renders simple json', async () => {
+ const modelValue = '{ "testing": [true, 5] }';
+ const result = renderEditor(modelValue);
+ expect(result.container.querySelector('.cm-content')?.textContent).toEqual(modelValue);
+ });
+
+ it('renders multiline json', async () => {
+ const modelValue = '{\n\t"testing": [true, 5]\n}';
+ const result = renderEditor(modelValue);
+ const gutter = result.container.querySelector('.cm-gutters');
+ expect(gutter?.querySelectorAll('.cm-lineNumbers .cm-gutterElement').length).toEqual(4);
+
+ const content = result.container.querySelector('.cm-content');
+ const lines = [...content!.querySelectorAll('.cm-line').values()].map((l) => l.textContent);
+ expect(lines).toEqual(['{', '\t"testing": [true, 5]', '}']);
+ });
+});
diff --git a/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts b/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts
index a46912c5e7..97302edd3b 100644
--- a/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts
+++ b/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts
@@ -68,10 +68,6 @@ const JSON_PARAM: INodeProperties = {
displayName: 'JSON Payload',
name: 'payloadJson',
type: 'json',
- typeOptions: {
- alwaysOpenEditWindow: true,
- editor: 'code',
- },
default: '',
};
diff --git a/packages/nodes-base/nodes/Discord/v1/DiscordV1.node.ts b/packages/nodes-base/nodes/Discord/v1/DiscordV1.node.ts
index 0da0647869..bf04088fd5 100644
--- a/packages/nodes-base/nodes/Discord/v1/DiscordV1.node.ts
+++ b/packages/nodes-base/nodes/Discord/v1/DiscordV1.node.ts
@@ -55,14 +55,14 @@ const versionDescription: INodeTypeDescription = {
displayName: 'Allowed Mentions',
name: 'allowedMentions',
type: 'json',
- typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
+ typeOptions: { alwaysOpenEditWindow: true },
default: '',
},
{
displayName: 'Attachments',
name: 'attachments',
type: 'json',
- typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
+ typeOptions: { alwaysOpenEditWindow: true },
default: '',
},
{
@@ -75,14 +75,14 @@ const versionDescription: INodeTypeDescription = {
displayName: 'Components',
name: 'components',
type: 'json',
- typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
+ typeOptions: { alwaysOpenEditWindow: true },
default: '',
},
{
displayName: 'Embeds',
name: 'embeds',
type: 'json',
- typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
+ typeOptions: { alwaysOpenEditWindow: true },
default: '',
},
{
@@ -95,7 +95,7 @@ const versionDescription: INodeTypeDescription = {
displayName: 'JSON Payload',
name: 'payloadJson',
type: 'json',
- typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
+ typeOptions: { alwaysOpenEditWindow: true },
default: '',
},
{
diff --git a/packages/nodes-base/nodes/Discord/v2/actions/common.description.ts b/packages/nodes-base/nodes/Discord/v2/actions/common.description.ts
index fd5ae047ee..fd3ae41d5f 100644
--- a/packages/nodes-base/nodes/Discord/v2/actions/common.description.ts
+++ b/packages/nodes-base/nodes/Discord/v2/actions/common.description.ts
@@ -416,11 +416,9 @@ export const embedsFixedCollection: INodeProperties = {
{
displayName: 'Value',
name: 'json',
- type: 'string',
+ type: 'json',
default: '={}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 2,
},
displayOptions: {
diff --git a/packages/nodes-base/nodes/ExecuteWorkflow/ExecuteWorkflow.node.ts b/packages/nodes-base/nodes/ExecuteWorkflow/ExecuteWorkflow.node.ts
index 6b7b6cce60..bd7ca7835b 100644
--- a/packages/nodes-base/nodes/ExecuteWorkflow/ExecuteWorkflow.node.ts
+++ b/packages/nodes-base/nodes/ExecuteWorkflow/ExecuteWorkflow.node.ts
@@ -111,9 +111,8 @@ export class ExecuteWorkflow implements INodeType {
{
displayName: 'Workflow JSON',
name: 'workflowJson',
- type: 'string',
+ type: 'json',
typeOptions: {
- editor: 'json',
rows: 10,
},
displayOptions: {
diff --git a/packages/nodes-base/nodes/ExecuteWorkflow/GenericFunctions.ts b/packages/nodes-base/nodes/ExecuteWorkflow/GenericFunctions.ts
index 78ad6fff6c..b91d6ee4b5 100644
--- a/packages/nodes-base/nodes/ExecuteWorkflow/GenericFunctions.ts
+++ b/packages/nodes-base/nodes/ExecuteWorkflow/GenericFunctions.ts
@@ -1,10 +1,6 @@
import { readFile as fsReadFile } from 'fs/promises';
-import {
- NodeOperationError,
- type IExecuteFunctions,
- type IExecuteWorkflowInfo,
- jsonParse,
-} from 'n8n-workflow';
+import { NodeOperationError, jsonParse } from 'n8n-workflow';
+import type { IWorkflowBase, IExecuteFunctions, IExecuteWorkflowInfo } from 'n8n-workflow';
export async function getWorkflowInfo(this: IExecuteFunctions, source: string, itemIndex = 0) {
const workflowInfo: IExecuteWorkflowInfo = {};
@@ -33,8 +29,7 @@ export async function getWorkflowInfo(this: IExecuteFunctions, source: string, i
workflowInfo.code = jsonParse(workflowJson);
} else if (source === 'parameter') {
// Read workflow from parameter
- const workflowJson = this.getNodeParameter('workflowJson', itemIndex) as string;
- workflowInfo.code = jsonParse(workflowJson);
+ workflowInfo.code = this.getNodeParameter('workflowJson', itemIndex) as IWorkflowBase;
} else if (source === 'url') {
// Read workflow from url
const workflowUrl = this.getNodeParameter('workflowUrl', itemIndex) as string;
diff --git a/packages/nodes-base/nodes/Function/Function.node.ts b/packages/nodes-base/nodes/Function/Function.node.ts
index 0475157702..75b003a733 100644
--- a/packages/nodes-base/nodes/Function/Function.node.ts
+++ b/packages/nodes-base/nodes/Function/Function.node.ts
@@ -40,7 +40,7 @@ export class Function implements INodeType {
typeOptions: {
alwaysOpenEditWindow: true,
codeAutocomplete: 'function',
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
type: 'string',
diff --git a/packages/nodes-base/nodes/FunctionItem/FunctionItem.node.ts b/packages/nodes-base/nodes/FunctionItem/FunctionItem.node.ts
index 85d4c76dd2..348f52aaef 100644
--- a/packages/nodes-base/nodes/FunctionItem/FunctionItem.node.ts
+++ b/packages/nodes-base/nodes/FunctionItem/FunctionItem.node.ts
@@ -40,7 +40,7 @@ export class FunctionItem implements INodeType {
typeOptions: {
alwaysOpenEditWindow: true,
codeAutocomplete: 'functionItem',
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
type: 'string',
diff --git a/packages/nodes-base/nodes/ItemLists/V1/ItemListsV1.node.ts b/packages/nodes-base/nodes/ItemLists/V1/ItemListsV1.node.ts
index d41d744cce..545b83502d 100644
--- a/packages/nodes-base/nodes/ItemLists/V1/ItemListsV1.node.ts
+++ b/packages/nodes-base/nodes/ItemLists/V1/ItemListsV1.node.ts
@@ -596,7 +596,7 @@ export class ItemListsV1 implements INodeType {
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
default: `// The two items to compare are in the variables a and b
diff --git a/packages/nodes-base/nodes/ItemLists/V2/ItemListsV2.node.ts b/packages/nodes-base/nodes/ItemLists/V2/ItemListsV2.node.ts
index 4625b272b4..52ca465e49 100644
--- a/packages/nodes-base/nodes/ItemLists/V2/ItemListsV2.node.ts
+++ b/packages/nodes-base/nodes/ItemLists/V2/ItemListsV2.node.ts
@@ -598,7 +598,7 @@ export class ItemListsV2 implements INodeType {
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
default: `// The two items to compare are in the variables a and b
diff --git a/packages/nodes-base/nodes/ItemLists/V3/actions/itemList/sort.operation.ts b/packages/nodes-base/nodes/ItemLists/V3/actions/itemList/sort.operation.ts
index 6825779e28..efc979917d 100644
--- a/packages/nodes-base/nodes/ItemLists/V3/actions/itemList/sort.operation.ts
+++ b/packages/nodes-base/nodes/ItemLists/V3/actions/itemList/sort.operation.ts
@@ -96,7 +96,7 @@ const properties: INodeProperties[] = [
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
default: `// The two items to compare are in the variables a and b
diff --git a/packages/nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts b/packages/nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts
index d6da0a0c51..ca16a82b04 100644
--- a/packages/nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts
+++ b/packages/nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts
@@ -115,8 +115,6 @@ export class RespondToWebhook implements INodeType {
},
default: '{\n "myField": "value"\n}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 4,
},
description: 'The HTTP response JSON data',
diff --git a/packages/nodes-base/nodes/Set/v2/manual.mode.ts b/packages/nodes-base/nodes/Set/v2/manual.mode.ts
index ca18e31ed3..42eb3e2a7d 100644
--- a/packages/nodes-base/nodes/Set/v2/manual.mode.ts
+++ b/packages/nodes-base/nodes/Set/v2/manual.mode.ts
@@ -139,11 +139,9 @@ const properties: INodeProperties[] = [
{
displayName: 'Value',
name: 'objectValue',
- type: 'string',
+ type: 'json',
default: '={}',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 2,
},
displayOptions: {
diff --git a/packages/nodes-base/nodes/Set/v2/raw.mode.ts b/packages/nodes-base/nodes/Set/v2/raw.mode.ts
index 6e45134c14..506ef48c91 100644
--- a/packages/nodes-base/nodes/Set/v2/raw.mode.ts
+++ b/packages/nodes-base/nodes/Set/v2/raw.mode.ts
@@ -15,10 +15,8 @@ const properties: INodeProperties[] = [
{
displayName: 'JSON Output',
name: 'jsonOutput',
- type: 'string',
+ type: 'json',
typeOptions: {
- editor: 'json',
- editorLanguage: 'json',
rows: 5,
},
default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}',
diff --git a/packages/nodes-base/nodes/TheHiveProject/actions/query/executeQuery.operation.ts b/packages/nodes-base/nodes/TheHiveProject/actions/query/executeQuery.operation.ts
index 3ef4f9d940..f4772aacad 100644
--- a/packages/nodes-base/nodes/TheHiveProject/actions/query/executeQuery.operation.ts
+++ b/packages/nodes-base/nodes/TheHiveProject/actions/query/executeQuery.operation.ts
@@ -13,13 +13,12 @@ const properties: INodeProperties[] = [
{
displayName: 'Query',
name: 'queryJson',
- type: 'string',
+ type: 'json',
required: true,
default: '=[\n {\n "_name": "listOrganisation"\n }\n]',
description: 'Search for objects with filtering and sorting capabilities',
hint: 'The query should be an array of operations with the required selection and optional filtering, sorting, and pagination. See
Query API for more information.',
typeOptions: {
- editor: 'json',
rows: 10,
},
},
diff --git a/packages/nodes-base/nodes/Transform/Sort/Sort.node.ts b/packages/nodes-base/nodes/Transform/Sort/Sort.node.ts
index acfa6a7d45..52ac687132 100644
--- a/packages/nodes-base/nodes/Transform/Sort/Sort.node.ts
+++ b/packages/nodes-base/nodes/Transform/Sort/Sort.node.ts
@@ -106,7 +106,7 @@ export class Sort implements INodeType {
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
- editor: 'code',
+ editor: 'jsEditor',
rows: 10,
},
default: `// The two items to compare are in the variables a and b
diff --git a/packages/workflow/src/Constants.ts b/packages/workflow/src/Constants.ts
index ad4946888e..ecd604f8dc 100644
--- a/packages/workflow/src/Constants.ts
+++ b/packages/workflow/src/Constants.ts
@@ -3,7 +3,7 @@ export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z';
export const LOG_LEVELS = ['silent', 'error', 'warn', 'info', 'debug', 'verbose'] as const;
-export const CODE_LANGUAGES = ['javaScript', 'json', 'python'] as const;
+export const CODE_LANGUAGES = ['javaScript', 'python'] as const;
export const CODE_EXECUTION_MODES = ['runOnceForAllItems', 'runOnceForEachItem'] as const;
/**
diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts
index 210741c44b..203a1df591 100644
--- a/packages/workflow/src/Interfaces.ts
+++ b/packages/workflow/src/Interfaces.ts
@@ -1078,7 +1078,7 @@ export type NodePropertyTypes =
export type CodeAutocompleteTypes = 'function' | 'functionItem';
-export type EditorType = 'code' | 'codeNodeEditor' | 'htmlEditor' | 'sqlEditor' | 'json';
+export type EditorType = 'codeNodeEditor' | 'jsEditor' | 'htmlEditor' | 'sqlEditor';
export type CodeNodeEditorLanguage = (typeof CODE_LANGUAGES)[number];
export type CodeExecutionMode = (typeof CODE_EXECUTION_MODES)[number];
export type SQLDialect =
@@ -1105,7 +1105,6 @@ export interface INodePropertyTypeOptions {
alwaysOpenEditWindow?: boolean; // Supported by: json
codeAutocomplete?: CodeAutocompleteTypes; // Supported by: string
editor?: EditorType; // Supported by: string
- editorLanguage?: CodeNodeEditorLanguage; // Supported by: string in combination with editor: codeNodeEditor
sqlDialect?: SQLDialect; // Supported by: sqlEditor
loadOptionsDependsOn?: string[]; // Supported by: options
loadOptionsMethod?: string; // Supported by: options