refactor(editor): Do not use CodeNodeEditor anywhere except the Code node (no-changelog) (#8636)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-02-15 11:35:50 +01:00 committed by GitHub
parent 941278db68
commit bf729aa2f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 11 deletions

View file

@ -158,8 +158,7 @@ export class Code implements INodeType {
name: 'code', name: 'code',
type: 'string', type: 'string',
typeOptions: { typeOptions: {
editor: 'codeNodeEditor', editor: 'jsEditor',
editorLanguage: 'javaScript',
}, },
default: defaultCodeExecute, default: defaultCodeExecute,
hint: 'This code will only run and return data if a "Main" input & output got created.', hint: 'This code will only run and return data if a "Main" input & output got created.',
@ -176,8 +175,7 @@ export class Code implements INodeType {
name: 'code', name: 'code',
type: 'string', type: 'string',
typeOptions: { typeOptions: {
editor: 'codeNodeEditor', editor: 'jsEditor',
editorLanguage: 'javaScript',
}, },
default: defaultCodeSupplyData, default: defaultCodeSupplyData,
hint: 'This code will only run and return data if an output got created which is not "Main".', hint: 'This code will only run and return data if an output got created which is not "Main".',

View file

@ -99,8 +99,7 @@ export class ToolCode implements INodeType {
}, },
}, },
typeOptions: { typeOptions: {
editor: 'codeNodeEditor', editor: 'jsEditor',
editorLanguage: 'javaScript',
}, },
default: default:
'// Example: convert the incoming query to uppercase and return it\nreturn query.toUpperCase()', '// Example: convert the incoming query to uppercase and return it\nreturn query.toUpperCase()',
@ -120,7 +119,7 @@ export class ToolCode implements INodeType {
}, },
}, },
typeOptions: { typeOptions: {
editor: 'codeNodeEditor', editor: 'codeNodeEditor', // TODO: create a separate `pythonEditor` component
editorLanguage: 'python', editorLanguage: 'python',
}, },
default: default:

View file

@ -8,7 +8,7 @@ import { CHAT_EMBED_MODAL_KEY, CHAT_TRIGGER_NODE_TYPE, WEBHOOK_NODE_TYPE } from
import { useRootStore } from '@/stores/n8nRoot.store'; import { useRootStore } from '@/stores/n8nRoot.store';
import { useWorkflowsStore } from '@/stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import HtmlEditor from '@/components/HtmlEditor/HtmlEditor.vue'; import HtmlEditor from '@/components/HtmlEditor/HtmlEditor.vue';
import CodeNodeEditor from '@/components/CodeNodeEditor/CodeNodeEditor.vue'; import JsEditor from '@/components/JsEditor/JsEditor.vue';
import { useI18n } from '@/composables/useI18n'; import { useI18n } from '@/composables/useI18n';
const props = defineProps({ const props = defineProps({
@ -150,7 +150,7 @@ function closeDialog() {
{{ i18n.baseText('chatEmbed.install') }} {{ i18n.baseText('chatEmbed.install') }}
</n8n-text> </n8n-text>
</div> </div>
<CodeNodeEditor :model-value="commonCode.install" is-read-only /> <HtmlEditor :model-value="commonCode.install" is-read-only />
</div> </div>
<div class="mb-s"> <div class="mb-s">
@ -165,8 +165,8 @@ function closeDialog() {
<HtmlEditor v-if="currentTab === 'cdn'" :model-value="cdnCode" is-read-only /> <HtmlEditor v-if="currentTab === 'cdn'" :model-value="cdnCode" is-read-only />
<HtmlEditor v-if="currentTab === 'vue'" :model-value="vueCode" is-read-only /> <HtmlEditor v-if="currentTab === 'vue'" :model-value="vueCode" is-read-only />
<CodeNodeEditor v-if="currentTab === 'react'" :model-value="reactCode" is-read-only /> <JsEditor v-if="currentTab === 'react'" :model-value="reactCode" is-read-only />
<CodeNodeEditor v-if="currentTab === 'other'" :model-value="otherCode" is-read-only /> <JsEditor v-if="currentTab === 'other'" :model-value="otherCode" is-read-only />
<n8n-text> <n8n-text>
{{ i18n.baseText('chatEmbed.packageInfo.description') }} {{ i18n.baseText('chatEmbed.packageInfo.description') }}