Skip to content

Commit 5dae795

Browse files
Ajay changes pt1
1 parent 4ea2d57 commit 5dae795

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/services/events/events.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Provider } from 'shared/api/helpers'
22

33
import { AmplitudeEventTracker, initAmplitude } from './amplitude/amplitude'
4+
import { StubbedEventTracker } from './stub'
45

56
const AMPLITUDE_API_KEY = process.env.REACT_APP_AMPLITUDE_API_KEY
67

78
export interface EventTracker {
89
// Identifies the user this session belongs to.
9-
identify(userOwnerId: number | string, username: string): void
10+
identify(userOwnerId: number, username: string): void
1011

1112
// Add new events as a new overloaded method signature here.
1213
// Please keep the `eventType`s very generic as we have a limited number of
@@ -28,11 +29,6 @@ export interface EventTracker {
2829
): void
2930
}
3031

31-
class StubbedEventTracker implements EventTracker {
32-
identify(_userOwnerId: string | number, _username: string): void {}
33-
track(_eventType: string, _eventProperties: any): void {}
34-
}
35-
3632
export function initEventTracker(): void {
3733
// Calls any init functions for EventTracker implementations
3834
initAmplitude()

src/services/events/stub.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { EventTracker } from './events'
2+
3+
export class StubbedEventTracker implements EventTracker {
4+
identify(_userOwnerId: string | number, _username: string): void {}
5+
track(_eventType: string, _eventProperties: any): void {}
6+
}

src/shared/utils/provider.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import { Provider } from 'shared/api/helpers'
66
export function providerToName(provider: Provider) {
77
return (
88
{
9-
gh: 'Github',
10-
bb: 'BitBucket',
11-
gl: 'Gitlab',
12-
ghe: 'Github Enterprise',
13-
gle: 'Gitlab Enterprise',
14-
bbs: 'BitBucket Server',
15-
github: 'Github',
16-
bitbucket: 'BitBucket',
17-
gitlab: 'Gitlab',
18-
github_enterprise: 'Github Enterprise',
19-
gitlab_enterprise: 'Gitlab Enterprise',
20-
bitbucket_server: 'BitBucket Server',
9+
gh: 'GitHub',
10+
bb: 'Bitbucket',
11+
gl: 'GitLab',
12+
ghe: 'GitHub Enterprise',
13+
gle: 'GitLab Enterprise',
14+
bbs: 'Bitbucket Server',
15+
github: 'GitHub',
16+
bitbucket: 'Bitbucket',
17+
gitlab: 'GitLab',
18+
github_enterprise: 'GitHub Enterprise',
19+
gitlab_enterprise: 'GitLab Enterprise',
20+
bitbucket_server: 'Bitbucket Server',
2121
} as const
2222
)[provider]
2323
}

0 commit comments

Comments
 (0)