mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Create separate components for JS and JSON editors (no-changelog) (#8156)
## Summary This is part-1 of refactoring our code editors to extract different type of editors into their own components. In part-2 we'll 1. delete a of unused or duplicate code 2. switch to a `useEditor` composable to bring more UX consistency across all the code editors. ## Review / Merge checklist - [x] PR title and summary are descriptive - [x] Tests included
This commit is contained in:
committed by
GitHub
parent
1286d6583c
commit
216ec079c9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user