mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
chore(editor): Drop rag starter callout experiment flag (no-changelog) (#18039)
This commit is contained in:
@@ -535,6 +535,10 @@ describe('Node Creator', () => {
|
|||||||
|
|
||||||
// Loop over all vector stores and check if they have the three actions
|
// Loop over all vector stores and check if they have the three actions
|
||||||
vectorStores.each((_i, vectorStore) => {
|
vectorStores.each((_i, vectorStore) => {
|
||||||
|
if (vectorStore.includes('RAG starter template')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nodeCreatorFeature.getters.getCreatorItem(vectorStore).click();
|
nodeCreatorFeature.getters.getCreatorItem(vectorStore).click();
|
||||||
actions.forEach((action) => {
|
actions.forEach((action) => {
|
||||||
nodeCreatorFeature.getters.getCreatorItem(action).should('be.visible').realHover();
|
nodeCreatorFeature.getters.getCreatorItem(action).should('be.visible').realHover();
|
||||||
|
|||||||
@@ -1,22 +1,10 @@
|
|||||||
import { overrideFeatureFlag } from '../composables/featureFlags';
|
|
||||||
import { openNodeCreator, searchBar } from '../composables/nodeCreator';
|
import { openNodeCreator, searchBar } from '../composables/nodeCreator';
|
||||||
import { addNodeToCanvas, navigateToNewWorkflowPage } from '../composables/workflow';
|
import { addNodeToCanvas, navigateToNewWorkflowPage } from '../composables/workflow';
|
||||||
|
|
||||||
describe('RAG callout experiment', () => {
|
describe('RAG callout experiment', () => {
|
||||||
describe('NDV callout', () => {
|
describe('NDV callout', () => {
|
||||||
it('should not show callout if experiment is control', () => {
|
it('should show callout and open template on click', () => {
|
||||||
overrideFeatureFlag('033_rag_template', 'control');
|
|
||||||
|
|
||||||
navigateToNewWorkflowPage();
|
|
||||||
|
|
||||||
addNodeToCanvas('Zep Vector Store', true, true, 'Add documents to vector store');
|
|
||||||
|
|
||||||
cy.contains('Tip: Get a feel for vector stores in n8n with our').should('not.exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should callout is variant and open on click', () => {
|
|
||||||
cy.intercept('workflows/templates/rag-starter-template?fromJson=true');
|
cy.intercept('workflows/templates/rag-starter-template?fromJson=true');
|
||||||
overrideFeatureFlag('033_rag_template', 'variant');
|
|
||||||
|
|
||||||
navigateToNewWorkflowPage();
|
navigateToNewWorkflowPage();
|
||||||
|
|
||||||
@@ -37,20 +25,8 @@ describe('RAG callout experiment', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('search callout', () => {
|
describe('search callout', () => {
|
||||||
it('should not show callout if experiment is control', () => {
|
it('should show callout and open template on click', () => {
|
||||||
overrideFeatureFlag('033_rag_template', 'control');
|
|
||||||
|
|
||||||
navigateToNewWorkflowPage();
|
|
||||||
|
|
||||||
openNodeCreator();
|
|
||||||
searchBar().type('rag');
|
|
||||||
|
|
||||||
cy.contains('RAG starter template').should('not.exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should should callout is variant and open on click', () => {
|
|
||||||
cy.intercept('workflows/templates/rag-starter-template?fromJson=true');
|
cy.intercept('workflows/templates/rag-starter-template?fromJson=true');
|
||||||
overrideFeatureFlag('033_rag_template', 'variant');
|
|
||||||
|
|
||||||
navigateToNewWorkflowPage();
|
navigateToNewWorkflowPage();
|
||||||
|
|
||||||
|
|||||||
@@ -415,13 +415,13 @@ function isCalloutVisible(parameter: INodeProperties): boolean {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onCalloutAction(action: CalloutActionType) {
|
function onCalloutAction(action: CalloutActionType) {
|
||||||
if (action === 'openRagStarterTemplate') {
|
if (action === 'openRagStarterTemplate') {
|
||||||
await openRagStarterTemplate(activeNode.value?.type ?? 'no active node');
|
openRagStarterTemplate(activeNode.value?.type ?? 'no active node');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onCalloutDismiss = async (parameter: INodeProperties) => {
|
async function onCalloutDismiss(parameter: INodeProperties) {
|
||||||
const dismissConfirmed = await message.confirm(
|
const dismissConfirmed = await message.confirm(
|
||||||
i18n.baseText('parameterInputList.callout.dismiss.confirm.text'),
|
i18n.baseText('parameterInputList.callout.dismiss.confirm.text'),
|
||||||
{
|
{
|
||||||
@@ -440,7 +440,7 @@ const onCalloutDismiss = async (parameter: INodeProperties) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await dismissCallout(parameter.name);
|
await dismissCallout(parameter.name);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -63,14 +63,14 @@ describe('useCalloutHelpers()', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('openRagStarterTemplate()', () => {
|
describe('openRagStarterTemplate()', () => {
|
||||||
it('opens the RAG starter template successfully', async () => {
|
it('opens the RAG starter template successfully', () => {
|
||||||
vi.spyOn(window, 'open').mockImplementation(() => null);
|
vi.spyOn(window, 'open').mockImplementation(() => null);
|
||||||
mocks.resolve.mockReturnValue({ href: 'n8n.io' });
|
mocks.resolve.mockReturnValue({ href: 'n8n.io' });
|
||||||
|
|
||||||
const { openRagStarterTemplate } = useCalloutHelpers();
|
const { openRagStarterTemplate } = useCalloutHelpers();
|
||||||
const nodeType = 'testNode';
|
const nodeType = 'testNode';
|
||||||
|
|
||||||
await openRagStarterTemplate('testNode');
|
openRagStarterTemplate('testNode');
|
||||||
|
|
||||||
expect(window.open).toHaveBeenCalledWith('n8n.io', '_blank');
|
expect(window.open).toHaveBeenCalledWith('n8n.io', '_blank');
|
||||||
expect(mocks.track).toHaveBeenCalledWith('User clicked on RAG callout', {
|
expect(mocks.track).toHaveBeenCalledWith('User clicked on RAG callout', {
|
||||||
@@ -79,34 +79,15 @@ describe('useCalloutHelpers()', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isRagStarterWorkflowExperimentEnabled', () => {
|
|
||||||
it('should be false if the RAG starter workflow experiment is not enabled', () => {
|
|
||||||
const { isRagStarterWorkflowExperimentEnabled } = useCalloutHelpers();
|
|
||||||
expect(isRagStarterWorkflowExperimentEnabled.value).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be true if the RAG starter workflow experiment is enabled', () => {
|
|
||||||
mocks.getVariant.mockReturnValueOnce('variant');
|
|
||||||
|
|
||||||
const { isRagStarterWorkflowExperimentEnabled } = useCalloutHelpers();
|
|
||||||
expect(isRagStarterWorkflowExperimentEnabled.value).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isRagStarterCalloutVisible', () => {
|
describe('isRagStarterCalloutVisible', () => {
|
||||||
it('should be false if the feature flag is disabled', () => {
|
it('should be true if current route is not on the RAG starter template', () => {
|
||||||
const { isRagStarterCalloutVisible } = useCalloutHelpers();
|
|
||||||
expect(isRagStarterCalloutVisible.value).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be true if the feature flag is enabled and not on the RAG starter template', () => {
|
|
||||||
mocks.getVariant.mockReturnValueOnce('variant');
|
mocks.getVariant.mockReturnValueOnce('variant');
|
||||||
|
|
||||||
const { isRagStarterCalloutVisible } = useCalloutHelpers();
|
const { isRagStarterCalloutVisible } = useCalloutHelpers();
|
||||||
expect(isRagStarterCalloutVisible.value).toBe(true);
|
expect(isRagStarterCalloutVisible.value).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be false if the feature flag is enabled and currently on unsaved RAG starter template', () => {
|
it('should be false and current route is not on unsaved RAG starter template', () => {
|
||||||
mocks.getVariant.mockReturnValueOnce('variant');
|
mocks.getVariant.mockReturnValueOnce('variant');
|
||||||
mocks.useRoute.mockReturnValueOnce({
|
mocks.useRoute.mockReturnValueOnce({
|
||||||
query: { templateId: 'rag-starter-template' },
|
query: { templateId: 'rag-starter-template' },
|
||||||
@@ -117,7 +98,7 @@ describe('useCalloutHelpers()', () => {
|
|||||||
expect(isRagStarterCalloutVisible.value).toBe(false);
|
expect(isRagStarterCalloutVisible.value).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be false if the feature flag is enabled and currently on saved RAG starter template', () => {
|
it('should be false if current route is on saved RAG starter template', () => {
|
||||||
mocks.getVariant.mockReturnValueOnce('variant');
|
mocks.getVariant.mockReturnValueOnce('variant');
|
||||||
mocks.getWorkflowById.mockReturnValueOnce({
|
mocks.getWorkflowById.mockReturnValueOnce({
|
||||||
meta: { templateId: 'rag-starter-template' },
|
meta: { templateId: 'rag-starter-template' },
|
||||||
@@ -129,13 +110,13 @@ describe('useCalloutHelpers()', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('isCalloutDismissed()', () => {
|
describe('isCalloutDismissed()', () => {
|
||||||
it('should return false if callout is not dismissed', async () => {
|
it('should return false if callout is not dismissed', () => {
|
||||||
const { isCalloutDismissed } = useCalloutHelpers();
|
const { isCalloutDismissed } = useCalloutHelpers();
|
||||||
const result = isCalloutDismissed('testNode');
|
const result = isCalloutDismissed('testNode');
|
||||||
expect(result).toBe(false);
|
expect(result).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true if callout is dismissed', async () => {
|
it('should return true if callout is dismissed', () => {
|
||||||
mocks.isCalloutDismissed.mockReturnValueOnce(true);
|
mocks.isCalloutDismissed.mockReturnValueOnce(true);
|
||||||
|
|
||||||
const { isCalloutDismissed } = useCalloutHelpers();
|
const { isCalloutDismissed } = useCalloutHelpers();
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ import { computed } from 'vue';
|
|||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useTelemetry } from '@/composables/useTelemetry';
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||||
import { usePostHog } from '@/stores/posthog.store';
|
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { RAG_STARTER_WORKFLOW_EXPERIMENT, VIEWS } from '@/constants';
|
import { VIEWS } from '@/constants';
|
||||||
import { getRagStarterWorkflowJson } from '@/utils/easyAiWorkflowUtils';
|
import { getRagStarterWorkflowJson } from '@/utils/easyAiWorkflowUtils';
|
||||||
import { updateCurrentUserSettings } from '@/api/users';
|
import { updateCurrentUserSettings } from '@/api/users';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||||
@@ -13,12 +12,11 @@ export function useCalloutHelpers() {
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const telemetry = useTelemetry();
|
const telemetry = useTelemetry();
|
||||||
const posthogStore = usePostHog();
|
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
const workflowsStore = useWorkflowsStore();
|
const workflowsStore = useWorkflowsStore();
|
||||||
const usersStore = useUsersStore();
|
const usersStore = useUsersStore();
|
||||||
|
|
||||||
const openRagStarterTemplate = async (nodeType?: string) => {
|
const openRagStarterTemplate = (nodeType?: string) => {
|
||||||
telemetry.track('User clicked on RAG callout', {
|
telemetry.track('User clicked on RAG callout', {
|
||||||
node_type: nodeType ?? null,
|
node_type: nodeType ?? null,
|
||||||
});
|
});
|
||||||
@@ -34,13 +32,6 @@ export function useCalloutHelpers() {
|
|||||||
window.open(href, '_blank');
|
window.open(href, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
const isRagStarterWorkflowExperimentEnabled = computed(() => {
|
|
||||||
return (
|
|
||||||
posthogStore.getVariant(RAG_STARTER_WORKFLOW_EXPERIMENT.name) ===
|
|
||||||
RAG_STARTER_WORKFLOW_EXPERIMENT.variant
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const isRagStarterCalloutVisible = computed(() => {
|
const isRagStarterCalloutVisible = computed(() => {
|
||||||
const template = getRagStarterWorkflowJson();
|
const template = getRagStarterWorkflowJson();
|
||||||
|
|
||||||
@@ -53,7 +44,7 @@ export function useCalloutHelpers() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isRagStarterWorkflowExperimentEnabled.value;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const isCalloutDismissed = (callout: string) => {
|
const isCalloutDismissed = (callout: string) => {
|
||||||
@@ -73,7 +64,6 @@ export function useCalloutHelpers() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
openRagStarterTemplate,
|
openRagStarterTemplate,
|
||||||
isRagStarterWorkflowExperimentEnabled,
|
|
||||||
isRagStarterCalloutVisible,
|
isRagStarterCalloutVisible,
|
||||||
isCalloutDismissed,
|
isCalloutDismissed,
|
||||||
dismissCallout,
|
dismissCallout,
|
||||||
|
|||||||
@@ -755,12 +755,6 @@ export const WORKFLOW_BUILDER_EXPERIMENT = {
|
|||||||
variant: 'variant',
|
variant: 'variant',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RAG_STARTER_WORKFLOW_EXPERIMENT = {
|
|
||||||
name: '033_rag_template',
|
|
||||||
control: 'control',
|
|
||||||
variant: 'variant',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const EXTRA_TEMPLATE_LINKS_EXPERIMENT = {
|
export const EXTRA_TEMPLATE_LINKS_EXPERIMENT = {
|
||||||
name: '034_extra_template_links',
|
name: '034_extra_template_links',
|
||||||
control: 'control',
|
control: 'control',
|
||||||
@@ -783,7 +777,6 @@ export const BATCH_11AUG_EXPERIMENT = {
|
|||||||
|
|
||||||
export const EXPERIMENTS_TO_TRACK = [
|
export const EXPERIMENTS_TO_TRACK = [
|
||||||
WORKFLOW_BUILDER_EXPERIMENT.name,
|
WORKFLOW_BUILDER_EXPERIMENT.name,
|
||||||
RAG_STARTER_WORKFLOW_EXPERIMENT.name,
|
|
||||||
EXTRA_TEMPLATE_LINKS_EXPERIMENT.name,
|
EXTRA_TEMPLATE_LINKS_EXPERIMENT.name,
|
||||||
TEMPLATE_ONBOARDING_EXPERIMENT.name,
|
TEMPLATE_ONBOARDING_EXPERIMENT.name,
|
||||||
NDV_UI_OVERHAUL_EXPERIMENT.name,
|
NDV_UI_OVERHAUL_EXPERIMENT.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user