mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Add workflows to the store when fetching current page (#13583)
This commit is contained in:
parent
727f6f3c0e
commit
c4f3293778
|
@ -1,9 +1,11 @@
|
||||||
|
import { WorkflowSharingModal } from '../pages';
|
||||||
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
||||||
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows';
|
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows';
|
||||||
import { getUniqueWorkflowName } from '../utils/workflowUtils';
|
import { getUniqueWorkflowName } from '../utils/workflowUtils';
|
||||||
|
|
||||||
const WorkflowsPage = new WorkflowsPageClass();
|
const WorkflowsPage = new WorkflowsPageClass();
|
||||||
const WorkflowPage = new WorkflowPageClass();
|
const WorkflowPage = new WorkflowPageClass();
|
||||||
|
const workflowSharingModal = new WorkflowSharingModal();
|
||||||
|
|
||||||
const multipleWorkflowsCount = 5;
|
const multipleWorkflowsCount = 5;
|
||||||
|
|
||||||
|
@ -138,4 +140,10 @@ describe('Workflows', () => {
|
||||||
cy.url().should('include', 'sort=lastCreated');
|
cy.url().should('include', 'sort=lastCreated');
|
||||||
cy.url().should('include', 'pageSize=25');
|
cy.url().should('include', 'pageSize=25');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should be able to share workflows from workflows list', () => {
|
||||||
|
WorkflowsPage.getters.workflowCardActions('Empty State Card Workflow').click();
|
||||||
|
WorkflowsPage.getters.workflowActionItem('share').click();
|
||||||
|
workflowSharingModal.getters.modal().should('be.visible');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -35,6 +35,7 @@ export class WorkflowsPage extends BasePage {
|
||||||
this.getters.workflowActivator(workflowName).findChildByTestId('workflow-activator-status'),
|
this.getters.workflowActivator(workflowName).findChildByTestId('workflow-activator-status'),
|
||||||
workflowCardActions: (workflowName: string) =>
|
workflowCardActions: (workflowName: string) =>
|
||||||
this.getters.workflowCard(workflowName).findChildByTestId('workflow-card-actions'),
|
this.getters.workflowCard(workflowName).findChildByTestId('workflow-card-actions'),
|
||||||
|
workflowActionItem: (action: string) => cy.getByTestId(`action-${action}`).filter(':visible'),
|
||||||
workflowDeleteButton: () =>
|
workflowDeleteButton: () =>
|
||||||
cy.getByTestId('action-toggle-dropdown').filter(':visible').contains('Delete'),
|
cy.getByTestId('action-toggle-dropdown').filter(':visible').contains('Delete'),
|
||||||
workflowMoveButton: () =>
|
workflowMoveButton: () =>
|
||||||
|
|
|
@ -517,6 +517,19 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
totalWorkflowCount.value = count;
|
totalWorkflowCount.value = count;
|
||||||
|
// Also set fetched workflows to store
|
||||||
|
// When fetching workflows from overview page, they don't have resource property
|
||||||
|
// so in order to filter out folders, we need to check if resource is not folder
|
||||||
|
data
|
||||||
|
.filter((item) => item.resource !== 'folder')
|
||||||
|
.forEach((item) => {
|
||||||
|
addWorkflow({
|
||||||
|
...item,
|
||||||
|
nodes: [],
|
||||||
|
connections: {},
|
||||||
|
versionId: '',
|
||||||
|
});
|
||||||
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue