fix(editor): Optimize workflow selector search performance by implementing pagination (#19252)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Danny Martini
2025-09-10 17:17:10 +02:00
committed by GitHub
parent d3ee6512a9
commit 8f60b52533
10 changed files with 791 additions and 148 deletions

View File

@@ -13,6 +13,8 @@ import { createEventBus } from '@n8n/utils/event-bus';
import { createMockEnterpriseSettings } from '@/__tests__/mocks';
import { useWorkflowsStore } from '@/stores/workflows.store';
import type { INodeParameterResourceLocator } from 'n8n-workflow';
import type { IWorkflowDb, WorkflowListResource } from '@/Interface';
import { mock } from 'vitest-mock-extended';
function getNdvStateMock(): Partial<ReturnType<typeof useNDVStore>> {
return {
@@ -379,19 +381,19 @@ describe('ParameterInput.vue', () => {
value: workflowId,
};
workflowsStore.allWorkflows = [
{
workflowsStore.fetchWorkflowsPage.mockResolvedValue([
mock<WorkflowListResource>({
id: workflowId,
name: 'Test',
active: false,
isArchived: false,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
nodes: [],
connections: {},
// nodes: [],
// connections: {},
versionId: faker.string.uuid(),
},
];
}),
]);
const { emitted, container, getByTestId, queryByTestId } = renderComponent({
props: {
@@ -432,19 +434,17 @@ describe('ParameterInput.vue', () => {
value: workflowId,
};
workflowsStore.allWorkflows = [
{
id: workflowId,
name: 'Test',
active: false,
isArchived: true,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
nodes: [],
connections: {},
versionId: faker.string.uuid(),
},
];
const workflowBase = {
id: workflowId,
name: 'Test',
active: false,
isArchived: true,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
versionId: faker.string.uuid(),
};
workflowsStore.allWorkflows = [mock<IWorkflowDb>(workflowBase)];
workflowsStore.fetchWorkflowsPage.mockResolvedValue([mock<WorkflowListResource>(workflowBase)]);
const { emitted, container, getByTestId } = renderComponent({
props: {