mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(editor): Escape node names with quotes in autocomplete and drag'n'drop (#8663)
This commit is contained in:
@@ -50,6 +50,7 @@ import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
import { escapeMappingString } from '@/utils/mappingUtils';
|
||||
|
||||
// Node types that should not be displayed in variable selector
|
||||
const SKIPPED_NODE_TYPES = [STICKY_NODE_TYPE];
|
||||
@@ -398,7 +399,9 @@ export default defineComponent({
|
||||
|
||||
// Get json data
|
||||
if (outputData.hasOwnProperty('json')) {
|
||||
const jsonPropertyPrefix = useShort ? '$json' : `$('${nodeName}').item.json`;
|
||||
const jsonPropertyPrefix = useShort
|
||||
? '$json'
|
||||
: `$('${escapeMappingString(nodeName)}').item.json`;
|
||||
|
||||
const jsonDataOptions: IVariableSelectorOption[] = [];
|
||||
for (const propertyName of Object.keys(outputData.json)) {
|
||||
@@ -423,7 +426,9 @@ export default defineComponent({
|
||||
|
||||
// Get binary data
|
||||
if (outputData.hasOwnProperty('binary')) {
|
||||
const binaryPropertyPrefix = useShort ? '$binary' : `$('${nodeName}').item.binary`;
|
||||
const binaryPropertyPrefix = useShort
|
||||
? '$binary'
|
||||
: `$('${escapeMappingString(nodeName)}').item.binary`;
|
||||
|
||||
const binaryData = [];
|
||||
let binaryPropertyData = [];
|
||||
@@ -537,7 +542,7 @@ export default defineComponent({
|
||||
|
||||
returnData.push({
|
||||
name: key,
|
||||
key: `$('${nodeName}').context["${key}"]`,
|
||||
key: `$('${escapeMappingString(nodeName)}').context['${escapeMappingString(key)}']`,
|
||||
// @ts-ignore
|
||||
value: nodeContext[key],
|
||||
});
|
||||
@@ -793,7 +798,12 @@ export default defineComponent({
|
||||
{
|
||||
name: this.$locale.baseText('variableSelector.parameters'),
|
||||
options: this.sortOptions(
|
||||
this.getNodeParameters(nodeName, `$('${nodeName}').params`, undefined, filterText),
|
||||
this.getNodeParameters(
|
||||
nodeName,
|
||||
`$('${escapeMappingString(nodeName)}').params`,
|
||||
undefined,
|
||||
filterText,
|
||||
),
|
||||
),
|
||||
} as IVariableSelectorOption,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user