[MM-61193] Create trackFeatureEvent telemetry handler for paid features in web (#28834)
* frontend paid feature usage tracking * fixes on the tooling * fix lint errors * fix types * fix ci * move from paid to SKU * fix linter * move categories and skus to depend on event instead of feature * move to constants
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
aa450f2432
Коммит
4cd73fc2d5
@@ -82,6 +82,7 @@ describe('ClientError', () => {
|
||||
describe('trackEvent', () => {
|
||||
class TestTelemetryHandler implements TelemetryHandler {
|
||||
trackEvent = jest.fn();
|
||||
trackFeatureEvent = jest.fn();
|
||||
pageVisited = jest.fn();
|
||||
}
|
||||
|
||||
|
||||
@@ -4327,6 +4327,11 @@ export default class Client4 {
|
||||
this.telemetryHandler.trackEvent(this.userId, this.userRoles, category, event, props);
|
||||
}
|
||||
}
|
||||
trackFeatureEvent(featureName: string, event: string, props?: any) {
|
||||
if (this.telemetryHandler) {
|
||||
this.telemetryHandler.trackFeatureEvent(this.userId, this.userRoles, featureName, event, props);
|
||||
}
|
||||
}
|
||||
|
||||
pageVisited(category: string, name: string) {
|
||||
if (this.telemetryHandler) {
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
|
||||
export interface TelemetryHandler {
|
||||
trackEvent: (userId: string, userRoles: string, category: string, event: string, props?: any) => void;
|
||||
trackFeatureEvent: (userId: string, userRoles: string, featureName: string, event: string, props?: any) => void;
|
||||
pageVisited: (userId: string, userRoles: string, category: string, name: string) => void;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user