mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
fix(editor): Fix completions for .json
on quoted node name in Code node (#7382)
To reproduce, request completion with `$input.first().json.` from a node with a quote in the name, e.g. `When clicking "Execute Workflow"`. Context: https://linear.app/n8n/issue/PAY-635/autocomplete-only-supports-3-levels-of-children#comment-234f738b
This commit is contained in:
parent
fbcd1d40ed
commit
86e7ec796a
|
@ -275,7 +275,16 @@ export const jsonFieldCompletions = defineComponent({
|
|||
* `index` is only passed for `all()`.
|
||||
*/
|
||||
getJsonOutput(quotedNodeName: string, options?: { accessor?: string; index?: number }) {
|
||||
const nodeName = quotedNodeName.replace(/['"]/g, '');
|
||||
let nodeName = quotedNodeName;
|
||||
|
||||
const isSingleQuoteWrapped = quotedNodeName.startsWith("'") && quotedNodeName.endsWith("'");
|
||||
const isDoubleQuoteWrapped = quotedNodeName.startsWith('"') && quotedNodeName.endsWith('"');
|
||||
|
||||
if (isSingleQuoteWrapped) {
|
||||
nodeName = quotedNodeName.replace(/^'/, '').replace(/'$/, '');
|
||||
} else if (isDoubleQuoteWrapped) {
|
||||
nodeName = quotedNodeName.replace(/^"/, '').replace(/"$/, '');
|
||||
}
|
||||
|
||||
const pinData: IPinData | undefined = this.workflowsStore.getPinData;
|
||||
|
||||
|
|
Loading…
Reference in a new issue