feat: optimize import export event tracker (#8652)

This commit is contained in:
donteatfriedrice
2024-11-01 08:37:00 +00:00
parent a776c1f82b
commit 0184328011
7 changed files with 65 additions and 7 deletions
+19 -3
View File
@@ -121,7 +121,6 @@ type UserEvents =
| AuthEvents
| AccountEvents
| PaymentEvents;
interface PageDivision {
[page: string]: {
[segment: string]: {
@@ -152,7 +151,7 @@ const PageEvents = {
},
settingsPanel: {
menu: ['openSettings'],
workspace: ['viewPlans'],
workspace: ['viewPlans', 'export'],
profileAndBadge: ['viewPlans'],
accountUsage: ['viewPlans'],
accountSettings: ['uploadAvatar', 'removeAvatar', 'updateUserName'],
@@ -214,7 +213,8 @@ const PageEvents = {
'openChangelog',
'dismissChangelog',
],
others: ['navigate', 'import'],
others: ['navigate'],
importModal: ['open'],
workspaceList: [
'open',
'signIn',
@@ -231,6 +231,9 @@ const PageEvents = {
docHistory: {
$: ['open', 'close', 'switchPageMode', 'viewPlans'],
},
importModal: {
$: ['open', 'import'],
},
paywall: {
storage: ['viewPlans'],
aiAction: ['viewPlans'],
@@ -259,6 +262,8 @@ const PageEvents = {
],
history: ['open'],
pageInfo: ['open'],
importModal: ['open'],
snapshot: ['import', 'export'],
},
},
doc: {
@@ -354,6 +359,16 @@ type AuthArgs = {
provider?: string;
};
type ImportStatus = 'importing' | 'failed' | 'success';
type ImportArgs = {
type: string;
status?: ImportStatus;
error?: string;
result?: {
docCount: number;
};
};
export type EventArgs = {
createWorkspace: { flavour: string };
signIn: AuthArgs;
@@ -393,6 +408,7 @@ export type EventArgs = {
copyShareLink: {
type: 'default' | 'doc' | 'whiteboard' | 'block' | 'element';
};
import: ImportArgs;
export: { type: string };
copyBlockToLink: {
type: string;