feat: Add events to enable onboarding checklist (#5536)

* feat: Add new event hooks

* fix: update event

* feat: Add more functionality for webhooks

*  Not sending onboarding checklist event from templates page

* 🔥 Removing quotes added by mistake

*  Added rest of events needed for onboarding checklist

* 💄 Hiding appcues checklist inside iframes

* 💄 Updating appcues selector

* fix: remove unnessary fix

* fix: fix schedule node

* refactor: bake events into segment store

* refactor: rename store

* refactor: use node keys

* refactor: remove unnessary

* chore: clean up store

* refactor: add key for event

* fix: allow tracking on template pages

* chore: remove comment

* fix: buidl

* refactor: block event if in iframe

* fix: fix tracking nodes

* refactor: track experiments once

* fix: ensure tracking works

* chore: remove comment

* fix: lint

* fix: lint

---------

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
This commit is contained in:
Mutasem Aldmour
2023-02-28 13:44:37 +03:00
committed by GitHub
parent ae634407a4
commit 20c4919513
9 changed files with 192 additions and 54 deletions

View File

@@ -34,7 +34,7 @@ import { getPersonalizedNodeTypes, isAuthorized, PERMISSIONS, ROLE } from '@/uti
import { defineStore } from 'pinia';
import Vue from 'vue';
import { useRootStore } from './n8nRootStore';
import { usePostHogStore } from './posthog';
import { usePostHog } from './posthog';
import { useSettingsStore } from './settings';
import { useUIStore } from './ui';
@@ -149,7 +149,7 @@ export const useUsersStore = defineStore(STORES.USERS, {
this.addUsers([user]);
this.currentUserId = user.id;
usePostHogStore().init(user.featureFlags);
usePostHog().init(user.featureFlags);
},
async loginWithCreds(params: { email: string; password: string }): Promise<void> {
const rootStore = useRootStore();
@@ -161,13 +161,13 @@ export const useUsersStore = defineStore(STORES.USERS, {
this.addUsers([user]);
this.currentUserId = user.id;
usePostHogStore().init(user.featureFlags);
usePostHog().init(user.featureFlags);
},
async logout(): Promise<void> {
const rootStore = useRootStore();
await logout(rootStore.getRestApiContext);
this.currentUserId = null;
usePostHogStore().reset();
usePostHog().reset();
},
async preOwnerSetup() {
return preOwnerSetup(useRootStore().getRestApiContext);
@@ -208,7 +208,7 @@ export const useUsersStore = defineStore(STORES.USERS, {
this.currentUserId = user.id;
}
usePostHogStore().init(user.featureFlags);
usePostHog().init(user.featureFlags);
},
async sendForgotPasswordEmail(params: { email: string }): Promise<void> {
const rootStore = useRootStore();