mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(editor): Cleanup demo/video experiment (#5974)
This commit is contained in:
parent
1bb987140a
commit
c171365d2a
|
@ -536,19 +536,12 @@ export const KEEP_AUTH_IN_NDV_FOR_NODES = [HTTP_REQUEST_NODE_TYPE, WEBHOOK_NODE_
|
|||
export const MAIN_AUTH_FIELD_NAME = 'authentication';
|
||||
export const NODE_RESOURCE_FIELD_NAME = 'resource';
|
||||
|
||||
export const ASSUMPTION_EXPERIMENT = {
|
||||
name: 'adore-assumption-tests-1',
|
||||
control: 'control',
|
||||
demo: 'assumption-demo',
|
||||
video: 'assumption-video',
|
||||
};
|
||||
|
||||
export const ONBOARDING_EXPERIMENT = {
|
||||
name: 'checklist_001',
|
||||
control: 'control',
|
||||
variant: 'variant',
|
||||
};
|
||||
|
||||
export const EXPERIMENTS_TO_TRACK = [ASSUMPTION_EXPERIMENT.name, ONBOARDING_EXPERIMENT.name];
|
||||
export const EXPERIMENTS_TO_TRACK = [ONBOARDING_EXPERIMENT.name];
|
||||
|
||||
export const NODE_TYPES_EXCLUDED_FROM_OUTPUT_NAME_APPEND = [FILTER_NODE_TYPE];
|
||||
|
|
|
@ -62,17 +62,6 @@ export const DEFAULT_PLACEHOLDER_TRIGGER_BUTTON = {
|
|||
},
|
||||
};
|
||||
|
||||
export const WELCOME_STICKY_NODE = {
|
||||
name: QUICKSTART_NOTE_NAME,
|
||||
type: STICKY_NODE_TYPE,
|
||||
typeVersion: 1,
|
||||
position: [0, 0] as XYPosition,
|
||||
parameters: {
|
||||
height: 320,
|
||||
width: 380,
|
||||
},
|
||||
};
|
||||
|
||||
export const CONNECTOR_FLOWCHART_TYPE: ConnectorSpec = {
|
||||
type: N8nConnector.type,
|
||||
options: {
|
||||
|
|
|
@ -2533,35 +2533,7 @@ export default mixins(
|
|||
},
|
||||
async tryToAddWelcomeSticky(): Promise<void> {
|
||||
const newWorkflow = this.workflowData;
|
||||
if (usePostHog().isVariantEnabled(ASSUMPTION_EXPERIMENT.name, ASSUMPTION_EXPERIMENT.video)) {
|
||||
// For novice users (onboardingFlowEnabled == true)
|
||||
// Inject welcome sticky note and zoom to fit
|
||||
|
||||
if (newWorkflow?.onboardingFlowEnabled && !this.isReadOnly) {
|
||||
// Position the welcome sticky left to the added trigger node
|
||||
const position: XYPosition = [50, 250];
|
||||
|
||||
await this.addNodes([
|
||||
{
|
||||
id: uuid(),
|
||||
...NodeViewUtils.WELCOME_STICKY_NODE,
|
||||
parameters: {
|
||||
// Use parameters from the template but add translated content
|
||||
...NodeViewUtils.WELCOME_STICKY_NODE.parameters,
|
||||
content: this.$locale.baseText('onboardingWorkflow.stickyContent'),
|
||||
},
|
||||
position,
|
||||
},
|
||||
]);
|
||||
setTimeout(() => {
|
||||
this.canvasStore.zoomToFit();
|
||||
this.canvasStore.canvasAddButtonPosition = [500, 350];
|
||||
this.$telemetry.track('welcome note inserted');
|
||||
}, 0);
|
||||
}
|
||||
} else {
|
||||
this.canvasStore.zoomToFit();
|
||||
}
|
||||
this.canvasStore.zoomToFit();
|
||||
},
|
||||
async initView(): Promise<void> {
|
||||
if (this.$route.params.action === 'workflowSave') {
|
||||
|
|
|
@ -101,9 +101,6 @@ export default mixins(showMessage, restApi).extend({
|
|||
},
|
||||
computed: {
|
||||
...mapStores(useCredentialsStore, useSettingsStore, useUIStore, useUsersStore),
|
||||
isDemoTest(): boolean {
|
||||
return usePostHog().isVariantEnabled(ASSUMPTION_EXPERIMENT.name, ASSUMPTION_EXPERIMENT.demo);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async confirmSetupOrGoBack(): Promise<boolean> {
|
||||
|
@ -163,7 +160,7 @@ export default mixins(showMessage, restApi).extend({
|
|||
}
|
||||
|
||||
if (forceRedirectedHere) {
|
||||
await this.$router.push({ name: this.isDemoTest ? VIEWS.HOMEPAGE : VIEWS.NEW_WORKFLOW });
|
||||
await this.$router.push({ name: VIEWS.NEW_WORKFLOW });
|
||||
} else {
|
||||
await this.$router.push({ name: VIEWS.USERS_SETTINGS });
|
||||
}
|
||||
|
@ -187,7 +184,7 @@ export default mixins(showMessage, restApi).extend({
|
|||
onSkip() {
|
||||
this.usersStore.skipOwnerSetup();
|
||||
this.$router.push({
|
||||
name: this.isDemoTest ? VIEWS.HOMEPAGE : VIEWS.NEW_WORKFLOW,
|
||||
name: VIEWS.NEW_WORKFLOW,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
@click:add="addWorkflow"
|
||||
@update:filters="filters = $event"
|
||||
>
|
||||
<template #callout v-if="!hasActiveWorkflows && isDemoTest">
|
||||
<template #callout v-if="!hasActiveWorkflows">
|
||||
<n8n-callout theme="secondary" icon="graduation-cap" class="mb-xs">
|
||||
{{ $locale.baseText('workflows.viewDemoNotice') }}
|
||||
|
||||
|
@ -60,7 +60,6 @@
|
|||
</n8n-text>
|
||||
</n8n-card>
|
||||
<n8n-card
|
||||
v-if="isDemoTest"
|
||||
:class="$style.emptyStateCard"
|
||||
hoverable
|
||||
@click="goToTemplates"
|
||||
|
@ -184,9 +183,6 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
|
|||
hasActiveWorkflows(): boolean {
|
||||
return !!this.workflowsStore.activeWorkflows.length;
|
||||
},
|
||||
isDemoTest(): boolean {
|
||||
return usePostHog().isVariantEnabled(ASSUMPTION_EXPERIMENT.name, ASSUMPTION_EXPERIMENT.demo);
|
||||
},
|
||||
statusFilterOptions(): Array<{ label: string; value: string | boolean }> {
|
||||
return [
|
||||
{
|
||||
|
@ -214,14 +210,7 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
|
|||
});
|
||||
},
|
||||
goToTemplates() {
|
||||
if (this.isDemoTest) {
|
||||
this.$router.push({ name: VIEWS.COLLECTION, params: { id: '7' } });
|
||||
this.$telemetry.track('User clicked on inspect demo workflow', {
|
||||
location: this.allWorkflows.length ? 'workflows' : 'start_page',
|
||||
});
|
||||
} else {
|
||||
this.$router.push({ name: VIEWS.TEMPLATES });
|
||||
}
|
||||
this.$router.push({ name: VIEWS.TEMPLATES });
|
||||
},
|
||||
async initialize() {
|
||||
await Promise.all([
|
||||
|
|
Loading…
Reference in a new issue