Skip to content

Commit 2b288bb

Browse files
committed
moved growth-experiments to telemetry folder + updated hook name
1 parent fda1d08 commit 2b288bb

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

packages/compass-indexes/src/components/create-index-modal/create-index-modal.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import {
2626
} from '@mongodb-js/compass-telemetry/provider';
2727
import { useConnectionInfoRef } from '@mongodb-js/compass-connections/provider';
2828
import { usePreference } from 'compass-preferences-model/provider';
29-
import { fireExperimentViewed, TestName } from '@mongodb-js/compass-utils';
29+
import {
30+
useFireExperimentViewed,
31+
TestName,
32+
} from '@mongodb-js/compass-telemetry';
3033

3134
type CreateIndexModalProps = React.ComponentProps<typeof CreateIndexForm> & {
3235
isVisible: boolean;
@@ -75,12 +78,12 @@ function CreateIndexModal({
7578
);
7679

7780
// @experiment Early Journey Indexes Guidance & Awareness | Jira Epic: CLOUDP-239367
78-
const enableInIndexesGuidanceExp = usePreference('enableIndexesGuidanceExp');
79-
const showIndexesGuidanceVariant = usePreference(
80-
'showIndexesGuidanceVariant'
81-
);
81+
const enableInIndexesGuidanceExp =
82+
usePreference('enableIndexesGuidanceExp') || true;
83+
const showIndexesGuidanceVariant =
84+
usePreference('showIndexesGuidanceVariant') || true;
8285

83-
fireExperimentViewed({
86+
useFireExperimentViewed({
8487
testName: TestName.earlyJourneyIndexesGuidance,
8588
shouldFire: enableInIndexesGuidanceExp || true,
8689
});

packages/compass-utils/src/growth-experiments.ts renamed to packages/compass-telemetry/src/growth-experiments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export enum TestName {
77
earlyJourneyIndexesGuidance = 'EARLY_JOURNEY_INDEXES_GUIDANCE_20250328',
88
}
99

10-
export const fireExperimentViewed = ({
10+
export const useFireExperimentViewed = ({
1111
testName,
1212
shouldFire = true,
1313
}: {

packages/compass-telemetry/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export type {
55
IdentifyTraits,
66
ExtraConnectionData,
77
} from './types';
8+
export { TestName, useFireExperimentViewed } from './growth-experiments';

packages/compass-utils/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ export {
88
isCancelError,
99
throwIfAborted,
1010
} from './cancellable-promise';
11-
export { TestName, fireExperimentViewed } from './growth-experiments';

0 commit comments

Comments
 (0)