mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(editor): Use resource locator at Simple Vector Store memory key, allow cross workflow use (#15421)
Remove workflow isolation from in-memory Simple Vector Store, making it possible to use vector stores created on other workflows. Display all current in-memory vector stores with a resource locator at Memory Key picker. Note that these vector stores are still intended for non-production development use. Any users of an instance can access data in all in-memory vector stores as they aren't bound to workflows.
This commit is contained in:
@@ -208,6 +208,21 @@ export function typeIntoFixedCollectionItem(collectionName: string, index: numbe
|
||||
);
|
||||
}
|
||||
|
||||
export function selectResourceLocatorAddResourceItem(
|
||||
resourceLocator: string,
|
||||
expectedText: string,
|
||||
) {
|
||||
clickResourceLocatorInput(resourceLocator);
|
||||
|
||||
// getVisiblePopper().findChildByTestId('rlc-item-add-resource').eq(0).should('exist');
|
||||
getVisiblePopper()
|
||||
.findChildByTestId('rlc-item-add-resource')
|
||||
.eq(0)
|
||||
.find('span')
|
||||
.should('contain.text', expectedText)
|
||||
.click();
|
||||
}
|
||||
|
||||
export function selectResourceLocatorItem(
|
||||
resourceLocator: string,
|
||||
index: number,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { setCredentialValues } from '../composables/modals/credential-modal';
|
||||
import {
|
||||
clickCreateNewCredential,
|
||||
getNdvContainer,
|
||||
selectResourceLocatorItem,
|
||||
selectResourceLocatorAddResourceItem,
|
||||
} from '../composables/ndv';
|
||||
import * as projects from '../composables/projects';
|
||||
import {
|
||||
@@ -299,9 +299,11 @@ describe('Projects', { disableAutoLogin: true }, () => {
|
||||
workflowPage.actions.saveWorkflowOnButtonClick();
|
||||
workflowPage.actions.addNodeToCanvas('Execute Workflow', true, true);
|
||||
|
||||
// This mock fails when running with `test:e2e:dev` but works with `test:e2e:ui`,
|
||||
// at least on macOS at version 1.94.0. ¯\_(ツ)_/¯
|
||||
cy.window().then((win) => cy.stub(win, 'open').callsFake((url) => cy.visit(url)));
|
||||
|
||||
selectResourceLocatorItem('workflowId', 0, 'Create a');
|
||||
selectResourceLocatorAddResourceItem('workflowId', 'Create a');
|
||||
// Need to wait for the trigger node to auto-open after a delay
|
||||
getNdvContainer().should('be.visible');
|
||||
cy.get('body').type('{esc}');
|
||||
|
||||
@@ -27,7 +27,9 @@ describe('Workflow Selector Parameter', () => {
|
||||
getVisiblePopper()
|
||||
.should('have.length', 1)
|
||||
.findChildByTestId('rlc-item')
|
||||
.should('have.length', 3);
|
||||
.should('have.length', 2);
|
||||
|
||||
getVisiblePopper().findChildByTestId('rlc-item-add-resource').should('have.length', 1);
|
||||
});
|
||||
|
||||
it('should show required parameter warning', () => {
|
||||
@@ -44,8 +46,8 @@ describe('Workflow Selector Parameter', () => {
|
||||
getVisiblePopper()
|
||||
.should('have.length', 1)
|
||||
.findChildByTestId('rlc-item')
|
||||
.should('have.length', 2)
|
||||
.eq(1)
|
||||
.should('have.length', 1)
|
||||
.eq(0)
|
||||
.click();
|
||||
|
||||
ndv.getters
|
||||
@@ -91,14 +93,14 @@ describe('Workflow Selector Parameter', () => {
|
||||
ndv.getters.resourceLocator('workflowId').should('be.visible');
|
||||
ndv.getters.resourceLocatorInput('workflowId').click();
|
||||
|
||||
getVisiblePopper().findChildByTestId('rlc-item').eq(0).should('exist');
|
||||
getVisiblePopper().findChildByTestId('rlc-item-add-resource').eq(0).should('exist');
|
||||
getVisiblePopper()
|
||||
.findChildByTestId('rlc-item')
|
||||
.findChildByTestId('rlc-item-add-resource')
|
||||
.eq(0)
|
||||
.find('span')
|
||||
.should('contain.text', 'Create a'); // Due to some inconsistency we're sometimes in a project and sometimes not, this covers both cases
|
||||
|
||||
getVisiblePopper().findChildByTestId('rlc-item').eq(0).click();
|
||||
getVisiblePopper().findChildByTestId('rlc-item-add-resource').eq(0).click();
|
||||
|
||||
cy.wait('@createSubworkflow').then((interception) => {
|
||||
expect(interception.request.body).to.have.property('name').that.includes('Sub-Workflow');
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
getParameterInputByName,
|
||||
populateFixedCollection,
|
||||
selectResourceLocatorItem,
|
||||
selectResourceLocatorAddResourceItem,
|
||||
typeIntoFixedCollectionItem,
|
||||
clickWorkflowCardContent,
|
||||
assertOutputTableContent,
|
||||
@@ -63,7 +64,7 @@ describe('Sub-workflow creation and typed usage', () => {
|
||||
openedUrl = url;
|
||||
});
|
||||
});
|
||||
selectResourceLocatorItem('workflowId', 0, 'Create a');
|
||||
selectResourceLocatorAddResourceItem('workflowId', 'Create a');
|
||||
cy.then(() => cy.visit(openedUrl));
|
||||
// **************************
|
||||
// NAVIGATE TO CHILD WORKFLOW
|
||||
@@ -142,7 +143,7 @@ describe('Sub-workflow creation and typed usage', () => {
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, 'open').callsFake((url) => {
|
||||
cy.visit(url);
|
||||
selectResourceLocatorItem('workflowId', 0, 'Create a');
|
||||
selectResourceLocatorAddResourceItem('workflowId', 'Create a');
|
||||
|
||||
openNode('When Executed by Another Workflow');
|
||||
|
||||
@@ -218,7 +219,7 @@ function validateAndReturnToParent(targetChild: string, offset: number, fields:
|
||||
|
||||
// Note that outside of e2e tests this will be pre-selected correctly.
|
||||
// Due to our workaround to remain in the same tab we need to select the correct tab manually
|
||||
selectResourceLocatorItem('workflowId', offset, targetChild);
|
||||
selectResourceLocatorItem('workflowId', offset - 1, targetChild);
|
||||
|
||||
clickExecuteNode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user