Browse Source

chore(ts): Use UPPER_CASE for debugImageDetails ImageFeature (#50388)

Evan Purkhiser 1 year ago
parent
commit
baa86def99

+ 2 - 4
static/app/components/events/interfaces/debugMeta/debugImageDetails/candidate/information/features.tsx

@@ -29,10 +29,8 @@ function Features({download}: Props) {
 
   return (
     <Fragment>
-      {Object.keys(ImageFeature).map(imageFeature => {
-        const {label, description} = getImageFeatureDescription(
-          imageFeature as ImageFeature
-        );
+      {Object.values(ImageFeature).map(imageFeature => {
+        const {label, description} = getImageFeatureDescription(imageFeature);
 
         const isDisabled = !features.includes(imageFeature);
 

+ 4 - 4
static/app/components/events/interfaces/debugMeta/debugImageDetails/candidate/utils.tsx

@@ -12,28 +12,28 @@ import {INTERNAL_SOURCE} from '../utils';
 
 export function getImageFeatureDescription(type: ImageFeature) {
   switch (type) {
-    case ImageFeature.has_debug_info:
+    case ImageFeature.HAS_DEBUG_INFO:
       return {
         label: t('debug'),
         description: t(
           'Debug information provides function names and resolves inlined frames during symbolication'
         ),
       };
-    case ImageFeature.has_sources:
+    case ImageFeature.HAS_SOURCES:
       return {
         label: t('sources'),
         description: t(
           'Source code information allows Sentry to display source code context for stack frames'
         ),
       };
-    case ImageFeature.has_symbols:
+    case ImageFeature.HAS_SYMBOLS:
       return {
         label: t('symtab'),
         description: t(
           'Symbol tables are used as a fallback when full debug information is not available'
         ),
       };
-    case ImageFeature.has_unwind_info:
+    case ImageFeature.HAS_UNWIND_INFO:
       return {
         label: t('unwind'),
         description: t(

+ 8 - 8
static/app/types/debugImage.tsx

@@ -18,10 +18,10 @@ export enum SymbolType {
 }
 
 export enum ImageFeature {
-  has_sources = 'has_sources',
-  has_debug_info = 'has_debug_info',
-  has_unwind_info = 'has_unwind_info',
-  has_symbols = 'has_symbols',
+  HAS_SOURCES = 'has_sources',
+  HAS_DEBUG_INFO = 'has_debug_info',
+  HAS_UNWIND_INFO = 'has_unwind_info',
+  HAS_SYMBOLS = 'has_symbols',
 }
 
 type CandidateProcessingInfoOkStatus = {
@@ -49,10 +49,10 @@ export enum CandidateDownloadStatus {
 }
 
 type ImageFeatures = {
-  [ImageFeature.has_sources]: boolean;
-  [ImageFeature.has_debug_info]: boolean;
-  [ImageFeature.has_unwind_info]: boolean;
-  [ImageFeature.has_symbols]: boolean;
+  [ImageFeature.HAS_SOURCES]: boolean;
+  [ImageFeature.HAS_DEBUG_INFO]: boolean;
+  [ImageFeature.HAS_UNWIND_INFO]: boolean;
+  [ImageFeature.HAS_SYMBOLS]: boolean;
 };
 
 type CandidateFeatures = ImageFeatures;