mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Fix adding of wrong actions when filtering in the node actions panel (no-changelog) (#5518)
This commit is contained in:
parent
75a094a8c0
commit
1c0966957d
|
@ -112,6 +112,20 @@ describe('Node Creator', () => {
|
||||||
NDVModal.getters.parameterInput('operation').should('contain.text', 'Crop');
|
NDVModal.getters.parameterInput('operation').should('contain.text', 'Crop');
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should search through actions and confirm added action', () => {
|
||||||
|
nodeCreatorFeature.actions.openNodeCreator();
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').clear().type('ftp');
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').realPress('{rightarrow}');
|
||||||
|
nodeCreatorFeature.getters.activeSubcategory().should('have.text', 'FTP');
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').clear().type('file');
|
||||||
|
// Navigate to rename action which should be the 4th item
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').realPress('{downarrow}');
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').realPress('{downarrow}');
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').realPress('{downarrow}');
|
||||||
|
nodeCreatorFeature.getters.searchBar().find('input').realPress('{rightarrow}');
|
||||||
|
NDVModal.getters.parameterInput('operation').should('contain.text', 'Rename');
|
||||||
|
})
|
||||||
|
|
||||||
it('should render and select community node', () => {
|
it('should render and select community node', () => {
|
||||||
cy.intercept('GET', '/types/nodes.json').as('nodesIntercept');
|
cy.intercept('GET', '/types/nodes.json').as('nodesIntercept');
|
||||||
cy.wait('@nodesIntercept').then(() => {
|
cy.wait('@nodesIntercept').then(() => {
|
||||||
|
|
|
@ -22,8 +22,13 @@
|
||||||
v-touch:start="touchStart"
|
v-touch:start="touchStart"
|
||||||
v-touch:end="touchEnd"
|
v-touch:end="touchEnd"
|
||||||
>
|
>
|
||||||
<i class="trigger-icon">
|
<i class="trigger-icon" v-if="isTriggerNode">
|
||||||
<font-awesome-icon icon="bolt" size="lg" v-if="isTriggerNode" />
|
<n8n-tooltip placement="bottom">
|
||||||
|
<template #content>
|
||||||
|
<span v-html="$locale.baseText('node.thisIsATriggerNode')" />
|
||||||
|
</template>
|
||||||
|
<font-awesome-icon icon="bolt" size="lg" />
|
||||||
|
</n8n-tooltip>
|
||||||
</i>
|
</i>
|
||||||
<div
|
<div
|
||||||
v-if="!data.disabled"
|
v-if="!data.disabled"
|
||||||
|
|
|
@ -223,7 +223,7 @@ const firstLevelItems = computed(() => (isRoot.value ? activeView.value.items :
|
||||||
|
|
||||||
const searchItems = computed<INodeCreateElement[]>(() => {
|
const searchItems = computed<INodeCreateElement[]>(() => {
|
||||||
return state.activeNodeActions
|
return state.activeNodeActions
|
||||||
? transformCreateElements(selectedNodeActions.value)
|
? transformCreateElements(selectedNodeActions.value, 'action')
|
||||||
: transformCreateElements(filteredMergedAppNodes.value);
|
: transformCreateElements(filteredMergedAppNodes.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -251,6 +251,7 @@ function sortActions(nodeCreateElements: INodeCreateElement[]): INodeCreateEleme
|
||||||
|
|
||||||
function transformCreateElements(
|
function transformCreateElements(
|
||||||
createElements: Array<INodeTypeDescription | INodeActionTypeDescription>,
|
createElements: Array<INodeTypeDescription | INodeActionTypeDescription>,
|
||||||
|
type: 'node' | 'action' = 'node',
|
||||||
): INodeCreateElement[] {
|
): INodeCreateElement[] {
|
||||||
const sorted = [...createElements];
|
const sorted = [...createElements];
|
||||||
|
|
||||||
|
@ -265,7 +266,7 @@ function transformCreateElements(
|
||||||
// if we have more cases like this we should add more robust logic
|
// if we have more cases like this we should add more robust logic
|
||||||
const isN8nNode = nodeType.name.includes(N8N_NODE_TYPE);
|
const isN8nNode = nodeType.name.includes(N8N_NODE_TYPE);
|
||||||
return {
|
return {
|
||||||
type: 'node',
|
type,
|
||||||
category: nodeType.codex?.categories,
|
category: nodeType.codex?.categories,
|
||||||
key: nodeType.name,
|
key: nodeType.name,
|
||||||
properties: {
|
properties: {
|
||||||
|
@ -274,7 +275,7 @@ function transformCreateElements(
|
||||||
},
|
},
|
||||||
includedByTrigger: isN8nNode || nodeType.group.includes('trigger'),
|
includedByTrigger: isN8nNode || nodeType.group.includes('trigger'),
|
||||||
includedByRegular: isN8nNode || !nodeType.group.includes('trigger'),
|
includedByRegular: isN8nNode || !nodeType.group.includes('trigger'),
|
||||||
};
|
} as INodeCreateElement;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -663,6 +663,7 @@
|
||||||
"ndv.pinData.error.tooLarge.description": "You can pin at most 12MB of output per workflow.",
|
"ndv.pinData.error.tooLarge.description": "You can pin at most 12MB of output per workflow.",
|
||||||
"noTagsView.readyToOrganizeYourWorkflows": "Ready to organize your workflows?",
|
"noTagsView.readyToOrganizeYourWorkflows": "Ready to organize your workflows?",
|
||||||
"noTagsView.withWorkflowTagsYouReFree": "With workflow tags, you're free to create the perfect tagging system for your flows",
|
"noTagsView.withWorkflowTagsYouReFree": "With workflow tags, you're free to create the perfect tagging system for your flows",
|
||||||
|
"node.thisIsATriggerNode": "This is a Trigger node. <a target=\"_blank\" href=\"https://docs.n8n.io/workflows/components/nodes/\">Learn more</a>",
|
||||||
"node.activateDeactivateNode": "Activate/Deactivate Node",
|
"node.activateDeactivateNode": "Activate/Deactivate Node",
|
||||||
"node.deleteNode": "Delete Node",
|
"node.deleteNode": "Delete Node",
|
||||||
"node.disabled": "Disabled",
|
"node.disabled": "Disabled",
|
||||||
|
|
Loading…
Reference in a new issue