Просмотр исходного кода

chore(ts): Use UPPER_CASE for ExperimentType (#50387)

Evan Purkhiser 1 год назад
Родитель
Сommit
8e9e3adb7d
2 измененных файлов с 9 добавлено и 5 удалено
  1. 3 3
      static/app/data/experimentConfig.tsx
  2. 6 2
      static/app/types/experiments.tsx

+ 3 - 3
static/app/data/experimentConfig.tsx

@@ -14,19 +14,19 @@ export const unassignedValue = -1;
 export const experimentList = [
   {
     key: 'OnboardingNewFooterExperiment',
-    type: ExperimentType.Organization,
+    type: ExperimentType.ORGANIZATION,
     parameter: 'scenario',
     assignments: ['baseline', 'variant1', 'variant2'],
   },
   {
     key: 'ExtendTrialByInvitingMemberExperiment',
-    type: ExperimentType.Organization,
+    type: ExperimentType.ORGANIZATION,
     parameter: 'exposed',
     assignments: [0, 1],
   },
   {
     key: 'ProjectCreationForAllExperiment',
-    type: ExperimentType.Organization,
+    type: ExperimentType.ORGANIZATION,
     parameter: 'exposed',
     assignments: [0, 1],
   },

+ 6 - 2
static/app/types/experiments.tsx

@@ -4,6 +4,10 @@ import type {experimentList, unassignedValue} from 'sentry/data/experimentConfig
  * The grouping of the experiment
  */
 export enum ExperimentType {
+  ORGANIZATION = 'organization',
+  USER = 'user',
+
+  // TODO(epurkhiser): Delete
   Organization = 'organization',
   User = 'user',
 }
@@ -71,11 +75,11 @@ type GetExperimentAssignment<E extends ExperimentList['key']> = {
 };
 
 export type OrgExperiments = GetExperimentAssignment<
-  TypeSelect<ExperimentList, ExperimentType.Organization>['key']
+  TypeSelect<ExperimentList, ExperimentType.ORGANIZATION>['key']
 >;
 
 export type UserExperiments = GetExperimentAssignment<
-  TypeSelect<ExperimentList, ExperimentType.User>['key']
+  TypeSelect<ExperimentList, ExperimentType.USER>['key']
 >;
 
 export type ExperimentAssignment = GetExperimentAssignment<ExperimentList['key']>;